ATLAS Offline Software
Loading...
Searching...
No Matches
InDetRecStatisticsAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// InDetRecStatisticsAlg.h
7// Authors: Sven Vahsen, Lauren Tompkins
9
10#ifndef INDETRECSTATISTICS_TrackStatistics_H
11#define INDETRECSTATISTICS_TrackStatistics_H
12
13
15#include "GaudiKernel/ToolHandle.h"
18#include "Identifier/Identifier.h"
24
25#include <vector>
26#include <atomic>
27
28// forward declarations
29
30class AtlasDetectorID;
31class PixelID;
32class SCT_ID;
33class TRT_ID;
34class IdDictManager;
37class GenParticle;
38
39namespace Trk {
41 class TrackSummary;
42}
43
44namespace InDet {
45
47
48
54
55 public:
57 InDetRecStatisticsAlg (const std::string& name, ISvcLocator* pSvcLocator);
59 StatusCode initialize();
61 StatusCode execute(const EventContext &ctx) const;
63 StatusCode finalize();
65 StatusCode getServices();
67 StatusCode resetStatistics();
69 void printStatistics();
71 void printTrackSummary (MsgStream &out, enum eta_region );
72
73
74
75 private:
76
77 template <typename T_Int=int>
78 struct Counter;
80
84 std::vector <std::pair<HepMC::ConstGenParticlePtr,int> > &,
85 unsigned int,
86 unsigned int,
87 CounterLocal &counter) const;
88
91 std::vector <const Trk::Track *> & ,
92 std::vector <const Trk::Track *> &,
93 CounterLocal &counter) const;
94
95
96
97 std::vector <class TrackStatHelper *> m_SignalCounters;
102 // added to check TRT existence (SLHC geo check)
104 ToolHandle<Trk::ITruthToTrack> m_truthToTrack;
105 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool;
106
107 ToolHandle<Trk::IUpdator> m_updatorHandle;
109 ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator;
110
111 // steering parameters of Algorithm
113 ToolHandle<Trk::ITrackSelectorTool> m_trackSelectorTool;
114
117 float m_minPt;
118 float m_maxEta;
125 // float m_maxRIndet;
140
141 mutable std::atomic<bool> m_pullWarning {};
142 mutable std::atomic<bool> m_UpdatorWarning {};
143 mutable std::atomic<int> m_isUnbiased ;
144
145 mutable std::atomic<long> m_events_processed ;
146 // statistics counters
155
156 template <typename T_Int>
157 struct Counter {
158 Counter() { reset(); }
159 void reset() {
160 for (unsigned int i=0; i<kNCounter; ++i) { m_counter[i]=0; }
161 }
162 template <typename T_IntB>
164 for (unsigned int i=0; i<kNCounter; ++i) { m_counter[i] += b.m_counter[i]; }
165 return *this;
166 }
168 };
169
172 static float calculatePull(const float, const float, const float); //vv
175 Identifier getIdentifier(const Trk::MeasurementBase* measurement );
176 };
177
178} // close of namespace
179
180#endif // INDETRECSTATISTICS_TrackStatistics_H
Extrapolation for HepMC particles.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
@ GenParticle
An algorithm that can be simultaneously executed in multiple threads.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdDictManager is the interface to identifier dictionaries.
const TRT_ID * m_trtID
get trt layer from hit ID
float m_minZEndSecondary
If track has end vertex, this is min Z of end vertex to be considered secondary.
void selectGenSignal(const McEventCollection *, std::vector< std::pair< HepMC::ConstGenParticlePtr, int > > &, unsigned int, unsigned int, CounterLocal &counter) const
Select charged,stable particles which pass pt and eta cuts for analysis.
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
tool to create track parameters from a gen particle
std::atomic< long > m_events_processed
number of events processed
Trk::IUpdator * m_updator
updator for unbiased states
std::atomic< int > m_isUnbiased
if can get unbiased residuals
float m_maxEta
Maximum Eta cut for tracks used by the algorithm.
SG::ReadHandleKey< McEventCollection > m_McTrackCollection_key
StatusCode getServices()
Get various services such as StoreGate, dictionaries, detector managers etc.
float m_minREndSecondary
If track has end vertex, this is min R of end vertex to be considered secondary.
float m_maxRStartSecondary
Maximum R of start vertex to be considered secondary.
StatusCode resetStatistics()
Clear statistics counters, called before each track collection is processed.
const AtlasDetectorID * m_idHelper
Used to find out the sub-det from PRD->identify().
SG::ReadHandleKeyArray< TrackTruthCollection > m_TrackTruthCollection_keys
std::atomic< bool > m_pullWarning
warn only once, if pull cannot be calculated
float m_minZEndPrimary
If track has end vertex, this is min Z of end vertex to be considered primary.
void printStatistics()
Print tracking statistics calculated with TrackStatHelper.
float m_maxZStartPrimary
Maximum Z of start vertex to be considered primary.
bool m_printSecondary
Flag to print hit information for secondary tracks.
const PixelID * m_pixelID
get pixel layer from hit ID
float m_minREndPrimary
If track has end vertex, this is min R of end vertex to be considered primary.
InDetRecStatisticsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Default Constructor.
float m_fakeTrackCut2
Second definition of maximum probability for which a track will be considered a fake.
StatusCode execute(const EventContext &ctx) const
Calculation of statistics.
Counter< std::atomic< long > > m_counter ATLAS_THREAD_SAFE
float m_maxRStartPrimary
Maximum R of start vertex to be considered primary.
float m_maxEtaEndcap
define max eta of eta region
bool m_doTruth
Use truth information.
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
The residual and pull calculator tool handle.
std::vector< class TrackStatHelper * > m_SignalCounters
Vector of TrackStatHelper objects, one for each track collection.
static float calculatePull(const float, const float, const float)
Calculate pull from residual, track and hit error.
float m_maxEtaTransition
define max eta of transition region
std::atomic< bool > m_UpdatorWarning
warn only once, if unbiased track states can not be calculated
ToolHandle< Trk::IUpdator > m_updatorHandle
Tool handle of updator for unbiased states.
void selectRecSignal(const TrackCollection *, std::vector< const Trk::Track * > &, std::vector< const Trk::Track * > &, CounterLocal &counter) const
Select for analysis reconstructed tracks passing Pt and eta cuts.
const SCT_ID * m_sctID
get sct layer from hit ID
Identifier getIdentifier(const Trk::MeasurementBase *measurement)
StatusCode finalize()
Statistics table printed, collection cleared.
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
tool to get track summary information from track
const Trk::TrackParameters * getUnbiasedTrackParameters(const Trk::TrackParameters *, const Trk::MeasurementBase *)
Get Unbiased Track Parameters.
SG::ReadHandleKeyArray< TrackCollection > m_RecTrackCollection_keys
ToolHandle< Trk::ITrackSelectorTool > m_trackSelectorTool
float m_minPt
Minimum Pt cut for tracks used by the algorithm.
bool m_UseTrackSummary
Flag to print detailed statistics for each track collection.
float m_fakeTrackCut
Maximum probability for which a track will be considered a fake.
@ kN_gen_tracks_processed
number of generated tracks processed
@ kN_rec_tracks_processed
number of reconstructed tracks processed
@ kN_rec_tracks_without_perigee
number of tracks w/o perigee
@ kN_spacepoints_processed
number of space points processed
@ kN_unknown_hits
number of hits without track
void printTrackSummary(MsgStream &out, enum eta_region)
Print track statistics for all and low proability tracks.
float m_maxEtaBarrel
define max eta of barrel region
StatusCode initialize()
Initialization of services, track collections, creates TrackStatHelper for each Track Collection.
bool m_useTrackSelection
Use track selector tool.
float m_maxZStartSecondary
Maximum Z of start vertex to be considered secondary.
float m_matchTrackCut
Minimum number of hits from a truth track to be considered a matched reco track.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
Property holding a SG store/key/clid from which a ReadHandle is made.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Interface for condensing Trk::Track properties and associated hits to a (non-fittable) foot print,...
Set of interfaces for methods operating on track states, mainly for Kalman filtering.
Definition IUpdator.h:64
This class is the pure abstract base class for all fittable tracking measurements.
A summary of the information contained by a track.
Primary Vertex Finder.
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersBase< TrackParametersDim, Charged > TrackParameters
Counter & operator+=(const Counter< T_IntB > &b)