ATLAS Offline Software
SiSPSeededTrackFinder.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
8 #ifndef SiSPSeededTrackFinder_H
9 #define SiSPSeededTrackFinder_H
10 
12 #include <Gaudi/Property.h>
14 
22 #include "StoreGate/DataHandle.h"
32 
34 #include "GaudiKernel/ToolHandle.h"
35 
37 #include <atomic>
38 #include <string>
39 
40 //class SpacePointContainer;
41 namespace InDet {
42 
49  {
50 
52  // Public methods
54 
55  public:
56 
60 
61  SiSPSeededTrackFinder(const std::string &name, ISvcLocator *pSvcLocator);
62  virtual ~SiSPSeededTrackFinder() = default;
63  virtual StatusCode initialize() override;
64  virtual StatusCode execute(const EventContext& ctx) const override;
65  virtual StatusCode finalize() override;
66 
68  virtual bool isClonable() const override { return true; };
70 
71  protected:
72 
74  // Protected data
76 
79 
82  class Counter_t : public std::array<std::atomic_int, kNCounter>
83  {
84  public:
86  for (unsigned int idx=0; idx <kNCounter; ++idx) {
87  (*this)[idx] += counter[idx];
88  }
89  return *this;
90  }
91  };
92 
94 
95  BooleanProperty m_useZvertexTool{this, "useZvertexTool", true};
96  BooleanProperty m_writeHolesFromPattern{this, "writeHolesFromPattern", false,"Flag to activate writing hole info from the pattern recognition"};
97  BooleanProperty m_useMBTS{this, "useMBTSTimeDiff", false};
98  BooleanProperty m_useNewStrategy{this, "useNewStrategy", false};
99  BooleanProperty m_useZBoundaryFinding{this, "useZBoundFinding", false};
100  BooleanProperty m_ITKGeometry{this, "ITKGeometry", false, "Flag to specify if it is ITK geometry"};
101  BooleanProperty m_useITkConvSeeded{this, "useITkConvSeeded", false, "ITk EM-seeded conversion reco"};
102  BooleanProperty m_doFastTracking{this, "doFastTracking", false, "ITk fast tracking reco"};
103  IntegerProperty m_maxNumberSeeds{this, "maxNumberSeeds", 3000000, "Max. number used seeds"};
104  BooleanProperty m_alwaysProtectAgainstBusyEvent{this, "alwaysProtectAgainstBusyEvents", false, "Flag that enables checking always maxNumberPIXsp and maxNumberSCTsp"};
105  IntegerProperty m_maxPIXsp{this, "maxNumberPIXsp", 150000, "Max. number pixels space points"};
106  IntegerProperty m_maxSCTsp{this, "maxNumberSCTsp", 500000, "Max. number sct space points"};
107  IntegerProperty m_nfreeCut{this, "FreeClustersCut", 1, "Min number free clusters"};
108  IntegerProperty m_histsize{this, "HistSize", 1400};
109  IntegerProperty m_nvertex{this, "maxVertices", 4};
110  DoubleProperty m_zcut{this, "Zcut", 350.};
111  DoubleProperty m_deltaEta{this, "dEtaCaloRoI", .1};
112  DoubleProperty m_deltaPhi{this, "dPhiCaloRoI", .25};
113  DoubleProperty m_deltaZ{this, "dZCaloRoI", 300.};
114  StringProperty m_fieldmode{this, "MagneticFieldMode", "MapSolenoid"};
116 
118 
119  double m_pTcut{500};
120  double m_imcut{2.};
121  double m_zstep{0.};
123 
125 
126  SG::ReadHandleKey<xAOD::EventInfo> m_evtKey{this, "EventInfoKey", "EventInfo"};
127  SG::ReadHandleKey<SpacePointContainer> m_SpacePointsSCTKey{this, "SpacePointsSCTName", "SCT_SpacePoints"};
128  SG::ReadHandleKey<SpacePointContainer> m_SpacePointsPixelKey{this, "SpacePointsPixelName", "PixelSpacePoints"};
130  SG::ReadHandleKey<ROIPhiRZContainer> m_caloClusterROIKey{this, "EMROIPhiRZContainer", "InDetCaloClusterROIPhiRZ15GeVUnordered", "Name of the calo cluster ROIs in Phi,R,Z parameterization"};
131 
132  SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
133 
134  SG::ReadDecorHandleKey<xAOD::EventInfo> m_mbtsKey{this, "MBTSKey", "EventInfo.MBTSBackground"};
135 
136  SG::WriteHandleKey<TrackCollection> m_outputTracksKey{this, "TracksLocation", "SiSPSeededTracks"};
138 
140 
141  ToolHandle<ISiSpacePointsSeedMaker> m_seedsmaker{this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"};
142  ToolHandle<ISiZvertexMaker> m_zvertexmaker{this, "ZvertexTool", "InDet::SiZvertexMaker_xk/InDetSiZvertexMaker", "Space poins z-vertex maker"};
143  ToolHandle<ISiTrackMaker> m_trackmaker{this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"};
144  PublicToolHandle<Trk::IPatternParametersPropagator> m_proptool{this, "PropagatorTool", "Trk::RungeKuttaPropagator/InDetPropagator"};
145  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};
146  ToolHandle<IRegSelTool> m_regsel_strip { this, "RegSelTool_Strip", "RegSelTool/RegSelTool_SCT" };
148 
150 
153 
155 
156 
157  ServiceHandle<IInDetEtaDependentCutsSvc> m_etaDependentCutsSvc{this, "InDetEtaDependentCutsSvc", "InDetEtaDependentCutsSvc"};
159 
161 
162  mutable Counter_t m_counterTotal ATLAS_THREAD_SAFE {};
163 
164  mutable std::atomic_int m_neventsTotal{0};
165  mutable std::atomic_int m_neventsTotalV{0};
166  mutable std::atomic_int m_problemsTotal{0};
167  mutable std::atomic_int m_problemsTotalV{0};
168 
169 
171  // Protected methods
173 
175 
176  MsgStream& dump(MSG::Level lvl, const SiSPSeededTrackFinder::Counter_t*) const;
177  MsgStream& dumptools(MsgStream& out) const;
178  MsgStream& dumpevent(MsgStream& out, const SiSPSeededTrackFinder::Counter_t& counter) const;
180 
181  // check event quality - mainly used for HI events
182  bool isGoodEvent(const EventContext& ctx) const;
183 
190  void filterSharedTracks(std::multimap<double, Trk::Track*>& scoredTracks) const;
191  void filterSharedTracksFast(std::multimap<double, Trk::Track*>& scoredTracks) const;
192 
202  void fillZHistogram(const Trk::Track* Tr,
203  const Trk::PerigeeSurface& beamlinePerigee,
204  std::vector<int>& numberWeightedhistogram,
205  std::vector<double>& zWeightedHistogram,
206  std::vector<double>& ptWeightedHistogram) const;
207 
217  void findZvertex(std::list<Trk::Vertex>& vertexList,
218  std::pair<double, double> & zBoundaries,
219  const std::vector<int>& numberWeightedhistogram,
220  const std::vector<double>& zWeightedHistogram,
221  const std::vector<double>& ptWeightedHistogram) const;
222 
224  StatusCode oldStrategy(const EventContext& ctx) const;
225 
227  StatusCode newStrategy(const EventContext& ctx) const;
228 
229  StatusCode itkFastTrackingStrategy(const EventContext& ctx) const;
230  StatusCode itkConvStrategy(const EventContext& ctx) const;
231 
232  void magneticFieldInit();
233 
234  bool passEtaDepCuts(const Trk::Track* track,
235  int nClusters,
236  int nFreeClusters,
237  int nPixels) const;
238 
239  };
240 }
241 #endif // SiSPSeededTrackFinder_H
InDet::SiSPSeededTrackFinder
Definition: SiSPSeededTrackFinder.h:49
IRegSelTool.h
PRDtoTrackMap.h
InDet::SiSPSeededTrackFinder::m_evtKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
Definition: SiSPSeededTrackFinder.h:126
InDet::SiSPSeededTrackFinder::kNTracks
@ kNTracks
Definition: SiSPSeededTrackFinder.h:78
InDet::SiSPSeededTrackFinder::dumpevent
MsgStream & dumpevent(MsgStream &out, const SiSPSeededTrackFinder::Counter_t &counter) const
Definition: SiSPSeededTrackFinder.cxx:778
InDet::SiSPSeededTrackFinder::isClonable
virtual bool isClonable() const override
Make this algorithm clonable.
Definition: SiSPSeededTrackFinder.h:68
InDet::SiSPSeededTrackFinder::m_outputTracksKey
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
Definition: SiSPSeededTrackFinder.h:136
InDet::SiSPSeededTrackFinder::kNSeeds
@ kNSeeds
Definition: SiSPSeededTrackFinder.h:78
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
PerigeeSurface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::SiSPSeededTrackFinder::m_seedsmaker
ToolHandle< ISiSpacePointsSeedMaker > m_seedsmaker
Definition: SiSPSeededTrackFinder.h:141
InDet::SiSPSeededTrackFinder::Counter_t::operator+=
Counter_t & operator+=(const Counter_t &counter)
Definition: SiSPSeededTrackFinder.h:85
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
InDet::SiSPSeededTrackFinder::m_alwaysProtectAgainstBusyEvent
BooleanProperty m_alwaysProtectAgainstBusyEvent
Definition: SiSPSeededTrackFinder.h:104
InDet::SiSPSeededTrackFinder::m_histsize
IntegerProperty m_histsize
Definition: SiSPSeededTrackFinder.h:108
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::SiSPSeededTrackFinder::dump
MsgStream & dump(MSG::Level lvl, const SiSPSeededTrackFinder::Counter_t *) const
Definition: SiSPSeededTrackFinder.cxx:724
InDet::SiSPSeededTrackFinder::m_ITKGeometry
BooleanProperty m_ITKGeometry
Definition: SiSPSeededTrackFinder.h:100
InDet::SiSPSeededTrackFinder::m_useZvertexTool
BooleanProperty m_useZvertexTool
Definition: SiSPSeededTrackFinder.h:95
InDet::SiSPSeededTrackFinder::m_pTcut
double m_pTcut
Definition: SiSPSeededTrackFinder.h:119
InDet::SiSPSeededTrackFinder::m_nfreeCut
IntegerProperty m_nfreeCut
Definition: SiSPSeededTrackFinder.h:107
InDet::SiSPSeededTrackFinder::m_etaDependentCutsSvc
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
service to get cut values depending on different variable
Definition: SiSPSeededTrackFinder.h:157
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ISiZvertexMaker.h
InDet::SiSPSeededTrackFinder::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: SiSPSeededTrackFinder.h:145
SG::ReadHandleKey< xAOD::EventInfo >
InDet::SiSPSeededTrackFinder::filterSharedTracksFast
void filterSharedTracksFast(std::multimap< double, Trk::Track * > &scoredTracks) const
Definition: SiSPSeededTrackFinder.cxx:913
InDet::SiSPSeededTrackFinder::m_maxNumberSeeds
IntegerProperty m_maxNumberSeeds
Definition: SiSPSeededTrackFinder.h:103
InDet::SiSPSeededTrackFinder::m_imcut
double m_imcut
Definition: SiSPSeededTrackFinder.h:120
DataHandle.h
InDet::SiSPSeededTrackFinder::m_useITkConvSeeded
BooleanProperty m_useITkConvSeeded
Definition: SiSPSeededTrackFinder.h:101
SpacePointContainer.h
InDet::SiSPSeededTrackFinder::m_useMBTS
BooleanProperty m_useMBTS
Definition: SiSPSeededTrackFinder.h:97
InDet::SiSPSeededTrackFinder::m_useZBoundaryFinding
BooleanProperty m_useZBoundaryFinding
Definition: SiSPSeededTrackFinder.h:99
InDet::SiSPSeededTrackFinder::m_prdToTrackMap
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
Definition: SiSPSeededTrackFinder.h:129
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDet::SiSPSeededTrackFinder::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition: SiSPSeededTrackFinder.cxx:141
InDet::SiSPSeededTrackFinder::kNCounter
@ kNCounter
Definition: SiSPSeededTrackFinder.h:78
MagneticFieldProperties.h
InDet::SiSPSeededTrackFinder::m_trackmaker
ToolHandle< ISiTrackMaker > m_trackmaker
Definition: SiSPSeededTrackFinder.h:143
InDet::SiSPSeededTrackFinder::SiSPSeededTrackFinder
SiSPSeededTrackFinder(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: SiSPSeededTrackFinder.cxx:65
InDet::SiSPSeededTrackFinder::m_nvertex
IntegerProperty m_nvertex
Definition: SiSPSeededTrackFinder.h:109
InDet::SiSPSeededTrackFinder::m_deltaEta
DoubleProperty m_deltaEta
Definition: SiSPSeededTrackFinder.h:111
InDet::SiSPSeededTrackFinder::m_fieldmode
StringProperty m_fieldmode
Definition: SiSPSeededTrackFinder.h:114
InDet::SiSPSeededTrackFinder::m_problemsTotal
std::atomic_int m_problemsTotal
Number events with number seeds > maxNumber.
Definition: SiSPSeededTrackFinder.h:166
InDet::SiSPSeededTrackFinder::m_SpacePointsSCTKey
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsSCTKey
Definition: SiSPSeededTrackFinder.h:127
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
InDet::SiSPSeededTrackFinder::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: SiSPSeededTrackFinder.h:132
InDet::SiSPSeededTrackFinder::m_maxSCTsp
IntegerProperty m_maxSCTsp
Definition: SiSPSeededTrackFinder.h:106
InDet::SiSPSeededTrackFinder::magneticFieldInit
void magneticFieldInit()
Definition: SiSPSeededTrackFinder.cxx:1095
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::SiSPSeededTrackFinder::m_neventsTotalV
std::atomic_int m_neventsTotalV
Number events.
Definition: SiSPSeededTrackFinder.h:165
InDet::SiSPSeededTrackFinder::m_proptool
PublicToolHandle< Trk::IPatternParametersPropagator > m_proptool
Definition: SiSPSeededTrackFinder.h:144
InDet::SiSPSeededTrackFinder::oldStrategy
StatusCode oldStrategy(const EventContext &ctx) const
this method performs the track finding using the old strategy
Definition: SiSPSeededTrackFinder.cxx:175
TrackCollection.h
InDet::SiSPSeededTrackFinder::~SiSPSeededTrackFinder
virtual ~SiSPSeededTrackFinder()=default
InDet::SiSPSeededTrackFinder::dumptools
MsgStream & dumptools(MsgStream &out) const
Definition: SiSPSeededTrackFinder.cxx:738
ROIPhiRZContainer.h
InDet::SiSPSeededTrackFinder::m_deltaZ
DoubleProperty m_deltaZ
Definition: SiSPSeededTrackFinder.h:113
InDet::SiSPSeededTrackFinder::filterSharedTracks
void filterSharedTracks(std::multimap< double, Trk::Track * > &scoredTracks) const
cleans up the collection of quality filtered tracks.
Definition: SiSPSeededTrackFinder.cxx:865
AthReentrantAlgorithm.h
lumiFormat.array
array
Definition: lumiFormat.py:91
InDet::SiSPSeededTrackFinder::finalize
virtual StatusCode finalize() override
Definition: SiSPSeededTrackFinder.cxx:712
InDet::SiSPSeededTrackFinder::passEtaDepCuts
bool passEtaDepCuts(const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
Definition: SiSPSeededTrackFinder.cxx:1111
ISiSpacePointsSeedMaker.h
InDet::SiSPSeededTrackFinder::m_SpacePointsPixelKey
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsPixelKey
Definition: SiSPSeededTrackFinder.h:128
InDet::SiSPSeededTrackFinder::m_deltaPhi
DoubleProperty m_deltaPhi
Definition: SiSPSeededTrackFinder.h:112
ISiTrackMaker.h
InDet::SiSPSeededTrackFinder::m_zcut
DoubleProperty m_zcut
Definition: SiSPSeededTrackFinder.h:110
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDet::SiSPSeededTrackFinder::isGoodEvent
bool isGoodEvent(const EventContext &ctx) const
EventContext is used to specify which event.
Definition: SiSPSeededTrackFinder.cxx:814
InDet::SiSPSeededTrackFinder::initialize
virtual StatusCode initialize() override
Initialisation.
Definition: SiSPSeededTrackFinder.cxx:73
InDet::SiSPSeededTrackFinder::m_zvertexmaker
ToolHandle< ISiZvertexMaker > m_zvertexmaker
Definition: SiSPSeededTrackFinder.h:142
InDet::SiSPSeededTrackFinder::m_maxPIXsp
IntegerProperty m_maxPIXsp
Definition: SiSPSeededTrackFinder.h:105
InDet::SiSPSeededTrackFinder::m_writeHolesFromPattern
BooleanProperty m_writeHolesFromPattern
Definition: SiSPSeededTrackFinder.h:96
InDet::SiSPSeededTrackFinder::ATLAS_THREAD_SAFE
Counter_t m_counterTotal ATLAS_THREAD_SAFE
Definition: SiSPSeededTrackFinder.h:162
InDet::SiSPSeededTrackFinder::m_mbtsKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_mbtsKey
Definition: SiSPSeededTrackFinder.h:134
EventInfo.h
InDet::SiSPSeededTrackFinder::itkFastTrackingStrategy
StatusCode itkFastTrackingStrategy(const EventContext &ctx) const
EventContext is used to specify which event.
Definition: SiSPSeededTrackFinder.cxx:446
InDet::SiSPSeededTrackFinder::m_fieldprop
Trk::MagneticFieldProperties m_fieldprop
Definition: SiSPSeededTrackFinder.h:151
InDet::SiSPSeededTrackFinder::m_regsel_strip
ToolHandle< IRegSelTool > m_regsel_strip
Definition: SiSPSeededTrackFinder.h:146
SG::ReadCondHandleKey< InDet::BeamSpotData >
InDet::SiSPSeededTrackFinder::m_useNewStrategy
BooleanProperty m_useNewStrategy
Definition: SiSPSeededTrackFinder.h:98
IExtendedTrackSummaryTool.h
InDet::SiSPSeededTrackFinder::itkConvStrategy
StatusCode itkConvStrategy(const EventContext &ctx) const
EventContext is used to specify which event.
Definition: SiSPSeededTrackFinder.cxx:562
InDet::SiSPSeededTrackFinder::newStrategy
StatusCode newStrategy(const EventContext &ctx) const
this method performs the track finding using the new strategy
Definition: SiSPSeededTrackFinder.cxx:260
InDet::SiSPSeededTrackFinder::fillZHistogram
void fillZHistogram(const Trk::Track *Tr, const Trk::PerigeeSurface &beamlinePerigee, std::vector< int > &numberWeightedhistogram, std::vector< double > &zWeightedHistogram, std::vector< double > &ptWeightedHistogram) const
fills three z0 histograms (non-weighted, weighted by z, and weighted by pt) with the track z at the b...
Definition: SiSPSeededTrackFinder.cxx:973
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
BeamSpotData.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
InDet::SiSPSeededTrackFinder::m_caloClusterROIKey
SG::ReadHandleKey< ROIPhiRZContainer > m_caloClusterROIKey
Definition: SiSPSeededTrackFinder.h:130
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
InDet::SiSPSeededTrackFinder::Counter_t
Definition: SiSPSeededTrackFinder.h:83
InDet::SiSPSeededTrackFinder::m_zstep
double m_zstep
Definition: SiSPSeededTrackFinder.h:121
InDet::SiSPSeededTrackFinder::m_neventsTotal
std::atomic_int m_neventsTotal
Number events.
Definition: SiSPSeededTrackFinder.h:164
InDet::SiSPSeededTrackFinder::m_doFastTracking
BooleanProperty m_doFastTracking
Definition: SiSPSeededTrackFinder.h:102
test_pyathena.counter
counter
Definition: test_pyathena.py:15
InDet::SiSPSeededTrackFinder::m_problemsTotalV
std::atomic_int m_problemsTotalV
Number events with number seeds > maxNumber.
Definition: SiSPSeededTrackFinder.h:167
IInDetEtaDependentCutsSvc.h
IPatternParametersPropagator.h
InDet::SiSPSeededTrackFinder::findZvertex
void findZvertex(std::list< Trk::Vertex > &vertexList, std::pair< double, double > &zBoundaries, const std::vector< int > &numberWeightedhistogram, const std::vector< double > &zWeightedHistogram, const std::vector< double > &ptWeightedHistogram) const
estimates a set of vertex positions and a z interval for the second track finding pass using the inpu...
Definition: SiSPSeededTrackFinder.cxx:1021
ServiceHandle
Definition: ClusterMakerTool.h:37
InDet::SiSPSeededTrackFinder::ECounter
ECounter
enums for Counter_t
Definition: SiSPSeededTrackFinder.h:78