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( ...@@ -98,17 +98,30 @@ void emcal_barrel_pi0_analysis(
}; };
// Define variables // Define variables
auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"}) auto d1 = ROOT::RDF::RNode(
d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("pid", getpid, {"MCParticles"})
.Define("dau", getdau, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"}) .Define("nhits", nhits, {"EcalBarrelHits"})
.Define("EsimImg", Esim, {"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("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi") .Define("Esim", "EsimImg+EsimScFi")
.Define("fsam", fsam, {"Esim","Ethr"}) .Define("fsamImg", fsam, {"EsimImg", "Ethr"})
.Define("pid", getpid, {"MCParticles"}) .Define("fsamScFi", fsam, {"EsimScFi", "Ethr"})
.Define("dau", getdau, {"MCParticles"}) .Define("fsam", fsam, {"Esim", "Ethr"});
.Define("dE", eResol, {"Esim","Ethr"}) fsam_est = 0.1;
.Define("dE_rel", eResol_rel, {"Esim","Ethr"}) } 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 // Define Histograms
std::vector <std::string> titleStr = { std::vector <std::string> titleStr = {
...@@ -118,7 +131,7 @@ void emcal_barrel_pi0_analysis( ...@@ -118,7 +131,7 @@ void emcal_barrel_pi0_analysis(
"dE Relative; dE Relative; Events" "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"}; std::vector<std::string> col = {"Ethr", "nhits", "Esim", "dE_rel"};
double meanE = 5; double meanE = 5;
...@@ -145,11 +158,11 @@ void emcal_barrel_pi0_analysis( ...@@ -145,11 +158,11 @@ void emcal_barrel_pi0_analysis(
"Sampling Fraction; Sampling Fraction; Events", "Sampling Fraction; Sampling Fraction; Events",
"dE; dE[GeV]; Events" "dE; dE[GeV]; Events"
}; };
range = {{0,0.15}, {-3, 3}}; range = {{0,fsam_est}, {-3, 3}};
col = {"fsam", "dE"}; col = {"fsam", "dE"};
nCol = range.size(); nCol = range.size();
std::printf("Here %d\n", 10); 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; double sigmaOverE = 0;
auto hr = d1.Histo1D({"histr", titleStr[0].c_str(), 150, range[0][0], range[0][1]}, col[0].c_str()); auto hr = d1.Histo1D({"histr", titleStr[0].c_str(), 150, range[0][0], range[0][1]}, col[0].c_str());
......
...@@ -87,19 +87,33 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal ...@@ -87,19 +87,33 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
}; };
// Define variables // Define variables
auto d1 = d0.Define("Ethr", Ethr, {"MCParticles"}) auto d1 = ROOT::RDF::RNode(
d0.Define("Ethr", Ethr, {"MCParticles"})
.Define("nhits", nhits, {"EcalBarrelHits"}) .Define("nhits", nhits, {"EcalBarrelHits"})
.Define("EsimImg", Esim, {"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("EsimScFi", Esim, {"EcalBarrelScFiHits"})
.Define("Esim", "EsimImg+EsimScFi") .Define("Esim", "EsimImg+EsimScFi")
.Define("fsam", fsam, {"Esim", "Ethr"}) .Define("fsamImg", fsam, {"EsimImg", "Ethr"})
.Define("pid", getpid, {"MCParticles"}); .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 // Define Histograms
auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 7.5}, "Ethr"); 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 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 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, fsam_est}, "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");
// Event Counts // Event Counts
......
...@@ -80,19 +80,28 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters ...@@ -80,19 +80,28 @@ std::tuple <double, double, double, double> extract_sampling_fraction_parameters
.Define("Esim", Esim, {"EcalBarrelHits"}) .Define("Esim", Esim, {"EcalBarrelHits"})
.Define("fsam", fsam, {"Esim", "Ethr"}); .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 // Define Histograms
auto hEthr = d1.Histo1D( 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"); "Ethr");
auto hNhits = auto hNhits =
d1.Histo1D({"hNhits", "Number of hits per events; Number of hits; Events", d1.Histo1D({"hNhits", "Number of hits per events; Number of hits; Events",
100, 0.0, 2000.0}, 100, 0.0, 2000.0},
"nhits"); "nhits");
auto hEsim = d1.Histo1D( 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"); "Esim");
auto hfsam = d1.Histo1D( 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"); "fsam");
// Event Counts // Event Counts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment