ATLAS Offline Software
OrthogonalSeedingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace ActsTrk {
8 
10  const std::string& name,
11  const IInterface* parent)
12  : base_class(type, name, parent)
13  {}
14 
16  ATH_MSG_DEBUG("Initializing " << name() << "...");
17 
18  ATH_MSG_DEBUG("Properties Summary:");
19  ATH_MSG_DEBUG(" * Used by SeedFinderOrthogonalConfig");
20  ATH_MSG_DEBUG(" " << m_minPt);
26 
27  ATH_MSG_DEBUG(" " << m_impactMax);
31 
34  ATH_MSG_DEBUG(" " << m_phiMin);
35  ATH_MSG_DEBUG(" " << m_phiMax);
36  ATH_MSG_DEBUG(" " << m_zMin);
37  ATH_MSG_DEBUG(" " << m_zMax);
38  ATH_MSG_DEBUG(" " << m_rMax);
39  ATH_MSG_DEBUG(" " << m_rMin);
40 
44  ATH_MSG_DEBUG(" " << m_deltaZMax);
45 
49 
50  ATH_MSG_DEBUG(" * Used by SeedFilterConfig" );
55  ATH_MSG_DEBUG(" " << m_deltaRMin);
58 
61 
66 
67  ATH_MSG_DEBUG(" * Used by SeedFilterConfig" );
76 
85 
87 
88  return StatusCode::SUCCESS;
89  }
90 
92  OrthogonalSeedingTool::createSeeds(const EventContext& /*ctx*/,
93  const Acts::SpacePointContainer<ActsTrk::SpacePointCollector, Acts::detail::RefHolder>& spContainer,
94  const Acts::Vector3& beamSpotPos,
95  const Acts::Vector3& bField,
96  ActsTrk::SeedContainer& seedContainer ) const
97  {
98  // Seed Finder Options
99  Acts::SeedFinderOptions finderOpts;
100  finderOpts.beamPos = Acts::Vector2(beamSpotPos[Amg::x],
101  beamSpotPos[Amg::y]);
102  finderOpts.bFieldInZ = bField[2];
103  finderOpts = finderOpts.toInternalUnits().calculateDerivedQuantities(m_finderCfg);
104 
105  // Compute seeds
106  auto groupSeeds = m_finder.createSeeds(finderOpts, spContainer);
107 
108  // Store seeds
109  seedContainer.reserve(groupSeeds.size());
110  for(const auto& seed: groupSeeds) {
111  const auto [bottom, middle, top] = seed.sp();
112 
113  std::unique_ptr< ActsTrk::Seed > toAdd =
114  std::make_unique< ActsTrk::Seed >(bottom->externalSpacePoint(),
115  middle->externalSpacePoint(),
116  top->externalSpacePoint());
117  toAdd->setVertexZ(seed.z());
118  toAdd->setQuality(seed.seedQuality());
119  seedContainer.push_back(std::move(toAdd));
120  }
121 
122  return StatusCode::SUCCESS;
123  }
124 
125  StatusCode
127  {
128  // Configuration for Acts::SeedFilter
129  Acts::SeedFilterConfig filterCfg;
130  filterCfg.deltaInvHelixDiameter = m_deltaInvHelixDiameter;
131  filterCfg.impactWeightFactor = m_impactWeightFactor;
132  filterCfg.zOriginWeightFactor = m_zOriginWeightFactor;
133  filterCfg.compatSeedWeight = m_compatSeedWeight;
134  filterCfg.deltaRMin = m_deltaRMin;
135  filterCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
136  filterCfg.compatSeedLimit = m_compatSeedLimit;
137  filterCfg.seedWeightIncrement = m_seedWeightIncrement;
138  filterCfg.numSeedIncrement = m_numSeedIncrement;
139  filterCfg.seedConfirmation = m_seedConfirmationInFilter;
140  filterCfg.maxSeedsPerSpMConf = m_maxSeedsPerSpMConf;
141  filterCfg.maxQualitySeedsPerSpMConf = m_maxQualitySeedsPerSpMConf;
142  filterCfg.useDeltaRorTopRadius = m_useDeltaRorTopRadius;
143  filterCfg.centralSeedConfirmationRange.zMinSeedConf = m_seedConfCentralZMin;
144  filterCfg.centralSeedConfirmationRange.zMaxSeedConf = m_seedConfCentralZMax;
145  filterCfg.centralSeedConfirmationRange.rMaxSeedConf = m_seedConfCentralRMax;
146  filterCfg.centralSeedConfirmationRange.nTopForLargeR = m_seedConfCentralNTopLargeR;
147  filterCfg.centralSeedConfirmationRange.nTopForSmallR = m_seedConfCentralNTopSmallR;
148  filterCfg.centralSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfCentralMinBottomRadius;
149  filterCfg.centralSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfCentralMaxZOrigin;
150  filterCfg.centralSeedConfirmationRange.minImpactSeedConf = m_seedConfCentralMinImpact;
151  filterCfg.forwardSeedConfirmationRange.zMinSeedConf = m_seedConfForwardZMin;
152  filterCfg.forwardSeedConfirmationRange.zMaxSeedConf = m_seedConfForwardZMax;
153  filterCfg.forwardSeedConfirmationRange.rMaxSeedConf = m_seedConfForwardRMax;
154  filterCfg.forwardSeedConfirmationRange.nTopForLargeR = m_seedConfForwardNTopLargeR;
155  filterCfg.forwardSeedConfirmationRange.nTopForSmallR = m_seedConfForwardNTopSmallR;
156  filterCfg.forwardSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfForwardMinBottomRadius;
157  filterCfg.forwardSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfForwardMaxZOrigin;
158  filterCfg.forwardSeedConfirmationRange.minImpactSeedConf = m_seedConfForwardMinImpact;
159 
160  // Configuration Acts::SeedFinderOrthogonal
161  m_finderCfg.seedFilter = std::make_shared<Acts::SeedFilter<value_type>>(filterCfg.toInternalUnits());
162  m_finderCfg.cotThetaMax = m_cotThetaMax;
163  m_finderCfg.deltaRMinTopSP = m_deltaRMinTopSP;
164  m_finderCfg.deltaRMaxTopSP = m_deltaRMaxTopSP;
165  m_finderCfg.deltaRMinBottomSP = m_deltaRMinBottomSP;
166  m_finderCfg.deltaRMaxBottomSP = m_deltaRMaxBottomSP;
167  m_finderCfg.impactMax = m_impactMax;
168  m_finderCfg.sigmaScattering = m_sigmaScattering;
169  m_finderCfg.maxPtScattering = m_maxPtScattering;
170  m_finderCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
171  m_finderCfg.collisionRegionMin = m_collisionRegionMin;
172  m_finderCfg.collisionRegionMax = m_collisionRegionMax;
173  m_finderCfg.phiMin = m_phiMin;
174  m_finderCfg.phiMax = m_phiMax;
175  m_finderCfg.zMin = m_zMin;
176  m_finderCfg.zMax = m_zMax;
177  m_finderCfg.rMax = m_rMax;
178  m_finderCfg.rMin = m_rMin;
179  m_finderCfg.rMinMiddle = m_rMinMiddle;
180  m_finderCfg.rMaxMiddle = m_rMaxMiddle;
181  m_finderCfg.deltaPhiMax = m_deltaPhiMax;
182  m_finderCfg.deltaZMax = m_deltaZMax;
183  m_finderCfg.interactionPointCut = m_interactionPointCut;
184  m_finderCfg.seedConfirmation = m_seedConfirmation;
185  m_finderCfg.centralSeedConfirmationRange = filterCfg.centralSeedConfirmationRange;
186  m_finderCfg.forwardSeedConfirmationRange = filterCfg.forwardSeedConfirmationRange;
187  m_finderCfg.radLengthPerSeed = m_radLengthPerSeed;
188 
189  // Fast tracking
190  // manually convert the two types
191  for (const auto& vec : m_rRangeMiddleSP) {
192  std::vector<float> convertedVec;
193 
194  for (const auto& val : vec) {
195  convertedVec.push_back(static_cast<float>(val));
196  }
197 
198  m_finderCfg.rRangeMiddleSP.push_back(convertedVec);
199  }
200  // define cuts used for fast tracking configuration
201  if (m_useExperimentCuts) {
202  m_finderCfg.experimentCuts.connect(
203  [](const void*, float bottomRadius, float cotTheta) -> bool {
204 
205  float fastTrackingRMin = 50.;
206  float fastTrackingCotThetaMax = 1.5;
207 
208  if (bottomRadius < fastTrackingRMin and
209  (cotTheta > fastTrackingCotThetaMax or
210  cotTheta < -fastTrackingCotThetaMax)) {
211  return false;
212  }
213  return true;
214  });
215  }
216 
217  m_finderCfg = m_finderCfg.toInternalUnits();
218 
219  m_finder = Acts::SeedFinderOrthogonal<value_type>(m_finderCfg);
220 
221  return StatusCode::SUCCESS;
222  }
223 
224 } // namespace ActsTrk
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ActsTrk::OrthogonalSeedingTool::m_rMaxMiddle
Gaudi::Property< float > m_rMaxMiddle
Definition: OrthogonalSeedingTool.h:100
ActsTrk::OrthogonalSeedingTool::m_zMin
Gaudi::Property< float > m_zMin
Definition: OrthogonalSeedingTool.h:94
ActsTrk::OrthogonalSeedingTool::prepareConfiguration
StatusCode prepareConfiguration()
Definition: OrthogonalSeedingTool.cxx:126
ActsTrk::OrthogonalSeedingTool::m_radLengthPerSeed
Gaudi::Property< float > m_radLengthPerSeed
Definition: OrthogonalSeedingTool.h:113
ActsTrk::OrthogonalSeedingTool::m_maxSeedsPerSpMConf
Gaudi::Property< int > m_maxSeedsPerSpMConf
Definition: OrthogonalSeedingTool.h:136
ActsTrk::OrthogonalSeedingTool::m_rMinMiddle
Gaudi::Property< float > m_rMinMiddle
Definition: OrthogonalSeedingTool.h:99
ActsTrk::OrthogonalSeedingTool::m_impactWeightFactor
Gaudi::Property< float > m_impactWeightFactor
Definition: OrthogonalSeedingTool.h:119
ActsTrk::OrthogonalSeedingTool::m_seedWeightIncrement
Gaudi::Property< float > m_seedWeightIncrement
Definition: OrthogonalSeedingTool.h:130
ActsTrk::OrthogonalSeedingTool::m_finder
Acts::SeedFinderOrthogonal< value_type > m_finder
Definition: OrthogonalSeedingTool.h:57
ActsTrk::OrthogonalSeedingTool::m_compatSeedLimit
Gaudi::Property< std::size_t > m_compatSeedLimit
Definition: OrthogonalSeedingTool.h:127
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMaxZOrigin
Gaudi::Property< float > m_seedConfCentralMaxZOrigin
Definition: OrthogonalSeedingTool.h:157
ActsTrk::OrthogonalSeedingTool::m_deltaRMinBottomSP
Gaudi::Property< float > m_deltaRMinBottomSP
Definition: OrthogonalSeedingTool.h:70
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMinImpact
Gaudi::Property< float > m_seedConfForwardMinImpact
Definition: OrthogonalSeedingTool.h:176
ActsTrk::OrthogonalSeedingTool::m_interactionPointCut
Gaudi::Property< bool > m_interactionPointCut
Definition: OrthogonalSeedingTool.h:107
ActsTrk::OrthogonalSeedingTool::m_deltaRMin
Gaudi::Property< float > m_deltaRMin
Definition: OrthogonalSeedingTool.h:125
ActsTrk::OrthogonalSeedingTool::m_maxPtScattering
Gaudi::Property< float > m_maxPtScattering
Definition: OrthogonalSeedingTool.h:80
ActsTrk::OrthogonalSeedingTool::m_minPt
Gaudi::Property< float > m_minPt
Definition: OrthogonalSeedingTool.h:62
ActsTrk::OrthogonalSeedingTool::initialize
virtual StatusCode initialize() override
Definition: OrthogonalSeedingTool.cxx:15
ActsTrk::OrthogonalSeedingTool::m_deltaInvHelixDiameter
Gaudi::Property< float > m_deltaInvHelixDiameter
Definition: OrthogonalSeedingTool.h:117
ActsTrk::OrthogonalSeedingTool::m_useDeltaRorTopRadius
Gaudi::Property< bool > m_useDeltaRorTopRadius
Definition: OrthogonalSeedingTool.h:141
Amg::y
@ y
Definition: GeoPrimitives.h:35
ActsTrk::OrthogonalSeedingTool::m_rMax
Gaudi::Property< float > m_rMax
Definition: OrthogonalSeedingTool.h:96
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
ActsTrk::OrthogonalSeedingTool::m_phiMax
Gaudi::Property< float > m_phiMax
Definition: OrthogonalSeedingTool.h:92
ActsTrk::OrthogonalSeedingTool::m_collisionRegionMin
Gaudi::Property< float > m_collisionRegionMin
Definition: OrthogonalSeedingTool.h:89
ActsTrk::OrthogonalSeedingTool::m_maxSeedsPerSpM
Gaudi::Property< unsigned int > m_maxSeedsPerSpM
Definition: OrthogonalSeedingTool.h:83
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardZMin
Gaudi::Property< float > m_seedConfForwardZMin
Definition: OrthogonalSeedingTool.h:162
ActsTrk::OrthogonalSeedingTool::createSeeds
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
Definition: OrthogonalSeedingTool.cxx:92
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralZMin
Gaudi::Property< float > m_seedConfCentralZMin
Definition: OrthogonalSeedingTool.h:145
ActsTrk::OrthogonalSeedingTool::m_rMin
Gaudi::Property< float > m_rMin
Definition: OrthogonalSeedingTool.h:97
ActsTrk::OrthogonalSeedingTool::m_zMax
Gaudi::Property< float > m_zMax
Definition: OrthogonalSeedingTool.h:95
ActsTrk::OrthogonalSeedingTool::m_deltaRMinTopSP
Gaudi::Property< float > m_deltaRMinTopSP
Definition: OrthogonalSeedingTool.h:66
ActsTrk::OrthogonalSeedingTool::m_numSeedIncrement
Gaudi::Property< float > m_numSeedIncrement
Definition: OrthogonalSeedingTool.h:131
ActsTrk::OrthogonalSeedingTool::m_phiMin
Gaudi::Property< float > m_phiMin
Definition: OrthogonalSeedingTool.h:91
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMinBottomRadius
Gaudi::Property< float > m_seedConfCentralMinBottomRadius
Definition: OrthogonalSeedingTool.h:155
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralNTopLargeR
Gaudi::Property< size_t > m_seedConfCentralNTopLargeR
Definition: OrthogonalSeedingTool.h:151
ActsTrk::OrthogonalSeedingTool::m_collisionRegionMax
Gaudi::Property< float > m_collisionRegionMax
Definition: OrthogonalSeedingTool.h:90
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::x
@ x
Definition: GeoPrimitives.h:34
OrthogonalSeedingTool.h
ActsTrk::OrthogonalSeedingTool::m_deltaRMaxTopSP
Gaudi::Property< float > m_deltaRMaxTopSP
Definition: OrthogonalSeedingTool.h:68
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsTrk::OrthogonalSeedingTool::m_seedConfirmation
Gaudi::Property< bool > m_seedConfirmation
Definition: OrthogonalSeedingTool.h:110
ActsTrk::OrthogonalSeedingTool::m_finderCfg
Acts::SeedFinderOrthogonalConfig< value_type > m_finderCfg
Definition: OrthogonalSeedingTool.h:58
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralZMax
Gaudi::Property< float > m_seedConfCentralZMax
Definition: OrthogonalSeedingTool.h:147
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardRMax
Gaudi::Property< float > m_seedConfForwardRMax
Definition: OrthogonalSeedingTool.h:166
ActsTrk::OrthogonalSeedingTool::m_deltaRMaxBottomSP
Gaudi::Property< float > m_deltaRMaxBottomSP
Definition: OrthogonalSeedingTool.h:72
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMaxZOrigin
Gaudi::Property< float > m_seedConfForwardMaxZOrigin
Definition: OrthogonalSeedingTool.h:174
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMinBottomRadius
Gaudi::Property< float > m_seedConfForwardMinBottomRadius
Definition: OrthogonalSeedingTool.h:172
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMinImpact
Gaudi::Property< float > m_seedConfCentralMinImpact
Definition: OrthogonalSeedingTool.h:159
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardZMax
Gaudi::Property< float > m_seedConfForwardZMax
Definition: OrthogonalSeedingTool.h:164
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralNTopSmallR
Gaudi::Property< size_t > m_seedConfCentralNTopSmallR
Definition: OrthogonalSeedingTool.h:153
ActsTrk::OrthogonalSeedingTool::m_compatSeedWeight
Gaudi::Property< float > m_compatSeedWeight
Definition: OrthogonalSeedingTool.h:123
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralRMax
Gaudi::Property< float > m_seedConfCentralRMax
Definition: OrthogonalSeedingTool.h:149
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ActsTrk::OrthogonalSeedingTool::m_rRangeMiddleSP
Gaudi::Property< std::vector< std::vector< double > > > m_rRangeMiddleSP
Definition: OrthogonalSeedingTool.h:182
ActsTrk::OrthogonalSeedingTool::OrthogonalSeedingTool
OrthogonalSeedingTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: OrthogonalSeedingTool.cxx:9
ActsTrk::OrthogonalSeedingTool::m_maxQualitySeedsPerSpMConf
Gaudi::Property< int > m_maxQualitySeedsPerSpMConf
Definition: OrthogonalSeedingTool.h:138
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TRT::Track::cotTheta
@ cotTheta
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:65
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
top
@ top
Definition: TruthClasses.h:64
ActsTrk::OrthogonalSeedingTool::m_impactMax
Gaudi::Property< float > m_impactMax
Definition: OrthogonalSeedingTool.h:75
ActsTrk::OrthogonalSeedingTool::m_useExperimentCuts
Gaudi::Property< bool > m_useExperimentCuts
Definition: OrthogonalSeedingTool.h:180
ActsTrk::OrthogonalSeedingTool::m_zOriginWeightFactor
Gaudi::Property< float > m_zOriginWeightFactor
Definition: OrthogonalSeedingTool.h:121
ActsTrk::OrthogonalSeedingTool::m_sigmaScattering
Gaudi::Property< float > m_sigmaScattering
Definition: OrthogonalSeedingTool.h:78
ActsTrk::OrthogonalSeedingTool::m_cotThetaMax
Gaudi::Property< float > m_cotThetaMax
Definition: OrthogonalSeedingTool.h:64
ActsTrk::OrthogonalSeedingTool::m_deltaZMax
Gaudi::Property< float > m_deltaZMax
Definition: OrthogonalSeedingTool.h:104
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardNTopSmallR
Gaudi::Property< size_t > m_seedConfForwardNTopSmallR
Definition: OrthogonalSeedingTool.h:170
ActsTrk::OrthogonalSeedingTool::m_deltaPhiMax
Gaudi::Property< float > m_deltaPhiMax
Definition: OrthogonalSeedingTool.h:102
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardNTopLargeR
Gaudi::Property< size_t > m_seedConfForwardNTopLargeR
Definition: OrthogonalSeedingTool.h:168
ActsTrk::OrthogonalSeedingTool::m_seedConfirmationInFilter
Gaudi::Property< bool > m_seedConfirmationInFilter
Definition: OrthogonalSeedingTool.h:133