ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetRecStatisticsAlg Class Reference

#include <InDetRecStatisticsAlg.h>

Inheritance diagram for InDet::InDetRecStatisticsAlg:

Classes

struct  Counter

Public Member Functions

 InDetRecStatisticsAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Default Constructor.
StatusCode initialize ()
 Initialization of services, track collections, creates TrackStatHelper for each Track Collection.
StatusCode execute (const EventContext &ctx) const
 Calculation of statistics.
StatusCode finalize ()
 Statistics table printed, collection cleared.
StatusCode getServices ()
 Get various services such as StoreGate, dictionaries, detector managers etc.
StatusCode resetStatistics ()
 Clear statistics counters, called before each track collection is processed.
void printStatistics ()
 Print tracking statistics calculated with TrackStatHelper.
void printTrackSummary (MsgStream &out, enum eta_region)
 Print track statistics for all and low proability tracks.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  ECounter {
  kN_rec_tracks_without_perigee , kN_unknown_hits , kN_rec_tracks_processed , kN_gen_tracks_processed ,
  kN_spacepoints_processed , kNCounter
}
using CounterLocal = Counter<int>
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

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.
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 Trk::TrackParametersgetUnbiasedTrackParameters (const Trk::TrackParameters *, const Trk::MeasurementBase *)
 Get Unbiased Track Parameters.
Identifier getIdentifier (const Trk::MeasurementBase *measurement)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static float calculatePull (const float, const float, const float)
 Calculate pull from residual, track and hit error.

Private Attributes

std::vector< class TrackStatHelper * > m_SignalCounters
 Vector of TrackStatHelper objects, one for each track collection.
const AtlasDetectorIDm_idHelper
 Used to find out the sub-det from PRD->identify().
const PixelIDm_pixelID
 get pixel layer from hit ID
const SCT_IDm_sctID
 get sct layer from hit ID
const TRT_IDm_trtID
 get trt layer from hit ID
const IdDictManagerm_idDictMgr
ToolHandle< Trk::ITruthToTrackm_truthToTrack
 tool to create track parameters from a gen particle
ToolHandle< Trk::IExtendedTrackSummaryToolm_trkSummaryTool
 tool to get track summary information from track
ToolHandle< Trk::IUpdatorm_updatorHandle
 Tool handle of updator for unbiased states.
Trk::IUpdatorm_updator
 updator for unbiased states
ToolHandle< Trk::IResidualPullCalculatorm_residualPullCalculator
 The residual and pull calculator tool handle.
SG::ReadHandleKey< McEventCollectionm_McTrackCollection_key
ToolHandle< Trk::ITrackSelectorToolm_trackSelectorTool
bool m_UseTrackSummary
 Flag to print detailed statistics for each track collection.
bool m_printSecondary
 Flag to print hit information for secondary tracks.
float m_minPt
 Minimum Pt cut for tracks used by the algorithm.
float m_maxEta
 Maximum Eta cut for tracks used by the algorithm.
float m_maxEtaBarrel
 define max eta of barrel region
float m_maxEtaTransition
 define max eta of transition region
float m_maxEtaEndcap
 define max eta of eta region
float m_fakeTrackCut
 Maximum probability for which a track will be considered a fake.
float m_fakeTrackCut2
 Second definition of maximum probability for which a track will be considered a fake.
float m_matchTrackCut
 Minimum number of hits from a truth track to be considered a matched reco track.
float m_maxRStartPrimary
 Maximum R of start vertex to be considered primary.
float m_maxRStartSecondary
 Maximum R of start vertex to be considered secondary.
float m_maxZStartPrimary
 Maximum Z of start vertex to be considered primary.
float m_maxZStartSecondary
 Maximum Z of start vertex to be considered secondary.
float m_minREndPrimary
 If track has end vertex, this is min R of end vertex to be considered primary.
float m_minREndSecondary
 If track has end vertex, this is min R of end vertex to be considered secondary.
float m_minZEndPrimary
 If track has end vertex, this is min Z of end vertex to be considered primary.
float m_minZEndSecondary
 If track has end vertex, this is min Z of end vertex to be considered secondary.
bool m_useTrackSelection
 Use track selector tool.
bool m_doTruth
 Use truth information.
float m_minEtaFORWARD
float m_maxEtaFORWARD
SG::ReadHandleKeyArray< TrackCollectionm_RecTrackCollection_keys
SG::ReadHandleKeyArray< TrackTruthCollectionm_TrackTruthCollection_keys
std::atomic< bool > m_pullWarning {}
 warn only once, if pull cannot be calculated
std::atomic< bool > m_UpdatorWarning {}
 warn only once, if unbiased track states can not be calculated
std::atomic< int > m_isUnbiased
 if can get unbiased residuals
std::atomic< long > m_events_processed
 number of events processed
Counter< std::atomic< long > > m_counter ATLAS_THREAD_SAFE
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 46 of file InDetRecStatisticsAlg.h.

Member Typedef Documentation

◆ CounterLocal

Definition at line 79 of file InDetRecStatisticsAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ ECounter

Enumerator
kN_rec_tracks_without_perigee 

number of tracks w/o perigee

kN_unknown_hits 

number of hits without track

kN_rec_tracks_processed 

number of reconstructed tracks processed

kN_gen_tracks_processed 

number of generated tracks processed

kN_spacepoints_processed 

number of space points processed

kNCounter 

Definition at line 147 of file InDetRecStatisticsAlg.h.

147 {
154 };
@ 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

Constructor & Destructor Documentation

◆ InDetRecStatisticsAlg()

InDet::InDetRecStatisticsAlg::InDetRecStatisticsAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Default Constructor.

Definition at line 76 of file InDetRecStatisticsAlg.cxx.

76 :
77 AthReentrantAlgorithm(name, pSvcLocator),
78 m_trtID (nullptr),
79 m_idDictMgr (nullptr),
80 m_truthToTrack ("Trk::TruthToTrack"),
81 m_trkSummaryTool ("Trk::TrackSummaryTool/InDetTrackSummaryTool"),
82 m_updatorHandle ("Trk::KalmanUpdator/TrkKalmanUpdator"),
83 m_updator (nullptr),
84 m_residualPullCalculator ("Trk::ResidualPullCalculator/ResidualPullCalculator"),
85 m_McTrackCollection_key ("TruthEvent"),
86 m_trackSelectorTool ("InDet::InDetDetailedTrackSelectorTool"),
87 m_UseTrackSummary (true),
88 m_printSecondary (false),
89 m_minPt (1000),
90 m_maxEta (4.2),
91 m_maxEtaBarrel (0.8),
93 m_maxEtaEndcap (2.5),
94 m_fakeTrackCut (0.9),
95 m_fakeTrackCut2 (0.7),
96 m_matchTrackCut (0.5),
97 m_maxRStartPrimary ( 25.0*CLHEP::mm),
98 m_maxRStartSecondary ( 360.0*CLHEP::mm),
99 m_maxZStartPrimary ( 200.0*CLHEP::mm),
100 m_maxZStartSecondary (2000.0*CLHEP::mm),
101 m_minREndPrimary ( 400.0*CLHEP::mm),
102 m_minREndSecondary (1000.0*CLHEP::mm),
103 m_minZEndPrimary (2300.0*CLHEP::mm),
104 //m_maxZIndet (),
105 m_minZEndSecondary (3200.0*CLHEP::mm),
106 m_useTrackSelection (false),
107 m_doTruth (true),
108 m_minEtaFORWARD (2.5),
109 m_maxEtaFORWARD (4.2),
110 m_isUnbiased (0),
112{
113 // m_RecTrackCollection_keys.push_back(std::string("Tracks"));
114 // m_TrackTruthCollection_keys.push_back(std::string("TrackTruthCollection"));
115
116 // Algorithm properties
117 declareProperty("SummaryTool", m_trkSummaryTool);
118 declareProperty("TruthToTrackTool", m_truthToTrack);
119 declareProperty("UpdatorTool", m_updatorHandle,
120 "Measurement updator to calculate unbiased track states");
121 declareProperty("ResidualPullCalculatorTool", m_residualPullCalculator,
122 "Tool to calculate residuals and pulls");
123 declareProperty("TrackCollectionKeys", m_RecTrackCollection_keys);
124 declareProperty("McTrackCollectionKey", m_McTrackCollection_key);
125 declareProperty("TrackTruthCollectionKeys", m_TrackTruthCollection_keys);
126 declareProperty("UseTrackSelection" , m_useTrackSelection);
127 declareProperty("DoTruth" , m_doTruth);
128 declareProperty("TrackSelectorTool" , m_trackSelectorTool);
129 declareProperty("UseTrackSummary", m_UseTrackSummary);
130 declareProperty("PrintSecondary", m_printSecondary);
131 declareProperty("minPt", m_minPt);
132 declareProperty("maxEta", m_maxEta);
133 declareProperty("maxEtaBarrel", m_maxEtaBarrel );
134 declareProperty("maxEtaTransition", m_maxEtaTransition);
135 declareProperty("maxEtaEndcap", m_maxEtaEndcap);
136 declareProperty("maxEtaFORWARD", m_maxEtaFORWARD);
137 declareProperty("minEtaFORWARD", m_minEtaFORWARD);
138 declareProperty("fakeTrackCut", m_fakeTrackCut);
139 declareProperty("fakeTrackCut2", m_fakeTrackCut2);
140 declareProperty("matchTrackCut", m_matchTrackCut);
141 declareProperty("maxRStartPrimary", m_maxRStartPrimary);
142 declareProperty("maxRStartSecondary", m_maxRStartSecondary);
143 declareProperty("maxZStartPrimary", m_maxZStartPrimary);
144 declareProperty("maxZStartSecondary", m_maxZStartSecondary);
145 declareProperty("minREndPrimary", m_minREndPrimary);
146 declareProperty("minREndSecondary", m_minREndSecondary);
147 declareProperty("minZEndPrimary", m_minZEndPrimary);
148 declareProperty("minZEndSecondary", m_minZEndSecondary);
149 m_idHelper = nullptr;
150 m_pixelID = nullptr;
151 m_sctID = nullptr;
152 m_UpdatorWarning = false;
153 m_pullWarning = false;
154}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.
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
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.
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.
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.
float m_fakeTrackCut2
Second definition of maximum probability for which a track will be considered a fake.
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.
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.
const SCT_ID * m_sctID
get sct layer from hit ID
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
tool to get track summary information from track
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.
float m_maxEtaBarrel
define max eta of barrel region
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.

Member Function Documentation

◆ calculatePull()

float InDet::InDetRecStatisticsAlg::calculatePull ( const float residual,
const float trkErr,
const float hitErr )
staticprivate

Calculate pull from residual, track and hit error.

Definition at line 773 of file InDetRecStatisticsAlg.cxx.

775 {
776 double ErrorSum;
777 ErrorSum = sqrt(pow(trkErr, 2) + pow(hitErr, 2));
778 if (ErrorSum != 0) { return residual/ErrorSum; }
779 else { return 0; }
780}
constexpr int pow(int x)
Definition conifer.h:27

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode InDet::InDetRecStatisticsAlg::execute ( const EventContext & ctx) const

Calculation of statistics.

Definition at line 267 of file InDetRecStatisticsAlg.cxx.

