ATLAS Offline Software
Loading...
Searching...
No Matches
SiSPSeededTrackFinder.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2026 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
33
35#include "GaudiKernel/ToolHandle.h"
36
38#include <atomic>
39#include <string>
40#include <mutex>
41
42//class SpacePointContainer;
43namespace InDet {
44
51 {
52
54 // Public methods
56
57 public:
58
62
63 SiSPSeededTrackFinder(const std::string &name, ISvcLocator *pSvcLocator);
64 virtual ~SiSPSeededTrackFinder() = default;
65 virtual StatusCode initialize() override;
66 virtual StatusCode execute(const EventContext& ctx) const override;
67 virtual StatusCode finalize() override;
68
70 virtual bool isClonable() const override { return true; };
72
73 protected:
74
76 // Protected data
78
81
84 class Counter_t : public std::array<std::atomic_int, kNCounter>
85 {
86 public:
87 Counter_t& operator += (const Counter_t& counter) {
88 for (unsigned int idx=0; idx <kNCounter; ++idx) {
89 (*this)[idx] += counter[idx];
90 }
91 return *this;
92 }
93 };
94
96
97 BooleanProperty m_useZvertexTool{this, "useZvertexTool", true};
98 BooleanProperty m_writeHolesFromPattern{this, "writeHolesFromPattern", false,"Flag to activate writing hole info from the pattern recognition"};
99 BooleanProperty m_useMBTS{this, "useMBTSTimeDiff", false};
100 BooleanProperty m_useNewStrategy{this, "useNewStrategy", false};
101 BooleanProperty m_useZBoundaryFinding{this, "useZBoundFinding", false};
102 BooleanProperty m_ITKGeometry{this, "ITKGeometry", false, "Flag to specify if it is ITK geometry"};
103 BooleanProperty m_useITkConvSeeded{this, "useITkConvSeeded", false, "ITk EM-seeded conversion reco"};
104 BooleanProperty m_doFastTracking{this, "doFastTracking", false, "ITk fast tracking reco"};
105 IntegerProperty m_maxNumberSeeds{this, "maxNumberSeeds", 3000000, "Max. number used seeds"};
106 BooleanProperty m_alwaysProtectAgainstBusyEvent{this, "alwaysProtectAgainstBusyEvents", false, "Flag that enables checking always maxNumberPIXsp and maxNumberSCTsp"};
107 IntegerProperty m_maxPIXsp{this, "maxNumberPIXsp", 150000, "Max. number pixels space points"};
108 IntegerProperty m_maxSCTsp{this, "maxNumberSCTsp", 500000, "Max. number sct space points"};
109 IntegerProperty m_nfreeCut{this, "FreeClustersCut", 1, "Min number free clusters"};
110 IntegerProperty m_histsize{this, "HistSize", 1400};
111 IntegerProperty m_nvertex{this, "maxVertices", 4};
112 DoubleProperty m_zcut{this, "Zcut", 350.};
113 DoubleProperty m_deltaEta{this, "dEtaCaloRoI", .1};
114 DoubleProperty m_deltaPhi{this, "dPhiCaloRoI", .25};
115 DoubleProperty m_deltaZ{this, "dZCaloRoI", 300.};
116 StringProperty m_fieldmode{this, "MagneticFieldMode", "MapSolenoid"};
117 BooleanProperty m_doDumpGBTSTrainingData{this, "doDumpGBTSTrainingData", false, "write training data used to create GBTS connection table"};
118 BooleanProperty m_doDumpGBTSTrainingDataLRT{this, "doDumpGBTSTrainingDataLRT", false, "write LRT training data used to create GBTS connection table"};
119 BooleanProperty m_removeShortSegments{this, "removeShortSegments", false, "remove short segments from GBTS connection table"};
120 StringProperty m_GBTSTrainingDataFileName{this, "GBTSTrainingDataFileName", "layer_connection_table.csv", "file to write training data used to create GBTS connection table"};
121 BooleanProperty m_useVertexPosition{this, "useVertexPosition", false};
122 FloatProperty m_collisionTollerance{this, "collisionTollerance", 10.};
124
126
127 double m_pTcut{500};
128 double m_imcut{2.};
129 double m_zstep{0.};
131
133
134 SG::ReadHandleKey<xAOD::EventInfo> m_evtKey{this, "EventInfoKey", "EventInfo"};
135 SG::ReadHandleKey<SpacePointContainer> m_SpacePointsSCTKey{this, "SpacePointsSCTName", "SCT_SpacePoints"};
136 SG::ReadHandleKey<SpacePointContainer> m_SpacePointsPixelKey{this, "SpacePointsPixelName", "PixelSpacePoints"};
138 SG::ReadHandleKey<ROIPhiRZContainer> m_caloClusterROIKey{this, "EMROIPhiRZContainer", "InDetCaloClusterROIPhiRZ15GeVUnordered", "Name of the calo cluster ROIs in Phi,R,Z parameterization"};
139 SG::ReadHandleKey<xAOD::VertexContainer> m_vertices{this, "Vertices", "PrimaryVertices"};
140
141 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
142
143 SG::ReadDecorHandleKey<xAOD::EventInfo> m_mbtsKey{this, "MBTSKey", m_evtKey, "MBTSBackground"};
144
145 SG::WriteHandleKey<TrackCollection> m_outputTracksKey{this, "TracksLocation", "SiSPSeededTracks"};
147
149
150 ToolHandle<ISiSpacePointsSeedMaker> m_seedsmaker{this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"};
151 ToolHandle<ISiZvertexMaker> m_zvertexmaker{this, "ZvertexTool", "InDet::SiZvertexMaker_xk/InDetSiZvertexMaker", "Space poins z-vertex maker"};
152 ToolHandle<ISiTrackMaker> m_trackmaker{this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"};
153 PublicToolHandle<Trk::IPatternParametersPropagator> m_proptool{this, "PropagatorTool", "Trk::RungeKuttaPropagator/InDetPropagator"};
154 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};
155 ToolHandle<IRegSelTool> m_regsel_strip { this, "RegSelTool_Strip", "RegSelTool/RegSelTool_SCT" };
157
159
162
164
165
166 ServiceHandle<IInDetEtaDependentCutsSvc> m_etaDependentCutsSvc{this, "InDetEtaDependentCutsSvc", "InDetEtaDependentCutsSvc"};
168
170
171 mutable Counter_t m_counterTotal ATLAS_THREAD_SAFE {};
172
173 mutable std::atomic_int m_neventsTotal{0};
174 mutable std::atomic_int m_neventsTotalV{0};
175 mutable std::atomic_int m_problemsTotal{0};
176 mutable std::atomic_int m_problemsTotalV{0};
178
179 mutable std::mutex m_GBTSTrainingDataMutex;
180 mutable std::map<int, std::map<int, unsigned long>> m_GBTSTrainingData ATLAS_THREAD_SAFE;
181 mutable std::atomic_ulong m_numGBTSTrainingData{0};
182
184 // Protected methods
186
188
189 MsgStream& dump(MSG::Level lvl, const SiSPSeededTrackFinder::Counter_t*) const;
190 MsgStream& dumptools(MsgStream& out) const;
191 MsgStream& dumpevent(MsgStream& out, const SiSPSeededTrackFinder::Counter_t& counter) const;
193
194 // check event quality - mainly used for HI events
195 bool isGoodEvent(const EventContext& ctx) const;
196
203 void filterSharedTracks(std::multimap<double, Trk::Track*>& scoredTracks) const;
204 void filterSharedTracksFast(std::multimap<double, Trk::Track*>& scoredTracks) const;
205
216 void fillZHistogram(const EventContext& ctx,
217 const Trk::Track* Tr,
218 const Trk::PerigeeSurface& beamlinePerigee,
219 std::vector<int>& numberWeightedhistogram,
220 std::vector<double>& zWeightedHistogram,
221 std::vector<double>& ptWeightedHistogram) const;
222
232 void findZvertex(std::list<Trk::Vertex>& vertexList,
233 std::pair<double, double> & zBoundaries,
234 const std::vector<int>& numberWeightedhistogram,
235 const std::vector<double>& zWeightedHistogram,
236 const std::vector<double>& ptWeightedHistogram) const;
237
239 StatusCode oldStrategy(const EventContext& ctx) const;
240
242 StatusCode newStrategy(const EventContext& ctx) const;
243
244 StatusCode itkFastTrackingStrategy(const EventContext& ctx) const;
245 StatusCode itkConvStrategy(const EventContext& ctx) const;
246
247 void magneticFieldInit();
248
249 bool passEtaDepCuts(const Trk::Track* track,
250 int nClusters,
251 int nFreeClusters,
252 int nPixels) const;
253
254 void collectGBTSTrainingData(const Trk::Track*) const;
255 void dumpGBTSTrainingData() const;
256
257 };
258}
259#endif // SiSPSeededTrackFinder_H
An algorithm that can be simultaneously executed in multiple threads.
Counter_t & operator+=(const Counter_t &counter)
virtual ~SiSPSeededTrackFinder()=default
bool passEtaDepCuts(const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
MsgStream & dumptools(MsgStream &out) const
StatusCode itkFastTrackingStrategy(const EventContext &ctx) const
EventContext is used to specify which event.
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsSCTKey
SG::ReadHandleKey< ROIPhiRZContainer > m_caloClusterROIKey
void filterSharedTracks(std::multimap< double, Trk::Track * > &scoredTracks) const
cleans up the collection of quality filtered tracks.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
ToolHandle< ISiTrackMaker > m_trackmaker
std::atomic_int m_problemsTotal
Number events with number seeds > maxNumber.
std::atomic_int m_problemsTotalV
Number events with number seeds > maxNumber.
PublicToolHandle< Trk::IPatternParametersPropagator > m_proptool
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
std::atomic_int m_neventsTotalV
Number events.
SG::ReadHandleKey< xAOD::VertexContainer > m_vertices
Trk::MagneticFieldProperties m_fieldprop
StatusCode itkConvStrategy(const EventContext &ctx) const
EventContext is used to specify which event.
void filterSharedTracksFast(std::multimap< double, Trk::Track * > &scoredTracks) const
SiSPSeededTrackFinder(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode newStrategy(const EventContext &ctx) const
this method performs the track finding using the new strategy
Counter_t m_counterTotal ATLAS_THREAD_SAFE
SG::ReadDecorHandleKey< xAOD::EventInfo > m_mbtsKey
virtual StatusCode finalize() override
ToolHandle< IRegSelTool > m_regsel_strip
void collectGBTSTrainingData(const Trk::Track *) const
bool isGoodEvent(const EventContext &ctx) const
EventContext is used to specify which event.
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
void fillZHistogram(const EventContext &ctx, 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...
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...
ToolHandle< ISiZvertexMaker > m_zvertexmaker
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
virtual StatusCode initialize() override
Initialisation.
MsgStream & dumpevent(MsgStream &out, const SiSPSeededTrackFinder::Counter_t &counter) const
std::atomic_int m_neventsTotal
Number events.
StatusCode oldStrategy(const EventContext &ctx) const
this method performs the track finding using the old strategy
SG::ReadHandleKey< SpacePointContainer > m_SpacePointsPixelKey
virtual bool isClonable() const override
Make this algorithm clonable.
ToolHandle< ISiSpacePointsSeedMaker > m_seedsmaker
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
service to get cut values depending on different variable
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
magnetic field properties to steer the behavior of the extrapolation
Class describing the Line to which the Perigee refers to.
Primary Vertex Finder.
-event-from-file