Skip to content
Snippets Groups Projects

Resolve "Fix Pi0 benchmark"

Merged Marshall Scott requested to merge 37-fix-pi0-benchmark into master
1 file
+ 4
8
Compare changes
  • Side-by-side
  • Inline
@@ -95,7 +95,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
};
// Energy Resolution = Esampling/Sampling_fraction - Ethrown
auto eResol = [samp_frac](const std::vector<double>& sampled, const std::vector<double>& thrown) {
auto eResol = [&samp_frac](const std::vector<double>& sampled, const std::vector<double>& thrown) {
std::vector<double> result;
auto it_sam = sampled.cbegin();
auto it_thr = thrown.cbegin();
@@ -106,7 +106,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
};
// Relative Energy Resolution = (Esampling/Sampling fraction - Ethrown)/Ethrown
auto eResol_rel = [samp_frac](const std::vector<double>& sampled, const std::vector<double>& thrown) {
auto eResol_rel = [&samp_frac](const std::vector<double>& sampled, const std::vector<double>& thrown) {
std::vector<double> result;
auto it_sam = sampled.cbegin();
auto it_thr = thrown.cbegin();
@@ -220,11 +220,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
double sigmaOverE = res[2] / thrown_energy;
//Pass/Fail
if (sigmaOverE <= resolutionTarget) {
pi0_energy_resolution.pass(sigmaOverE);
} else {
pi0_energy_resolution.fail(sigmaOverE);
}
sigmaOverE <= resolutionTarget ? pi0_energy_resolution.pass(sigmaOverE) : pi0_energy_resolution.fail(sigmaOverE);
//std::printf("Energy Resolution is %f\n", res[2]);
//Energy Resolution Histogram Plotting
@@ -247,7 +243,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.png");
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.pdf");
eic::util::write_test({pi0_energy_resolution}, fmt::format("{}_pi0.json", detector));
eic::util::write_test({pi0_energy_resolution}, fmt::format("results/{}_pi0.json", detector));
}
Loading