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
1 file
+ 22
8
Compare changes
  • Side-by-side
  • Inline
@@ -54,14 +54,6 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -54,14 +54,6 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
ROOT::EnableImplicitMT();
ROOT::EnableImplicitMT();
ROOT::RDataFrame d0("events", input_fname);
ROOT::RDataFrame d0("events", input_fname);
/*
auto colNames = d0.GetColumnNames();
ofstream out;
out.open("results/column_list.txt");
for (auto &&col : colNames){out << col << endl; cout << col << endl;}
out.close();
*/
// Thrown Energy [GeV]
// Thrown Energy [GeV]
auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
@@ -125,6 +117,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -125,6 +117,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
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("Esim_hcal", Esim, {"HcalBarrelHits"})
 
.Define("Esim_crycal", Esim, {"CrystalEcalHits"})
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
@@ -137,6 +131,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -137,6 +131,8 @@ 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 hhcal = d1.Histo1D({"hhcal", "Energy Deposit; Energy Deposit [GeV]; Events", 100, 0.0, 1.0}, "Esim_hcal");
 
auto hcrycal = d1.Histo1D({"hcrycal", "Energy Deposit; Energy Deposit [GeV]; Events", 100, 0.0, 1.0}, "Esim_crycal");
// Event Counts
// Event Counts
auto nevents_thrown = d1.Count();
auto nevents_thrown = d1.Count();
@@ -191,6 +187,24 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -191,6 +187,24 @@ 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);
 
c6->SetLogy(1);
 
hhcal->GetYaxis()->SetTitleOffset(1.4);
 
hhcal->SetLineWidth(2);
 
hhcal->SetLineColor(kBlue);
 
hhcal->DrawClone();
 
c6->SaveAs("results/emcal_barrel_pions_hcal.png");
 
c6->SaveAs("results/emcal_barrel_pions_hcal.pdf");
 
 
TCanvas *c7 = new TCanvas("c7", "c7", 700, 500);
 
c7->SetLogy(1);
 
hcrycal->GetYaxis()->SetTitleOffset(1.4);
 
hcrycal->SetLineWidth(2);
 
hcrycal->SetLineColor(kBlue);
 
hcrycal->DrawClone();
 
c7->SaveAs("results/emcal_barrel_pions_crycal.png");
 
c7->SaveAs("results/emcal_barrel_pions_crycal.pdf");
 
//Energy Resolution Work
//Energy Resolution Work
auto hdE = d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -7.5, 7.5}, "dE");//changed from 100
auto hdE = d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -7.5, 7.5}, "dE");//changed from 100
auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -2, 2}, "dE_rel");//changed from 100
auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -2, 2}, "dE_rel");//changed from 100
Loading