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

calculates sampling fraction and then uses that to correctly calculate the resolution 7

parent c6835eae
Branches
Tags
1 merge request!24Resolve "pi0 resolution for ECal barrel"
This commit is part of merge request !24. Comments created here will be created in the context of that merge request.
...@@ -125,13 +125,6 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal ...@@ -125,13 +125,6 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
.Define("dE_rel", eResol_rel, {"Esim","Ethr"}) .Define("dE_rel", eResol_rel, {"Esim","Ethr"})
.Define("pid", getpid, {"mcparticles"}) .Define("pid", getpid, {"mcparticles"})
; ;
// Set sampling Fraction, ideally this will be taken from a json file
auto svec = d1.Mean("fsam");
for (auto ele : svec){cout << ele << endl;}
auto d2 = d1.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
;
// Define Histograms // Define Histograms
auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 7.5}, "Ethr"); auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 7.5}, "Ethr");
...@@ -140,6 +133,15 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal ...@@ -140,6 +133,15 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
auto hfsam = d1.Histo1D({"hfsam", "Sampling Fraction; Sampling Fraction; Events", 100, 0.0, 0.1}, "fsam"); auto hfsam = d1.Histo1D({"hfsam", "Sampling Fraction; Sampling Fraction; Events", 100, 0.0, 0.1}, "fsam");
auto hpid = d1.Histo1D({"hpid", "PID; PID; Count", 100, -220, 220}, "pid"); auto hpid = d1.Histo1D({"hpid", "PID; PID; Count", 100, -220, 220}, "pid");
// Set sampling Fraction, ideally this will be taken from a json file
samp_frac = hfsam -> GetMean();
auto d2 = d1.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
;
// Event Counts // Event Counts
auto nevents_thrown = d1.Count(); auto nevents_thrown = d1.Count();
std::cout << "Number of Thrown Events: " << (*nevents_thrown) << "\n"; std::cout << "Number of Thrown Events: " << (*nevents_thrown) << "\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment