Skip to content
Snippets Groups Projects
Commit f5226007 authored by Maria Zurek's avatar Maria Zurek
Browse files

Make calibration optional

parent e557d87a
No related branches found
No related tags found
1 merge request!52Resolve "Add reading sampling fraction from electrons benchmarks"
...@@ -40,7 +40,7 @@ calib:emcal_barrel_electrons: ...@@ -40,7 +40,7 @@ calib:emcal_barrel_electrons:
script: script:
- ls -lhtR sim_output/ - ls -lhtR sim_output/
- rootls -t sim_output/sim_emcal_barrel_electron.root - rootls -t sim_output/sim_emcal_barrel_electron.root
- root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("electron")' - root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("electron", true)'
- echo "JSON file(s) from analysis:" ; cat results/*.json - echo "JSON file(s) from analysis:" ; cat results/*.json
bench:emcal_barrel_pions: bench:emcal_barrel_pions:
...@@ -65,6 +65,7 @@ bench:emcal_barrel_pi0: ...@@ -65,6 +65,7 @@ bench:emcal_barrel_pi0:
needs: needs:
- ["sim:emcal_barrel_pi0", "calib:emcal_barrel_electrons"] - ["sim:emcal_barrel_pi0", "calib:emcal_barrel_electrons"]
script: script:
- echo "JSON file(s) from analysis:" ; cat results/*.json
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx+ - root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx+
bench:emcal_barrel_photons: bench:emcal_barrel_photons:
...@@ -75,8 +76,7 @@ bench:emcal_barrel_photons: ...@@ -75,8 +76,7 @@ bench:emcal_barrel_photons:
script: script:
- ls -lhtR sim_output/ - ls -lhtR sim_output/
- rootls -t sim_output/sim_emcal_barrel_photon.root - rootls -t sim_output/sim_emcal_barrel_photon.root
- root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("photon")' - root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_particles_analysis.cxx+("photon", false)'
- echo "JSON file(s) from analysis:" ; cat results/*.json
- if [[ "$RUN_EXTENDED_BENCHMARK" == "true" ]] ; then root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx+("photon")' ; fi - if [[ "$RUN_EXTENDED_BENCHMARK" == "true" ]] ; then root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx+("photon")' ; fi
bench:emcal_barrel_pions_electrons: bench:emcal_barrel_pions_electrons:
......
...@@ -36,7 +36,7 @@ void save_canvas(TCanvas* c, std::string label, std::string particle_label) ...@@ -36,7 +36,7 @@ void save_canvas(TCanvas* c, std::string label, std::string particle_label)
save_canvas(c, label_with_E); save_canvas(c, label_with_E);
} }
void emcal_barrel_particles_analysis(std::string particle_name = "electron") void emcal_barrel_particles_analysis(std::string particle_name = "electron", bool save_calib = false)
{ {
// Setting for graphs // Setting for graphs
gROOT->SetStyle("Plain"); gROOT->SetStyle("Plain");
...@@ -173,7 +173,11 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron") ...@@ -173,7 +173,11 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron")
{"thrown_energy", Ethr_mean}, {"thrown_energy", Ethr_mean},
{"sampling_fraction", fSam_mean} {"sampling_fraction", fSam_mean}
}; };
std::ofstream o("results/emcal_barrel_particles_analyses.json"); if (save_calib) {
std::string calib_output_path = "results/emcal_barrel_calibration.json";
std::cout << "Saving calibration results to " << calib_output_path << std::endl;
std::ofstream o(calib_output_path);
o << std::setw(4) << j << std::endl; o << std::setw(4) << j << std::endl;
} }
}
...@@ -59,7 +59,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -59,7 +59,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
{"target", std::to_string(resolutionTarget)}}}; {"target", std::to_string(resolutionTarget)}}};
json j; json j;
std::ifstream prev_steps_ifstream("results/emcal_barrel_particles_analyses.json"); std::ifstream prev_steps_ifstream("results/emcal_barrel_calibration.json");
prev_steps_ifstream >> j; prev_steps_ifstream >> j;
ROOT::EnableImplicitMT(); ROOT::EnableImplicitMT();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment