3 #include "TClonesArray.h"
5 #include "Math/PdfFuncMathCore.h"
40 std::vector<Track*> all_muons;
47 float mu_efficiency = 0.95;
48 float mupi_separation = 2.0;
53 if (DataStore->find(
"TracksForPID") != DataStore->end()) {
54 for (
auto track : std::any_cast<std::vector<Track*>>((*DataStore)[
"TracksForPID"])) {
55 if (
MuonPID(track, mu_efficiency, mupi_separation))
56 all_muons.push_back(track);
64 if (
MuonPID(track, mu_efficiency, mupi_separation))
65 all_muons.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_muons = SelectorFcn<Track>(all_muons, [](Track*
t){
return (
t->PT >= 0.1); });
80 std::vector<Track*> tracks_for_PID = std::any_cast<std::vector<Track*>>((*DataStore)[
"TracksForPID"]);
81 for (
auto muon : reconstructed_muons) {
82 tracks_for_PID.erase(std::find(tracks_for_PID.begin(), tracks_for_PID.end(), muon));
84 (*DataStore)[
"TracksForPID"] = tracks_for_PID;
86 (*DataStore)[
"Muons"] = reconstructed_muons;
95 bool TrackIsMuon =
false;
105 int track_truth = track->PID;
107 if (TMath::Abs(track_truth) == 13) {
109 if (gRandom->Uniform(0, 1) <= muIDprob) {
117 }
else if (TMath::Abs(track_truth) == 211) {
119 if (gRandom->Uniform(0,1) <= ROOT::Math::gaussian_pdf(separation)) {