267 {
268
269 ATH_MSG_DEBUG("entering execute()");
270
271 // Get reconstructed tracks , generated tracks, and truth from storegate
272
273 SG::ReadHandle<McEventCollection> SimTracks;
274
275 if (m_doTruth) {
276 SimTracks=SG::ReadHandle<McEventCollection>(m_McTrackCollection_key,ctx);
277 if (!SimTracks.isValid()) {
278 // @TODO warning ?
279 ATH_MSG_WARNING("Error retrieving collections !");
280 return StatusCode::SUCCESS;
281 }
282 }
283
284 // Doesn't take account of pileup:
285 //m_gen_tracks_processed += (*(SimTracks->begin()))->particles_size();
288
289 // select charged and stable generated tracks
290 // apply pt, eta etc cuts to generated tracks
291 // devide generated tracks into primary, truncated, secondary
292
293 std::vector <std::pair<HepMC::ConstGenParticlePtr,int> > GenSignal;
294 // GenSignalPrimary, GenSignalTruncated, GenSignalSecondary;
295 unsigned int inTimeStart = 0;
296 unsigned int inTimeEnd = 0;
297 if (m_doTruth) selectGenSignal ((SimTracks.isValid() ? &(*SimTracks) : nullptr), GenSignal, inTimeStart, inTimeEnd, counter);
298
299 // step through the various reconstructed TrackCollections and
300 // corresponding TrackTruthCollections and produce statistics for each
301
302 if (m_SignalCounters.empty()) {
303 ATH_MSG_ERROR("No reco track collection specified! Aborting.");
304 return StatusCode::FAILURE;
305 }
306
307 std::vector< SG::ReadHandle<TrackCollection> > rec_track_collections = m_RecTrackCollection_keys.makeHandles(ctx);
308 std::vector< SG::ReadHandle<TrackTruthCollection> > truth_track_collections;
309 if (m_doTruth && !m_TrackTruthCollection_keys.empty()) {
310 truth_track_collections = m_TrackTruthCollection_keys.makeHandles(ctx);
311 if (truth_track_collections.size() != rec_track_collections.size()) {
312 ATH_MSG_ERROR("Different number of reco and truth track collections (" << rec_track_collections.size() << "!=" << truth_track_collections.size() << ")" );
313 }
314 }
315 if (m_SignalCounters.size() != rec_track_collections.size()) {
316 ATH_MSG_ERROR("Number expected reco track collections does not match the actual number of such collections ("
317 << m_SignalCounters.size() << "!=" << rec_track_collections.size() << ")" );
318 }
319
320 std::vector< SG::ReadHandle<TrackCollection> >::iterator rec_track_collections_iter = rec_track_collections.begin();
321 std::vector< SG::ReadHandle<TrackTruthCollection> >::iterator truth_track_collections_iter = truth_track_collections.begin();
322 for (std::vector <class TrackStatHelper *>::const_iterator statHelper
323 = m_SignalCounters.begin();
324 statHelper != m_SignalCounters.end();
325 ++statHelper, ++rec_track_collections_iter) {
326 assert( rec_track_collections_iter != rec_track_collections.end());
327
328 ATH_MSG_DEBUG("Acessing TrackCollection " << m_RecTrackCollection_keys.at(rec_track_collections_iter - rec_track_collections.begin()).key());
329 const TrackCollection * RecCollection = &(**rec_track_collections_iter);
330 const TrackTruthCollection * TruthMap = nullptr;
331
332 if (RecCollection) ATH_MSG_DEBUG("Retrieved " << RecCollection->size() << " reconstructed tracks from storegate");
333
334 if (m_doTruth) {
335 ATH_MSG_DEBUG("Acessing TrackTruthCollection " << m_TrackTruthCollection_keys.at(truth_track_collections_iter - truth_track_collections.begin()).key());
336 assert( truth_track_collections_iter != truth_track_collections.end());
337 TruthMap = &(**truth_track_collections_iter);
338 if (TruthMap) ATH_MSG_DEBUG("Retrieved " << TruthMap->size() << " TrackTruth elements from storegate");
339 ++truth_track_collections_iter;
340 }
341
342 //start process of getting correct track summary
343
344 std::vector <const Trk::Track *> RecTracks, RecSignal;
345 selectRecSignal (RecCollection, RecTracks,RecSignal,counter);
346
348 " RecTracks.size()=" << RecTracks.size()
349 << ", GenSignal.size()=" << GenSignal.size());
350
351 ATH_MSG_DEBUG("Accumulating Statistics...");
352 (*statHelper)->addEvent (ctx,
353 RecCollection,
354 RecTracks,
355 GenSignal,
356 TruthMap,
358 m_pixelID,
359 m_sctID,
360 m_trkSummaryTool.operator->(),
362 &inTimeStart,
363 &inTimeEnd);
364
365 counter.m_counter[kN_rec_tracks_processed] += RecCollection->size();
366
367 for ( TrackCollection::const_iterator it = RecCollection->begin() ;
368 it < RecCollection->end(); ++ it){
369 std::vector<const Trk::RIO_OnTrack*> rioOnTracks;
370 Trk::RoT_Extractor::extract( rioOnTracks,
371 (*it)->measurementsOnTrack()->stdcont() );
372 counter.m_counter[kN_spacepoints_processed] += rioOnTracks.size();
373 }
374
375 }
376 m_counter += counter;
377
378 ATH_MSG_DEBUG("leaving execute()");
379 return StatusCode::SUCCESS;
380}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
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.
std::vector< class TrackStatHelper * > m_SignalCounters
Vector of TrackStatHelper objects, one for each track collection.
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.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
static void extract(std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode InDet::InDetRecStatisticsAlg::finalize ( )

Statistics table printed, collection cleared.

Definition at line 385 of file InDetRecStatisticsAlg.cxx.

385 {
386
387 // Part 1: Get the messaging service, print where you are
388 ATH_MSG_DEBUG("finalize()");
389
391
392 for (std::vector <class TrackStatHelper *>::const_iterator collection =
393 m_SignalCounters.begin(); collection != m_SignalCounters.end();
394 ++collection) {
396 delete (*collection);
397 }
398 m_SignalCounters.clear();
399 return StatusCode::SUCCESS;
400}
static const char *const s_linestr2
void printStatistics()
Print tracking statistics calculated with TrackStatHelper.

◆ getIdentifier()

Identifier InDet::InDetRecStatisticsAlg::getIdentifier ( const Trk::MeasurementBase * measurement)
private

Definition at line 823 of file InDetRecStatisticsAlg.cxx.

823 {
824 Identifier id;
825 const Trk::CompetingRIOsOnTrack *comprot = nullptr;
826 // identify by ROT:
827 const Trk::RIO_OnTrack *rot =
828 dynamic_cast<const Trk::RIO_OnTrack*>(measurement);
829 if (rot) {
830 id = rot->identify();
831 } else {
832 // identify by CompetingROT:
833 comprot = dynamic_cast<const Trk::CompetingRIOsOnTrack*>(measurement);
834 if (comprot) {
835 rot = &comprot->rioOnTrack(comprot->indexOfMaxAssignProb());
836 id = rot->identify();
837 } else {
838 ATH_MSG_DEBUG("measurement is neither ROT nor competingROT:"
839 <<" can not determine detector type");
840 id.clear();
841 }
842 }
843 delete comprot;
844 return id;
845}
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
Identifier identify() const
return the identifier -extends MeasurementBase

◆ getServices()

StatusCode InDet::InDetRecStatisticsAlg::getServices ( )

Get various services such as StoreGate, dictionaries, detector managers etc.

Definition at line 403 of file InDetRecStatisticsAlg.cxx.

404{
405 //Set up ATLAS ID helper to be able to identify the RIO's det-subsystem.
406
407 // Get the dictionary manager from the detector store
408 const IdDictManager* idDictMgr = nullptr;
409 StatusCode sc = detStore()->retrieve(idDictMgr, "IdDict");
410 if (sc.isFailure()) {
411 ATH_MSG_FATAL("Could not get IdDictManager !");
412 return StatusCode::FAILURE;
413 }
414
415 // Initialize the helper with the dictionary information.
416 sc = detStore()->retrieve(m_idHelper, "AtlasID");
417 if (sc.isFailure()) {
418 ATH_MSG_FATAL("Could not get AtlasDetectorID helper.");
419 return StatusCode::FAILURE;
420 }
421
422 //get Pixel, SCT, TRT managers and helpers
423
424 if (detStore()->retrieve(m_pixelID, "PixelID").isFailure()) {
425 msg(MSG::FATAL) << "Could not get Pixel ID helper" << endmsg;
426 return StatusCode::FAILURE;
427 }
428 if (detStore()->retrieve(m_sctID, "SCT_ID").isFailure()) {
429 msg(MSG::FATAL) << "Could not get SCT ID helper" << endmsg;
430 return StatusCode::FAILURE;
431 }
432
433 //retrieve the TRT helper only if not-SLHC layout used
434 sc = detStore()->retrieve(m_idDictMgr, "IdDict");
435 if (sc.isFailure()) {
436 ATH_MSG_FATAL("Could not get IdDictManager !");
437 return StatusCode::FAILURE;
438 }
439 const IdDictDictionary* dict = m_idDictMgr->manager()->find_dictionary("InnerDetector");
440 if(!dict) {
441 ATH_MSG_FATAL(" Cannot access InnerDetector dictionary ");
442 return StatusCode::FAILURE;
443 }
444
445 bool isSLHC = false;
446 if (dict->file_name().find("SLHC")!=std::string::npos) isSLHC=true;
447
448 if(!isSLHC){
449 if (detStore()->retrieve(m_trtID, "TRT_ID").isFailure()) {
450 msg(MSG::FATAL) << "Could not get TRT ID helper" << endmsg;
451 return StatusCode::FAILURE;
452 }
453 }
454 //
455
456 if (m_UseTrackSummary) {
457 if (m_trkSummaryTool.retrieve().isFailure() ) {
458 ATH_MSG_FATAL("Failed to retrieve tool "
460 return StatusCode::FAILURE;
461 } else {
462 ATH_MSG_INFO("Retrieved tool " << m_trkSummaryTool);
463 }
464 } else {
465 m_trkSummaryTool.disable();
466 }
467
468 // AG: init truthToTrack
469 if (m_doTruth) {
470 if (m_truthToTrack.retrieve().isFailure() ) {
471 ATH_MSG_FATAL("Failed to retrieve tool " << m_truthToTrack);
472 return StatusCode::FAILURE;
473 } else {
474 ATH_MSG_INFO("Retrieved tool " << m_truthToTrack);
475 }
476 } else {
477 m_truthToTrack.disable();
478 }
479
480 //adding track selector tool
482 if ( m_trackSelectorTool.retrieve().isFailure() ) {
483 ATH_MSG_FATAL("Failed to retrieve tool " << m_trackSelectorTool);
484 return StatusCode::FAILURE;
485 } else {
486 ATH_MSG_INFO("Retrieved tool " << m_trackSelectorTool);
487 }
488 } else {
489 m_trackSelectorTool.disable();
490 }
491 return StatusCode :: SUCCESS;
492}
#define endmsg
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
const std::string & file_name() const
Access to file name.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ getUnbiasedTrackParameters()

const Trk::TrackParameters * InDet::InDetRecStatisticsAlg::getUnbiasedTrackParameters ( const Trk::TrackParameters * trkParameters,
const Trk::MeasurementBase * measurement )
private

Get Unbiased Track Parameters.

Definition at line 782 of file InDetRecStatisticsAlg.cxx.

782 {
783
784
785 const Trk::TrackParameters *unbiasedTrkParameters = nullptr;
786
787 // -----------------------------------------
788 // use unbiased track states or normal ones?
789 // unbiased track parameters are tried to retrieve if the updator tool
790 // is available and if unbiased track states could be produced before
791 // for the current track (ie. if one trial to get unbiased track states
792 // fail
793
794 if (m_updator && (m_isUnbiased==1) ) {
795 if ( trkParameters->covariance() ) {
796 // Get unbiased state
797 ATH_MSG_VERBOSE(" getting unbiased params");
798 unbiasedTrkParameters =
799 m_updator->removeFromState( *trkParameters,
800 measurement->localParameters(),
801 measurement->localCovariance()).release();
802
803 if (!unbiasedTrkParameters) {
804 ATH_MSG_WARNING("Could not get unbiased track parameters, "
805 <<"use normal parameters");
806 m_isUnbiased = 0;
807 }
808 } else if(!m_UpdatorWarning) {
809 // warn only once!
810 ATH_MSG_WARNING("TrackParameters contain no covariance: "
811 <<"Unbiased track states can not be calculated "
812 <<"(ie. pulls and residuals will be too small)");
813 m_UpdatorWarning = true;
814 m_isUnbiased = 0;
815 } else {
816 m_isUnbiased = 0;
817 }
818 } // end if no measured track parameter
819 return unbiasedTrkParameters;
820}
#define ATH_MSG_VERBOSE(x)
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ initialize()

StatusCode InDet::InDetRecStatisticsAlg::initialize ( )

Initialization of services, track collections, creates TrackStatHelper for each Track Collection.

Definition at line 158 of file InDetRecStatisticsAlg.cxx.

158 {
159
160 // Part 1: Get the messaging service, print where you are
161 ATH_MSG_DEBUG("initialize()");
162
163 StatusCode sc1 = getServices(); // retrieve store gate service etc
164 if (sc1.isFailure()) {
165 ATH_MSG_FATAL("Error retrieving services !");
166 return StatusCode::FAILURE;
167 }
168
169 if (m_RecTrackCollection_keys.empty()) {
170 ATH_MSG_ERROR("No reco track collection specified! Aborting.");
171 return StatusCode::FAILURE;
172 }
173
175 ATH_MSG_ERROR("You have specified "
177 << " TrackCollection keys, and " << m_TrackTruthCollection_keys.size()
178 << " TrackTruthCollection keys."
179 << " You have to specify one TrackTruthCollection for each"
180 << " TrackCollection! Exiting."
181 );
182 return StatusCode::FAILURE;
183 }
184
185 // ----------------------------------
186 // use updator to get unbiased states
187 if ( ! m_updatorHandle.empty() ) {
188 if (m_updatorHandle.retrieve().isFailure()) {
189 ATH_MSG_FATAL("Could not retrieve measurement updator tool: "
190 << m_updatorHandle);
191 return StatusCode::FAILURE;
192 }
193 m_updator = &(*m_updatorHandle);
194 } else {
196 "No Updator for unbiased track states given, use normal states!");
197 m_updator = nullptr;
198 }
199
200
201 //get residual and pull calculator
202 if (m_residualPullCalculator.empty()) {
204 "No residual/pull calculator for general hit residuals configured."
205 );
207 "It is recommended to give R/P calculators to the det-specific tool"
208 << " handle lists then.");
209 } else if (m_residualPullCalculator.retrieve().isFailure()) {
210 ATH_MSG_FATAL("Could not retrieve "<< m_residualPullCalculator
211 <<" (to calculate residuals and pulls) ");
212
213 } else {
214 ATH_MSG_INFO("Generic hit residuals&pulls will be calculated in one or both "
215 << "available local coordinates");
216 }
217
218 // create one TrackStatHelper object of each trackCollection --- this is used to accumulate track and hit statistics
219
220 struct cuts ct;
221 ct.maxEtaBarrel= m_maxEtaBarrel;
222 ct.maxEtaTransition= m_maxEtaTransition;
223 ct.maxEtaEndcap= m_maxEtaEndcap;
224 ct.fakeTrackCut= m_fakeTrackCut;
225 ct.fakeTrackCut2= m_fakeTrackCut2;
226 ct.matchTrackCut = m_matchTrackCut;
227 ct.maxRStartPrimary = m_maxRStartPrimary;
228 ct.maxRStartSecondary = m_maxRStartSecondary;
229 ct.maxZStartPrimary = m_maxZStartPrimary;
230 ct.maxZStartSecondary = m_maxZStartSecondary;
231 ct.minREndPrimary = m_minREndPrimary;
232 ct.minREndSecondary = m_minREndSecondary;
233 ct.minZEndPrimary = m_minZEndPrimary;
234 ct.minZEndSecondary = m_minZEndSecondary;
235 ct.minPt = m_minPt;
236 ct.minEtaFORWARD = m_minEtaFORWARD;
237 ct.maxEtaFORWARD = m_maxEtaFORWARD;
238
239 unsigned int nCollections = 0;
240 for (SG::ReadHandleKeyArray<TrackCollection>::const_iterator
241 it = m_RecTrackCollection_keys.begin();
242 it < m_RecTrackCollection_keys.end(); ++ it) {
243 InDet::TrackStatHelper * collection =
244 new TrackStatHelper(it->key(),(m_doTruth ? m_TrackTruthCollection_keys[nCollections].key() : ""), m_doTruth);
245 nCollections ++;
246 collection->SetCuts(ct);
247 m_SignalCounters.push_back(collection);
248 }
249
250 StatusCode sc3 = resetStatistics(); // reset all statistic counters
251 if (sc3.isFailure()) {
252 ATH_MSG_FATAL("Error in resetStatistics !");
253 return StatusCode::FAILURE;
254 }
255
256 ATH_CHECK( m_RecTrackCollection_keys.initialize() );
259
260 return StatusCode :: SUCCESS;
261
262}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode getServices()
Get various services such as StoreGate, dictionaries, detector managers etc.
StatusCode resetStatistics()
Clear statistics counters, called before each track collection is processed.
void SetCuts(const struct cuts &)
Sets the cuts such as the eta regions (barrel, transition,endcap) and the hit fraction fake cuts and ...

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ printStatistics()

