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
+ 19
0
Compare changes
  • Side-by-side
  • Inline
@@ -120,12 +120,21 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -120,12 +120,21 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
return input[2].pdgID;
return input[2].pdgID;
};
};
 
// 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;
 
};
 
// Define variables
// Define variables
auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
auto d1 = d0.Define("Ethr", Ethr, {"mcparticles"})
.Define("nhits", nhits, {"EcalBarrelHits"})
.Define("nhits", nhits, {"EcalBarrelHits"})
.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("pid", getpid, {"mcparticles"})
.Define("pid", getpid, {"mcparticles"})
 
.Define("dau", getdau, {"mcparticles"})
;
;
// Define Histograms
// Define Histograms
@@ -134,6 +143,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -134,6 +143,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 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 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");
 
auto hpid2 = d1.Histo1D({"hpid2", "PID; PID; Count", 100, -220, 220}, "dau");
// Set sampling Fraction, ideally this will be taken from a json file
// Set sampling Fraction, ideally this will be taken from a json file
cout << "The sampling fraction mean is " << samp_frac << endl;
cout << "The sampling fraction mean is " << samp_frac << endl;
@@ -199,6 +209,15 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -199,6 +209,15 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
c5->SaveAs("results/emcal_barrel_pions_pid.png");
c5->SaveAs("results/emcal_barrel_pions_pid.png");
c5->SaveAs("results/emcal_barrel_pions_pid.pdf");
c5->SaveAs("results/emcal_barrel_pions_pid.pdf");
 
TCanvas *c6 = new TCanvas("c6", "c6", 700, 500);
 
c5->SetLogy(1);
 
hpid2->GetYaxis()->SetTitleOffset(1.4);
 
hpid2->SetLineWidth(2);
 
hpid2->SetLineColor(kBlue);
 
hpid2->DrawClone();
 
c6->SaveAs("results/emcal_barrel_pions_pid2.png");
 
c6->SaveAs("results/emcal_barrel_pions_pid2.pdf");
 
//Energy Resolution Calculation
//Energy Resolution Calculation
auto hdE = d2.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -2.5, 2.5}, "dE");//changed from 100
auto hdE = d2.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -2.5, 2.5}, "dE");//changed from 100
auto hdE_rel = d2.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -2.5, 2.5}, "dE_rel");//changed from 100
auto hdE_rel = d2.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -2.5, 2.5}, "dE_rel");//changed from 100
Loading