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 
86  // Make the logger And Propagate to ACTS routines
87  m_logger = makeActsAthenaLogger(this, "Acts");
88 
90 
91  return StatusCode::SUCCESS;
92  }
93 
95  OrthogonalSeedingTool::createSeeds(const EventContext& /*ctx*/,
96  const Acts::SpacePointContainer<ActsTrk::SpacePointCollector, Acts::detail::RefHolder>& spContainer,
97  const Acts::Vector3& beamSpotPos,
98  const Acts::Vector3& bField,
99  ActsTrk::SeedContainer& seedContainer ) const
100  {
101  // Seed Finder Options
102  Acts::SeedFinderOptions finderOpts;
103  finderOpts.beamPos = Acts::Vector2(beamSpotPos[Amg::x],
104  beamSpotPos[Amg::y]);
105  finderOpts.bFieldInZ = bField[2];
106  finderOpts = finderOpts.toInternalUnits().calculateDerivedQuantities(m_finderCfg);
107 
108  // Compute seeds
109  auto groupSeeds = m_finder.createSeeds(finderOpts, spContainer);
110 
111  // Store seeds
112  seedContainer.reserve(groupSeeds.size());
113  for(const auto& seed: groupSeeds) {
114  const auto [bottom, middle, top] = seed.sp();
115 
116  std::unique_ptr< ActsTrk::Seed > toAdd =
117  std::make_unique< ActsTrk::Seed >(bottom->externalSpacePoint(),
118  middle->externalSpacePoint(),
119  top->externalSpacePoint());
120  toAdd->setVertexZ(seed.z());
121  toAdd->setQuality(seed.seedQuality());
122  seedContainer.push_back(std::move(toAdd));
123  }
124 
125  return StatusCode::SUCCESS;
126  }
127 
128  StatusCode
130  {
131  // Configuration for Acts::SeedFilter
132  Acts::SeedFilterConfig filterCfg;
133  filterCfg.deltaInvHelixDiameter = m_deltaInvHelixDiameter;
134  filterCfg.impactWeightFactor = m_impactWeightFactor;
135  filterCfg.zOriginWeightFactor = m_zOriginWeightFactor;
136  filterCfg.compatSeedWeight = m_compatSeedWeight;
137  filterCfg.deltaRMin = m_deltaRMin;
138  filterCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
139  filterCfg.compatSeedLimit = m_compatSeedLimit;
140  filterCfg.seedWeightIncrement = m_seedWeightIncrement;
141  filterCfg.numSeedIncrement = m_numSeedIncrement;
142  filterCfg.seedConfirmation = m_seedConfirmationInFilter;
143  filterCfg.maxSeedsPerSpMConf = m_maxSeedsPerSpMConf;
144  filterCfg.maxQualitySeedsPerSpMConf = m_maxQualitySeedsPerSpMConf;
145  filterCfg.useDeltaRorTopRadius = m_useDeltaRorTopRadius;
146  filterCfg.centralSeedConfirmationRange.zMinSeedConf = m_seedConfCentralZMin;
147  filterCfg.centralSeedConfirmationRange.zMaxSeedConf = m_seedConfCentralZMax;
148  filterCfg.centralSeedConfirmationRange.rMaxSeedConf = m_seedConfCentralRMax;
149  filterCfg.centralSeedConfirmationRange.nTopForLargeR = m_seedConfCentralNTopLargeR;
150  filterCfg.centralSeedConfirmationRange.nTopForSmallR = m_seedConfCentralNTopSmallR;
151  filterCfg.centralSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfCentralMinBottomRadius;
152  filterCfg.centralSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfCentralMaxZOrigin;
153  filterCfg.centralSeedConfirmationRange.minImpactSeedConf = m_seedConfCentralMinImpact;
154  filterCfg.forwardSeedConfirmationRange.zMinSeedConf = m_seedConfForwardZMin;
155  filterCfg.forwardSeedConfirmationRange.zMaxSeedConf = m_seedConfForwardZMax;
156  filterCfg.forwardSeedConfirmationRange.rMaxSeedConf = m_seedConfForwardRMax;
157  filterCfg.forwardSeedConfirmationRange.nTopForLargeR = m_seedConfForwardNTopLargeR;
158  filterCfg.forwardSeedConfirmationRange.nTopForSmallR = m_seedConfForwardNTopSmallR;
159  filterCfg.forwardSeedConfirmationRange.seedConfMinBottomRadius = m_seedConfForwardMinBottomRadius;
160  filterCfg.forwardSeedConfirmationRange.seedConfMaxZOrigin = m_seedConfForwardMaxZOrigin;
161  filterCfg.forwardSeedConfirmationRange.minImpactSeedConf = m_seedConfForwardMinImpact;
162 
163  // Configuration Acts::SeedFinderOrthogonal
164  m_finderCfg.seedFilter = std::make_shared<Acts::SeedFilter<value_type>>(filterCfg.toInternalUnits(), logger().cloneWithSuffix("Filter"));
165  m_finderCfg.cotThetaMax = m_cotThetaMax;
166  m_finderCfg.deltaRMinTopSP = m_deltaRMinTopSP;
167  m_finderCfg.deltaRMaxTopSP = m_deltaRMaxTopSP;
168  m_finderCfg.deltaRMinBottomSP = m_deltaRMinBottomSP;
169  m_finderCfg.deltaRMaxBottomSP = m_deltaRMaxBottomSP;
170  m_finderCfg.impactMax = m_impactMax;
171  m_finderCfg.sigmaScattering = m_sigmaScattering;
172  m_finderCfg.maxPtScattering = m_maxPtScattering;
173  m_finderCfg.maxSeedsPerSpM = m_maxSeedsPerSpM;
174  m_finderCfg.collisionRegionMin = m_collisionRegionMin;
175  m_finderCfg.collisionRegionMax = m_collisionRegionMax;
176  m_finderCfg.phiMin = m_phiMin;
177  m_finderCfg.phiMax = m_phiMax;
178  m_finderCfg.zMin = m_zMin;
179  m_finderCfg.zMax = m_zMax;
180  m_finderCfg.rMax = m_rMax;
181  m_finderCfg.rMin = m_rMin;
182  m_finderCfg.rMinMiddle = m_rMinMiddle;
183  m_finderCfg.rMaxMiddle = m_rMaxMiddle;
184  m_finderCfg.deltaPhiMax = m_deltaPhiMax;
185  m_finderCfg.deltaZMax = m_deltaZMax;
186  m_finderCfg.interactionPointCut = m_interactionPointCut;
187  m_finderCfg.seedConfirmation = m_seedConfirmation;
188  m_finderCfg.centralSeedConfirmationRange = filterCfg.centralSeedConfirmationRange;
189  m_finderCfg.forwardSeedConfirmationRange = filterCfg.forwardSeedConfirmationRange;
190  m_finderCfg.radLengthPerSeed = m_radLengthPerSeed;
191 
192  // Fast tracking
193  // manually convert the two types
194  for (const auto& vec : m_rRangeMiddleSP) {
195  std::vector<float> convertedVec;
196 
197  for (const auto& val : vec) {
198  convertedVec.push_back(static_cast<float>(val));
199  }
200 
201  m_finderCfg.rRangeMiddleSP.push_back(convertedVec);
202  }
203  // define cuts used for fast tracking configuration
204  if (m_useExperimentCuts) {
205  m_finderCfg.experimentCuts.connect(
206  [](const void*, float bottomRadius, float cotTheta) -> bool {
207 
208  float fastTrackingRMin = 50.;
209  float fastTrackingCotThetaMax = 1.5;
210 
211  if (bottomRadius < fastTrackingRMin and
212  (cotTheta > fastTrackingCotThetaMax or
213  cotTheta < -fastTrackingCotThetaMax)) {
214  return false;
215  }
216  return true;
217  });
218  }
219 
220  m_finderCfg = m_finderCfg.toInternalUnits();
221 
222  m_finder = Acts::SeedFinderOrthogonal<value_type>(m_finderCfg, logger().cloneWithSuffix("Finder"));
223 
224  return StatusCode::SUCCESS;
225  }
226 
227 } // 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:101
ActsTrk::OrthogonalSeedingTool::m_zMin
Gaudi::Property< float > m_zMin
Definition: OrthogonalSeedingTool.h:95
ActsTrk::OrthogonalSeedingTool::prepareConfiguration
StatusCode prepareConfiguration()
Definition: OrthogonalSeedingTool.cxx:129
ActsTrk::OrthogonalSeedingTool::m_radLengthPerSeed
Gaudi::Property< float > m_radLengthPerSeed
Definition: OrthogonalSeedingTool.h:114
ActsTrk::OrthogonalSeedingTool::m_maxSeedsPerSpMConf
Gaudi::Property< int > m_maxSeedsPerSpMConf
Definition: OrthogonalSeedingTool.h:137
ActsTrk::OrthogonalSeedingTool::m_rMinMiddle
Gaudi::Property< float > m_rMinMiddle
Definition: OrthogonalSeedingTool.h:100
ActsTrk::OrthogonalSeedingTool::m_impactWeightFactor
Gaudi::Property< float > m_impactWeightFactor
Definition: OrthogonalSeedingTool.h:120
ActsTrk::OrthogonalSeedingTool::m_seedWeightIncrement
Gaudi::Property< float > m_seedWeightIncrement
Definition: OrthogonalSeedingTool.h:131
ActsTrk::OrthogonalSeedingTool::m_finder
Acts::SeedFinderOrthogonal< value_type > m_finder
Definition: OrthogonalSeedingTool.h:58
ActsTrk::OrthogonalSeedingTool::m_compatSeedLimit
Gaudi::Property< std::size_t > m_compatSeedLimit
Definition: OrthogonalSeedingTool.h:128
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMaxZOrigin
Gaudi::Property< float > m_seedConfCentralMaxZOrigin
Definition: OrthogonalSeedingTool.h:158
ActsTrk::OrthogonalSeedingTool::m_deltaRMinBottomSP
Gaudi::Property< float > m_deltaRMinBottomSP
Definition: OrthogonalSeedingTool.h:71
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMinImpact
Gaudi::Property< float > m_seedConfForwardMinImpact
Definition: OrthogonalSeedingTool.h:177
ActsTrk::OrthogonalSeedingTool::m_interactionPointCut
Gaudi::Property< bool > m_interactionPointCut
Definition: OrthogonalSeedingTool.h:108
ActsTrk::OrthogonalSeedingTool::m_deltaRMin
Gaudi::Property< float > m_deltaRMin
Definition: OrthogonalSeedingTool.h:126
ActsTrk::OrthogonalSeedingTool::m_maxPtScattering
Gaudi::Property< float > m_maxPtScattering
Definition: OrthogonalSeedingTool.h:81
ActsTrk::OrthogonalSeedingTool::m_minPt
Gaudi::Property< float > m_minPt
Definition: OrthogonalSeedingTool.h:63
ActsTrk::OrthogonalSeedingTool::initialize
virtual StatusCode initialize() override
Definition: OrthogonalSeedingTool.cxx:15
ActsTrk::OrthogonalSeedingTool::m_deltaInvHelixDiameter
Gaudi::Property< float > m_deltaInvHelixDiameter
Definition: OrthogonalSeedingTool.h:118
ActsTrk::OrthogonalSeedingTool::m_useDeltaRorTopRadius
Gaudi::Property< bool > m_useDeltaRorTopRadius
Definition: OrthogonalSeedingTool.h:142
Amg::y
@ y
Definition: GeoPrimitives.h:35
ActsTrk::OrthogonalSeedingTool::m_rMax
Gaudi::Property< float > m_rMax
Definition: OrthogonalSeedingTool.h:97
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
ActsTrk::OrthogonalSeedingTool::m_phiMax
Gaudi::Property< float > m_phiMax
Definition: OrthogonalSeedingTool.h:93
ActsTrk::OrthogonalSeedingTool::m_collisionRegionMin
Gaudi::Property< float > m_collisionRegionMin
Definition: OrthogonalSeedingTool.h:90
ActsTrk::OrthogonalSeedingTool::m_maxSeedsPerSpM
Gaudi::Property< unsigned int > m_maxSeedsPerSpM
Definition: OrthogonalSeedingTool.h:84
ActsTrk::OrthogonalSeedingTool::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: OrthogonalSeedingTool.h:190
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardZMin
Gaudi::Property< float > m_seedConfForwardZMin
Definition: OrthogonalSeedingTool.h:163
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:95
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralZMin
Gaudi::Property< float > m_seedConfCentralZMin
Definition: OrthogonalSeedingTool.h:146
ActsTrk::OrthogonalSeedingTool::m_rMin
Gaudi::Property< float > m_rMin
Definition: OrthogonalSeedingTool.h:98
makeActsAthenaLogger
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition: Tracking/Acts/ActsInterop/src/Logger.cxx:64
ActsTrk::OrthogonalSeedingTool::m_zMax
Gaudi::Property< float > m_zMax
Definition: OrthogonalSeedingTool.h:96
ActsTrk::OrthogonalSeedingTool::m_deltaRMinTopSP
Gaudi::Property< float > m_deltaRMinTopSP
Definition: OrthogonalSeedingTool.h:67
ActsTrk::OrthogonalSeedingTool::m_numSeedIncrement
Gaudi::Property< float > m_numSeedIncrement
Definition: OrthogonalSeedingTool.h:132
ActsTrk::OrthogonalSeedingTool::m_phiMin
Gaudi::Property< float > m_phiMin
Definition: OrthogonalSeedingTool.h:92
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMinBottomRadius
Gaudi::Property< float > m_seedConfCentralMinBottomRadius
Definition: OrthogonalSeedingTool.h:156
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralNTopLargeR
Gaudi::Property< size_t > m_seedConfCentralNTopLargeR
Definition: OrthogonalSeedingTool.h:152
ActsTrk::OrthogonalSeedingTool::m_collisionRegionMax
Gaudi::Property< float > m_collisionRegionMax
Definition: OrthogonalSeedingTool.h:91
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:69
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsTrk::OrthogonalSeedingTool::m_seedConfirmation
Gaudi::Property< bool > m_seedConfirmation
Definition: OrthogonalSeedingTool.h:111
ActsTrk::OrthogonalSeedingTool::m_finderCfg
Acts::SeedFinderOrthogonalConfig< value_type > m_finderCfg
Definition: OrthogonalSeedingTool.h:59
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralZMax
Gaudi::Property< float > m_seedConfCentralZMax
Definition: OrthogonalSeedingTool.h:148
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardRMax
Gaudi::Property< float > m_seedConfForwardRMax
Definition: OrthogonalSeedingTool.h:167
ActsTrk::OrthogonalSeedingTool::m_deltaRMaxBottomSP
Gaudi::Property< float > m_deltaRMaxBottomSP
Definition: OrthogonalSeedingTool.h:73
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMaxZOrigin
Gaudi::Property< float > m_seedConfForwardMaxZOrigin
Definition: OrthogonalSeedingTool.h:175
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardMinBottomRadius
Gaudi::Property< float > m_seedConfForwardMinBottomRadius
Definition: OrthogonalSeedingTool.h:173
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralMinImpact
Gaudi::Property< float > m_seedConfCentralMinImpact
Definition: OrthogonalSeedingTool.h:160
DeMoUpdate.toAdd
bool toAdd
Definition: DeMoUpdate.py:1304
ActsTrk::OrthogonalSeedingTool::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: OrthogonalSeedingTool.h:188
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardZMax
Gaudi::Property< float > m_seedConfForwardZMax
Definition: OrthogonalSeedingTool.h:165
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralNTopSmallR
Gaudi::Property< size_t > m_seedConfCentralNTopSmallR
Definition: OrthogonalSeedingTool.h:154
ActsTrk::OrthogonalSeedingTool::m_compatSeedWeight
Gaudi::Property< float > m_compatSeedWeight
Definition: OrthogonalSeedingTool.h:124
ActsTrk::OrthogonalSeedingTool::m_seedConfCentralRMax
Gaudi::Property< float > m_seedConfCentralRMax
Definition: OrthogonalSeedingTool.h:150
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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:183
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:139
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:54
top
@ top
Definition: TruthClasses.h:64
ActsTrk::OrthogonalSeedingTool::m_impactMax
Gaudi::Property< float > m_impactMax
Definition: OrthogonalSeedingTool.h:76
ActsTrk::OrthogonalSeedingTool::m_useExperimentCuts
Gaudi::Property< bool > m_useExperimentCuts
Definition: OrthogonalSeedingTool.h:181
ActsTrk::OrthogonalSeedingTool::m_zOriginWeightFactor
Gaudi::Property< float > m_zOriginWeightFactor
Definition: OrthogonalSeedingTool.h:122
ActsTrk::OrthogonalSeedingTool::m_sigmaScattering
Gaudi::Property< float > m_sigmaScattering
Definition: OrthogonalSeedingTool.h:79
ActsTrk::OrthogonalSeedingTool::m_cotThetaMax
Gaudi::Property< float > m_cotThetaMax
Definition: OrthogonalSeedingTool.h:65
ActsTrk::OrthogonalSeedingTool::m_deltaZMax
Gaudi::Property< float > m_deltaZMax
Definition: OrthogonalSeedingTool.h:105
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardNTopSmallR
Gaudi::Property< size_t > m_seedConfForwardNTopSmallR
Definition: OrthogonalSeedingTool.h:171
ActsTrk::OrthogonalSeedingTool::m_deltaPhiMax
Gaudi::Property< float > m_deltaPhiMax
Definition: OrthogonalSeedingTool.h:103
ActsTrk::OrthogonalSeedingTool::m_seedConfForwardNTopLargeR
Gaudi::Property< size_t > m_seedConfForwardNTopLargeR
Definition: OrthogonalSeedingTool.h:169
ActsTrk::OrthogonalSeedingTool::m_seedConfirmationInFilter
Gaudi::Property< bool > m_seedConfirmationInFilter
Definition: OrthogonalSeedingTool.h:134