115 hyp.
init(
"lha/si_input.flha", config_hyp);
121 auto oint = std::make_shared<ObservableInterface>();
129 oint->set_bkstarll_threads(30);
138 oint->set_bsphi_threads(30);
143 oint->set_bkll_threads(30);
146 constexpr bool kAddDeps =
false;
148 std::set<Observables> seen_unbinned;
149 std::set<std::tuple<Observables, double, double>> seen_binned;
150 std::set<ExperimentObs> selected_exp_obs;
153 if (!seen_unbinned.insert(obs).second)
return;
154 oint->add_observable(
161 auto add_bin = [&](
Observables obs,
double q2min,
double q2max) {
162 auto key = std::make_tuple(obs, q2min, q2max);
163 if (!seen_binned.insert(key).second)
return;
164 oint->add_observable(
171 auto add_exp_unbinned = [&](
const std::string& experiment,
Observables obs) {
177 auto add_exp_bin = [&](
const std::string& experiment,
Observables obs,
178 double q2min,
double q2max) {
180 add_bin(obs, q2min, q2max);
307 add_exp_bin(
"CMS", O::F_L_B0__KSTAR0_MU_MU, 1.1, 2);
308 add_exp_bin(
"CMS", O::P_1_B0__KSTAR0_MU_MU, 1.1, 2);
309 add_exp_bin(
"CMS", O::P_2_B0__KSTAR0_MU_MU, 1.1, 2);
310 add_exp_bin(
"CMS", O::P_3_B0__KSTAR0_MU_MU, 1.1, 2);
311 add_exp_bin(
"CMS", O::P_PRIME_4_B0__KSTAR0_MU_MU, 1.1, 2);
312 add_exp_bin(
"CMS", O::P_PRIME_5_B0__KSTAR0_MU_MU, 1.1, 2);
313 add_exp_bin(
"CMS", O::P_PRIME_6_B0__KSTAR0_MU_MU, 1.1, 2);
314 add_exp_bin(
"CMS", O::P_PRIME_8_B0__KSTAR0_MU_MU, 1.1, 2);
315 add_exp_bin(
"CMS", O::F_L_B0__KSTAR0_MU_MU, 2, 4.3);
316 add_exp_bin(
"CMS", O::P_1_B0__KSTAR0_MU_MU, 2, 4.3);
317 add_exp_bin(
"CMS", O::P_2_B0__KSTAR0_MU_MU, 2, 4.3);
318 add_exp_bin(
"CMS", O::P_3_B0__KSTAR0_MU_MU, 2, 4.3);
319 add_exp_bin(
"CMS", O::P_PRIME_4_B0__KSTAR0_MU_MU, 2, 4.3);
320 add_exp_bin(
"CMS", O::P_PRIME_5_B0__KSTAR0_MU_MU, 2, 4.3);
321 add_exp_bin(
"CMS", O::P_PRIME_6_B0__KSTAR0_MU_MU, 2, 4.3);
322 add_exp_bin(
"CMS", O::P_PRIME_8_B0__KSTAR0_MU_MU, 2, 4.3);
323 add_exp_bin(
"CMS", O::F_L_B0__KSTAR0_MU_MU, 4.3, 6);
324 add_exp_bin(
"CMS", O::P_1_B0__KSTAR0_MU_MU, 4.3, 6);
325 add_exp_bin(
"CMS", O::P_2_B0__KSTAR0_MU_MU, 4.3, 6);
326 add_exp_bin(
"CMS", O::P_3_B0__KSTAR0_MU_MU, 4.3, 6);
327 add_exp_bin(
"CMS", O::P_PRIME_4_B0__KSTAR0_MU_MU, 4.3, 6);
328 add_exp_bin(
"CMS", O::P_PRIME_5_B0__KSTAR0_MU_MU, 4.3, 6);
329 add_exp_bin(
"CMS", O::P_PRIME_6_B0__KSTAR0_MU_MU, 4.3, 6);
330 add_exp_bin(
"CMS", O::P_PRIME_8_B0__KSTAR0_MU_MU, 4.3, 6);
331 add_exp_bin(
"CMS", O::F_L_B0__KSTAR0_MU_MU, 14.18, 16);
332 add_exp_bin(
"CMS", O::P_1_B0__KSTAR0_MU_MU, 14.18, 16);
333 add_exp_bin(
"CMS", O::P_2_B0__KSTAR0_MU_MU, 14.18, 16);
334 add_exp_bin(
"CMS", O::P_3_B0__KSTAR0_MU_MU, 14.18, 16);
335 add_exp_bin(
"CMS", O::P_PRIME_4_B0__KSTAR0_MU_MU, 14.18, 16);
336 add_exp_bin(
"CMS", O::P_PRIME_5_B0__KSTAR0_MU_MU, 14.18, 16);
337 add_exp_bin(
"CMS", O::P_PRIME_6_B0__KSTAR0_MU_MU, 14.18, 16);
338 add_exp_bin(
"CMS", O::P_PRIME_8_B0__KSTAR0_MU_MU, 14.18, 16);
419 std::shared_ptr<IStatParamOptimizerProxy> spop = std::make_shared<StatParamOptimizerProxy>();
420 auto model = std::make_shared<ObservableInterfaceProxy>(oint, spop);
458 const std::string had_bsm_block =
460 +
"__BSM_INTERMEDIATE";
462 const std::string had_bsm_block2 =
464 +
"__BSM_INTERMEDIATE";
466 const std::string had_bsm_block3 =
468 +
"__BSM_INTERMEDIATE";
471 std::vector<ParamId> p_specs = {
483 std::shared_ptr<INuisancePathsProvider> npp = std::make_shared<DefaultNuisancePathsProvider>();
488 std::make_shared<StatCorrelationProxy>(),
489 std::make_shared<StatParameterProxy>(),
490 std::make_shared<StatParamSourcesProxy>(),
491 std::make_shared<StatDependencyPruner>(),
492 std::make_shared<NuisanceReader>(npp),
496 std::set<std::string> exp = {
"DEFAULT",
"Belle",
"CMS",
"LHCb2025c2"};
504 std::map<std::string, std::size_t> selected_exp_counts;
505 for (
const auto& exp_obs : selected_exp_obs) {
506 selected_exp_counts[exp_obs.experiment]++;
508 std::cout <<
"[FIT] Requested explicit experimental observables = "
509 << selected_exp_obs.size() <<
"\n";
510 for (
const auto& [experiment, count] : selected_exp_counts) {
511 std::cout <<
"[FIT] " << experiment <<
" : " << count <<
"\n";
514 auto t2 = std::chrono::steady_clock::now();
516 auto t3 = std::chrono::steady_clock::now();
518 std::cout <<
"\nMLE done in "
519 << std::chrono::duration_cast<std::chrono::milliseconds>(t3 - t2).count()
523 std::cerr <<
"[ERROR] MLE fit failed.\n";
527 print_fit_result(fit);
528 save_bestfit_csv(
"bestfit.csv", fit);
529 std::cout <<
"[INFO] Wrote bestfit.csv\n";
535 std::array<double, 4> bounds = {
540 auto trace = std::make_shared<std::ofstream>(
"contour_trace.csv");
541 (*trace) <<
"type,level,path_id,point_id,x,y,n_paths,n_points,elapsed_s,message\n";
551 if (!trace || !(*trace))
return;
553 const char* type_str =
"";
566 << ev.point_id <<
","
570 << ev.n_points <<
","
571 << ev.elapsed_seconds <<
","
572 <<
"\"" << ev.message <<
"\"\n";
577 auto t4 = std::chrono::steady_clock::now();
579 auto t5 = std::chrono::steady_clock::now();
581 std::cout <<
"\nContour done in "
582 << std::chrono::duration_cast<std::chrono::milliseconds>(t5 - t4).count()
585 std::cout <<
"[INFO] contour 68% paths = " << c68.level <<
"\n";
588 "contours_BKsmumu_ang.csv",
594 std::cout <<
"[INFO] Wrote contours.csv\n";