3 #include "TClonesArray.h"
5 #include "Math/PdfFuncMathCore.h"
41 std::vector<Track*> all_electrons;
48 float e_efficiency = 0.90;
49 float epi_separation = 2.4;
53 if (DataStore->find(
"TracksForPID") != DataStore->end()) {
54 for (
auto track : std::any_cast<std::vector<Track*>>((*DataStore)[
"TracksForPID"])) {
55 if (
ElectronPID(track, e_efficiency, epi_separation))
56 all_electrons.push_back(track);
64 if (
ElectronPID(track, e_efficiency, epi_separation))
65 all_electrons.push_back(track);
68 std::vector<Track*> tracks_for_PID;
72 tracks_for_PID.push_back(track);
74 (*DataStore)[
"TracksForPID"] = tracks_for_PID;
78 std::vector<Track*> reconstructed_electrons = SelectorFcn<Track>(all_electrons,
79 [](Track*
t){
return (
t->PT >= 0.1); });
81 std::vector<Track*> tracks_for_PID = std::any_cast<std::vector<Track*>>((*DataStore)[
"TracksForPID"]);
82 for (
auto electron : reconstructed_electrons) {
83 tracks_for_PID.erase(std::find(tracks_for_PID.begin(), tracks_for_PID.end(), electron));
85 (*DataStore)[
"TracksForPID"] = tracks_for_PID;
89 (*DataStore)[
"Electrons"] = reconstructed_electrons;
98 bool TrackIsElectron =
false;
106 return TrackIsElectron;
108 int track_truth = track->PID;
110 if (TMath::Abs(track_truth) == 11) {
112 if (gRandom->Uniform(0, 1) <= eIDprob) {
113 TrackIsElectron =
true;
115 TrackIsElectron =
false;
120 }
else if (TMath::Abs(track_truth) == 211) {
122 if (gRandom->Uniform(0,1) <= ROOT::Math::gaussian_pdf(separation)) {
123 TrackIsElectron =
true;
125 TrackIsElectron =
false;
130 TrackIsElectron =
false;
134 return TrackIsElectron;