ATLAS Offline Software
Loading...
Searching...
No Matches
OrthogonalSeedingTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#if defined(FLATTEN) && defined(__GNUC__)
6// Avoid warning in dbg build
7#pragma GCC optimize "-fno-var-tracking-assignments"
8#endif
9
12
13namespace ActsTrk {
14
16 const std::string& name,
17 const IInterface* parent)
18 : base_class(type, name, parent)
19 {}
20
22 ATH_MSG_DEBUG("Initializing " << name() << "...");
23
24 ATH_MSG_DEBUG("Properties Summary:");
25 ATH_MSG_DEBUG(" * Used by SeedFinderOrthogonalConfig");
26 ATH_MSG_DEBUG(" " << m_minPt);
32
37
40 ATH_MSG_DEBUG(" " << m_phiMin);
41 ATH_MSG_DEBUG(" " << m_phiMax);
42 ATH_MSG_DEBUG(" " << m_zMin);
43 ATH_MSG_DEBUG(" " << m_zMax);
44 ATH_MSG_DEBUG(" " << m_rMax);
45 ATH_MSG_DEBUG(" " << m_rMin);
46
51
55
56 ATH_MSG_DEBUG(" * Used by SeedFilterConfig" );
64
67
72
73 ATH_MSG_DEBUG(" * Used by SeedFilterConfig" );
82
91
92 // Make the logger And Propagate to ACTS routines
93 m_logger = makeActsAthenaLogger(this, "Acts");
94
96
97 return StatusCode::SUCCESS;
98 }
99
101 StatusCode
102 OrthogonalSeedingTool::createSeeds(const EventContext& /*ctx*/,
103 const Acts::SpacePointContainer<ActsTrk::SpacePointCollector, Acts::detail::RefHolder>& spContainer,
104 const Acts::Vector3& beamSpotPos,
105 const Acts::Vector3& bField,
106 ActsTrk::SeedContainer& seedContainer ) const
107 {
108 seedContainer.spacePoints().reserve(spContainer.size());
109 for (auto sp : spContainer) {
110 seedContainer.spacePoints().push_back(&sp.externalSpacePoint());
111 }
112
113 // Seed Finder Options
114 Acts::SeedFinderOptions finderOpts;
115 finderOpts.beamPos = Acts::Vector2(beamSpotPos[Amg::x],
116 beamSpotPos[Amg::y]);
117 finderOpts.bFieldInZ = bField[2];
118 finderOpts = finderOpts.toInternalUnits().calculateDerivedQuantities(m_finderCfg);
119
120 // Compute seeds
121 auto groupSeeds = m_finder.createSeeds(finderOpts, spContainer);
122
123 // Store seeds
124 seedContainer.reserve(groupSeeds.size());
125 for(const auto& seed: groupSeeds) {
126 seedContainer.push_back(&seed);
127 }
128
129 return StatusCode::SUCCESS;
130 }
131
132 StatusCode
134 {
135 // Configuration for Acts::SeedFilter
136 Acts::SeedFilterConfig filterCfg;
137 filterCfg.deltaInvHelixDiameter = m_deltaInvHelixDiameter;
138 filterCfg.impactWeightFactor = m_impactWeightFactor;
139 filterCfg.zOriginWeightFactor = m_zOriginWeightFactor;
140 filterCfg.compatSeedWeight = m_compatSeedWeight;
141 filterCfg.deltaRMin = m_deltaRMin;
142 filterCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
143 filterCfg.compatSeedLimit = m_compatSeedLimit;
144 filterCfg.seedWeightIncrement = m_seedWeightIncrement;
145 filterCfg.numSeedIncrement = m_numSeedIncrement;
146 filterCfg.seedConfirmation = m_seedConfirmationInFilter;
147 filterCfg.maxSeedsPerSpMConf = m_maxSeedsPerSpMConf;
148 filterCfg.maxQualitySeedsPerSpMConf = m_maxQualitySeedsPerSpMConf;
149 filterCfg.useDeltaRorTopRadius = m_useDeltaRorTopRadius;
150 filterCfg.centralSeedConfirmationRange.zMinSeedConf = m_seedConfCentralZMin;
151 filterCfg.centralSeedConfirmationRange.zMaxSeedConf = m_seedConfCentralZMax;
152 filterCfg.centralSeedConfirmationRange.rMaxSeedConf = m_seedConfCentralRMax;
153 filterCfg.centralSeedConfirmationRange.nTopForLargeR = m_seedConfCentralNTopLargeR;
154 filterCfg.centralSeedConfirmationRange.nTopForSmallR = m_seedConfCentralNTopSmallR;
155 filterCfg.centralSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfCentralMinBottomRadius;
156 filterCfg.centralSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfCentralMaxZOrigin;
157 filterCfg.centralSeedConfirmationRange.minImpactSeedConf = m_seedConfCentralMinImpact;
158 filterCfg.forwardSeedConfirmationRange.zMinSeedConf = m_seedConfForwardZMin;
159 filterCfg.forwardSeedConfirmationRange.zMaxSeedConf = m_seedConfForwardZMax;
160 filterCfg.forwardSeedConfirmationRange.rMaxSeedConf = m_seedConfForwardRMax;
161 filterCfg.forwardSeedConfirmationRange.nTopForLargeR = m_seedConfForwardNTopLargeR;
162 filterCfg.forwardSeedConfirmationRange.nTopForSmallR = m_seedConfForwardNTopSmallR;
163 filterCfg.forwardSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfForwardMinBottomRadius;
164 filterCfg.forwardSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfForwardMaxZOrigin;
165 filterCfg.forwardSeedConfirmationRange.minImpactSeedConf = m_seedConfForwardMinImpact;
166
167 // Configuration Acts::SeedFinderOrthogonal
168 m_finderCfg.seedFilter = std::make_shared<Acts::SeedFilter<value_type>>(filterCfg.toInternalUnits(), logger().cloneWithSuffix("Filter"));
169 m_finderCfg.cotThetaMax = m_cotThetaMax;
170 m_finderCfg.deltaRMinTopSP = m_deltaRMinTopSP;
171 m_finderCfg.deltaRMaxTopSP = m_deltaRMaxTopSP;
172 m_finderCfg.deltaRMinBottomSP = m_deltaRMinBottomSP;
173 m_finderCfg.deltaRMaxBottomSP = m_deltaRMaxBottomSP;
174 m_finderCfg.impactMax = m_impactMax;
175 m_finderCfg.sigmaScattering = m_sigmaScattering;
176 m_finderCfg.maxPtScattering = m_maxPtScattering;
177 m_finderCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
178 m_finderCfg.collisionRegionMin = m_collisionRegionMin;
179 m_finderCfg.collisionRegionMax = m_collisionRegionMax;
180 m_finderCfg.phiMin = m_phiMin;
181 m_finderCfg.phiMax = m_phiMax;
182 m_finderCfg.zMin = m_zMin;
183 m_finderCfg.zMax = m_zMax;
184 m_finderCfg.rMax = m_rMax;
185 m_finderCfg.rMin = m_rMin;
186 m_finderCfg.rMinMiddle = m_rMinMiddle;
187 m_finderCfg.rMaxMiddle = m_rMaxMiddle;
188 m_finderCfg.deltaPhiMax = m_deltaPhiMax;
189 m_finderCfg.deltaZMax = m_deltaZMax;
190 m_finderCfg.interactionPointCut = m_interactionPointCut;
191 m_finderCfg.seedConfirmation = m_seedConfirmation;
192 m_finderCfg.centralSeedConfirmationRange = filterCfg.centralSeedConfirmationRange;
193 m_finderCfg.forwardSeedConfirmationRange = filterCfg.forwardSeedConfirmationRange;
194 m_finderCfg.radLengthPerSeed = m_radLengthPerSeed;
195
196 // Fast tracking
197 // manually convert the two types
198 for (const auto& vec : m_rRangeMiddleSP) {
199 std::vector<float> convertedVec;
200
201 for (const auto& val : vec) {
202 convertedVec.push_back(static_cast<float>(val));
203 }
204
205 m_finderCfg.rRangeMiddleSP.push_back(convertedVec);
206 }
207 // define cuts used for fast tracking configuration
209 m_finderCfg.experimentCuts.connect(
210 [](const void*, float bottomRadius, float cotTheta) -> bool {
211
212 float fastTrackingRMin = 50.;
213 float fastTrackingCotThetaMax = 1.5;
214
215 if (bottomRadius < fastTrackingRMin and
216 (cotTheta > fastTrackingCotThetaMax or
217 cotTheta < -fastTrackingCotThetaMax)) {
218 return false;
219 }
220 return true;
221 });
222 }
223
224 m_finderCfg = m_finderCfg.toInternalUnits();
225
226 m_finder = Acts::SeedFinderOrthogonal<value_type>(m_finderCfg, logger().cloneWithSuffix("Finder"));
227
228 return StatusCode::SUCCESS;
229 }
230
231} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
static Double_t sp
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Gaudi::Property< float > m_deltaRMinTopSP
Gaudi::Property< bool > m_interactionPointCut
const Acts::Logger & logger() const
Private access to the logger.
Gaudi::Property< float > m_phiMax
Gaudi::Property< float > m_phiMin
Gaudi::Property< float > m_seedConfForwardRMax
Gaudi::Property< int > m_maxSeedsPerSpMConf
Gaudi::Property< float > m_radLengthPerSeed
Gaudi::Property< float > m_deltaInvHelixDiameter
Gaudi::Property< float > m_zOriginWeightFactor
Gaudi::Property< size_t > m_seedConfForwardNTopLargeR
Gaudi::Property< float > m_seedConfCentralZMin
Gaudi::Property< float > m_maxPtScattering
Gaudi::Property< float > m_seedConfCentralMinBottomRadius
Gaudi::Property< float > m_seedWeightIncrement
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Gaudi::Property< bool > m_seedConfirmation
Gaudi::Property< bool > m_useDeltaRorTopRadius
Gaudi::Property< float > m_deltaPhiMax
Gaudi::Property< float > m_deltaRMaxBottomSP
Gaudi::Property< float > m_cotThetaMax
Gaudi::Property< float > m_seedConfForwardZMin
Acts::SeedFinderOrthogonalConfig< value_type > m_finderCfg
Gaudi::Property< float > m_collisionRegionMax
Gaudi::Property< size_t > m_seedConfCentralNTopSmallR
Gaudi::Property< float > m_collisionRegionMin
Gaudi::Property< size_t > m_seedConfCentralNTopLargeR
Gaudi::Property< float > m_deltaRMin
Gaudi::Property< float > m_seedConfForwardZMax
Gaudi::Property< float > m_seedConfCentralZMax
Gaudi::Property< float > m_sigmaScattering
Gaudi::Property< float > m_rMaxMiddle
Gaudi::Property< float > m_seedConfForwardMinImpact
Gaudi::Property< float > m_deltaZMax
Gaudi::Property< float > m_seedConfCentralRMax
Gaudi::Property< float > m_rMinMiddle
Gaudi::Property< size_t > m_seedConfForwardNTopSmallR
Gaudi::Property< bool > m_seedConfirmationInFilter
Gaudi::Property< bool > m_useExperimentCuts
Gaudi::Property< float > m_seedConfCentralMinImpact
Gaudi::Property< float > m_impactWeightFactor
Gaudi::Property< std::size_t > m_compatSeedLimit
Gaudi::Property< float > m_seedConfCentralMaxZOrigin
Gaudi::Property< std::vector< std::vector< double > > > m_rRangeMiddleSP
Gaudi::Property< float > m_deltaRMinBottomSP
Gaudi::Property< int > m_maxQualitySeedsPerSpMConf
Acts::SeedFinderOrthogonal< value_type > m_finder
virtual StatusCode initialize() override
Gaudi::Property< float > m_impactMax
OrthogonalSeedingTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< float > m_numSeedIncrement
Gaudi::Property< unsigned int > m_maxSeedsPerSpM
virtual StatusCode createSeeds(const EventContext &ctx, const Acts::SpacePointContainer< ActsTrk::SpacePointCollector, Acts::detail::RefHolder > &spContainer, const Acts::Vector3 &beamSpotPos, const Acts::Vector3 &bField, ActsTrk::SeedContainer &seedContainer) const override
Gaudi::Property< float > m_seedConfForwardMaxZOrigin
Gaudi::Property< float > m_deltaRMaxTopSP
Gaudi::Property< float > m_compatSeedWeight
Gaudi::Property< float > m_seedConfForwardMinBottomRadius
#define ATH_FLATTEN
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Acts::MutableSeedProxy2 push_back(Acts::SpacePointIndexSubset2 sp)
const SpacePointContainer & spacePoints() const noexcept