void InDet::InDetRecStatisticsAlg::printStatistics ( )

Print tracking statistics calculated with TrackStatHelper.

Definition at line 585 of file InDetRecStatisticsAlg.cxx.

585 {
586 if (!msgLvl(MSG::INFO)) return;
587
588 ATH_MSG_INFO(" ********** Beginning InDetRecStatistics Statistics Table ***********");
589 ATH_MSG_INFO("For documentation see https://twiki.cern.ch/twiki/bin/view/Atlas/InDetRecStatistics");
590 ATH_MSG_INFO("(or for guaranteed latest version: http://atlas-sw.cern.ch/cgi-bin/viewcvs-atlas.cgi/offline/InnerDetector/InDetValidation/InDetRecStatistics/doc/mainpage.h?&view=markup )");
591 ATH_MSG_INFO(" ********************************************************************");
592
593 std::stringstream outstr;
594 int def_precision(outstr.precision());
595 outstr << "\n"
596 << MSG::INFO
597 << std::setiosflags(std::ios::fixed | std::ios::showpoint)
598 << std::setw(7) << std::setprecision(2)
599 << s_linestr << "\n"
600 << "Summary" << "\n"
601 << "\tProcessed : " << m_events_processed
602 << " events, " << m_counter.m_counter[kN_rec_tracks_processed]
603 << " reconstructed tracks with " << m_counter.m_counter[kN_spacepoints_processed]
604 << " hits, and " << m_counter.m_counter[kN_gen_tracks_processed]
605 << " truth particles" << "\n"
606 << "\tProblem objects : " << m_counter.m_counter[kN_rec_tracks_without_perigee]
607 << " tracks without perigee, "
608 << m_counter.m_counter[kN_unknown_hits] << " unknown hits" << "\n"
609 << "\t" << "Reco TrackCollections : ";
610 bool first = true;
611 for (std::vector <class TrackStatHelper *>::const_iterator collection =
612 m_SignalCounters.begin();
613 collection != m_SignalCounters.end(); ++collection)
614 {
615 if (first) {
616 first = false;
617 }
618 else {
619 outstr << ", ";
620 }
621 outstr << "\"" << (*collection)->key() << "\"";
622 }
623 ATH_MSG_INFO(outstr.str());
624 outstr.str("");
625
626 if (m_doTruth)
627 {
628 outstr.str("");
629 outstr << "\n"
630 << "\t" << "TrackTruthCollections : ";
631 first = true;
632 for (std::vector <class TrackStatHelper *>::const_iterator collection = m_SignalCounters.begin();
633 collection != m_SignalCounters.end(); ++collection)
634 {
635 if (first) {
636 first = false;
637 }
638 else {
639 outstr << ", ";
640 }
641 outstr << "\"" << (*collection)->Truthkey() << "\"";
642 }
643 ATH_MSG_INFO(outstr.str());
644 outstr.str("");
645 }
646 outstr.str("");
647 outstr << "\n"
648 << s_linestr2 << "\n"
649 << "Cuts and Settings for Statistics Table" << "\n"
650 << "\t" << "TrackSummary Statistics" << "\t"
651 << (m_UseTrackSummary ? "YES" : "NO") << "\n"
652 << "\t" << "Signal \t" << "pT > "
653 << m_minPt/1000 << " GeV/c, |eta| < " << m_maxEta << "\t\t"
654 << "\t" << "Primary track start \t" << "R < "
655 << m_maxRStartPrimary << "mm and |z| < "
656 << m_maxZStartPrimary << "mm" << "\n"
657 << "\t" << "Barrel \t" << 0.0
658 << "< |eta| < " << m_maxEtaBarrel << "\t\t\t"
659 << "\t" << "Primary track end \t" << "R > "
660 << m_minREndPrimary << "mm or |z| > " << m_minZEndPrimary
661 << "mm" << "\n"
662 << "\t" << "Transition Region \t" << m_maxEtaBarrel
663 << "< |eta| < " << m_maxEtaTransition << "\t\t\t"
664 << "\t" << "Secondary (non-Primary) start \t"
665 << " R < " << m_maxRStartSecondary << "mm and"
666 << " |z| < " << m_maxZStartSecondary << " mm" << "\n"
667 << "\t" << "Endcap \t" << m_maxEtaTransition
668 << "< |eta| < " << m_maxEtaEndcap << "\t\t\t"
669 << "\t" << "Secondary (non-primary) end \t"
670 << " R > " << m_minREndSecondary << "mm or"
671 << " |z| > " << m_minREndSecondary << "mm" << "\n"
672 << "\t" << "Forward \t"
673 << "|eta| > " << m_minEtaFORWARD << "\n"
674 << "\t" << "Low prob tracks #1 \t" << "< "
675 << m_fakeTrackCut << " of hits from single Truth Track "
676 << "\n"
677 << "\t" << "Low prob tracks #2 \t" << "< "
678 << m_fakeTrackCut2 << " of hits from single Truth Track "
679 << "\n"
680 << "\t" << "No link tracks \t Track has no link associated to an HepMC Particle" << "\n"
681 << "\t" << "Good reco tracks \t" << "> "
682 << m_matchTrackCut << " of hits from single Truth Track + a link !";
683 ATH_MSG_INFO(outstr.str());
684 outstr.str("");
685
686 MsgStream &out = msg(MSG::INFO);
687 {
688 RestoreStream<MsgStream> restore(out);
689 out << "\n" << s_linestr2 << "\n";
690 m_SignalCounters.back()->print(out);
691
692 if (m_UseTrackSummary) {
693 std::string track_stummary_type_header = TrackStatHelper::getSummaryTypeHeader();
694 out << "\n"
695 << s_linestr2 << "\n"
696 << "Detailed Statistics for Hits on Reconstructed tracks, using TrackSummary: (Preselection of tracks as described above.)" << "\n"
697 << s_linestr2 << "\n"
698 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n"
699 << " Reco Tracks .........................................hits/track....................................................... " << "\n"
700 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n"
701 << " in BARREL tracks/event " << track_stummary_type_header << "\n"
702 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n";
703 printTrackSummary (out, ETA_BARREL);
704
705 out<< "\n"
706 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n"
707 << " in TRANSITION region tracks/event " << track_stummary_type_header << "\n"
708 << "----------------------------------------------------------------------------------------------------------------------------------------------------"
709 << "\n";
710 printTrackSummary (out, ETA_TRANSITION);
711
712 out << "\n"
713 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n"
714 << " in ENDCAP tracks/event " << track_stummary_type_header << "\n"
715 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n";
716 printTrackSummary (out, ETA_ENDCAP);
717
718 out << "\n"
719 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n"
720 << " in FORWARD region tracks/event " << track_stummary_type_header << "\n"
721 << "----------------------------------------------------------------------------------------------------------------------------------------------------" << "\n";
722 printTrackSummary (out, ETA_FORWARD);
723 }
724
726 outstr.str("");
727 outstr << "\n" << std::setprecision(def_precision)
728 <<s_linestr<<"\n"
729 <<"Statistics for Secondaries (non-Primaries)"<<"\n"
730 << "\t" << "Secondary track start \t"
731 << " R < " << m_maxRStartSecondary << "mm and"
732 << " |z| < " << m_maxZStartSecondary << " mm" << "\n"
733 << "\t" << "Secondary track end \t"
734 << " R > " << m_minREndSecondary << "mm or"
735 << " |z| > " << m_minZEndSecondary << "mm";
736 ATH_MSG_INFO(outstr.str());
737 outstr.str("");
738 out << "\n" << s_linestr2 << "\n";
739 m_SignalCounters.back()->printSecondary(out);
740
741 }
742 }
743 out << endmsg;
744
745 ATH_MSG_INFO(" ********** Ending InDetRecStatistics Statistics Table ***********");
746 ATH_MSG_INFO( "\n"
747 << s_linestr );
748}
static const char *const s_linestr
bool msgLvl(const MSG::Level lvl) const
void printTrackSummary(MsgStream &out, enum eta_region)
Print track statistics for all and low proability tracks.
static std::string getSummaryTypeHeader()
bool first
Definition DeMoScan.py:534

