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