ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::ExtrapolationTool Class Reference

#include <ExtrapolationTool.h>

Inheritance diagram for ActsTrk::ExtrapolationTool:
Collaboration diagram for ActsTrk::ExtrapolationTool:

Public Member Functions

virtual StatusCode initialize () override
 ExtrapolationTool (const std::string &type, const std::string &name, const IInterface *parent)
 Explicitly define the constrcutor due to the variant forward declaration.
 ~ExtrapolationTool ()
 Destructor needs to implemented due to the variant.
virtual Acts::Result< PropagationOutput > propagationSteps (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::Direction navDir, const double pathLimit) const override final
 Extrapolate the track parameters until the end of the world and record the performed steps & the allocated material.
virtual Acts::Result< Acts::BoundTrackParameters > propagate (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::Direction navDir, const double pathLimit) const override final
 Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.
virtual Acts::Result< PropagationOutput > propagationSteps (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::Surface &target, const Acts::Direction navDir, const double pathLimit) const override
 Extrapolate the track parameters until the end of the world and record the performed steps & the allocated material.
virtual Acts::Result< Acts::BoundTrackParameters > propagate (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::Surface &target, const Acts::Direction navDir, const double pathLimit) const override
 Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.
virtual Acts::Result< Acts::BoundTrackParameters > propagate (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::TrackingVolume &target, const VolumeAbort stopVolumeFlag, const Acts::Direction navDir, const double pathLimit) const override
 Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.
virtual Acts::Result< BoundParamVec_t > propagateAndRecord (const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const SurfaceRecordOptions &recordOpts) const override
 Propagate the track parameters forward throuht the detector and record the surface crossings along the trajectory.

Private Member Functions

const Acts::Logger & logger () const
template<typename OptionsType>
OptionsType prepareOptions (const Acts::GeometryContext &gctx, const Acts::MagneticFieldContext &mctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir, double pathLimit) const

Private Attributes

std::unique_ptr< const ActsExtrapolationDetail::VariantPropagatorm_varProp
std::unique_ptr< const Acts::Logger > m_logger {nullptr}
ContextUtility m_ctxProvider {this}
 Utility to fetch the geometry, magnetic field and calibration context in the event.
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
Gaudi::Property< std::string > m_fieldMode {this, "FieldMode", "ATLAS", "Either ATLAS or Constant or StraightLine"}
Gaudi::Property< std::vector< double > > m_constantFieldVector {this, "ConstantFieldVector", {0, 0, 0}, "Constant field value to use if FieldMode == Constant"}
Gaudi::Property< double > m_ptLoopers {this, "PtLoopers", 300, "PT loop protection threshold. Will be converted to Acts MeV unit"}
Gaudi::Property< double > m_maxStepSize {this, "MaxStepSize", 10, "Max step size in Acts m unit"}
Gaudi::Property< unsigned > m_maxStep {this, "MaxSteps", 100000, "Max number of steps"}
Gaudi::Property< unsigned > m_maxSurfSkip {this, "MaxSurfaceSkip" ,100, "Maximum number of surfaces to be tried by the navigator"}
Gaudi::Property< double > m_surfTolerance
Gaudi::Property< bool > m_interactionMultiScatering {this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"}
Gaudi::Property< bool > m_interactionEloss {this, "InteractionEloss", false, "Whether to consider energy loss in the interactor"}
Gaudi::Property< bool > m_interactionRecord {this, "InteractionRecord", false, "Whether to record all material interactions"}

Detailed Description

Definition at line 53 of file ExtrapolationTool.h.

Constructor & Destructor Documentation

◆ ExtrapolationTool()

ActsTrk::ExtrapolationTool::ExtrapolationTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Explicitly define the constrcutor due to the variant forward declaration.

Definition at line 155 of file ExtrapolationTool.cxx.

◆ ~ExtrapolationTool()

ActsTrk::ExtrapolationTool::~ExtrapolationTool ( )
default

Destructor needs to implemented due to the variant.

Member Function Documentation

◆ initialize()

StatusCode ActsTrk::ExtrapolationTool::initialize ( )
overridevirtual

Definition at line 163 of file ExtrapolationTool.cxx.

164{
165
166
167 ATH_MSG_INFO("Initializing ACTS extrapolation");
168
170
171 ATH_CHECK( m_trackingGeometrySvc.retrieve() );
172
173 Acts::Navigator::Config navConfig{m_trackingGeometrySvc->trackingGeometry()};
174 Acts::Navigator navigator{std::move(navConfig), logger().clone()};
175
176 ATH_CHECK(m_ctxProvider.initialize());
177 if (m_fieldMode == "ATLAS") {
178 ATH_MSG_INFO("Using ATLAS magnetic field service");
179
180 auto bField = std::make_shared<ATLASMagneticFieldWrapper>();
181
182 CurvedStepper_t stepper{std::move(bField)};
183 CurvedPropagator_t propagator{std::move(stepper), std::move(navigator),
184 logger().clone()};
185 m_varProp = std::make_unique<VariantPropagator>(propagator);
186 }
187 else if (m_fieldMode == "Constant") {
188 if (m_constantFieldVector.value().size() != 3)
189 {
190 ATH_MSG_ERROR("Incorrect field vector size. Using empty field.");
191 return StatusCode::FAILURE;
192 }
193
194 Acts::Vector3 constantFieldVector = Acts::Vector3(m_constantFieldVector[0],
197
198 ATH_MSG_INFO("Using constant magnetic field: (Bx, By, Bz) = "
199 <<Amg::toString(constantFieldVector));
200
201 auto bField = std::make_shared<Acts::ConstantBField>(constantFieldVector);
202 CurvedStepper_t stepper{std::move(bField)};
203 CurvedPropagator_t propagator{std::move(stepper), std::move(navigator), logger().clone()};
204 m_varProp = std::make_unique<VariantPropagator>(propagator);
205 } else if (m_fieldMode == "StraightLine") {
206 Acts::StraightLineStepper stepper{};
207 StraightPropagator_t propagator{stepper, std::move(navigator), logger().clone()};
208 m_varProp = std::make_unique<VariantPropagator>(propagator);
209 } else {
210 ATH_MSG_FATAL("Invalid mode provided "<<m_fieldMode<<". Allowed : \"ATLAS\", \"Constant\", \"StraightLine\".");
211 return StatusCode::FAILURE;
212 }
213
214 ATH_MSG_INFO("ACTS extrapolation successfully initialized");
215 return StatusCode::SUCCESS;
216}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
std::unique_ptr< const Acts::Logger > m_logger
Gaudi::Property< std::vector< double > > m_constantFieldVector
const Acts::Logger & logger() const
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
std::unique_ptr< const ActsExtrapolationDetail::VariantPropagator > m_varProp
Gaudi::Property< std::string > m_fieldMode
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.

◆ logger()

const Acts::Logger & ActsTrk::ExtrapolationTool::logger ( ) const
inlineprivate

Definition at line 106 of file ExtrapolationTool.h.

106{ return *m_logger; }

◆ prepareOptions()

template<typename OptionsType>
OptionsType ActsTrk::ExtrapolationTool::prepareOptions ( const Acts::GeometryContext & gctx,
const Acts::MagneticFieldContext & mctx,
const Acts::BoundTrackParameters & startParameters,
Acts::Direction navDir,
double pathLimit ) const
private

Definition at line 405 of file ExtrapolationTool.cxx.

408 {
409 using namespace Acts::UnitLiterals;
410 OptionsType options(gctx, mfContext);
411
412 options.pathLimit = pathLimit;
413 options.loopProtection
414 = (Acts::VectorHelpers::perp(startParameters.momentum())
415 < m_ptLoopers * 1_MeV);
416 options.maxSteps = m_maxStep;
417 options.direction = navDir;
418 options.stepping.maxStepSize = m_maxStepSize * 1_m;
419 options.maxTargetSkipping = m_maxSurfSkip;
420 options.surfaceTolerance = m_surfTolerance;
421 auto& mInteractor = options.actorList.template get<Acts::MaterialInteractor>();
422 mInteractor.multipleScattering = m_interactionMultiScatering;
423 mInteractor.energyLoss = m_interactionEloss;
424 mInteractor.recordInteractions = m_interactionRecord;
425 return options;
426}
Gaudi::Property< unsigned > m_maxSurfSkip
Gaudi::Property< bool > m_interactionRecord
Gaudi::Property< double > m_ptLoopers
Gaudi::Property< bool > m_interactionMultiScatering
Gaudi::Property< double > m_maxStepSize
Gaudi::Property< double > m_surfTolerance
Gaudi::Property< bool > m_interactionEloss
Gaudi::Property< unsigned > m_maxStep
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132

◆ propagate() [1/3]

Acts::Result< Acts::BoundTrackParameters > ActsTrk::ExtrapolationTool::propagate ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const Acts::Direction navDir,
const double pathLimit ) const
finaloverridevirtual

Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.

If the extrapolation fails, a nullopt is returned

Parameters
ctxEventContext to fetch the alignment & magnetic field from the conditions store
startParametersReference to the bound track parameters encoding the start surface & the associated track parameters on the surface
targetReference to the surface onto which the track shall be extrapolated
navDirRun the propagation along (Foward) or opposite (Backward) to the track parameter's direction
pathLimitMaximum length of the propagated trajectory. The extrapolation is aborted if the limit is exceeded and the surface not yet reached.

Definition at line 277 of file ExtrapolationTool.cxx.

281{
282 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin");
283
284 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
285 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
286
287 auto parameters = std::visit([&](const auto& propagator) -> Acts::Result<Acts::BoundTrackParameters> {
288 using Propagator = std::decay_t<decltype(propagator)>;
289
290 // Action list and abort list
291 using ActorList =
292 Acts::ActorList<Acts::MaterialInteractor, EndOfWorld>;
293 using Options = typename Propagator::template Options<ActorList>;
294
295 Options options = prepareOptions<Options>(tgContext, mfContext, startParameters, navDir, pathLimit);
296
297
298 auto result = propagator.propagate(startParameters, options);
299 if (!result.ok()) {
300 ATH_MSG_DEBUG("Got error during propagation:" << result.error());
301 return result.error();
302 }
303 if (!result.value().endParameters.has_value()) {
304 ATH_MSG_DEBUG("Propagation did not result in valid end parameters.");
305 return Acts::PropagatorError::Failure;
306 }
307 return result.value().endParameters.value();
308 }, *m_varProp);
309
310 return parameters;
311}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
OptionsType prepareOptions(const Acts::GeometryContext &gctx, const Acts::MagneticFieldContext &mctx, const Acts::BoundTrackParameters &startParameters, Acts::Direction navDir, double pathLimit) const

◆ propagate() [2/3]

Acts::Result< Acts::BoundTrackParameters > ActsTrk::ExtrapolationTool::propagate ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const Acts::Surface & target,
const Acts::Direction navDir,
const double pathLimit ) const
overridevirtual

Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.

