From 40b79e721969184db294299c1c17af3367bbb3b0 Mon Sep 17 00:00:00 2001 From: Zachary W Sweger <zsweger@eic0108.rcf.bnl.gov> Date: Wed, 2 Oct 2024 13:52:29 -0400 Subject: [PATCH] Added a status flag! --- benchmarks/your_benchmark/benchmark.json | 6 +++ benchmarks/your_benchmark/config.yml | 4 ++ .../macros/plot_rho_physics_benchmark.C | 37 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 benchmarks/your_benchmark/benchmark.json diff --git a/benchmarks/your_benchmark/benchmark.json b/benchmarks/your_benchmark/benchmark.json new file mode 100644 index 00000000..01279efa --- /dev/null +++ b/benchmarks/your_benchmark/benchmark.json @@ -0,0 +1,6 @@ +{ + "name": "UCHANNEL RHO", + "title": "UCHANNEL RHO BENCHMARK", + "description": "Benchmark for backward rho", + "target": "0.9" +} diff --git a/benchmarks/your_benchmark/config.yml b/benchmarks/your_benchmark/config.yml index 5f800c3d..32443f2c 100644 --- a/benchmarks/your_benchmark/config.yml +++ b/benchmarks/your_benchmark/config.yml @@ -47,4 +47,8 @@ your_benchmark:results: - bash benchmarks/your_benchmark/analyze.sh - cp sim_output/nocampaign/plots_figures/*.pdf results/your_benchmark/ - fi + - echo "Finished, copying over json now" + - cp benchmark_output/u_rho_eff.json results/your_benchmark/ - echo "Finished copying!" + - collect_tests.py your_benchmark + - echo "Finished collecting!" diff --git a/benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C b/benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C index 7348acb7..644f7da8 100644 --- a/benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C +++ b/benchmarks/your_benchmark/macros/plot_rho_physics_benchmark.C @@ -1,7 +1,37 @@ #include "RiceStyle.h" +#include "common_bench/benchmark.h" + using namespace std; +///////////// Set benchmark status! +int setbenchstatus(double eff){ + // create our test definition + common_bench::Test rho_reco_eff_test{ + { + {"name", "rho_reconstruction_efficiency"}, + {"title", "rho Reconstruction Efficiency for rho -> pi+pi- in the B0"}, + {"description", "u-channel rho->pi+pi- reconstruction efficiency "}, + {"quantity", "efficiency"}, + {"target", "0.9"} + } + }; + //this need to be consistent with the target above + double eff_target = 0.9; + + if(eff<0 || eff>1){ + rho_reco_eff_test.error(-1); + }else if(eff > eff_target){ + rho_reco_eff_test.pass(eff); + }else{ + rho_reco_eff_test.fail(eff); + } + + // write out our test data + common_bench::write_test(rho_reco_eff_test, "./benchmark_output/u_rho_eff.json"); + return 0; +} + void plot_rho_physics_benchmark(TString filename="./sim_output/plot_combined.root"){ Ssiz_t dotPosition = filename.Last('.'); TString figure_directory = filename(0, dotPosition); @@ -378,4 +408,11 @@ void plot_rho_physics_benchmark(TString filename="./sim_output/plot_combined.roo TString figure3name = figure_directory+"/benchmark_rho_efficiencies.pdf"; c5->Print(figure3name); + + int minbineff = h_VM_mass_MC_etacut->FindBin(0.6); + int maxbineff = h_VM_mass_MC_etacut->FindBin(1.0); + double reconstuctionEfficiency = (1.0*h_VM_mass_REC_etacut->Integral(minbineff,maxbineff))/(1.0*h_VM_mass_MC_etacut->Integral(minbineff,maxbineff)); + //set the benchmark status: + setbenchstatus(reconstuctionEfficiency); + } -- GitLab