Skip to content
Snippets Groups Projects
Commit 0f16cd6e authored by Marshall Scott's avatar Marshall Scott
Browse files

First commit

parent 35fca2fc
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !51. Comments created here will be created in the context of that merge request.
...@@ -95,7 +95,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -95,7 +95,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
}; };
// Energy Resolution = Esampling/Sampling_fraction - Ethrown // 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; std::vector<double> result;
auto it_sam = sampled.cbegin(); auto it_sam = sampled.cbegin();
auto it_thr = thrown.cbegin(); auto it_thr = thrown.cbegin();
...@@ -106,7 +106,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -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 // 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; std::vector<double> result;
auto it_sam = sampled.cbegin(); auto it_sam = sampled.cbegin();
auto it_thr = thrown.cbegin(); auto it_thr = thrown.cbegin();
...@@ -220,11 +220,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -220,11 +220,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
double sigmaOverE = res[2] / thrown_energy; double sigmaOverE = res[2] / thrown_energy;
//Pass/Fail //Pass/Fail
if (sigmaOverE <= resolutionTarget) { sigmaOverE <= resolutionTarget ? pi0_energy_resolution.pass(sigmaOverE) : pi0_energy_resolution.fail(sigmaOverE);
pi0_energy_resolution.pass(sigmaOverE);
} else {
pi0_energy_resolution.fail(sigmaOverE);
}
//std::printf("Energy Resolution is %f\n", res[2]); //std::printf("Energy Resolution is %f\n", res[2]);
//Energy Resolution Histogram Plotting //Energy Resolution Histogram Plotting
...@@ -247,7 +243,7 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -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.png");
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.pdf"); 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));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment