ATLAS Offline Software
Loading...
Searching...
No Matches
SiSPSeededTrackFinder.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2025 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
32
34#include "GaudiKernel/ToolHandle.h"
35
37#include <atomic>
38#include <string>
39#include <mutex>
40
41//class SpacePointContainer;
42namespace InDet {
43
50 {
51
53 // Public methods
55
56 public:
57
61
62 SiSPSeededTrackFinder(const std::string &name, ISvcLocator *pSvcLocator);
63 virtual ~SiSPSeededTrackFinder() = default;
64 virtual StatusCode initialize() override;
65 virtual StatusCode execute(const EventContext& ctx) const override;
66 virtual StatusCode finalize() override;
67
69 virtual bool isClonable() const override { return true; };
71
72 protected:
73
75 // Protected data
77
80
83 class Counter_t : public std::array<std::atomic_int, kNCounter>
84 {
85 public:
86 Counter_t& operator += (const Counter_t& counter) {
87 for (unsigned int idx=0; idx <kNCounter; ++idx) {
88 (*this)[idx] += counter[idx];
89 }
90 return *this;
91 }
92 };
93
95
96 BooleanProperty m_useZvertexTool{this, "useZvertexTool", true};
97 BooleanProperty m_writeHolesFromPattern{this, "writeHolesFromPattern", false,"Flag to activate writing hole info from the pattern recognition"};
98 BooleanProperty m_useMBTS{this, "useMBTSTimeDiff", false};
99 BooleanProperty m_useNewStrategy{this, "useNewStrategy", false};
100 BooleanProperty m_useZBoundaryFinding{this, "useZBoundFinding", false};
101 BooleanProperty m_ITKGeometry{this, "ITKGeometry", false, "Flag to specify if it is ITK geometry"};
102 BooleanProperty m_useITkConvSeeded{this, "useITkConvSeeded", false, "ITk EM-seeded conversion reco"};
103 BooleanProperty m_doFastTracking{this, "doFastTracking", false, "ITk fast tracking reco"};
104 IntegerProperty m_maxNumberSeeds{this, "maxNumberSeeds", 3000000, "Max. number used seeds"};
105 BooleanProperty m_alwaysProtectAgainstBusyEvent{this, "alwaysProtectAgainstBusyEvents", false, "Flag that enables checking always maxNumberPIXsp and maxNumberSCTsp"};
106 IntegerProperty m_maxPIXsp{this, "maxNumberPIXsp", 150000, "Max. number pixels space points"};
107 IntegerProperty m_maxSCTsp{this, "maxNumberSCTsp", 500000, "Max. number sct space points"};
108 IntegerProperty m_nfreeCut{this, "FreeClustersCut", 1, "Min number free clusters"};
109 IntegerProperty m_histsize{this, "HistSize", 1400};
110 IntegerProperty m_nvertex{this, "maxVertices", 4};
111 DoubleProperty m_zcut{this, "Zcut", 350.};
112 DoubleProperty m_deltaEta{this, "dEtaCaloRoI", .1};
113 DoubleProperty m_deltaPhi{this, "dPhiCaloRoI", .25};
114 DoubleProperty m_deltaZ{this, "dZCaloRoI", 300.};
115 StringProperty m_fieldmode{this, "MagneticFieldMode", "MapSolenoid"};
116 BooleanProperty m_doDumpGBTSTrainingData{this, "doDumpGBTSTrainingData", false, "write training data used to create GBTS connection table"};
117 BooleanProperty m_doDumpGBTSTrainingDataLRT{this, "doDumpGBTSTrainingDataLRT", false, "write LRT training data used to create GBTS connection table"};
118 BooleanProperty m_removeShortSegments{this, "removeShortSegments", false, "remove short segments from GBTS connection table"};
119 StringProperty m_GBTSTrainingDataFileName{this, "GBTSTrainingDataFileName", "layer_connection_table.csv", "file to write training data used to create GBTS connection table"};
121
123
124 double m_pTcut{500};
125 double m_imcut{2.};
126 double m_zstep{0.};
128
130
131 SG::ReadHandleKey<xAOD::EventInfo> m_evtKey{this, "EventInfoKey", "EventInfo"};
132 SG::ReadHandleKey<SpacePointContainer> m_SpacePointsSCTKey{this, "SpacePointsSCTName", "SCT_SpacePoints"};
133 SG::ReadHandleKey<SpacePointContainer> m_SpacePointsPixelKey{this, "SpacePointsPixelName", "PixelSpacePoints"};
135 SG::ReadHandleKey<ROIPhiRZContainer> m_caloClusterROIKey{this, "EMROIPhiRZContainer", "InDetCaloClusterROIPhiRZ15GeVUnordered", "Name of the calo cluster ROIs in Phi,R,Z parameterization"};
136
137 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};
138
139 SG::ReadDecorHandleKey<xAOD::EventInfo> m_mbtsKey{this, "MBTSKey", m_evtKey, "MBTSBackground"};
140
141 SG::WriteHandleKey<TrackCollection> m_outputTracksKey{this, "TracksLocation", "SiSPSeededTracks"};
143
145
146 ToolHandle<ISiSpacePointsSeedMaker> m_seedsmaker{this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"};
147 ToolHandle<ISiZvertexMaker> m_zvertexmaker{this, "ZvertexTool", "InDet::SiZvertexMaker_xk/InDetSiZvertexMaker", "Space poins z-vertex maker"};
148 ToolHandle<ISiTrackMaker> m_trackmaker{this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"};
149 PublicToolHandle<Trk::IPatternParametersPropagator> m_proptool{this, "PropagatorTool", "Trk::RungeKuttaPropagator/InDetPropagator"};
150 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};
151 ToolHandle<IRegSelTool> m_regsel_strip { this, "RegSelTool_Strip", "RegSelTool/RegSelTool_SCT" };
153
155
158
160
161
162 ServiceHandle<IInDetEtaDependentCutsSvc> m_etaDependentCutsSvc{this, "InDetEtaDependentCutsSvc", "InDetEtaDependentCutsSvc"};
164
166
167 mutable Counter_t m_counterTotal ATLAS_THREAD_SAFE {};
168
169 mutable std::atomic_int m_neventsTotal{0};
170 mutable std::atomic_int m_neventsTotalV{0};
171 mutable std::atomic_int m_problemsTotal{0};
172 mutable std::atomic_int m_problemsTotalV{0};
174
175 mutable std::mutex m_GBTSTrainingDataMutex;
176 mutable std::map<int, std::map<int, unsigned long>> m_GBTSTrainingData ATLAS_THREAD_SAFE;
177 mutable std::atomic_ulong m_numGBTSTrainingData{0};
178
180 // Protected methods
182
184
185 MsgStream& dump(MSG::Level lvl, const SiSPSeededTrackFinder::Counter_t*) const;
186 MsgStream& dumptools(MsgStream& out) const;
187 MsgStream& dumpevent(MsgStream& out, const SiSPSeededTrackFinder::Counter_t& counter) const;
189
190 // check event quality - mainly used for HI events
191 bool isGoodEvent(const EventContext& ctx) const;
192
199 void filterSharedTracks(std::multimap<double, Trk::Track*>& scoredTracks) const;
200 void filterSharedTracksFast(std::multimap<double, Trk::Track*>& scoredTracks) const;
201
211 void fillZHistogram(const Trk::Track* Tr,
212 const Trk::PerigeeSurface& beamlinePerigee,
213 std::vector<int>& numberWeightedhistogram,
214 std::vector<double>& zWeightedHistogram,
215 std::vector<double>& ptWeightedHistogram) const;
216
226 void findZvertex(std::list<Trk::Vertex>& vertexList,
227 std::pair<double, double> & zBoundaries,
228 const std::vector<int>& numberWeightedhistogram,
229 const std::vector<double>& zWeightedHistogram,
230 const std::vector<double>& ptWeightedHistogram) const;
231
233 StatusCode oldStrategy(const EventContext& ctx) const;
234
236 StatusCode newStrategy(const EventContext& ctx) const;
237
238 StatusCode itkFastTrackingStrategy(const EventContext& ctx) const;
239 StatusCode itkConvStrategy(const EventContext& ctx) const;
240
241 void magneticFieldInit();
242
243 bool passEtaDepCuts(const Trk::Track* track,
244 int nClusters,
245 int nFreeClusters,
246 int nPixels) const;
247
248 void collectGBTSTrainingData(const Trk::Track*) const;
249 void dumpGBTSTrainingData() const;
250
251 };
252}
253#endif // SiSPSeededTrackFinder_H
defines an "iterator" over instances of a given type in StoreGateSvc
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.
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...
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.
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 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