ATLAS Offline Software
Loading...
Searching...
No Matches
GridTripletSeedingTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRK_GRIDTRIPLETSEEDINGTOOL_GRIDTRIPLETSEEDINGTOOL_H
6#define ACTSTRK_GRIDTRIPLETSEEDINGTOOL_GRIDTRIPLETSEEDINGTOOL_H
7
8// ATHENA
13
14// ACTS CORE
15#include "Acts/EventData/SeedContainer2.hpp"
16#include "Acts/EventData/SpacePointContainer2.hpp"
17#include "Acts/Seeding2/BroadTripletSeedFilter.hpp"
18#include "Acts/Seeding2/CylindricalSpacePointGrid2.hpp"
19#include "Acts/Seeding2/TripletSeeder.hpp"
20
21// Other
22#include <memory>
23#include <optional>
24
25namespace ActsTrk {
26
28 : public extends<AthAlgTool, ActsTrk::ISeedingTool> {
29 public:
30 GridTripletSeedingTool(const std::string& type, const std::string& name,
31 const IInterface* parent);
32
33 virtual StatusCode initialize() override;
34
35 StatusCode createSeeds2(const EventContext& ctx,
36 const std::vector<const xAOD::SpacePointContainer*>&
37 spacePointCollections,
38 const Eigen::Vector3f& beamSpotPos, float bFieldInZ,
39 ActsTrk::SeedContainer& seedContainer) const override;
40
41 protected:
42 Gaudi::Property<bool> m_seedQualitySelection{
43 this, "doSeedQualitySelection", true,
44 "Select seed according to quality criteria"};
45
46 // Cylindrical space point grid properties. Some are also used for the seed
47 // finder.
48 Gaudi::Property<float> m_minPt{this, "minPt", 900. * Acts::UnitConstants::MeV,
49 "lower pT cutoff for seeds"};
50 Gaudi::Property<float> m_cotThetaMax{this, "cotThetaMax", 27.2899,
51 "cot of maximum theta angle"};
52 Gaudi::Property<float> m_zMin{this, "zMin", -3000. * Acts::UnitConstants::mm,
53 "limiting location of measurements"};
54 Gaudi::Property<float> m_zMax{this, "zMax", 3000. * Acts::UnitConstants::mm,
55 "limiting location of measurements"};
56 Gaudi::Property<float> m_deltaRMax{
57 this, "deltaRMax", 280. * Acts::UnitConstants::mm,
58 "maximum distance in r between two measurements within one "
59 "seed"};
60 Gaudi::Property<float> m_impactMax{this, "impactMax",
61 2. * Acts::UnitConstants::mm,
62 "maximum impact parameter"};
63 Gaudi::Property<std::vector<float>> m_zBinEdges{
64 this,
65 "zBinEdges",
66 {-3000., -2700., -2500., -1400., -925., -500., -250., 250., 500., 925.,
67 1400., 2500., 2700, 3000.},
68 "enable non equidistant binning in z"};
69 Gaudi::Property<std::vector<float>> m_rBinEdges{
70 this,
71 "rBinEdges",
72 {0., 1100 * Acts::UnitConstants::mm},
73 "enable non equidistant binning in radius"};
74 Gaudi::Property<float> m_gridRMax{
75 this, "gridRMax", 320. * Acts::UnitConstants::mm,
76 "radial extension of subdetector to be used in grid building"};
77 Gaudi::Property<float> m_gridPhiMin{this, "gridPhiMin",
78 -std::numbers::pi_v<float>,
79 "phi min for space point grid formation"};
80 Gaudi::Property<float> m_gridPhiMax{this, "gridPhiMax",
81 std::numbers::pi_v<float>,
82 "phi max for space point grid formation"};
83 Gaudi::Property<int> m_phiBinDeflectionCoverage{
84 this, "phiBinDeflectionCoverage", 3,
85 "sets of consecutive phi bins to cover full deflection of minimum pT "
86 "particle"};
87 Gaudi::Property<int> m_maxPhiBins{this, "maxPhiBins", 200,
88 "max number of bins"};
89
90 // Seed finder properties. Some are also used for the seed filter.
91 Gaudi::Property<float> m_rMax{this, "rMax", 320. * Acts::UnitConstants::mm,
92 "limiting location of measurements"};
93 Gaudi::Property<float> m_binSizeR{
94 this, "binSizeR", 1. * Acts::UnitConstants::mm,
95 "defining radial bin for space point sorting"};
96 Gaudi::Property<float> m_deltaRMin{
97 this, "deltaRMin", 20. * Acts::UnitConstants::mm,
98 "minimum distance in r between two measurements within one "
99 "seed"};
100 Gaudi::Property<float> m_deltaRMinTopSP{
101 this, "deltaRMinTopSP", 6. * Acts::UnitConstants::mm,
102 "minimum distance in r between middle and top SP"};
103 Gaudi::Property<float> m_deltaRMaxTopSP{
104 this, "deltaRMaxTopSP", 280. * Acts::UnitConstants::mm,
105 "maximum distance in r between middle and top SP"};
106 Gaudi::Property<float> m_deltaRMinBottomSP{
107 this, "deltaRMinBottomSP", 6. * Acts::UnitConstants::mm,
108 "minimum distance in r between middle and top SP"};
109 Gaudi::Property<float> m_deltaRMaxBottomSP{
110 this, "deltaRMaxBottomSP", 150. * Acts::UnitConstants::mm,
111 "maximum distance in r between middle and top SP"};
112 Gaudi::Property<float> m_deltaZMax{
113 this, "deltaZMax", 600,
114 "maximum distance in z between two measurements within one seed"};
115 Gaudi::Property<float> m_collisionRegionMin{
116 this, "collisionRegionMin", -200. * Acts::UnitConstants::mm,
117 "limiting location of collision region in z"};
118 Gaudi::Property<float> m_collisionRegionMax{
119 this, "collisionRegionMax", 200. * Acts::UnitConstants::mm,
120 "limiting location of collision region in z"};
121 Gaudi::Property<float> m_sigmaScattering{
122 this, "sigmaScattering", 2.,
123 "how many sigmas of scattering angle should be considered"};
124 Gaudi::Property<float> m_maxPtScattering{
125 this, "maxPtScattering", 10e6,
126 "Upper pt limit for scattering calculation"};
127 Gaudi::Property<float> m_radLengthPerSeed{
128 this, "radLengthPerSeed", 0.098045,
129 "average radiation lengths of material on the length of a seed. used for "
130 "scattering"};
131 Gaudi::Property<int> m_maxSeedsPerSpM{
132 this, "maxSeedsPerSpM", 4,
133 "In dense environments many seeds may be found per middle space point. "
134 "Only seeds with the highest weight will be kept if this limit is "
135 "reached."};
136 Gaudi::Property<bool> m_interactionPointCut{
137 this, "interactionPointCut", true,
138 "Enable cut on the compatibility between interaction point and SPs"};
139 Gaudi::Property<std::vector<size_t>> m_zBinsCustomLooping{
140 this,
141 "zBinsCustomLooping",
142 {2, 3, 4, 5, 12, 11, 10, 9, 7, 6, 8},
143 "defines order of z bins for looping"};
144 Gaudi::Property<std::vector<std::size_t>> m_rBinsCustomLooping{
145 this, "rBinsCustomLooping", {1}, "defines order of r bins for looping"};
146 Gaudi::Property<bool> m_useVariableMiddleSPRange{
147 this, "useVariableMiddleSPRange", true,
148 "Enable variable range to search for middle SPs"};
149 Gaudi::Property<std::vector<std::vector<double>>> m_rRangeMiddleSP{
150 this,
151 "rRangeMiddleSP",
152 {{40.0, 90.0},
153 {40.0, 90.0},
154 {40.0, 200.0},
155 {46.0, 200.0},
156 {46.0, 200.0},
157 {46.0, 250.0},
158 {46.0, 250.0},
159 {46.0, 250.0},
160 {46.0, 200.0},
161 {46.0, 200.0},
162 {40.0, 200.0},
163 {40.0, 90.0},
164 {40.0, 90.0}},
165 "radial range for middle SP"};
166 Gaudi::Property<float> m_deltaRMiddleMinSPRange{
167 this, "deltaRMiddleMinSPRange", 10., "delta R for middle SP range (min)"};
168 Gaudi::Property<float> m_deltaRMiddleMaxSPRange{
169 this, "deltaRMiddleMaxSPRange", 10., "delta R for middle SP range (max)"};
170 Gaudi::Property<bool> m_seedConfirmation{this, "seedConfirmation", true,
171 "run seed confirmation"};
172 Gaudi::Property<float> m_seedConfCentralZMin{
173 this, "seedConfCentralZMin", -250. * Acts::UnitConstants::mm,
174 "minimum z for central seed confirmation "};
175 Gaudi::Property<float> m_seedConfCentralZMax{
176 this, "seedConfCentralZMax", 250. * Acts::UnitConstants::mm,
177 "maximum z for central seed confirmation "};
178 Gaudi::Property<float> m_seedConfCentralRMax{
179 this, "seedConfCentralRMax", 140. * Acts::UnitConstants::mm,
180 "maximum r for central seed confirmation "};
181 Gaudi::Property<size_t> m_seedConfCentralNTopLargeR{
182 this, "seedConfCentralNTopLargeR", 1,
183 "nTop for large R central seed confirmation"};
184 Gaudi::Property<size_t> m_seedConfCentralNTopSmallR{
185 this, "seedConfCentralNTopSmallR", 2,
186 "nTop for small R central seed confirmation"};
187 Gaudi::Property<float> m_seedConfCentralMinBottomRadius{
188 this, "seedConfCentralMinBottomRadius", 60 * Acts::UnitConstants::mm,
189 "Minimum radius for bottom SP in seed confirmation"};
190 Gaudi::Property<float> m_seedConfCentralMaxZOrigin{
191 this, "seedConfCentralMaxZOrigin", 150 * Acts::UnitConstants::mm,
192 "Maximum zOrigin in seed confirmation"};
193 Gaudi::Property<float> m_seedConfCentralMinImpact{
194 this, "seedConfCentralMinImpact", 1. * Acts::UnitConstants::mm,
195 "Minimum impact parameter for seed confirmation"};
196 Gaudi::Property<float> m_seedConfForwardZMin{
197 this, "seedConfForwardZMin", -3000. * Acts::UnitConstants::mm,
198 "minimum z for forward seed confirmation "};
199 Gaudi::Property<float> m_seedConfForwardZMax{
200 this, "seedConfForwardZMax", 3000. * Acts::UnitConstants::mm,
201 "maximum z for forward seed confirmation "};
202 Gaudi::Property<float> m_seedConfForwardRMax{
203 this, "seedConfForwardRMax", 140. * Acts::UnitConstants::mm,
204 "maximum r for forward seed confirmation "};
205 Gaudi::Property<size_t> m_seedConfForwardNTopLargeR{
206 this, "seedConfForwardNTopLargeR", 1,
207 "nTop for large R forward seed confirmation"};
208 Gaudi::Property<size_t> m_seedConfForwardNTopSmallR{
209 this, "seedConfForwardNTopSmallR", 2,
210 "nTop for small R forward seed confirmation"};
211 Gaudi::Property<float> m_seedConfForwardMinBottomRadius{
212 this, "seedConfForwardMinBottomRadius", 60 * Acts::UnitConstants::mm,
213 "Minimum radius for bottom SP in seed confirmation"};
214 Gaudi::Property<float> m_seedConfForwardMaxZOrigin{
215 this, "seedConfForwardMaxZOrigin", 150 * Acts::UnitConstants::mm,
216 "Maximum zOrigin in seed confirmation"};
217 Gaudi::Property<float> m_seedConfForwardMinImpact{
218 this, "seedConfForwardMinImpact", 1. * Acts::UnitConstants::mm,
219 "Minimum impact parameter for seed confirmation"};
221 this, "useDetailedDoubleMeasurementInfo", false,
222 "enable use of double measurement details"};
223
224 Gaudi::Property<float> m_toleranceParam{
225 this, "toleranceParam", 1.1 * Acts::UnitConstants::mm,
226 "tolerance parameter used to check the compatibility of SPs coordinates "
227 "in xyz"};
228 Gaudi::Property<float> m_phiMin{this, "phiMin", -std::numbers::pi_v<float>,
229 ""};
230 Gaudi::Property<float> m_phiMax{this, "phiMax", std::numbers::pi_v<float>,
231 ""};
232 Gaudi::Property<float> m_rMin{this, "rMin", 0 * Acts::UnitConstants::mm, ""};
233 Gaudi::Property<float> m_zAlign{this, "zAlign", 0 * Acts::UnitConstants::mm,
234 ""};
235 Gaudi::Property<float> m_rAlign{this, "rAlign", 0 * Acts::UnitConstants::mm,
236 ""};
237 Gaudi::Property<float> m_sigmaError{this, "sigmaError", 5, ""};
238
239 // Seed filter properties
240 Gaudi::Property<float> m_impactWeightFactor{
241 this, "impactWeightFactor", 100.,
242 "the impact parameters (d0) is multiplied by this factor and subtracted "
243 "from weight"};
244 Gaudi::Property<float> m_zOriginWeightFactor{this, "zOriginWeightFactor", 1.};
245 Gaudi::Property<float> m_compatSeedWeight{
246 this, "compatSeedWeight", 100.,
247 "seed weight increased by this value if a compatible seed has been "
248 "found"};
249 Gaudi::Property<std::size_t> m_compatSeedLimit{
250 this, "compatSeedLimit", 3,
251 "how often do you want to increase the weight of a seed for finding a "
252 "compatible seed"};
253 Gaudi::Property<float> m_seedWeightIncrement{
254 this, "seedWeightIncrement", 0., "increment in seed weight if needed"};
255 Gaudi::Property<float> m_numSeedIncrement{
256 this, "numSeedIncrement", 10e6,
257 "increment in seed weight is applied if the number of compatible seeds "
258 "is larger than numSeedIncrement"};
259 Gaudi::Property<bool> m_seedConfirmationInFilter{
260 this, "seedConfirmationInFilter", true, "run seed confirmation"};
261 Gaudi::Property<std::size_t> m_maxSeedsPerSpMConf{
262 this, "maxSeedsPerSpMConf", 5,
263 "Maximum number of lower quality seeds in seed confirmation."};
264 Gaudi::Property<std::size_t> m_maxQualitySeedsPerSpMConf{
265 this, "maxQualitySeedsPerSpMConf", 5,
266 "Maximum number of quality seeds for each middle-bottom SP-duplet in "
267 "seed confirmation."};
268 Gaudi::Property<bool> m_useDeltaRorTopRadius{
269 this, "useDeltaRorTopRadius", true,
270 "use deltaR (top radius - middle radius) instead of top radius"};
271 Gaudi::Property<float> m_deltaInvHelixDiameter{
272 this, "deltaInvHelixDiameter", 0.00003 * 1. / Acts::UnitConstants::mm,
273 "the allowed delta between two inverted seed radii for them to be "
274 "considered compatible"};
275
276 // Properties to set other objects used in seeding algorithm
277 Gaudi::Property<std::vector<std::pair<int, int>>> m_zBinNeighborsTop{
278 this,
279 "zBinNeighborsTop",
280 {{0, 0},
281 {-1, 0},
282 {-2, 0},
283 {-1, 0},
284 {-1, 0},
285 {-1, 0},
286 {-1, 1},
287 {0, 1},
288 {0, 1},
289 {0, 1},
290 {0, 2},
291 {0, 1},
292 {0, 0}},
293 "vector containing the map of z bins in the top layers"};
294 Gaudi::Property<std::vector<std::pair<int, int>>> m_zBinNeighborsBottom{
295 this,
296 "zBinNeighborsBottom",
297 {{0, 0},
298 {0, 1},
299 {0, 1},
300 {0, 1},
301 {0, 1},
302 {0, 1},
303 {0, 0},
304 {-1, 0},
305 {-1, 0},
306 {-1, 0},
307 {-1, 0},
308 {-1, 0},
309 {0, 0}},
310 "vector containing the map of z bins in the top layers"};
311 Gaudi::Property<std::vector<std::pair<int, int>>> m_rBinNeighborsTop{
312 this,
313 "rBinNeighborsTop",
314 {{0, 0}},
315 "vector containing the map of radius bins in the top layers"};
316 Gaudi::Property<std::vector<std::pair<int, int>>> m_rBinNeighborsBottom{
317 this,
318 "rBinNeighborsBottom",
319 {{0, 0}},
320 "vector containing the map of radius bins in the bottom layers"};
321 Gaudi::Property<int> m_numPhiNeighbors{
322 this, "numPhiNeighbors", 1,
323 "number of phi bin neighbors at each side of the current bin that will "
324 "be used to search for SPs"};
325
326 Gaudi::Property<bool> m_useExperimentCuts{this, "useExperimentCuts", false,
327 ""};
328
329 Gaudi::Property<int> m_stateVectorReserveSize{
330 this, "stateVectorReserveSize", 500,
331 "Size of the initial Seeding State internal vectors"};
332
333 Gaudi::Property<float> m_expCutrMin{this, "SpSelectionExpCutrMin",
334 45. * Acts::UnitConstants::mm};
335
336 private:
337 Acts::CylindricalSpacePointGrid2::Config m_gridCfg;
338 Acts::DoubletSeedFinder::Config m_bottomDoubletFinderCfg;
339 Acts::DoubletSeedFinder::Config m_topDoubletFinderCfg;
340 Acts::TripletSeedFinder::Config m_tripletFinderCfg;
341 Acts::BroadTripletSeedFilter::Config m_filterCfg;
342
343 std::optional<Acts::TripletSeeder> m_finder;
344
346 std::unique_ptr<const Acts::Logger> m_logger;
347 std::unique_ptr<const Acts::Logger> m_loggerFilter;
348
349 const PixelID* m_pixelId{nullptr};
350
352 const Acts::Logger& logger() const { return *m_logger; }
353
354 bool spacePointSelectionFunction(const xAOD::SpacePoint* sp, float r) const;
355
356 bool doubletSelectionFunction(const Acts::ConstSpacePointProxy2& middle,
357 const Acts::ConstSpacePointProxy2& other,
358 float cotTheta, bool isBottomCandidate) const;
359
360 std::pair<float, float> retrieveRadiusRangeForMiddle(
361 const Acts::ConstSpacePointProxy2& spM,
362 const Acts::Range1D<float>& rMiddleSpRange) const;
363};
364
365} // namespace ActsTrk
366
367#endif
static Double_t sp
This is an Identifier helper class for the Pixel subdetector.
bool spacePointSelectionFunction(const xAOD::SpacePoint *sp, float r) const
Acts::TripletSeedFinder::Config m_tripletFinderCfg
Gaudi::Property< bool > m_useDeltaRorTopRadius
Gaudi::Property< bool > m_seedQualitySelection
Gaudi::Property< float > m_seedConfForwardMinImpact
Acts::DoubletSeedFinder::Config m_bottomDoubletFinderCfg
Gaudi::Property< std::vector< std::pair< int, int > > > m_rBinNeighborsTop
Gaudi::Property< float > m_impactWeightFactor
std::pair< float, float > retrieveRadiusRangeForMiddle(const Acts::ConstSpacePointProxy2 &spM, const Acts::Range1D< float > &rMiddleSpRange) const
Acts::DoubletSeedFinder::Config m_topDoubletFinderCfg
Gaudi::Property< float > m_collisionRegionMax
StatusCode createSeeds2(const EventContext &ctx, const std::vector< const xAOD::SpacePointContainer * > &spacePointCollections, const Eigen::Vector3f &beamSpotPos, float bFieldInZ, ActsTrk::SeedContainer &seedContainer) const override
Gaudi::Property< float > m_seedConfCentralMinBottomRadius
std::optional< Acts::TripletSeeder > m_finder
Gaudi::Property< int > m_phiBinDeflectionCoverage
Gaudi::Property< float > m_zOriginWeightFactor
Gaudi::Property< std::size_t > m_maxSeedsPerSpMConf
Gaudi::Property< float > m_maxPtScattering
Gaudi::Property< bool > m_useVariableMiddleSPRange
Gaudi::Property< float > m_toleranceParam
Gaudi::Property< float > m_deltaRMaxBottomSP
Gaudi::Property< float > m_seedConfForwardMinBottomRadius
Gaudi::Property< float > m_compatSeedWeight
Gaudi::Property< std::vector< std::vector< double > > > m_rRangeMiddleSP
Gaudi::Property< float > m_deltaRMinTopSP
Gaudi::Property< float > m_seedConfForwardZMin
Acts::BroadTripletSeedFilter::Config m_filterCfg
Gaudi::Property< std::vector< std::pair< int, int > > > m_rBinNeighborsBottom
Gaudi::Property< bool > m_useDetailedDoubleMeasurementInfo
Gaudi::Property< std::vector< std::pair< int, int > > > m_zBinNeighborsBottom
Acts::CylindricalSpacePointGrid2::Config m_gridCfg
Gaudi::Property< float > m_gridPhiMin
Gaudi::Property< bool > m_interactionPointCut
Gaudi::Property< size_t > m_seedConfCentralNTopSmallR
Gaudi::Property< std::vector< float > > m_rBinEdges
Gaudi::Property< float > m_seedConfForwardRMax
Gaudi::Property< float > m_deltaRMiddleMaxSPRange
GridTripletSeedingTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< std::vector< std::pair< int, int > > > m_zBinNeighborsTop
Gaudi::Property< float > m_deltaInvHelixDiameter
Gaudi::Property< float > m_collisionRegionMin
Gaudi::Property< float > m_seedConfCentralMaxZOrigin
Gaudi::Property< float > m_seedConfCentralMinImpact
Gaudi::Property< std::size_t > m_maxQualitySeedsPerSpMConf
Gaudi::Property< float > m_gridPhiMax
Gaudi::Property< std::vector< float > > m_zBinEdges
Gaudi::Property< bool > m_seedConfirmation
Gaudi::Property< float > m_seedConfForwardMaxZOrigin
Gaudi::Property< float > m_seedWeightIncrement
bool doubletSelectionFunction(const Acts::ConstSpacePointProxy2 &middle, const Acts::ConstSpacePointProxy2 &other, float cotTheta, bool isBottomCandidate) const
Gaudi::Property< float > m_radLengthPerSeed
Gaudi::Property< float > m_cotThetaMax
Gaudi::Property< float > m_deltaRMinBottomSP
Gaudi::Property< size_t > m_seedConfCentralNTopLargeR
Gaudi::Property< int > m_stateVectorReserveSize
virtual StatusCode initialize() override
Gaudi::Property< float > m_deltaRMiddleMinSPRange
Gaudi::Property< float > m_seedConfForwardZMax
Gaudi::Property< bool > m_seedConfirmationInFilter
Gaudi::Property< std::vector< std::size_t > > m_rBinsCustomLooping
const Acts::Logger & logger() const
Private access to the logger.
Gaudi::Property< float > m_seedConfCentralRMax
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Gaudi::Property< float > m_sigmaScattering
std::unique_ptr< const Acts::Logger > m_loggerFilter
Gaudi::Property< std::vector< size_t > > m_zBinsCustomLooping
Gaudi::Property< float > m_seedConfCentralZMax
Gaudi::Property< float > m_deltaRMaxTopSP
Gaudi::Property< std::size_t > m_compatSeedLimit
Gaudi::Property< size_t > m_seedConfForwardNTopSmallR
Gaudi::Property< float > m_seedConfCentralZMin
Gaudi::Property< bool > m_useExperimentCuts
Gaudi::Property< float > m_numSeedIncrement
Gaudi::Property< size_t > m_seedConfForwardNTopLargeR
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
int r
Definition globals.cxx:22
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...