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

Final

parent c8a596d5
Branches
No related tags found
1 merge request!24Resolve "pi0 resolution for ECal barrel"
......@@ -121,12 +121,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
return input[2].pdgID;
};
// Returns the pdgID of the particle daughters(hopefully?)
// Returns number of particle daughters
auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
std::vector<int> result;
//for (auto part : input[2].daughters_begin)
// result.push_back(part)
return input[2].daughters_begin;
};
......@@ -145,19 +141,15 @@ 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 hdau = d1.Histo1D({"hdau", "Number of Daughters; Number of Daughters; Count", 10, 0, 10}, "dau");
// Set sampling Fraction, ideally this will be taken from a json file
cout << "The sampling fraction mean is " << samp_frac << endl;
samp_frac = hfsam -> GetMean();
cout << "The sampling fraction mean is " << samp_frac << endl;
auto d2 = d1.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
;
// Event Counts
auto nevents_thrown = d1.Count();
std::cout << "Number of Thrown Events: " << (*nevents_thrown) << "\n";
......@@ -213,12 +205,12 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
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");
hdau->GetYaxis()->SetTitleOffset(1.4);
hdau->SetLineWidth(2);
hdau->SetLineColor(kBlue);
hdau->DrawClone();
c6->SaveAs("results/emcal_barrel_pions_dau.png");
c6->SaveAs("results/emcal_barrel_pions_dau.pdf");
//Energy Resolution Calculation
auto hdE = d2.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -2.5, 2.5}, "dE");//changed from 100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment