14#ifndef INDETRECSTATISTICS_TrackStatHelper_H
15#define INDETRECSTATISTICS_TrackStatHelper_H
136 TrackStatHelper (
const std::string&,
const std::string&,
bool careAboutTruth =
true);
138 void SetCuts(
const struct cuts&);
141 std::vector<const Trk::Track *> &,
142 const std::vector <std::pair<HepMC::ConstGenParticlePtr,int> > &,
149 const unsigned int *,
150 const unsigned int *)
const;
154 void print (MsgStream &out)
const;
156 void printRegion1(MsgStream &out,
enum eta_region)
const;
157 void printRegion2(MsgStream &out,
enum eta_region,
float denominator)
const;
189 template <
int N_Categories,
int N_Types,
int N_Regions,
typename T_Int=
long>
193 for (
unsigned int cat_i=0; cat_i < N_Categories; ++cat_i ) {
194 for (
unsigned int type_i=0; type_i < N_Types; ++type_i) {
195 for (
unsigned int eta_i=0; eta_i < N_Regions; ++eta_i) {
201 template <
typename T_IntB>
203 for (
unsigned int cat_i=0; cat_i < N_Categories; ++cat_i ) {
204 for (
unsigned int type_i=0; type_i < N_Types; ++type_i) {
205 for (
unsigned int eta_i=0; eta_i < N_Regions; ++eta_i) {
206 m_counter[cat_i][type_i][eta_i] +=
a.m_counter[cat_i][type_i][eta_i];
215 template <
int N_Categories,
int N_Types,
int N_Regions,
int N_SubCategories,
typename T_Int=
long>
219 for (
unsigned int cat_i=0; cat_i < N_Categories; ++cat_i ) {
220 for (
unsigned int type_i=0; type_i < N_Types; ++type_i) {
221 for (
unsigned int eta_i=0; eta_i < N_Regions; ++eta_i) {
222 for (
unsigned int sub_i=0; sub_i < N_SubCategories; ++sub_i) {
223 m_counter[cat_i][type_i][eta_i][sub_i]=0;
229 template <
typename T_IntB>
231 for (
unsigned int cat_i=0; cat_i < N_Categories; ++cat_i ) {
232 for (
unsigned int type_i=0; type_i < N_Types; ++type_i) {
233 for (
unsigned int eta_i=0; eta_i < N_Regions; ++eta_i) {
234 for (
unsigned int sub_i=0; sub_i < N_SubCategories; ++sub_i) {
235 m_counter[cat_i][type_i][eta_i][sub_i] +=
a.m_counter[cat_i][type_i][eta_i][sub_i];
242 T_Int
m_counter[N_Categories][N_Types][N_Regions][N_SubCategories];
333 mutable std::bitset<Trk::TrackInfo::NumberOfTrackProperties> m_patternProperties
ATLAS_THREAD_SAFE;
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
bool printTrackSummaryRegion(MsgStream &out, enum track_types, enum eta_region) const
Sets up detailed statistics part of table, calls printTrackSummaryRegion.
Counter4D< kNTrackSummaryCounter, N_TRACKTYPES, N_ETAREGIONS, kNSummaryTypes, int > TrackSummaryCounter
type statistics.
Counter4D< kNTrackSummaryCounter, N_TRACKTYPES, N_ETAREGIONS, kNSummaryTypes, std::atomic< long > > TrackSummaryCounterAtomic
bool PassTrackCuts(const Trk::TrackParameters *para) const
defines 'good' reco tracks
void printRegionSecondary(MsgStream &out, enum eta_region, float denominator) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
void printRegion1(MsgStream &out, enum eta_region) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
std::atomic< bool > m_author_found[Trk::TrackInfo::NumberOfTrackFitters]
Number of tracking authors found.
TrackStatHelper(const std::string &, const std::string &, bool careAboutTruth=true)
Constructor.
void addEvent(const TrackCollection *, std::vector< const Trk::Track * > &, const std::vector< std::pair< HepMC::ConstGenParticlePtr, int > > &, const TrackTruthCollection *, const AtlasDetectorID *const, const PixelID *, const SCT_ID *, const Trk::IExtendedTrackSummaryTool *, bool, const unsigned int *, const unsigned int *) const
Adds hit, track and matching information for each event.
void printSecondary(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
std::string m_TrackTruthCollectionKey
StoreGate Track Truth Collection Key.
std::string m_TrackCollectionKey
StoreGate Track Collection Key.
TracksCounterAtomic m_tracks ATLAS_THREAD_SAFE
void printTrackSummaryAverage(MsgStream &out, enum track_types, enum eta_region, int summary_type) const
Prints information from TrackSummaryTool.
static std::string getSummaryTypeHeader()
static const char *const s_summaryTypeName[kNSummaryTypes]
table column labels for summary
std::multimap< HepMcParticleLink, float > recoToTruthMap
map containing reco track and matched truth track barcode
@ kNumberOfTRTHighThresholdOutliers
@ kNumberOfTRTHighThresholdHits
@ kNumberOfInnermostPixelLayerHits
@ kNumberOfSCTDoubleHoles
@ kNumberOfOutliersOnTrack
const std::string & Truthkey() const
Returns Truth TrackCollection Key.
Counter< kNTracksCounter, N_TRACKTYPES, N_ETAREGIONS, int > TracksCounter
void print(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
@ kTracks_rec
number of reconstructed tracks for a given type and eta region
@ kTracks_gen
number of generated tracks for a given type and eta region, looping over genevents to include possibl...
@ kTracks_gen_signal
number of generated tracks for a given type and eta region, just from first genevent
Counter< kNTracksCounter, N_TRACKTYPES, N_ETAREGIONS, std::atomic< long > > TracksCounterAtomic
static const Trk::SummaryType s_summaryTypes[kNSummaryTypes]
summary types for which statistics are gathered
void reset()
Resets the track collection information, called in the constructor.
void setSummaryStat(track_types track_i, eta_region region_i, const Trk::TrackSummary *summary, TrackSummaryCounter &trackSummarySum) const
@ kNTrackSummaryBAD
Number of tracks with track summary bad for given type,eta,summary type.
@ kNTrackSummaryOK
Number of tracks with track summary OK for given type,eta,summary type.
@ kTrackSummarySum
Track Summary Values for each track type, region and summary type.
const std::string & key() const
Returns TrackCollection Key.
Counter< kNHitsCounter, N_HITTYPES, N_ETAREGIONS, std::atomic< long > > HitsCounterAtomic
@ kHits_sec
number of hits from secondary tracks for a given type and eta region
@ kHits_rec
number of reconstructed hits for a given type and eta region
@ kHits_pri
number of hits from primary tracks for a given type and eta region
int ClassifyParticle(const HepMC::ConstGenParticlePtr &particle, const double prob) const
classifies gen particle as primary, secondary or truncated
Counter< kNHitsCounter, N_HITTYPES, N_ETAREGIONS, int > HitsCounter
std::atomic< long > m_events
Number of events.
void printRegion2(MsgStream &out, enum eta_region, float denominator) const
std::atomic< bool > m_truthMissing
Flag for if track truth is missing.
void SetCuts(const struct cuts &)
Sets the cuts such as the eta regions (barrel, transition,endcap) and the hit fraction fake cuts and ...
@ TRACK_NOHEPMCPARTICLELINK
@ TRACK_LOWTRUTHPROB2_SIGNAL
@ TRACK_LOWTRUTHPROB_SIGNAL
@ TRACK_MULTMATCH_SECONDARY
@ TRACK_MULTMATCH_PRIMARY
@ TRACK_MATCHED_SECONDARY
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
@ NumberOfTrackFitters
maximum number of enums
A summary of the information contained by a track.
const GenParticle * ConstGenParticlePtr
ParametersBase< TrackParametersDim, Charged > TrackParameters
SummaryType
enumerates the different types of information stored in Summary.
int m_counter[N_Categories][N_Types][N_Regions][N_SubCategories]
Counter4D & operator+=(const Counter4D< N_Categories, N_Types, N_Regions, N_SubCategories, T_IntB > &a)
Counter & operator+=(const Counter< N_Categories, N_Types, N_Regions, T_IntB > &a)
int m_counter[N_Categories][N_Types][N_Regions]
float fakeTrackCut
fraction of hits per track that come from single matched truth track.
float matchTrackCut
Truth probability has to be greater than this for track to be considered matched.
float maxEtaTransition
Maxiumu eta for transition region.
float fakeTrackCut2
2nd value for fraction of hits per track that come from single matched truth track.
float maxEtaEndcap
Maximum eta for endcap.