ATLAS Offline Software
InDetExtensionProcessor.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 // InDetExtensionProcessor.h, (c) ATLAS Detector Softwareop
8 
9 #ifndef INDETEXTENSIONPROCESSOR_H
10 #define INDETEXTENSIONPROCESSOR_H
11 
12 // Base class
13 
22 
23 #include "GaudiKernel/ToolHandle.h"
24 
25 #include <vector>
26 #include <array>
27 #include <mutex>
28 
29 namespace InDet {
38  public:
40  InDetExtensionProcessor(const std::string& name, ISvcLocator* pSvcLocator);
41 
42  virtual StatusCode initialize();
43  virtual StatusCode execute(const EventContext& ctx) const;
44  virtual StatusCode finalize();
45  private:
46  MsgStream &dumpStat(MsgStream &out) const;
47 
49  TrackCollection* createExtendedTracks(const EventContext& ctx,
50  const TrackCollection* tracks_in,
51  const TrackExtensionMap* track_extension_map) const;
52 
54  Trk::Track* trackPlusExtension(const EventContext& ctx,
55  const Trk::Track*,
56  const std::vector<const Trk::MeasurementBase*>&) const;
57 
58  //
59  // --- job options
60  //
62  this, "TrackName", "Tracks", "Name of the input Trackcollection"};
64  this, "ExtensionMap", "TrackExtensionMap", "Name of the input extension map"};
66  this, "NewTrackName", "ExtendedTrack", "Name of the output Trackcollection"};
67 
68  PublicToolHandle<Trk::ITrackFitter> m_trackFitter{
69  this, "TrackFitter", "Trk::KalmanFitter/InDetTrackFitter",
70  "Toolhandle for the track fitter"};
71 
72  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{
73  this, "TrackSummaryTool", ""};
74 
75  PublicToolHandle<Trk::ITrackScoringTool> m_scoringTool{
76  this, "ScoringTool", "Trk::TrackScoringTool",
77  "Toolhandle for the track scorer"};
78 
79  BooleanProperty m_cosmics{
80  this, "Cosmics", false, "switch whether we are running on cosmics"};
81  Gaudi::Property<Trk::RunOutlierRemoval> m_runOutlier{
82  this, "runOutlier", true, "switch whether to run outlier logics or not"};
84  this, "keepFailedExtension", true,
85  "switch whether to keep failed extension as outlier hits on the new track"};
86  BooleanProperty m_refitPrds{
87  this, "RefitPrds", true,
88  "switch whether to do the fit with re-calibrated clusters (true) or not"};
89  IntegerProperty m_matEffects{
90  this, "matEffects", 3,
91  "particle hypothesis to assume for material effects in track fit"};
92  BooleanProperty m_suppressHoleSearch{
93  this, "suppressHoleSearch", false, "suppressing hole search for comparison"};
94  BooleanProperty m_tryBremFit{
95  this, "tryBremFit", false, "brem recovery mode"};
96  BooleanProperty m_caloSeededBrem{
97  this, "caloSeededBrem", false, "calo seeded brem recovery"};
98  FloatProperty m_pTminBrem{
99  this, "pTminBrem", 1000., "min pT for trying a brem recovery"};
100  Gaudi::Property<std::vector<float>> m_etabounds{
101  this, "etaBounds", {0.8, 1.6, 2.10}, "eta intervals for internal monitoring"};
102  //note: only three values!
103 
104  // -- algorithm members
106 
108  enum StatIndex {
110  };
111 
112  enum StatTrkType {
115  };
116 
117  // -- Using atomics to be multi-thread safe
118  mutable std::array< std::array<std::atomic<int>, Nregions>, nTypes > m_counters ATLAS_THREAD_SAFE;
119  mutable std::atomic<int> m_Nevents ATLAS_THREAD_SAFE;
120 
122  void incrementRegionCounter(std::array<std::atomic<int>, 4>&, const Trk::Track*, bool = true) const;
123  };
124 }
125 
126 #endif //INDETEXTENSIONPROCESSOR_H
InDet::InDetExtensionProcessor::ATLAS_THREAD_SAFE
std::atomic< int > m_Nevents ATLAS_THREAD_SAFE
Definition: InDetExtensionProcessor.h:119
InDet::InDetExtensionProcessor::ATLAS_THREAD_SAFE
std::array< std::array< std::atomic< int >, Nregions >, nTypes > m_counters ATLAS_THREAD_SAFE
Definition: InDetExtensionProcessor.h:118
InDet::InDetExtensionProcessor::m_trackFitter
PublicToolHandle< Trk::ITrackFitter > m_trackFitter
Definition: InDetExtensionProcessor.h:68
InDet::InDetExtensionProcessor::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: InDetExtensionProcessor.h:72
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::InDetExtensionProcessor::nInput
@ nInput
Definition: InDetExtensionProcessor.h:113
InDet::InDetExtensionProcessor::InDetExtensionProcessor
InDetExtensionProcessor(const std::string &name, ISvcLocator *pSvcLocator)
Default Algorithm constructor with parameters.
Definition: InDetExtensionProcessor.cxx:38
InDet::InDetExtensionProcessor::m_pTminBrem
FloatProperty m_pTminBrem
Definition: InDetExtensionProcessor.h:98
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::InDetExtensionProcessor::m_suppressHoleSearch
BooleanProperty m_suppressHoleSearch
Definition: InDetExtensionProcessor.h:92
InDet::InDetExtensionProcessor::nRejected
@ nRejected
Definition: InDetExtensionProcessor.h:113
InDet::InDetExtensionProcessor::trackPlusExtension
Trk::Track * trackPlusExtension(const EventContext &ctx, const Trk::Track *, const std::vector< const Trk::MeasurementBase * > &) const
internal structuring: creates new track with original one plus extension as outliers
Definition: InDetExtensionProcessor.cxx:385
InDet::InDetExtensionProcessor::m_runOutlier
Gaudi::Property< Trk::RunOutlierRemoval > m_runOutlier
Definition: InDetExtensionProcessor.h:81
Trk::undefined
@ undefined
Definition: ParticleHypothesis.h:38
ITrackScoringTool.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
InDet::InDetExtensionProcessor::nRecognised
@ nRecognised
Definition: InDetExtensionProcessor.h:113
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDet::InDetExtensionProcessor::nExtended
@ nExtended
Definition: InDetExtensionProcessor.h:113
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
InDet::InDetExtensionProcessor::m_matEffects
IntegerProperty m_matEffects
Definition: InDetExtensionProcessor.h:89
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
InDet::InDetExtensionProcessor::m_keepFailedExtensionOnTrack
BooleanProperty m_keepFailedExtensionOnTrack
Definition: InDetExtensionProcessor.h:83
InDet::InDetExtensionProcessor::m_tryBremFit
BooleanProperty m_tryBremFit
Definition: InDetExtensionProcessor.h:94
InDet::InDetExtensionProcessor::iTransi
@ iTransi
Definition: InDetExtensionProcessor.h:109
InDet::InDetExtensionProcessor::Nregions
@ Nregions
Definition: InDetExtensionProcessor.h:109
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::InDetExtensionProcessor::nLowScoreBremFits
@ nLowScoreBremFits
Definition: InDetExtensionProcessor.h:114
InDet::InDetExtensionProcessor::createExtendedTracks
TrackCollection * createExtendedTracks(const EventContext &ctx, const TrackCollection *tracks_in, const TrackExtensionMap *track_extension_map) const
process events
Definition: InDetExtensionProcessor.cxx:93
InDet::InDetExtensionProcessor::StatIndex
StatIndex
internal monitoring: categories for counting different types of extension results
Definition: InDetExtensionProcessor.h:108
InDet::InDetExtensionProcessor::nTypes
@ nTypes
Definition: InDetExtensionProcessor.h:114
TrackCollection.h
InDet::InDetExtensionProcessor::iAll
@ iAll
Definition: InDetExtensionProcessor.h:109
InDet::InDetExtensionProcessor::m_scoringTool
PublicToolHandle< Trk::ITrackScoringTool > m_scoringTool
Definition: InDetExtensionProcessor.h:75
InDet::InDetExtensionProcessor::m_refitPrds
BooleanProperty m_refitPrds
Definition: InDetExtensionProcessor.h:86
DataVector< Trk::Track >
ParticleHypothesis.h
InDet::InDetExtensionProcessor::nNotExtended
@ nNotExtended
Definition: InDetExtensionProcessor.h:114
InDet::InDetExtensionProcessor::iBarrel
@ iBarrel
Definition: InDetExtensionProcessor.h:109
InDet::InDetExtensionProcessor::incrementRegionCounter
void incrementRegionCounter(std::array< std::atomic< int >, 4 > &, const Trk::Track *, bool=true) const
monitoring and validation: does success/failure counting for each detector region
Definition: InDetExtensionProcessor.cxx:362
AthReentrantAlgorithm.h
lumiFormat.array
array
Definition: lumiFormat.py:91
InDet::InDetExtensionProcessor::StatTrkType
StatTrkType
Definition: InDetExtensionProcessor.h:112
InDet::InDetExtensionProcessor::execute
virtual StatusCode execute(const EventContext &ctx) const
Definition: InDetExtensionProcessor.cxx:71
InDet::InDetExtensionProcessor::m_etabounds
Gaudi::Property< std::vector< float > > m_etabounds
Definition: InDetExtensionProcessor.h:100
TrackExtensionMap.h
InDet::InDetExtensionProcessor::nRecoveryBremFits
@ nRecoveryBremFits
Definition: InDetExtensionProcessor.h:113
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::InDetExtensionProcessor::m_trackName
SG::ReadHandleKey< TrackCollection > m_trackName
Definition: InDetExtensionProcessor.h:61
InDet::InDetExtensionProcessor::nExtendedBrem
@ nExtendedBrem
Definition: InDetExtensionProcessor.h:114
InDet::InDetExtensionProcessor::dumpStat
MsgStream & dumpStat(MsgStream &out) const
Definition: InDetExtensionProcessor.cxx:456
InDet::InDetExtensionProcessor::nFits
@ nFits
Definition: InDetExtensionProcessor.h:114
InDet::InDetExtensionProcessor::initialize
virtual StatusCode initialize()
Definition: InDetExtensionProcessor.cxx:48
InDet::InDetExtensionProcessor::m_cosmics
BooleanProperty m_cosmics
Definition: InDetExtensionProcessor.h:79
InDet::InDetExtensionProcessor
Algorithm to process a TrackExtensionMap, refit the extended tracks and decide if the old track is to...
Definition: InDetExtensionProcessor.h:37
IExtendedTrackSummaryTool.h
TrackExtensionMap
AUTO - An Undocumented Tracking Object.
Definition: TrackExtensionMap.h:16
InDet::InDetExtensionProcessor::finalize
virtual StatusCode finalize()
Definition: InDetExtensionProcessor.cxx:446
InDet::InDetExtensionProcessor::m_caloSeededBrem
BooleanProperty m_caloSeededBrem
Definition: InDetExtensionProcessor.h:96
checker_macros.h
Define macros for attributes used to control the static checker.
InDet::InDetExtensionProcessor::m_extensionMapName
SG::ReadHandleKey< TrackExtensionMap > m_extensionMapName
Definition: InDetExtensionProcessor.h:63
ITrackFitter.h
InDet::InDetExtensionProcessor::nBremFits
@ nBremFits
Definition: InDetExtensionProcessor.h:114
InDet::InDetExtensionProcessor::m_particleHypothesis
Trk::ParticleHypothesis m_particleHypothesis
nomen est omen
Definition: InDetExtensionProcessor.h:105
InDet::InDetExtensionProcessor::m_newTrackName
SG::WriteHandleKey< TrackCollection > m_newTrackName
Definition: InDetExtensionProcessor.h:65
InDet::InDetExtensionProcessor::nFailed
@ nFailed
Definition: InDetExtensionProcessor.h:113
InDet::InDetExtensionProcessor::iEndcap
@ iEndcap
Definition: InDetExtensionProcessor.h:109