◆ printTrackSummary()

void InDet::InDetRecStatisticsAlg::printTrackSummary ( MsgStream & out,
enum eta_region eta_reg )

Print track statistics for all and low proability tracks.

Definition at line 751 of file InDetRecStatisticsAlg.cxx.

752{
753 bool printed = m_SignalCounters.back()->printTrackSummaryRegion(out, TRACK_ALL, eta_reg);
754
755 if (printed) {
756 out << "\n"
757 << "----------------------------------------------------------------------------------------------------------------------------------------------" << "\n";
758 }
759
760 printed = m_SignalCounters.back()->printTrackSummaryRegion(out, TRACK_LOWTRUTHPROB, eta_reg);
761 if (printed) {
762 out << "\n"
763 << "----------------------------------------------------------------------------------------------------------------------------------------------" << "\n";
764 }
765
766 m_SignalCounters.back()->printTrackSummaryRegion(out, TRACK_LOWTRUTHPROB2, eta_reg);
767
768}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resetStatistics()

StatusCode InDet::InDetRecStatisticsAlg::resetStatistics ( )

Clear statistics counters, called before each track collection is processed.

Definition at line 494 of file InDetRecStatisticsAlg.cxx.

494 {
495 m_counter.reset();
497
498 for (std::vector<InDet::TrackStatHelper *>::const_iterator counter =
499 m_SignalCounters.begin();
500 counter != m_SignalCounters.end(); ++ counter) {
501 (*counter)->reset();
502 }
503 return StatusCode :: SUCCESS;
504}

◆ selectGenSignal()

void InDet::InDetRecStatisticsAlg::selectGenSignal ( const McEventCollection * SimTracks,
std::vector< std::pair< HepMC::ConstGenParticlePtr, int > > & GenSignal,
unsigned int ,
unsigned int ,
CounterLocal & counter ) const
private

Select charged,stable particles which pass pt and eta cuts for analysis.

Classify truth tracks as primary, secondary or truncated

Definition at line 532 of file InDetRecStatisticsAlg.cxx.

537{
538 if (! SimTracks) return;
539
540 unsigned int nb_mc_event = SimTracks->size();
541 std::unique_ptr<PileUpType> put = std::make_unique<PileUpType>(SimTracks);
542
545
546 if (put)
547 {
548 inTimeMBbegin = put->in_time_minimum_bias_event_begin();
549 inTimeMBend = put->in_time_minimum_bias_event_end();
550 }
551
552 for(unsigned int ievt=0; ievt<nb_mc_event; ++ievt)
553 {
554 const HepMC::GenEvent* genEvent = SimTracks->at(ievt);
555 counter.m_counter[kN_gen_tracks_processed] += genEvent->particles_size();
556 for (const auto& particle: *genEvent){
557 // require stable particle from generation or simulation
558 if (!MC::isStable(particle)) continue;
559 int pdgCode = particle->pdg_id();
560 if (MC::isNucleus(pdgCode)) continue; // ignore nuclei from hadronic interactions
561 float charge = MC::charge(pdgCode);
562 if (std::abs(charge)<0.5) continue;
563 if (std::abs(particle->momentum().perp()) > m_minPt &&
564 std::abs(particle->momentum().pseudoRapidity()) < m_maxEta ) {
565 GenSignal.emplace_back(particle,ievt);
566 }
567 } // End of a particle iteration
568 } // End of one GenEvent iteration
569 }
double charge(const T &p)
Definition AtlasPID.h:997
const T * at(size_type n) const
Access an element, as an rvalue.
std::pair< const_iterator, bool > put(val_t key, size_t hash, val_t val, bool overwrite, const typename Updater_t::Context_t &ctx)
Add an entry to the table.
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
double charge(const T &p)
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ selectRecSignal()

