Skip to content
Snippets Groups Projects

Resolve "pi0 resolution for ECal barrel"

Merged Marshall Scott requested to merge 19-pi0-resolution-for-ecal-barrel into master
Compare and Show latest version
1 file
+ 8
6
Compare changes
  • Side-by-side
  • Inline
@@ -123,9 +123,11 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
// Returns the pdgID of the particle daughters(hopefully?)
auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
std::vector<double> result;
/*
for (auto part : input[2].daughters_begin)
result.push_back(part)
return result;
result.push_back(*part)
*/
return *input[2].daughters_begin;
};
// Define variables
@@ -134,7 +136,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("pid", getpid, {"mcparticles"})
.Define("dau", getd, {"mcparticles"})
.Define("dau", getdau, {"mcparticles"})
;
// Define Histograms
@@ -143,7 +145,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
auto hEsim = d1.Histo1D({"hEsim", "Energy Deposit; Energy Deposit [GeV]; Events", 100, 0.0, 1.0}, "Esim");
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 hpid2 = d1.Histo1D({"hpid2", "PID; PID; Count", 100, -220, 220}, "dau");
auto hpid2 = d1.Histo1D({"hpid2", "PID; PID; Count", 100, -220, 220}, "dau");
// Set sampling Fraction, ideally this will be taken from a json file
cout << "The sampling fraction mean is " << samp_frac << endl;
@@ -215,8 +217,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
hpid2->SetLineWidth(2);
hpid2->SetLineColor(kBlue);
hpid2->DrawClone();
c6->SaveAs("results/emcal_barrel_pions_pid.png");
c6->SaveAs("results/emcal_barrel_pions_pid.pdf");
c6->SaveAs("results/emcal_barrel_pions_pid2.png");
c6->SaveAs("results/emcal_barrel_pions_pid2.pdf");
//Energy Resolution Calculation
auto hdE = d2.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -2.5, 2.5}, "dE");//changed from 100
Loading