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
+ 11
19
Compare changes
  • Side-by-side
  • Inline
@@ -41,7 +41,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -41,7 +41,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
std::string test_tag = "Barrel_emcal_pi0";
std::string test_tag = "Barrel_emcal_pi0";
//TODO: Change test_tag to something else
//TODO: Change test_tag to something else
std:string detector = "Barrel_emcal";
std:string detector = "Barrel_emcal";
//Energy resolution in teh barrel region(-1 < eta < 1)
// Energy resolution in the barrel region(-1 < eta < 1)
 
// Taken from : Initial considerations for EMCal of the EIC detector by A. Bazilevsky
// sigma_E / E = 12% / E^0.5 convoluted with 2%
// sigma_E / E = 12% / E^0.5 convoluted with 2%
// sigma_E / E = [ (0.12/E^0.5)^2 + 0.02^2]^0.5, with E in [GeV]
// sigma_E / E = [ (0.12/E^0.5)^2 + 0.02^2]^0.5, with E in [GeV]
double thrown_energy = 5; // Current thrown energy, will need to grab from json file
double thrown_energy = 5; // Current thrown energy, will need to grab from json file
@@ -120,14 +121,9 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -120,14 +121,9 @@ 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?)
// Returns number of particle daughters
auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
auto getdau = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
std::vector<double> result;
return input[2].daughters_begin;
/*
for (auto part : input[2].daughters_begin)
result.push_back(*part)
*/
return *input[2].daughters_begin;
};
};
// Define variables
// Define variables
@@ -145,19 +141,15 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -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 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");
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
// 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();
samp_frac = hfsam -> GetMean();
cout << "The sampling fraction mean is " << samp_frac << endl;
auto d2 = d1.Define("dE", eResol, {"Esim","Ethr"})
auto d2 = d1.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"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";
@@ -213,12 +205,12 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
@@ -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);
TCanvas *c6 = new TCanvas("c6", "c6", 700, 500);
c5->SetLogy(1);
c5->SetLogy(1);
hpid2->GetYaxis()->SetTitleOffset(1.4);
hdau->GetYaxis()->SetTitleOffset(1.4);
hpid2->SetLineWidth(2);
hdau->SetLineWidth(2);
hpid2->SetLineColor(kBlue);
hdau->SetLineColor(kBlue);
hpid2->DrawClone();
hdau->DrawClone();
c6->SaveAs("results/emcal_barrel_pions_pid2.png");
c6->SaveAs("results/emcal_barrel_pions_dau.png");
c6->SaveAs("results/emcal_barrel_pions_pid2.pdf");
c6->SaveAs("results/emcal_barrel_pions_dau.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
Loading