void InDet::InDetRecStatisticsAlg::selectRecSignal ( const TrackCollection * RecCollection,
std::vector< const Trk::Track * > & RecTracks,
std::vector< const Trk::Track * > & RecSignal,
CounterLocal & counter ) const
private

Select for analysis reconstructed tracks passing Pt and eta cuts.

Definition at line 506 of file InDetRecStatisticsAlg.cxx.

509 {
510
511 for ( TrackCollection::const_iterator it = RecCollection->begin() ;
512 it != RecCollection->end(); ++ it){
513 RecTracks.push_back(*it);
514 const DataVector<const Trk::TrackParameters>* trackpara =
515 (*it)->trackParameters();
516
517 if(!trackpara->empty()){
518 const Trk::TrackParameters* para = trackpara->front();
519 if (para){
520 if (para->pT() > m_minPt && std::abs(para->eta()) < m_maxEta) {
521 RecSignal.push_back(*it);
522 }
523 }
524 }
525 else {
527 }
528 }
529 }
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const T * front() const
Access the first element in the collection as an rvalue.
bool empty() const noexcept
Returns true if the collection is empty.
double eta() const
Access method for pseudorapidity - from momentum.
double pT() const
Access method for transverse momentum.

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

Counter<std::atomic<long> > m_counter InDet::InDetRecStatisticsAlg::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 170 of file InDetRecStatisticsAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doTruth

bool InDet::InDetRecStatisticsAlg::m_doTruth
private

Use truth information.

Definition at line 135 of file InDetRecStatisticsAlg.h.

◆ m_events_processed

std::atomic<long> InDet::InDetRecStatisticsAlg::m_events_processed
mutableprivate

number of events processed

Definition at line 145 of file InDetRecStatisticsAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fakeTrackCut

float InDet::InDetRecStatisticsAlg::m_fakeTrackCut
private

Maximum probability for which a track will be considered a fake.

Definition at line 122 of file InDetRecStatisticsAlg.h.

◆ m_fakeTrackCut2

float InDet::InDetRecStatisticsAlg::m_fakeTrackCut2
private

Second definition of maximum probability for which a track will be considered a fake.

Definition at line 123 of file InDetRecStatisticsAlg.h.

◆ m_idDictMgr

const IdDictManager* InDet::InDetRecStatisticsAlg::m_idDictMgr
private

Definition at line 103 of file InDetRecStatisticsAlg.h.

◆ m_idHelper

const AtlasDetectorID* InDet::InDetRecStatisticsAlg::m_idHelper
private

Used to find out the sub-det from PRD->identify().

Definition at line 98 of file InDetRecStatisticsAlg.h.

◆ m_isUnbiased

std::atomic<int> InDet::InDetRecStatisticsAlg::m_isUnbiased
mutableprivate

if can get unbiased residuals

Definition at line 143 of file InDetRecStatisticsAlg.h.

◆ m_matchTrackCut

float InDet::InDetRecStatisticsAlg::m_matchTrackCut
private

Minimum number of hits from a truth track to be considered a matched reco track.

Definition at line 124 of file InDetRecStatisticsAlg.h.

◆ m_maxEta

float InDet::InDetRecStatisticsAlg::m_maxEta
private

Maximum Eta cut for tracks used by the algorithm.

Definition at line 118 of file InDetRecStatisticsAlg.h.

◆ m_maxEtaBarrel

float InDet::InDetRecStatisticsAlg::m_maxEtaBarrel
private

define max eta of barrel region

Definition at line 119 of file InDetRecStatisticsAlg.h.

◆ m_maxEtaEndcap

float InDet::InDetRecStatisticsAlg::m_maxEtaEndcap
private

define max eta of eta region

Definition at line 121 of file InDetRecStatisticsAlg.h.

◆ m_maxEtaFORWARD

float InDet::InDetRecStatisticsAlg::m_maxEtaFORWARD
private

Definition at line 137 of file InDetRecStatisticsAlg.h.

◆ m_maxEtaTransition

float InDet::InDetRecStatisticsAlg::m_maxEtaTransition
private

define max eta of transition region

Definition at line 120 of file InDetRecStatisticsAlg.h.

◆ m_maxRStartPrimary

float InDet::InDetRecStatisticsAlg::m_maxRStartPrimary
private

Maximum R of start vertex to be considered primary.

Definition at line 126 of file InDetRecStatisticsAlg.h.

◆ m_maxRStartSecondary

float InDet::InDetRecStatisticsAlg::m_maxRStartSecondary
private

Maximum R of start vertex to be considered secondary.

Definition at line 127 of file InDetRecStatisticsAlg.h.

◆ m_maxZStartPrimary

float InDet::InDetRecStatisticsAlg::m_maxZStartPrimary
private

Maximum Z of start vertex to be considered primary.

Definition at line 128 of file InDetRecStatisticsAlg.h.

◆ m_maxZStartSecondary

float InDet::InDetRecStatisticsAlg::m_maxZStartSecondary
private

Maximum Z of start vertex to be considered secondary.

Definition at line 129 of file InDetRecStatisticsAlg.h.

◆ m_McTrackCollection_key

SG::ReadHandleKey<McEventCollection> InDet::InDetRecStatisticsAlg::m_McTrackCollection_key
private

Definition at line 112 of file InDetRecStatisticsAlg.h.

◆ m_minEtaFORWARD

float InDet::InDetRecStatisticsAlg::m_minEtaFORWARD
private

Definition at line 136 of file InDetRecStatisticsAlg.h.

◆ m_minPt

float InDet::InDetRecStatisticsAlg::m_minPt
private

Minimum Pt cut for tracks used by the algorithm.

Definition at line 117 of file InDetRecStatisticsAlg.h.

◆ m_minREndPrimary

float InDet::InDetRecStatisticsAlg::m_minREndPrimary
private

If track has end vertex, this is min R of end vertex to be considered primary.

Definition at line 130 of file InDetRecStatisticsAlg.h.

◆ m_minREndSecondary

float InDet::InDetRecStatisticsAlg::m_minREndSecondary
private

If track has end vertex, this is min R of end vertex to be considered secondary.

Definition at line 131 of file InDetRecStatisticsAlg.h.

◆ m_minZEndPrimary

float InDet::InDetRecStatisticsAlg::m_minZEndPrimary
private

If track has end vertex, this is min Z of end vertex to be considered primary.

Definition at line 132 of file InDetRecStatisticsAlg.h.

◆ m_minZEndSecondary

float InDet::InDetRecStatisticsAlg::m_minZEndSecondary
private

If track has end vertex, this is min Z of end vertex to be considered secondary.

Definition at line 133 of file InDetRecStatisticsAlg.h.

◆ m_pixelID

const PixelID* InDet::InDetRecStatisticsAlg::m_pixelID
private

get pixel layer from hit ID

Definition at line 99 of file InDetRecStatisticsAlg.h.

◆ m_printSecondary

bool InDet::InDetRecStatisticsAlg::m_printSecondary
private

Flag to print hit information for secondary tracks.

Definition at line 116 of file InDetRecStatisticsAlg.h.

◆ m_pullWarning

std::atomic<bool> InDet::InDetRecStatisticsAlg::m_pullWarning {}
mutableprivate

warn only once, if pull cannot be calculated

Definition at line 141 of file InDetRecStatisticsAlg.h.

141{};

◆ m_RecTrackCollection_keys

SG::ReadHandleKeyArray<TrackCollection> InDet::InDetRecStatisticsAlg::m_RecTrackCollection_keys
private

Definition at line 138 of file InDetRecStatisticsAlg.h.

◆ m_residualPullCalculator

ToolHandle<Trk::IResidualPullCalculator> InDet::InDetRecStatisticsAlg::m_residualPullCalculator
private

The residual and pull calculator tool handle.

Definition at line 109 of file InDetRecStatisticsAlg.h.

◆ m_sctID

const SCT_ID* InDet::InDetRecStatisticsAlg::m_sctID
private

get sct layer from hit ID

Definition at line 100 of file InDetRecStatisticsAlg.h.

◆ m_SignalCounters

std::vector<class TrackStatHelper *> InDet::InDetRecStatisticsAlg::m_SignalCounters
private

Vector of TrackStatHelper objects, one for each track collection.

Definition at line 97 of file InDetRecStatisticsAlg.h.

◆ m_trackSelectorTool

ToolHandle<Trk::ITrackSelectorTool> InDet::InDetRecStatisticsAlg::m_trackSelectorTool
private

Definition at line 113 of file InDetRecStatisticsAlg.h.

◆ m_TrackTruthCollection_keys

SG::ReadHandleKeyArray<TrackTruthCollection> InDet::InDetRecStatisticsAlg::m_TrackTruthCollection_keys
private

Definition at line 139 of file InDetRecStatisticsAlg.h.

◆ m_trkSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> InDet::InDetRecStatisticsAlg::m_trkSummaryTool
private

tool to get track summary information from track

Definition at line 105 of file InDetRecStatisticsAlg.h.

◆ m_trtID

const TRT_ID* InDet::InDetRecStatisticsAlg::m_trtID
private

get trt layer from hit ID

Definition at line 101 of file InDetRecStatisticsAlg.h.

◆ m_truthToTrack

ToolHandle<Trk::ITruthToTrack> InDet::InDetRecStatisticsAlg::m_truthToTrack
private

tool to create track parameters from a gen particle

Definition at line 104 of file InDetRecStatisticsAlg.h.

◆ m_updator

Trk::IUpdator* InDet::InDetRecStatisticsAlg::m_updator
private

updator for unbiased states

Definition at line 108 of file InDetRecStatisticsAlg.h.

◆ m_updatorHandle

ToolHandle<Trk::IUpdator> InDet::InDetRecStatisticsAlg::m_updatorHandle
private

Tool handle of updator for unbiased states.

Definition at line 107 of file InDetRecStatisticsAlg.h.

◆ m_UpdatorWarning

std::atomic<bool> InDet::InDetRecStatisticsAlg::m_UpdatorWarning {}
mutableprivate

warn only once, if unbiased track states can not be calculated

Definition at line 142 of file InDetRecStatisticsAlg.h.

142{};

◆ m_useTrackSelection

bool InDet::InDetRecStatisticsAlg::m_useTrackSelection
private

Use track selector tool.

Definition at line 134 of file InDetRecStatisticsAlg.h.

◆ m_UseTrackSummary

bool InDet::InDetRecStatisticsAlg::m_UseTrackSummary
private

Flag to print detailed statistics for each track collection.

Definition at line 115 of file InDetRecStatisticsAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: