Skip to content
Snippets Groups Projects
Commit 2db8d2fd authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Improved handling of sciglass ecal

parent a6fba614
No related branches found
No related tags found
1 merge request!111Improved handling of sciglass ecal
......@@ -98,17 +98,30 @@ void emcal_barrel_pi0_analysis(
};
// Define variables
auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"})
.Define("EsimImg", Esim, {"EcalBarrelHits"})
.Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi")
.Define("fsam", fsam, {"Esim","Ethr"})
.Define("pid", getpid, {"MCParticles"})
.Define("dau", getdau, {"MCParticles"})
.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"})
;
auto d1 = ROOT::RDF::RNode(
d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("pid", getpid, {"MCParticles"})
.Define("dau", getdau, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"})
);
auto Ethr_max = 7.5;
auto fsam_est = 1.0;
if (d1.HasColumn("EcalBarrelScFiHits")) {
d1 = d1.Define("EsimImg", Esim, {"EcalBarrelHits"})
.Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi")
.Define("fsamImg", fsam, {"EsimImg", "Ethr"})
.Define("fsamScFi", fsam, {"EsimScFi", "Ethr"})
.Define("fsam", fsam, {"Esim", "Ethr"});
fsam_est = 0.1;
} else {
d1 = d1.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim", "Ethr"});
fsam_est = 1.0;
}
d1 = d1.Define("dE", eResol, {"Esim","Ethr"})
.Define("dE_rel", eResol_rel, {"Esim","Ethr"});
// Define Histograms
std::vector <std::string> titleStr = {
......@@ -118,7 +131,7 @@ void emcal_barrel_pi0_analysis(
"dE Relative; dE Relative; Events"
};
std::vector<std::vector<double>> range = {{0, 7.5}, {0, 2000}, {0, 2}, {-3, 3}};
std::vector<std::vector<double>> range = {{0, Ethr_max}, {0, 2000}, {0, fsam_est * Ethr_max}, {-3, 3}};
std::vector<std::string> col = {"Ethr", "nhits", "Esim", "dE_rel"};
double meanE = 5;
......@@ -145,11 +158,11 @@ void emcal_barrel_pi0_analysis(
"Sampling Fraction; Sampling Fraction; Events",
"dE; dE[GeV]; Events"
};
range = {{0,0.15}, {-3, 3}};
range = {{0,fsam_est}, {-3, 3}};
col = {"fsam", "dE"};
nCol = range.size();
std::printf("Here %d\n", 10);
std::vector<std::vector<double>> fitRange = {{0.005, 0.1}, {-3, 3}};
std::vector<std::vector<double>> fitRange = {{0.005, fsam_est}, {-3, 3}};
double sigmaOverE = 0;
auto hr = d1.Histo1D({"histr", titleStr[0].c_str(), 150, range[0][0], range[0][1]}, col[0].c_str());
......
......@@ -87,20 +87,34 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
};
// Define variables
auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"})
.Define("EsimImg", Esim, {"EcalBarrelHits"})
.Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi")
.Define("fsam", fsam, {"Esim", "Ethr"})
.Define("pid", getpid, {"MCParticles"});
auto d1 = ROOT::RDF::RNode(
d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"})
.Define("pid", getpid, {"MCParticles"})
);
auto Ethr_max = 7.5;
auto fsam_est = 1.0;
if (d1.HasColumn("EcalBarrelScFiHits")) {
d1 = d1.Define("EsimImg", Esim, {"EcalBarrelHits"})
.Define("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi")
.Define("fsamImg", fsam, {"EsimImg", "Ethr"})
.Define("fsamScFi", fsam, {"EsimScFi", "Ethr"})
.Define("fsam", fsam, {"Esim", "Ethr"});
fsam_est = 0.1;
} else {
d1 = d1.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim", "Ethr"});
fsam_est = 1.0;
}
// Define Histograms
auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 7.5}, "Ethr");
auto hNhits = d1.Histo1D({"hNhits", "Number of hits per events; Number of hits; Events", 100, 0.0, 2000.0}, "nhits");
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 hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, Ethr_max}, "Ethr");
auto hNhits = d1.Histo1D({"hNhits", "Number of hits per events; Number of hits; Events", 100, 0.0, 2000.0}, "nhits");
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, fsam_est}, "fsam");
auto hpid = d1.Histo1D({"hpid", "PID; PID; Count", 100, -220, 220}, "pid");
// Event Counts
auto nevents_thrown = d1.Count();
......
......@@ -80,19 +80,28 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters
.Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim", "Ethr"});
// Define assumptions
auto Ethr_max = 25.0;
auto fsam_estimate = 1.0;
if (d1.HasColumn("EcalBarrelScFiHits")) {
fsam_estimate = 0.1;
} else {
fsam_estimate = 1.0;
}
// Define Histograms
auto hEthr = d1.Histo1D(
{"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 25.0},
{"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, Ethr_max},
"Ethr");
auto hNhits =
d1.Histo1D({"hNhits", "Number of hits per events; Number of hits; Events",
100, 0.0, 2000.0},
"nhits");
auto hEsim = d1.Histo1D(
{"hEsim", "Energy Deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},
{"hEsim", "Energy Deposit; Energy Deposit [GeV]; Events", 500, 0.0, fsam_estimate * Ethr_max},
"Esim");
auto hfsam = d1.Histo1D(
{"hfsam", "Sampling Fraction; Sampling Fraction; Events", 200, 0.0, 0.05},
{"hfsam", "Sampling Fraction; Sampling Fraction; Events", 200, 0.0, 2.0 * fsam_estimate},
"fsam");
// Event Counts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment