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

Testing new fsam

parent 80f40a14
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !24. Comments created here will be created in the context of that merge request.
...@@ -84,11 +84,23 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal ...@@ -84,11 +84,23 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
return result; return result;
}; };
// Sampling fraction = Esampling / Ethrown, revised
auto fsam2 = [](const std::vector<double>& sampled, const std::vector<double>& thrown) {
std::vector<double> result;
auto it_sam = sampled.cbegin();
auto it_thr = thrown.cbegin();
for (; it_sam != sampled.end() && it_thr != thrown.end(); ++it_sam, ++it_thr) {
result.push_back(*it_sam / *it_thr);
}
return result;
};
// Define variables // Define variables
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("fsam", fsam, {"Esim","Ethr"}) //.Define("fsam", fsam, {"Esim","Ethr"})
.Define("fsam", fsam2, {"Esim","Ethr"})
.Define("dE", "Ethr-Esim") .Define("dE", "Ethr-Esim")
.Define("dE_rel", "(Ethr - Esim)/Esim") .Define("dE_rel", "(Ethr - Esim)/Esim")
; ;
......
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