Skip to content

Commit

Permalink
added a status flag!
Browse files Browse the repository at this point in the history
  • Loading branch information
dglazier committed Oct 25, 2024
1 parent 567df55 commit ecf9609
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
6 changes: 6 additions & 0 deletions benchmarks/dglazier_benchmark/benchmark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "YOUR BENCHMARK NAME",
"title": "YOUR BENCHMARK TITLE",
"description": "Benchmark for ...",
"target": "0.9"
}
7 changes: 6 additions & 1 deletion benchmarks/dglazier_benchmark/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ dglazier_benchmark:results:
- bash benchmarks/dglazier_benchmark/analyze.sh
- cp sim_output/nocampaign/plots_figures/*.pdf results/dglazier_benchmark/
- fi
- echo "Finished copying!"
- echo "Finished, copying over json now"
- cp benchmark_output/u_rho_eff.json results/dglazier_benchmark/
- echo "Finished copying!"
- collect_tests.py your_benchmark
- echo "Finished collecting!"

35 changes: 35 additions & 0 deletions benchmarks/dglazier_benchmark/macros/plot_rho_physics_benchmark.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
#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);
Expand Down Expand Up @@ -147,6 +176,10 @@ void plot_rho_physics_benchmark(TString filename="./sim_output/plot_combined.roo
double maxbineff = h_VM_mass_MC_etacut->FindBin(1.0);
double thiseff = 100.0*(1.0*h_VM_mass_REC_etacut->Integral(minbineff,maxbineff))/(1.0*h_VM_mass_MC_etacut->Integral(minbineff,maxbineff));

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);

r42->Draw("same");
r43->Draw("same");
r44->Draw("same");
Expand Down Expand Up @@ -378,4 +411,6 @@ void plot_rho_physics_benchmark(TString filename="./sim_output/plot_combined.roo

TString figure3name = figure_directory+"/benchmark_rho_efficiencies.pdf";
c5->Print(figure3name);


}

0 comments on commit ecf9609

Please sign in to comment.