ATLAS Offline Software
RungeKuttaPropagator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 // Header file for class RungeKuttaPropagator, (c) ATLAS Detector software
8 
9 #ifndef RungeKuttaPropagator_H
10 #define RungeKuttaPropagator_H
11 
13 #include "GaudiKernel/ServiceHandle.h"
20 #include <list>
21 
22 // MagField cache
25 
26 namespace Trk {
27 
28 class Surface;
29 class MagneticFieldProperties;
30 class CylinderBounds;
31 class CylinderSurface;
32 class PatternTrackParameters;
33 
131  : public AthAlgTool
132  , virtual public IPropagator
133  , virtual public IPatternParametersPropagator
134 {
135 
136 public:
137  RungeKuttaPropagator(const std::string&,
138  const std::string&,
139  const IInterface*);
140  virtual StatusCode initialize() override final;
141  virtual ~RungeKuttaPropagator() = default;
142 
144  virtual std::unique_ptr<NeutralParameters> propagate(
145  const NeutralParameters&,
146  const Surface&,
148  const BoundaryCheck&,
149  bool) const override final;
150 
152  virtual std::unique_ptr<TrackParameters> propagate(
153  const EventContext& ctx,
154  const TrackParameters&,
155  const Surface&,
156  const PropDirection,
157  const BoundaryCheck&,
159  ParticleHypothesis /*not used*/,
160  bool,
161  const TrackingVolume*) const override final;
162 
165  const EventContext& ctx,
166  const MultiComponentState& multiComponentState,
167  const Surface& surface,
168  const MagneticFieldProperties& fieldProperties,
169  const PropDirection direction = Trk::anyDirection,
170  const BoundaryCheck& boundaryCheck = true,
171  const ParticleHypothesis particleHypothesis =
172  nonInteracting) const override final;
173 
175  virtual std::unique_ptr<TrackParameters> propagate(
176  const EventContext& ctx,
177  const TrackParameters&,
178  const Surface&,
179  const PropDirection,
180  const BoundaryCheck&,
182  std::optional<TransportJacobian>&,
183  double&,
184  ParticleHypothesis /*not used*/,
185  bool,
186  const TrackingVolume*) const override final;
187 
189  virtual std::unique_ptr<TrackParameters> propagate(
190  const EventContext& ctx,
191  const TrackParameters&,
192  std::vector<DestSurf>&,
195  ParticleHypothesis /*not used*/,
196  std::vector<unsigned int>&,
197  double&,
198  bool,
199  bool,
200  const TrackingVolume*) const override final;
201 
204  virtual std::unique_ptr<TrackParameters> propagateParameters(
205  const EventContext& ctx,
206  const TrackParameters&,
207  const Surface&,
208  const PropDirection,
209  const BoundaryCheck&,
211  ParticleHypothesis /*not used*/,
212  bool,
213  const TrackingVolume*) const override final;
214 
217  virtual std::unique_ptr<TrackParameters> propagateParameters(
218  const EventContext& ctx,
219  const TrackParameters&,
220  const Surface&,
221  const PropDirection,
222  const BoundaryCheck&,
224  std::optional<TransportJacobian>&,
225  ParticleHypothesis /*not used*/,
226  bool,
227  const TrackingVolume*) const override final;
228 
231  virtual std::optional<Trk::TrackSurfaceIntersection> intersect(
232  const EventContext& ctx,
233  const TrackParameters&,
234  const Surface&,
236  ParticleHypothesis /*not used*/,
237  const TrackingVolume* tvol = nullptr) const override final;
238 
240  virtual void globalPositions(
241  const EventContext& ctx,
242  std::deque<Amg::Vector3D>&,
246  double,
247  ParticleHypothesis /*not used*/,
248  const TrackingVolume* tvol = nullptr) const override final;
249 
251  // Public methods for Trk::PatternTrackParameters (from IPattern'Propagator)
253 
255  virtual bool propagate(
256  const EventContext& ctx,
258  const Surface&,
262  ParticleHypothesis particle = pion) const override final;
263 
265  virtual bool propagate(
266  const EventContext& ctx,
268  const Surface&,
272  double&,
273  ParticleHypothesis particle = pion) const override final;
274 
276  virtual bool propagateParameters(
277  const EventContext& ctx,
279  const Surface&,
283  ParticleHypothesis particle = pion) const override final;
284 
287  virtual bool propagateParameters(
288  const EventContext& ctx,
290  const Surface&,
294  double&,
295  ParticleHypothesis particle = pion) const override final;
296 
297  virtual void globalPositions(
298  const EventContext& ctx,
300  std::vector<const Surface*>&,
301  std::vector<std::pair<Amg::Vector3D, double>>&,
303  ParticleHypothesis particle = pion) const override final;
304 
306  virtual std::unique_ptr<Trk::TrackParameters> propagateT(
307  const EventContext&,
309  std::vector<DestSurf>&,
313  std::vector<unsigned int>&,
314  PathLimit&,
315  TimeLimit&,
316  bool,
318  std::vector<Trk::HitInfo>*&) const override final
319  {
320  ATH_MSG_ERROR("Call to non-implemented propagateT");
321  return nullptr;
322  }
323 
325  virtual std::unique_ptr<Trk::TrackParameters> propagateM(
326  const EventContext&,
327  const TrackParameters&,
328  std::vector<DestSurf>&,
332  std::vector<unsigned int>&,
333  std::vector<const Trk::TrackStateOnSurface*>*&,
334  std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>, int>>*,
335  double&,
336  bool,
337  bool,
338  const Trk::TrackingVolume*,
339  Trk::ExtrapolationCache*) const override final
340  {
341  ATH_MSG_ERROR("Call to non-implemented propagateM");
342  return nullptr;
343  }
344 
346  virtual std::optional<Trk::TrackSurfaceIntersection> intersectSurface(
347  const EventContext&,
348  const Surface&,
350  const double,
352  ParticleHypothesis) const override final
353  {
354  ATH_MSG_ERROR("Call to non-implemented intersectSurface");
355  return std::nullopt;
356  }
357 
359  const EventContext&,
362  Trk::TargetSurfaceVector&) const override final
363  {
365  }
366 
367  struct Cache
368  {
370  double m_field[3];
371  double m_direction;
372  double m_step;
373  double m_maxPath = 10000.;
374  double m_dlt = .000200;
375  double m_helixStep = 1;
376  double m_straightStep = 0.01;
377  bool m_maxPathLimit = false;
378  bool m_mcondition = false;
379  bool m_solenoid = true;
380  bool m_needgradient = false;
381  bool m_newfield = true;
382  bool m_usegradient = false;
383  };
384 
385 private:
387  // Private methods:
389  Cache getInitializedCache(const EventContext& ctx) const;
390 
392  // Private data members:
394 
395  // Read handle for conditions object to get the field cache
397  this,
398  "AtlasFieldCacheCondObj",
399  "fieldCondObj",
400  "Name of the Magnetic Field conditions object key"
401  };
402 
403  double m_dlt; // accuracy parameter
404  double m_helixStep; // max step whith helix model
405  double m_straightStep; // max step whith srtaight line model
406  bool m_usegradient; // use magnetig field gradient into the error
407  // propagation
408 };
409 
410 } // end namespace Trk
411 #endif // RungeKuttaPropagator_H
Trk::RungeKuttaPropagator::intersectSurface
virtual std::optional< Trk::TrackSurfaceIntersection > intersectSurface(const EventContext &, const Surface &, const TrackSurfaceIntersection &, const double, const MagneticFieldProperties &, ParticleHypothesis) const override final
unimplemented intersectSurface
Definition: RungeKuttaPropagator.h:346
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
Trk::RungeKuttaPropagator::Cache
Definition: RungeKuttaPropagator.h:368
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::RungeKuttaPropagator::Cache::m_field
double m_field[3]
Definition: RungeKuttaPropagator.h:370
Trk::RungeKuttaPropagator::initialize
virtual StatusCode initialize() override final
Definition: RungeKuttaPropagator.cxx:1398
TrackParameters.h
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
Trk::RungeKuttaPropagator::Cache::m_newfield
bool m_newfield
Definition: RungeKuttaPropagator.h:381
Trk::RungeKuttaPropagator::propagate
virtual std::unique_ptr< TrackParameters > propagate(const EventContext &ctx, const TrackParameters &, const Surface &, const PropDirection, const BoundaryCheck &, const MagneticFieldProperties &, std::optional< TransportJacobian > &, double &, ParticleHypothesis, bool, const TrackingVolume *) const override final
Main propagation method with transport jacobian production.
Trk::RungeKuttaPropagator::Cache::m_direction
double m_direction
Definition: RungeKuttaPropagator.h:371
AtlasFieldCacheCondObj.h
Trk::RungeKuttaPropagator::propagateParameters
virtual std::unique_ptr< TrackParameters > propagateParameters(const EventContext &ctx, const TrackParameters &, const Surface &, const PropDirection, const BoundaryCheck &, const MagneticFieldProperties &, ParticleHypothesis, bool, const TrackingVolume *) const override final
Main propagation method for parameters only.
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
PropDirection.h
IPropagator.h
Trk::RungeKuttaPropagator::Cache::m_solenoid
bool m_solenoid
Definition: RungeKuttaPropagator.h:379
Trk::TrackSurfaceIntersection
Definition: TrackSurfaceIntersection.h:32
NeutralParameters.h
Trk::RungeKuttaPropagator::Cache::m_step
double m_step
Definition: RungeKuttaPropagator.h:372
Trk::IPatternParametersPropagator
interface for track parameter propagation through the magnetic field, using the Trk::PatternTrackPara...
Definition: IPatternParametersPropagator.h:41
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Trk::RungeKuttaPropagator::RungeKuttaPropagator
RungeKuttaPropagator(const std::string &, const std::string &, const IInterface *)
Definition: RungeKuttaPropagator.cxx:1380
Trk::RungeKuttaPropagator::Cache::m_straightStep
double m_straightStep
Definition: RungeKuttaPropagator.h:376
Trk::RungeKuttaPropagator::Cache::m_usegradient
bool m_usegradient
Definition: RungeKuttaPropagator.h:382
Trk::RungeKuttaPropagator::Cache::m_fieldCache
MagField::AtlasFieldCache m_fieldCache
Definition: RungeKuttaPropagator.h:369
Trk::RungeKuttaPropagator::~RungeKuttaPropagator
virtual ~RungeKuttaPropagator()=default
Trk::RungeKuttaPropagator::Cache::m_helixStep
double m_helixStep
Definition: RungeKuttaPropagator.h:375
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
Trk::RungeKuttaPropagator::Cache::m_needgradient
bool m_needgradient
Definition: RungeKuttaPropagator.h:380
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
Trk::RungeKuttaPropagator::intersect
virtual std::optional< Trk::TrackSurfaceIntersection > intersect(const EventContext &ctx, const TrackParameters &, const Surface &, const MagneticFieldProperties &, ParticleHypothesis, const TrackingVolume *tvol=nullptr) const override final
Global position together with direction of the trajectory on the surface.
Definition: RungeKuttaPropagator.cxx:1804
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::RungeKuttaPropagator::multiStatePropagate
virtual Trk::MultiComponentState multiStatePropagate(const EventContext &ctx, const MultiComponentState &multiComponentState, const Surface &surface, const MagneticFieldProperties &fieldProperties, const PropDirection direction=Trk::anyDirection, const BoundaryCheck &boundaryCheck=true, const ParticleHypothesis particleHypothesis=nonInteracting) const override final
Main propagation method for Multi Component state.
Definition: RungeKuttaPropagator.cxx:1449
Trk::IPropagator
Definition: IPropagator.h:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
Trk::RungeKuttaPropagator
Definition: RungeKuttaPropagator.h:134
Trk::CylinderBounds
Definition: CylinderBounds.h:46
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
Trk::RungeKuttaPropagator::Cache::m_maxPath
double m_maxPath
Definition: RungeKuttaPropagator.h:373
AthAlgTool.h
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
AtlasFieldCache.h
Trk::MultiComponentState
std::vector< ComponentParameters > MultiComponentState
Definition: ComponentParameters.h:27
Trk::RungeKuttaPropagator::Cache::m_dlt
double m_dlt
Definition: RungeKuttaPropagator.h:374
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::DestSurf
std::pair< const Surface *, BoundaryCheck > DestSurf
typedef for input surfaces, boundary check
Definition: IPropagator.h:45
Trk::TimeLimit
Definition: HelperStructs.h:58
ParticleHypothesis.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::RungeKuttaPropagator::m_usegradient
bool m_usegradient
Definition: RungeKuttaPropagator.h:406
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
Trk::RungeKuttaPropagator::propagateT
virtual std::unique_ptr< Trk::TrackParameters > propagateT(const EventContext &, const TrackParameters &, std::vector< DestSurf > &, PropDirection, const MagneticFieldProperties &, ParticleHypothesis, std::vector< unsigned int > &, PathLimit &, TimeLimit &, bool, const Trk::TrackingVolume *, std::vector< Trk::HitInfo > *&) const override final
unimplemented propagateT
Definition: RungeKuttaPropagator.h:306
Trk::PathLimit
Definition: HelperStructs.h:34
Trk::RungeKuttaPropagator::propagate
virtual Trk::ExtrapolationCode propagate(const EventContext &, Trk::ExCellCharged &, Trk::TargetSurfaces &, Trk::TargetSurfaceVector &) const override final
Propagation method needed for StepEngine.
Definition: RungeKuttaPropagator.h:358
Trk::RungeKuttaPropagator::m_straightStep
double m_straightStep
Definition: RungeKuttaPropagator.h:405
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::RungeKuttaPropagator::propagateParameters
virtual std::unique_ptr< TrackParameters > propagateParameters(const EventContext &ctx, const TrackParameters &, const Surface &, const PropDirection, const BoundaryCheck &, const MagneticFieldProperties &, std::optional< TransportJacobian > &, ParticleHypothesis, bool, const TrackingVolume *) const override final
Main propagation method for parameters only with transport jacobian production.
Trk::ExtrapolationCode::FailureConfiguration
@ FailureConfiguration
Definition: ExtrapolationCell.h:124
Trk::RungeKuttaPropagator::Cache::m_mcondition
bool m_mcondition
Definition: RungeKuttaPropagator.h:378
Trk::RungeKuttaPropagator::m_dlt
double m_dlt
Definition: RungeKuttaPropagator.h:403
Trk::RungeKuttaPropagator::m_helixStep
double m_helixStep
Definition: RungeKuttaPropagator.h:404
SG::ReadCondHandleKey< AtlasFieldCacheCondObj >
Trk::RungeKuttaPropagator::globalPositions
virtual void globalPositions(const EventContext &ctx, std::deque< Amg::Vector3D > &, const TrackParameters &, const MagneticFieldProperties &, const CylinderBounds &, double, ParticleHypothesis, const TrackingVolume *tvol=nullptr) const override final
GlobalPositions list interface:
Trk::RungeKuttaPropagator::m_fieldCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
Definition: RungeKuttaPropagator.h:396
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::TargetSurfaceVector
std::vector< TargetSurface > TargetSurfaceVector
Definition: TargetSurfaces.h:121
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
Trk::PatternTrackParameters
Definition: PatternTrackParameters.h:32
MagField::AtlasFieldCache
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Definition: AtlasFieldCache.h:43
Trk::RungeKuttaPropagator::propagate
virtual std::unique_ptr< NeutralParameters > propagate(const NeutralParameters &, const Surface &, PropDirection, const BoundaryCheck &, bool) const override final
Main propagation method for NeutralParameters.
Definition: RungeKuttaPropagator.cxx:1410
Trk::TargetSurfaces
Definition: TargetSurfaces.h:126
Trk::HitInfo
Definition: HelperStructs.h:12
AthAlgTool
Definition: AthAlgTool.h:26
Trk::RungeKuttaPropagator::propagateM
virtual std::unique_ptr< Trk::TrackParameters > propagateM(const EventContext &, const TrackParameters &, std::vector< DestSurf > &, PropDirection, const MagneticFieldProperties &, ParticleHypothesis, std::vector< unsigned int > &, std::vector< const Trk::TrackStateOnSurface * > *&, std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int >> *, double &, bool, bool, const Trk::TrackingVolume *, Trk::ExtrapolationCache *) const override final
unimplemented propagateM
Definition: RungeKuttaPropagator.h:325
Trk::RungeKuttaPropagator::Cache::m_maxPathLimit
bool m_maxPathLimit
Definition: RungeKuttaPropagator.h:377
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::RungeKuttaPropagator::propagate
virtual std::unique_ptr< TrackParameters > propagate(const EventContext &ctx, const TrackParameters &, const Surface &, const PropDirection, const BoundaryCheck &, const MagneticFieldProperties &, ParticleHypothesis, bool, const TrackingVolume *) const override final
Main propagation method without transport jacobian production.
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Trk::RungeKuttaPropagator::propagate
virtual std::unique_ptr< TrackParameters > propagate(const EventContext &ctx, const TrackParameters &, std::vector< DestSurf > &, PropDirection, const MagneticFieldProperties &, ParticleHypothesis, std::vector< unsigned int > &, double &, bool, bool, const TrackingVolume *) const override final
The propagation method finds the closest surface.
Trk::ExtrapolationCache
Definition: ExtrapolationCache.h:26
IPatternParametersPropagator.h
Trk::RungeKuttaPropagator::getInitializedCache
Cache getInitializedCache(const EventContext &ctx) const
Definition: RungeKuttaPropagator.cxx:1922