If the extrapolation fails, a nullopt is returned

Parameters
ctxEventContext to fetch the alignment & magnetic field from the conditions store
startParametersReference to the bound track parameters encoding the start surface & the associated track parameters on the surface
targetReference to the surface onto which the track shall be extrapolated
navDirRun the propagation along (Foward) or opposite (Backward) to the track parameter's direction
pathLimitMaximum length of the propagated trajectory. The extrapolation is aborted if the limit is exceeded and the surface not yet reached.

Definition at line 366 of file ExtrapolationTool.cxx.

370{
371
372 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin");
373
374 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
375 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
376
377 auto parameters = std::visit([&](const auto& propagator) -> Acts::Result<Acts::BoundTrackParameters> {
378 using Propagator = std::decay_t<decltype(propagator)>;
379
380 // Action list and abort list
381 using ActorList =
382 Acts::ActorList<Acts::MaterialInteractor>;
383 using Options = typename Propagator::template Options<ActorList>;
384
385 Options options = prepareOptions<Options>(tgContext, mfContext, startParameters, navDir, pathLimit);
386 auto result = target.type() == Acts::Surface::Perigee ?
387 propagator.template propagate<Options, Acts::ForcedSurfaceReached, Acts::PathLimitReached>(startParameters, target, options) :
388 propagator.template propagate<Options, Acts::SurfaceReached, Acts::PathLimitReached>(startParameters, target, options);
389 if (!result.ok()) {
390 ATH_MSG_DEBUG("Got error during propagation: " << result.error());
391 return result.error();
392 }
393 if (!result.value().endParameters.has_value()) {
394 ATH_MSG_DEBUG("Propagation did not result in valid end parameters.");
395 return Acts::PropagatorError::Failure;
396 }
397 return result.value().endParameters.value();
398 }, *m_varProp);
399
400 return parameters;
401}
if(pathvar)
virtual Acts::Result< Acts::BoundTrackParameters > propagate(const EventContext &ctx, const Acts::BoundTrackParameters &startParameters, const Acts::Direction navDir, const double pathLimit) const override final
Extrapolates the track parameters from a start to a target surface and returns the extrapolated track...
dict template
Definition taskman.py:314

