PandaRoot
PndTrackingQAQualityNumbers.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <array>
5 
7 
8 namespace TrackingQA {
9 struct qualityNumbers {
10  static const std::array<int, 22> constexpr listOfNumbers{-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8};
11  static const int
12  // Following: Default statuses.
13  // Are the 'not found' tracks in the quality histogram of PndTrackingQualityTask.
14  kPossibleSec = -1, // possible: As defined through the possibleFunctor; secondary: a non-primary particle
15  kPossiblePrim = -2, // possible: As defined through the possibleFunctor; primary: coming directly from particle generator (e.g. EvtGen)
16  kAtLeastThreeSec = -3, // atLeastThree: min. 3 hit points in central tracking detectors (MVD, STT, GEM); secondary: a non-primary particle
17  kAtLeastThreePrim = -4, // atLeastThree: min. 3 hit points in central tracking detectors (MVD, STT, GEM); primary: coming directly from particle generator (e.g. EvtGen)
18  kLessThanThreePrim = -5, // LessThanThree: fewer than 3 hit points in central tracking detectors (MVD, STT, GEM); primary: coming directly from particle generator (e.g. EvtGen)
19  kLessThanThreeSec = -6, // LessThanThree: fewer than 3 hit points in central tracking detectors (MVD, STT, GEM); secondary: not coming from particle generator (e.g. EvtGen)
20  // Following: MC statuses of all (found+notfound) tracks
21  kMcPossibleSec = -7, // see above
23  kMcAllTracksWithHits = -13, // sum of -7 - -10
24  kMcAllTracks = -14, // sum of -11 and -12
25 
26  // Following: Status of reconstructed tracks (= created PndTracks)
27  kPartiallyImpure = 1, // PartiallyImpure: at least 70% of hits of reco'd track come from one MC track ('mostProbableTrack')
28  kPartiallyPure = 2, // PartiallyPure: all hits of reco'd track come from one single MC track; at least 70% of hits of MC track have been found in reco'd track
29  kFullyImpure = 3, // FullyImpure: all hits of MC track have been found in reco'd track but some impurities from other tracks are allowed
30  kFullyPure = 4, // FullyPure: all hits of reco'd track come from one single MC track; all hits of MC track have been found in reco'd track
31 
32  kGhost = 5, // ghost: less than 70% of hits of reco'd track come from one MC track ('mostProbableTrack')
33  kClone = 6, // clone: sum of (number of times one mc track was found -1) over all mc tracks
34 
35  kNotFound = 7, // notFound: total number of not reco'd tracks
36  kFound = 8; // found: total number of reco'd tracks; the sum of FullyPure, FullyImpure, PartiallyPure, PartiallyImpure
37 
38  static std::string QualityNumberToString(int qNumber)
39  {
40  switch (qNumber) {
41  case kPossiblePrim: return "PossiblePrimary"; break;
42  case kPossibleSec: return "PossibleSec"; break;
43  case kAtLeastThreeSec: return "AtLeastThreeSec"; break;
44  case kAtLeastThreePrim: return "AtLeastThreePrim"; break;
45  case kLessThanThreePrim: return "LessThanThreePrim"; break;
46  case kLessThanThreeSec: return "LessThanThreeSec"; break;
47  case kMcPossiblePrim: return "McPossiblePrimary"; break;
48  case kMcPossibleSec: return "McPossibleSec"; break;
49  case kMcAtLeastThreeSec: return "McAtLeastThreeSec"; break;
50  case kMcAtLeastThreePrim: return "McAtLeastThreePrim"; break;
51  case kMcLessThanThreePrim: return "McLessThanThreePrim"; break;
52  case kMcLessThanThreeSec: return "McLessThanThreeSec"; break;
53  case kMcAllTracksWithHits: return "McAllTracksWithHits"; break;
54  case kMcAllTracks: return "McAllTracks"; break;
55  case kPartiallyImpure: return "PartiallyImpure"; break;
56  case kPartiallyPure: return "PartiallyPure"; break;
57  case kFullyPure: return "FullyPure"; break;
58  case kFullyImpure: return "FullyImpure"; break;
59  case kGhost: return "Ghost"; break;
60  case kClone: return "Clone"; break;
61  case kNotFound: return "NotFound"; break;
62  case kFound: return "Found"; break;
63  default: {
64  return std::to_string(qNumber);
65  }
66  }
67  };
68 
69  static std::string QualityNumberToDetailedString(int qNumber)
70  {
71  switch (qNumber) {
72 
73  case kFullyPure: return "Fully Purely found"; break;
74  case kFullyImpure: return "Fully Impurely found"; break;
75  case kPartiallyPure: return "Partially Purely found"; break;
76  case kPartiallyImpure: return "Partially Impurely found"; break;
77  case kGhost: return "Ghosts"; break;
78  case kClone: return "Clones"; break;
79  case kNotFound: return "Total not found"; break;
80  case kFound: return "Total found"; break;
81  case kPossibleSec: return "Possible, Sec."; break;
82  case kPossiblePrim: return "Possible, Prim."; break;
83  case kAtLeastThreeSec: return ">= 3 Hits, Sec."; break;
84  case kAtLeastThreePrim: return ">= 3 Hits, Prim."; break;
85  case kLessThanThreePrim: return "< 3 Hits, Prim."; break;
86  case kLessThanThreeSec: return "< 3 Hits, Sec."; break;
87  case kMcPossibleSec: return "MC: Possible, Sec."; break;
88  case kMcPossiblePrim: return "MC: Possible, Prim."; break;
89  case kMcAtLeastThreeSec: return "MC: >= 3 Hits, Sec."; break;
90  case kMcAtLeastThreePrim: return "MC: >= 3 Hits, Prim."; break;
91  case kMcLessThanThreePrim: return "MC: < 3 Hits, Prim."; break;
92  case kMcLessThanThreeSec: return "MC: < 3 Hits, Sec."; break;
93  case kMcAllTracksWithHits: return "All tracks with MC hits"; break;
94  case kMcAllTracks: return "All tracks"; break;
95  default: {
96  return std::to_string(qNumber);
97  }
98  }
99  };
100 };
101 
102 bool RecoTrackFound(PndTrackingQARecoInfo *recoInfo, double purityThreshold = 0.7, double efficiencyThreshold = 0.);
103 
104 int GetRecoQuality(PndTrackingQARecoInfo *recoInfo, double purityThreshold = 0.7, double efficiencyThreshold = 0.);
105 }; // namespace TrackingQA
static std::string QualityNumberToDetailedString(int qNumber)
static std::string QualityNumberToString(int qNumber)
int GetRecoQuality(PndTrackingQARecoInfo *recoInfo, double purityThreshold=0.7, double efficiencyThreshold=0.)
bool RecoTrackFound(PndTrackingQARecoInfo *recoInfo, double purityThreshold=0.7, double efficiencyThreshold=0.)
static const std::array< int, 22 > constexpr listOfNumbers