◆ propagate() [3/3]

Acts::Result< Acts::BoundTrackParameters > ActsTrk::ExtrapolationTool::propagate ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const Acts::TrackingVolume & target,
const VolumeAbort stopVolumeFlag,
const Acts::Direction navDir,
const double pathLimit ) const
overridevirtual

Extrapolates the track parameters from a start to a target surface and returns the extrapolated track parameters on that surface.

If the extrapolation fails, a nullopt is returned

Parameters
ctxEventContext to fetch the alignment & magnetic field from the conditions store
startParametersReference to the bound track parameters encoding the start surface & the associated track parameters on the surface
targetReference to the surface onto which the track shall be extrapolated
navDirRun the propagation along (Foward) or opposite (Backward) to the track parameter's direction
pathLimitMaximum length of the propagated trajectory. The extrapolation is aborted if the limit is exceeded and the surface not yet reached.

Execute the propagation

Definition at line 482 of file ExtrapolationTool.cxx.

487 {
488 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
489 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
490
491 return std::visit([&](const auto& propagator) -> Acts::Result<Acts::BoundTrackParameters> {
492 using Propagator = std::decay_t<decltype(propagator)>;
493 using ActorList = Acts::ActorList<Acts::MaterialInteractor, PassedVolumeAborter, EndOfWorld>;
494
495 using Options = typename Propagator::template Options<ActorList>;
496
497 auto propOptions = prepareOptions<Options>(tgContext, mfContext, startParameters,
498 navDir, pathLimit);
499
500 auto& aborter = propOptions.actorList.template get<PassedVolumeAborter>();
501 aborter.targetVolumeId = target.geometryId();
502 aborter.stopVolumeFlag = stopVolumeFlag;
503
505 auto propResult = propagator.propagate(startParameters, propOptions);
506 if (!propResult.ok()) {
507 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Propagation failed.");
508 return Acts::PropagatorError::Failure;
509 }
510 if (!propResult.ok()) {
511 ATH_MSG_DEBUG("Got error during propagation: " << propResult.error());
512 return propResult.error();
513 }
514 if (!propResult.value().endParameters.has_value()) {
515 ATH_MSG_DEBUG("Propagation did not result in valid end parameters.");
516 return Acts::PropagatorError::Failure;
517 }
518 return propResult.value().endParameters.value();
519 }, *m_varProp);
520 }
#define ATH_MSG_WARNING(x)

◆ propagateAndRecord()

Acts::Result< ExtrapolationTool::BoundParamVec_t > ActsTrk::ExtrapolationTool::propagateAndRecord ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const SurfaceRecordOptions & recordOpts ) const
overridevirtual

Propagate the track parameters forward throuht the detector and record the surface crossings along the trajectory.

Parameters
ctxEventContext to access the alignment and the magnetic field
startParametersThe track parameters from which the propagation shall start
recordOptsRecord options specifying the target and also the flags at which surface types the track parameters shall be recorded

Define the volume abort condition. If the propagation leaves the volume or enters the volume

Execute the propagation

Definition at line 429 of file ExtrapolationTool.cxx.

431 {
432
433 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
434 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
435
436 return std::visit([&](const auto& propagator) -> Acts::Result<BoundParamVec_t> {
437 using Propagator = std::decay_t<decltype(propagator)>;
438
439 // Action list and abort list
440 using ParamRecorder_t = Acts::BoundParameterRecorder<Acts::SurfaceSelector>;
441 return std::visit([&](const auto target) -> Acts::Result<BoundParamVec_t> {
442 using Target_t = std::decay_t<decltype(target)>;
443
444 using TargetAborter_t = std::conditional_t<std::is_same_v<Target_t, const Acts::Surface*>,
445 PassedSurfaceAborter, PassedVolumeAborter>;
446
447 using ActorList = Acts::ActorList<ParamRecorder_t, Acts::MaterialInteractor,
448 TargetAborter_t, EndOfWorld>;
449
450 using Options = typename Propagator::template Options<ActorList>;
451
452 auto propOptions = prepareOptions<Options>(tgContext, mfContext, startParameters,
453 recordOpts.navDir, recordOpts.pathLimit);
454
455 auto& surfaceRecorder = propOptions.actorList.template get<ParamRecorder_t>();
456 surfaceRecorder.selector.selectSensitive = recordOpts.recordSensitive;
457 surfaceRecorder.selector.selectMaterial = recordOpts.recordMaterial;
458 surfaceRecorder.selector.selectPassive = recordOpts.recordPassive;
459
460 auto& aborter = propOptions.actorList.template get<TargetAborter_t>();
461 if constexpr(std::is_same_v<Target_t, const Acts::Surface*>) {
462 aborter.targetSurface = target;
463 aborter.surpassedDistance = recordOpts.extraPathLength;
464 } else {
467 aborter.targetVolumeId = target->geometryId();
468 aborter.stopVolumeFlag = recordOpts.stopVolumeFlag;
469 }
471 auto propResult = propagator.propagate(startParameters, propOptions);
472 if (!propResult.ok()) {
473 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Propagation failed.");
474 return Acts::Result<BoundParamVec_t>::failure(std::make_error_code(std::errc::invalid_argument));
475 }
476 auto& result = *propResult;
477 return Acts::Result<BoundParamVec_t>::success(std::move(result.template get<BoundParamVec_t>()));
478 }, recordOpts.target);
479 }, *m_varProp);
480 }

◆ propagationSteps() [1/2]

Acts::Result< ExtrapolationTool::PropagationOutput > ActsTrk::ExtrapolationTool::propagationSteps ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const Acts::Direction navDir,
const double pathLimit ) const
finaloverridevirtual

Extrapolate the track parameters until the end of the world and record the performed steps & the allocated material.

Parameters
ctxEventContext to fetch the alignment & magnetic field from the conditions store
startParametersReference to the bound track parameters encoding the start surface & the associated track parameters on the surface
navDirRun the propagation along (Foward) or opposite (Backward) to the track parameter's direction
pathLimitMaximum length of the propagated trajectory, if not aborted by the end of the world condition otherwise.

Definition at line 220 of file ExtrapolationTool.cxx.

223 {
224
225 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin");
226
227 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
228 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
229
230 PropagationOutput output;
231
232 auto res = std::visit([&](const auto& propagator) -> Acts::Result<ExtrapolationTool::PropagationOutput> {
233 using Propagator = std::decay_t<decltype(propagator)>;
234
235 // Action list and abort list
236 using ActorList =
237 Acts::ActorList<SteppingLogger, Acts::MaterialInteractor, EndOfWorld>;
238 using Options = typename Propagator::template Options<ActorList>;
239
240 Options options = prepareOptions<Options>(tgContext, mfContext, startParameters, navDir, pathLimit);
241
242 auto result = propagator.propagate(startParameters, options);
243 if (!result.ok()) {
244 return result.error();
245 }
246 auto& propRes = *result;
247
248 auto steppingResults = propRes.template get<SteppingLogger::result_type>();
249 auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>();
250 output.first = std::move(steppingResults.steps);
251 output.second = std::move(materialResult);
252 // try to force return value optimization, not sure this is necessary
253 return std::move(output);
254 }, *m_varProp);
255
256 if (!res.ok()) {
257 ATH_MSG_DEBUG("Got error during propagation: "
258 << res.error() << " " << res.error().message()
259 << ". Returning empty step vector.");
260 return res.error();
261 }
262 output = std::move(*res);
263
264 ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps");
265 if(output.first.size() == 0) {
266 ATH_MSG_WARNING("ZERO steps returned by stepper, that is not typically a good sign");
267 }
268
269 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " end");
270
271 return output;
272}
std::pair< std::vector< unsigned int >, bool > res
output
Definition merge.py:16

◆ propagationSteps() [2/2]

Acts::Result< ExtrapolationTool::PropagationOutput > ActsTrk::ExtrapolationTool::propagationSteps ( const EventContext & ctx,
const Acts::BoundTrackParameters & startParameters,
const Acts::Surface & target,
const Acts::Direction navDir,
const double pathLimit ) const
overridevirtual

Extrapolate the track parameters until the end of the world and record the performed steps & the allocated material.

Parameters
ctxEventContext to fetch the alignment & magnetic field from the conditions store
startParametersReference to the bound track parameters encoding the start surface & the associated track parameters on the surface
navDirRun the propagation along (Foward) or opposite (Backward) to the track parameter's direction
pathLimitMaximum length of the propagated trajectory, if not aborted by the end of the world condition otherwise.

Definition at line 314 of file ExtrapolationTool.cxx.

318 {
319 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " begin");
320
321 PropagationOutput output;
322
323 const Acts::MagneticFieldContext mfContext = m_ctxProvider.getMagneticFieldContext(ctx);
324 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
325
326 auto res = std::visit([&](const auto& propagator) -> Acts::Result<PropagationOutput> {
327 using Propagator = std::decay_t<decltype(propagator)>;
328
329 // Action list and abort list
330 using ActorList =
331 Acts::ActorList<SteppingLogger, Acts::MaterialInteractor>;
332 using Options = typename Propagator::template Options<ActorList>;
333
334 Options options = prepareOptions<Options>(tgContext, mfContext, startParameters, navDir, pathLimit);
335 auto result = target.type() == Acts::Surface::Perigee ?
336 propagator.template propagate<Options, Acts::ForcedSurfaceReached, Acts::PathLimitReached>(startParameters, target, options) :
337 propagator.template propagate<Options, Acts::SurfaceReached, Acts::PathLimitReached>(startParameters, target, options);
338
339
340 if (!result.ok()) {
341 return result.error();
342 }
343 auto& propRes = *result;
344
345 auto steppingResults = propRes.template get<SteppingLogger::result_type>();
346 auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>();
347 output.first = std::move(steppingResults.steps);
348 output.second = std::move(materialResult);
349 return std::move(output);
350 }, *m_varProp);
351
352 if (!res.ok()) {
353 ATH_MSG_DEBUG("Got error during propagation:" << res.error()
354 << ". Returning empty step vector.");
355 return res.error();
356 }
357 output = std::move(*res);
358
359 ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps");
360 ATH_MSG_VERBOSE(name() << "::" << __FUNCTION__ << " end");
361
362 return output;
363}

Member Data Documentation

◆ m_constantFieldVector

Gaudi::Property<std::vector<double> > ActsTrk::ExtrapolationTool::m_constantFieldVector {this, "ConstantFieldVector", {0, 0, 0}, "Constant field value to use if FieldMode == Constant"}
private

Definition at line 116 of file ExtrapolationTool.h.

116{this, "ConstantFieldVector", {0, 0, 0}, "Constant field value to use if FieldMode == Constant"};

◆ m_ctxProvider

ContextUtility ActsTrk::ExtrapolationTool::m_ctxProvider {this}
private

Utility to fetch the geometry, magnetic field and calibration context in the event.

Definition at line 111 of file ExtrapolationTool.h.

111{this};

◆ m_fieldMode

Gaudi::Property<std::string> ActsTrk::ExtrapolationTool::m_fieldMode {this, "FieldMode", "ATLAS", "Either ATLAS or Constant or StraightLine"}
private

Definition at line 115 of file ExtrapolationTool.h.

115{this, "FieldMode", "ATLAS", "Either ATLAS or Constant or StraightLine"};

◆ m_interactionEloss

Gaudi::Property<bool> ActsTrk::ExtrapolationTool::m_interactionEloss {this, "InteractionEloss", false, "Whether to consider energy loss in the interactor"}
private

Definition at line 126 of file ExtrapolationTool.h.

126{this, "InteractionEloss", false, "Whether to consider energy loss in the interactor"};

◆ m_interactionMultiScatering

Gaudi::Property<bool> ActsTrk::ExtrapolationTool::m_interactionMultiScatering {this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"}
private

Definition at line 125 of file ExtrapolationTool.h.

125{this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"};

◆ m_interactionRecord

Gaudi::Property<bool> ActsTrk::ExtrapolationTool::m_interactionRecord {this, "InteractionRecord", false, "Whether to record all material interactions"}
private

Definition at line 127 of file ExtrapolationTool.h.

127{this, "InteractionRecord", false, "Whether to record all material interactions"};

◆ m_logger

std::unique_ptr<const Acts::Logger> ActsTrk::ExtrapolationTool::m_logger {nullptr}
private

Definition at line 109 of file ExtrapolationTool.h.

109{nullptr};

◆ m_maxStep

Gaudi::Property<unsigned> ActsTrk::ExtrapolationTool::m_maxStep {this, "MaxSteps", 100000, "Max number of steps"}
private

Definition at line 120 of file ExtrapolationTool.h.

120{this, "MaxSteps", 100000, "Max number of steps"};

◆ m_maxStepSize

Gaudi::Property<double> ActsTrk::ExtrapolationTool::m_maxStepSize {this, "MaxStepSize", 10, "Max step size in Acts m unit"}
private

Definition at line 119 of file ExtrapolationTool.h.

119{this, "MaxStepSize", 10, "Max step size in Acts m unit"};

◆ m_maxSurfSkip

Gaudi::Property<unsigned> ActsTrk::ExtrapolationTool::m_maxSurfSkip {this, "MaxSurfaceSkip" ,100, "Maximum number of surfaces to be tried by the navigator"}
private

Definition at line 121 of file ExtrapolationTool.h.

121{this, "MaxSurfaceSkip" ,100, "Maximum number of surfaces to be tried by the navigator"};

◆ m_ptLoopers

Gaudi::Property<double> ActsTrk::ExtrapolationTool::m_ptLoopers {this, "PtLoopers", 300, "PT loop protection threshold. Will be converted to Acts MeV unit"}
private

Definition at line 118 of file ExtrapolationTool.h.

118{this, "PtLoopers", 300, "PT loop protection threshold. Will be converted to Acts MeV unit"};

◆ m_surfTolerance

Gaudi::Property<double> ActsTrk::ExtrapolationTool::m_surfTolerance
private
Initial value:
{this, "OnSurfaceTolerance", Acts::s_onSurfaceTolerance,
"Tolerance to consider track parameters on surface"}

Definition at line 122 of file ExtrapolationTool.h.

122 {this, "OnSurfaceTolerance", Acts::s_onSurfaceTolerance,
123 "Tolerance to consider track parameters on surface"};

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> ActsTrk::ExtrapolationTool::m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
private

Definition at line 113 of file ExtrapolationTool.h.

113{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ m_varProp

std::unique_ptr<const ActsExtrapolationDetail::VariantPropagator> ActsTrk::ExtrapolationTool::m_varProp
private

Definition at line 108 of file ExtrapolationTool.h.


The documentation for this class was generated from the following files: