Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::STEP_Propagator Class Referencefinalabstract

#include <STEP_Propagator.h>

Inheritance diagram for Trk::STEP_Propagator:
Collaboration diagram for Trk::STEP_Propagator:

Classes

struct  Cache
 stuct to pass information to the heavy lifting calculation internal methods More...
 

Public Member Functions

 STEP_Propagator (const std::string &, const std::string &, const IInterface *)
 
virtual ~STEP_Propagator ()
 
virtual StatusCode initialize () override final
 AlgTool initialize method. More...
 
virtual StatusCode finalize () override final
 AlgTool finalize method. More...
 
virtual std::unique_ptr< Trk::NeutralParameterspropagate (const Trk::NeutralParameters &, const Trk::Surface &, Trk::PropDirection, const Trk::BoundaryCheck &, bool rC=false) const override final
 Main propagation method NeutralParameters. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagate (const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, Trk::PropDirection propagationDirection, const Trk::BoundaryCheck &boundaryCheck, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters and covariance without returning the Jacobian. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagate (const EventContext &ctx, const Trk::TrackParameters &trackParameters, std::vector< Trk::DestSurf > &targetSurfaces, Trk::PropDirection propagationDirection, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, std::vector< unsigned int > &solutions, double &path, bool usePathLimit=false, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters and covariance with search of closest surface. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagateT (const EventContext &ctx, const Trk::TrackParameters &trackParameters, std::vector< Trk::DestSurf > &targetSurfaces, Trk::PropDirection propagationDirection, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, std::vector< unsigned int > &solutions, Trk::PathLimit &path, Trk::TimeLimit &time, bool returnCurv, const Trk::TrackingVolume *tVol, std::vector< Trk::HitInfo > *&hitVector) const override final
 Propagate parameters and covariance with search of closest surface time included. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagateM (const EventContext &ctx, const Trk::TrackParameters &trackParameters, std::vector< Trk::DestSurf > &targetSurfaces, Trk::PropDirection propagationDirection, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, std::vector< unsigned int > &solutions, std::vector< const Trk::TrackStateOnSurface * > *&matstates, std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int >> *intersections, double &path, bool usePathLimit=false, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr, Trk::ExtrapolationCache *=nullptr) const override final
 Propagate parameters and covariance with search of closest surface and material collection. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagate (const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, Trk::PropDirection propagationDirection, const Trk::BoundaryCheck &boundaryCheck, const MagneticFieldProperties &magneticFieldProperties, std::optional< Trk::TransportJacobian > &jacobian, double &pathLimit, ParticleHypothesis particle, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters and covariance, and return the Jacobian. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagateParameters (const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, Trk::PropDirection propagationDirection, const Trk::BoundaryCheck &boundaryCheck, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters only. More...
 
virtual std::unique_ptr< Trk::TrackParameterspropagateParameters (const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, Trk::PropDirection propagationDirection, const Trk::BoundaryCheck &boundaryCheck, const MagneticFieldProperties &magneticFieldProperties, std::optional< Trk::TransportJacobian > &jacobian, ParticleHypothesis particle, bool returnCurv=false, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters and return Jacobian. More...
 
virtual std::optional< TrackSurfaceIntersectionintersect (const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, const Trk::MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, const Trk::TrackingVolume *tVol=nullptr) const override final
 Propagate parameters and return path (Similar to propagateParameters. More...
 
virtual std::optional< TrackSurfaceIntersectionintersectSurface (const EventContext &ctx, const Surface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP, const MagneticFieldProperties &mft, ParticleHypothesis particle) const override final
 Intersection and propagation: More...
 
virtual void globalPositions (const EventContext &ctx, std::deque< Amg::Vector3D > &positionsList, const TrackParameters &trackParameters, const MagneticFieldProperties &magneticFieldProperties, const CylinderBounds &cylinderBounds, double maxStepSize, ParticleHypothesis particle, const Trk::TrackingVolume *tVol=0) const override final
 Return a list of positions along the track. More...
 
virtual Trk::MultiComponentState multiStatePropagate (const EventContext &, const MultiComponentState &, const Surface &, const MagneticFieldProperties &, const PropDirection, const BoundaryCheck &, const ParticleHypothesis) const override final
 unimplemented multiStatePropagate More...
 
virtual Trk::ExtrapolationCode propagate (const EventContext &, Trk::ExCellCharged &, Trk::TargetSurfaces &, Trk::TargetSurfaceVector &) const override final
 Propagation method needed for StepEngine. More...
 
virtual std::unique_ptr< NeutralParameterspropagate (const NeutralParameters &parameters, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, bool returnCurv=false) const=0
 Main propagation method for NeutralParameters. More...
 
virtual std::unique_ptr< TrackParameterspropagate (const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const=0
 Main propagation method without transport jacobian production. More...
 
virtual std::unique_ptr< TrackParameterspropagate (const EventContext &ctx, const TrackParameters &parm, std::vector< DestSurf > &sfs, PropDirection dir, const MagneticFieldProperties &mprop, ParticleHypothesis particle, std::vector< unsigned int > &solutions, double &path, bool usePathLim=false, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const=0
 Propagate parameters and covariance with search of closest surface. More...
 
virtual std::unique_ptr< TrackParameterspropagate (const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, std::optional< TransportJacobian > &jacob, double &pathLength, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const=0
 Main propagation method with transport jacobian production. More...
 
virtual Trk::ExtrapolationCode propagate (const EventContext &ctx, Trk::ExCellCharged &eCell, Trk::TargetSurfaces &sfs, Trk::TargetSurfaceVector &solutions) const=0
 Propagation method needed for StepEngine. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
virtual std::unique_ptr< TrackParameterspropagate (const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, std::optional< TransportJacobian > &jacob, double &pathLength, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const =0
 Main propagation method with transport jacobian production. More...
 
virtual std::unique_ptr< TrackParameterspropagateParameters (const EventContext &ctx, const TrackParameters &parm, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, const MagneticFieldProperties &mprop, std::optional< TransportJacobian > &jacob, ParticleHypothesis particle=pion, bool returnCurv=false, const TrackingVolume *tVol=nullptr) const =0
 Main propagation method for parameters only with transport jacobian production. More...
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool and IAlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void setCacheFromProperties (Cache &cache) const
 initialize cache with the variables we need to take from More...
 
std::unique_ptr< Trk::TrackParameterspropagateRungeKutta (Cache &cache, bool errorPropagation, const Trk::TrackParameters &trackParameters, std::vector< DestSurf > &targetSurfaces, Trk::PropDirection propagationDirection, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, std::vector< unsigned int > &solutions, double &path, bool returnCurv=false) const
 
bool propagateWithJacobian (Cache &cache, bool errorPropagation, std::vector< DestSurf > &sfs, double *P, Trk::PropDirection propDir, std::vector< unsigned int > &solutions, double &path, double sumPath) const
 
void dumpMaterialEffects (Cache &cache, const Trk::CurvilinearParameters *trackParameters, double path) const
 
void smear (Cache &cache, double &phi, double &theta, const Trk::TrackParameters *parms, double radDist) const
 
void sampleBrem (Cache &cache, double mom) const
 
void getFieldCacheObject (Cache &cache, const EventContext &ctx) const
 
CLHEP::HepRandomEngine * getRandomEngine (const EventContext &ctx) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

DoubleProperty m_tolerance
 
BooleanProperty m_materialEffects
 
BooleanProperty m_includeBgradients
 
BooleanProperty m_includeGgradient
 
DoubleProperty m_momentumCutOff
 
BooleanProperty m_multipleScattering
 
BooleanProperty m_energyLoss {this, "EnergyLoss", true, "Include energy loss?"}
 
BooleanProperty m_detailedEloss
 
BooleanProperty m_straggling
 
BooleanProperty m_MPV
 
DoubleProperty m_stragglingScale
 
DoubleProperty m_scatteringScale
 
DoubleProperty m_maxPath
 
IntegerProperty m_maxSteps
 
DoubleProperty m_layXmax
 
BooleanProperty m_simulation
 
ToolHandle< ITimedMatEffUpdatorm_simMatUpdator {this, "SimMatEffUpdator", ""}
 secondary interactions (brem photon emission) More...
 
ServiceHandle< IAthRNGSvcm_rndGenSvc
 Random Generator service. More...
 
ATHRNG::RNGWrapperm_rngWrapper = nullptr
 Random engine. More...
 
StringProperty m_randomEngineName
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

STEP (Simultaneous Track and Error Propagation ) is an algorithm for track parameters propagation through magnetic field.

The algorithm can produce the Jacobian that transports the covariance matrix from one set of track parameters at the initial surface to another set of track parameters at the destination surface. This is useful for Chi2 fitting.

One can choose to perform the transport of the parameters only and omit the transport of the associated covariances (propagateParameters).

The implementation performs the propagation in global coordinates and uses Jacobian matrices (see RungeKuttaUtils) for the transformations between the global frame and local surface-attached coordinate systems.

The STEP_Propagator includes material effects in the equation of motion and applies corrections to the covariance matrices continuously during the parameter transport. It is designed for the propagation of a particle going through a dense block of material (e.g a muon transversing the calorimeter).

1.The first step of the algorithm is track parameters transformation from local presentation for given start surface to global Runge Kutta coordinates.

2.The second step is propagation through magnetic field with or without jacobian.

3.Third step is transformation from global Runge Kutta presentation to local presentation of given output surface.

AtaPlane AtaStraightLine AtaDisc AtaCylinder Perigee | | | | | | | | | |

V V V V V

| Local->Global transformation V Global position (Runge Kutta presentation) | | Propagation to next surface with or without jacobian |

V Global->Local transformation

| | | | | | | | | | V V V V V PlaneSurface StraightLineSurface DiscSurface CylinderSurface PerigeeSurface

For propagation using Runge Kutta method we use global coordinate, direction, inverse momentum and Jacobian of transformation. All this parameters we save in array P[42]. /dL0 /dL1 /dPhi /dThe /dCM X ->P[0] dX / P[ 7] P[14] P[21] P[28] P[35] Y ->P[1] dY / P[ 8] P[15] P[22] P[29] P[36] Z ->P[2] dZ / P[ 9] P[16] P[23] P[30] P[37] Ax ->P[3] dAx/ P[10] P[17] P[24] P[31] P[38] Ay ->P[4] dAy/ P[11] P[18] P[25] P[32] P[39] Az ->P[5] dAz/ P[12] P[19] P[26] P[33] P[40] CM ->P[6] dCM/ P[13] P[20] P[27] P[34] P[41]

where in case local presentation

L0 - first local coordinate (surface dependent) L1 - second local coordinate (surface dependent) Phi - Azimuthal angle The - Polar angle CM - charge/momentum

in case global presentation

X - global x-coordinate = surface dependent Y - global y-coordinate = surface dependent Z - global z-coordinate = sutface dependent Ax - direction cosine to x-axis = Sin(The)*Cos(Phi) Ay - direction cosine to y-axis = Sin(The)*Sin(Phi) Az - direction cosine to z-axis = Cos(The) CM - charge/momentum = local CM

The Runge-Kutta method:

The equations of motion are solved using an embedded pair of Runge-Kutta formulas. This method, Runge-Kutta-Fehlberg, calculates a number of points along the step and adds them up in different ways to get two different solutions, of different order, for the integration. The higher order solution is used for the propagation and the lower order solution for error control. The difference between these solutions is used to estimate the quality of the integration (propagation), and to calculate the step size for the next step. If the quality is below a given tolerance then the step is rejected and repeated with a shorter step length. This propagator uses the TP43 (Tsitouras-Papakostas 4th and 3rd order) Runge-Kutta pair.

The step size algoritm by L.P.Endresen and J.Myrheim was choosen for its low step rejection and effective step size calculation. The low step rejection is achieved by letting the step size oscillate around the optimal value instead of repeating steps every time they fall below the tolerance level.

Units are mm, MeV and kiloGauss.

Author
esben.nosp@m..lun.nosp@m.d@fys.nosp@m..uio.nosp@m..no

Definition at line 163 of file STEP_Propagator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ STEP_Propagator()

Trk::STEP_Propagator::STEP_Propagator ( const std::string &  p,
const std::string &  n,
const IInterface *  t 
)

Definition at line 1179 of file STEP_Propagator.cxx.

1180  : AthAlgTool(p, n, t)
1181 {
1182  declareInterface<Trk::IPropagator>(this);
1183 }

◆ ~STEP_Propagator()

Trk::STEP_Propagator::~STEP_Propagator ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ dumpMaterialEffects()

void Trk::STEP_Propagator::dumpMaterialEffects ( Cache cache,
const Trk::CurvilinearParameters trackParameters,
double  path 
) const
private

Definition at line 2708 of file STEP_Propagator.cxx.

2709  {
2710 
2711  // kinematics
2712  double mom = parms->momentum().mag();
2713 
2714  // first update to make sure all material counted
2715  updateMaterialEffects(cache, mom, sin(parms->momentum().theta()), path);
2716 
2717  if (cache.m_extrapolationCache) {
2718  cache.m_extrapolationCache->updateX0(cache.m_combinedThickness);
2719  cache.m_extrapolationCache->updateEloss(
2720  cache.m_combinedEloss.meanIoni(), cache.m_combinedEloss.sigmaIoni(), cache.m_combinedEloss.meanRad(),
2721  cache.m_combinedEloss.sigmaRad());
2722  }
2723  // output
2724  if (cache.m_matstates) {
2725  auto eloss = !m_detailedEloss
2726  ? std::make_unique<Trk::EnergyLoss>(cache.m_combinedEloss.deltaE(),
2727  cache.m_combinedEloss.sigmaDeltaE())
2728  : std::make_unique<Trk::EnergyLoss>(
2729  cache.m_combinedEloss.deltaE(), cache.m_combinedEloss.sigmaDeltaE(),
2730  cache.m_combinedEloss.sigmaDeltaE(), cache.m_combinedEloss.sigmaDeltaE(),
2731  cache.m_combinedEloss.meanIoni(), cache.m_combinedEloss.sigmaIoni(),
2732  cache.m_combinedEloss.meanRad(), cache.m_combinedEloss.sigmaRad(), path);
2733 
2734  auto sa = Trk::ScatteringAngles(0., 0., std::sqrt(cache.m_covariance(2, 2)),
2735  std::sqrt(cache.m_covariance(3, 3)));
2736 
2737  auto cvlTP = parms->uniqueClone();
2738  auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(cache.m_combinedThickness, sa,
2739  std::move(eloss), cvlTP->associatedSurface());
2740 
2741  cache.m_matstates->push_back(new TrackStateOnSurface(nullptr, std::move(cvlTP), std::move(mefot)));
2742  }
2743 
2744  cache.m_matdump_lastpath = path;
2745 
2746  // clean-up
2747  cache.m_combinedCovariance += cache.m_covariance;
2748  cache.m_covariance.setZero();
2749  cache.m_combinedThickness = 0.;
2750  cache.m_combinedEloss.set(0., 0., 0., 0., 0., 0.);
2751 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode Trk::STEP_Propagator::finalize ( )
finaloverridevirtual

AlgTool finalize method.

Definition at line 1220 of file STEP_Propagator.cxx.

1220  {
1221  return StatusCode::SUCCESS;
1222 }

◆ getFieldCacheObject()

void Trk::STEP_Propagator::getFieldCacheObject ( Cache cache,
const EventContext &  ctx 
) const
private

Definition at line 2806 of file STEP_Propagator.cxx.

2806  {
2808  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
2809  if (fieldCondObj == nullptr) {
2810  ATH_MSG_ERROR("extrapolate: Failed to retrieve AtlasFieldCacheCondObj with key "
2812  return;
2813  }
2814  fieldCondObj->getInitializedCache(cache.m_fieldCache);
2815 }

◆ getRandomEngine()

CLHEP::HepRandomEngine * Trk::STEP_Propagator::getRandomEngine ( const EventContext &  ctx) const
private

Definition at line 2818 of file STEP_Propagator.cxx.

2819 {
2820  if (!m_simulation || !m_rngWrapper) {
2821  return nullptr;
2822  }
2823  if (m_rngWrapper->evtSeeded(ctx) != ctx.evt()) {
2824  // Ok, the wrappers are unique to this algorithm and a given slot,
2825  // so cannot be accessed concurrently.
2827  wrapper_nc->setSeed (this->name(), ctx);
2828  }
2829  return m_rngWrapper->getEngine (ctx);
2830 }

◆ globalPositions()

void Trk::STEP_Propagator::globalPositions ( const EventContext &  ctx,
std::deque< Amg::Vector3D > &  positionsList,
const TrackParameters trackParameters,
const MagneticFieldProperties magneticFieldProperties,
const CylinderBounds cylinderBounds,
double  maxStepSize,
ParticleHypothesis  particle,
const Trk::TrackingVolume tVol = 0 
) const
finaloverridevirtual

Return a list of positions along the track.

Implements Trk::IPropagator.

Definition at line 1780 of file STEP_Propagator.cxx.

1785  {
1786  Cache cache(ctx);
1787 
1788  // Get field cache object
1789  getFieldCacheObject(cache, ctx);
1790  setCacheFromProperties(cache);
1791  clearMaterialEffects(cache);
1792 
1793  cache.m_particle = particle; // Store for later use
1794 
1795  // Check for tracking volume (materialproperties)
1796  cache.m_trackingVolume = tVol;
1797  cache.m_material = tVol;
1798  cache.m_matPropOK = tVol != nullptr;
1799 
1800  // Check for empty volumes. If x != x then x is not a number.
1801  if (cache.m_matPropOK && ((cache.m_material->zOverAtimesRho() == 0.) || (cache.m_material->x0() == 0.) ||
1802  (cache.m_material->zOverAtimesRho() != cache.m_material->zOverAtimesRho()))) {
1803  cache.m_matPropOK = false;
1804  }
1805 
1806  mft.magneticFieldMode() == Trk::FastField ? cache.m_solenoid = true : cache.m_solenoid = false;
1807 
1808  // Check inputvalues
1809  if (cache.m_tolerance <= 0.)
1810  return;
1811 
1812  double PP[7];
1813  if (!Trk::RungeKuttaUtils::transformLocalToGlobal(false, trackParameters, PP))
1814  return;
1815 
1816  double maxPath = cache.m_maxPath; // Max path allowed
1817  double dDir[3] = {0., 0., 0.}; // Start directions derivs. Zero in case of no RK steps
1818  double distanceStepped = 0.;
1819  double BG1[12] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; // Bx, By, Bz, dBx/dx, dBx/dy, dBx/dz,
1820  // dBy/dx, dBy/dy, dBy/dz, dBz/dx, dBz/dy, dBz/dz
1821  bool firstStep = true; // Poll B1, else recycle B4
1822  double path = 0.; // path of the trajectory
1823  double radius2Max = cylinderBounds.r() * cylinderBounds.r(); // max. radius**2 of region
1824  double zMax = cylinderBounds.halflengthZ(); // max. Z of region
1825  double radius2 = PP[0] * PP[0] + PP[1] * PP[1]; // Start radius**2
1826  double direction = PP[0] * PP[3] + PP[1] * PP[4]; // Direction
1827  double h = maxStepSize; // max step allowed
1828 
1829  // Test position of the track
1830  if ((std::abs(PP[2]) > zMax) || (radius2 > radius2Max))
1831  return;
1832 
1833  // Store initial position
1834  Amg::Vector3D initialPosition(PP[0], PP[1], PP[2]);
1835  positionsList.push_back(initialPosition);
1836 
1837  bool perigee = false;
1838  if (std::abs(direction) < 0.00001) {
1839  perigee = true;
1840  }
1841 
1842  for (int i = 0; i != 2; ++i) {
1843  if (i) {
1844  if (perigee)
1845  return;
1846  h = -h;
1847  }
1848  double p[7] = {PP[0], PP[1], PP[2], PP[3], PP[4], PP[5], PP[6]};
1849 
1850  while (std::abs(path) < maxPath) {
1851  // Do the step.
1852  if (!rungeKuttaStep(cache, false, h, p, dDir, BG1, firstStep, distanceStepped))
1853  break;
1854  path = path + distanceStepped;
1855 
1856  // Keep h within max stepsize
1857  if (h > maxStepSize) {
1858  h = maxStepSize;
1859  } else if (h < -maxStepSize) {
1860  h = -maxStepSize;
1861  }
1862 
1863  // store current step
1864  Amg::Vector3D globalPosition(p[0], p[1], p[2]);
1865  if (!i) {
1866  positionsList.push_back(globalPosition);
1867  } else {
1868  positionsList.push_front(globalPosition);
1869  }
1870 
1871  // Test position of the track
1872  radius2 = p[0] * p[0] + p[1] * p[1];
1873  if ((std::abs(p[2]) > zMax) || (radius2 > radius2Max))
1874  break;
1875 
1876  // Test perigee
1877  if ((p[0] * p[3] + p[1] * p[4]) * direction < 0.) {
1878  if (i)
1879  return;
1880  perigee = true;
1881  }
1882  }
1883  }
1884 }

◆ initialize()

StatusCode Trk::STEP_Propagator::initialize ( )
finaloverridevirtual

AlgTool initialize method.

Definition at line 1193 of file STEP_Propagator.cxx.

1193  {
1194 
1195  // Read handle for AtlasFieldCacheCondObj
1197 
1198  if (!m_materialEffects) { // override all material interactions
1199  m_multipleScattering = false;
1200  m_energyLoss = false;
1201  m_straggling = false;
1202  } else if (!m_energyLoss) { // override straggling
1203  m_straggling = false;
1204  }
1205 
1206  if (m_simulation && m_simMatUpdator.retrieve().isFailure()) {
1207  ATH_MSG_WARNING("Simulation mode requested but material updator not found - no brem photon emission.");
1208  }
1209 
1210  if (m_simulation) {
1211  // get the random generator serice
1212  ATH_CHECK(m_rndGenSvc.retrieve());
1213  m_rngWrapper = m_rndGenSvc->getEngine(this, m_randomEngineName);
1214  }
1215 
1216  return StatusCode::SUCCESS;
1217 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& Trk::IPropagator::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Definition at line 61 of file IPropagator.h.

61 { return IID_IPropagator; }

◆ intersect()

std::optional< Trk::TrackSurfaceIntersection > Trk::STEP_Propagator::intersect ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
const Trk::Surface targetSurface,
const Trk::MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters and return path (Similar to propagateParameters.

Implements Trk::IPropagator.

Definition at line 1612 of file STEP_Propagator.cxx.

1618  {
1619 
1620  Cache cache(ctx);
1621 
1622  // Get field cache object
1623  getFieldCacheObject(cache, ctx);
1624  setCacheFromProperties(cache);
1625  clearMaterialEffects(cache);
1626 
1627  cache.m_particle = particle; // Store for later use
1628 
1629  // Check for tracking volume (materialproperties)
1630  cache.m_trackingVolume = tVol;
1631  cache.m_material = tVol;
1632  cache.m_matPropOK = tVol != nullptr;
1633 
1634  // no identified intersections needed/ no material dump
1635  cache.m_identifiedParameters = nullptr;
1636  cache.m_matstates = nullptr;
1637  cache.m_extrapolationCache = nullptr;
1638  cache.m_hitVector = nullptr;
1639 
1640  // Bfield mode
1641  mft.magneticFieldMode() == Trk::FastField ? cache.m_solenoid = true : cache.m_solenoid = false;
1642 
1643  // Check inputvalues
1644  if (cache.m_tolerance <= 0.) {
1645  return std::nullopt;
1646  }
1647  if (cache.m_momentumCutOff < 0.) {
1648  return std::nullopt;
1649  }
1650  if (std::abs(1. / trackParameters.parameters()[Trk::qOverP]) <= cache.m_momentumCutOff) {
1651  return std::nullopt;
1652  }
1653 
1654  // Check for empty volumes. If x != x then x is not a number.
1655  if (cache.m_matPropOK && ((cache.m_material->zOverAtimesRho() == 0.) || (cache.m_material->x0() == 0.) ||
1656  (cache.m_material->zOverAtimesRho() != cache.m_material->zOverAtimesRho()))) {
1657  cache.m_matPropOK = false;
1658  }
1659 
1660  // double P[45];
1661  if (!Trk::RungeKuttaUtils::transformLocalToGlobal(false, trackParameters, cache.m_P)) {
1662  return std::nullopt;
1663  }
1664  double path = 0.;
1665 
1666  const Amg::Transform3D& T = targetSurface.transform();
1667  Trk::SurfaceType ty = targetSurface.type();
1668 
1669  if (ty == Trk::SurfaceType::Plane || ty == Trk::SurfaceType::Disc) {
1670  double s[4];
1671  double d = T(0, 3) * T(0, 2) + T(1, 3) * T(1, 2) + T(2, 3) * T(2, 2);
1672 
1673  if (d >= 0.) {
1674  s[0] = T(0, 2);
1675  s[1] = T(1, 2);
1676  s[2] = T(2, 2);
1677  s[3] = d;
1678  } else {
1679  s[0] = -T(0, 2);
1680  s[1] = -T(1, 2);
1681  s[2] = -T(2, 2);
1682  s[3] = -d;
1683  }
1684  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)){
1685  return std::nullopt;
1686  }
1687  }
1688 
1689  else if (ty == Trk::SurfaceType::Line) {
1690 
1691  double s[6] = {T(0, 3), T(1, 3), T(2, 3), T(0, 2), T(1, 2), T(2, 2)};
1692  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1693  return std::nullopt;
1694  }
1695  }
1696 
1697  else if (ty == Trk::SurfaceType::Cylinder) {
1698 
1699  const Trk::CylinderSurface* cyl = static_cast<const Trk::CylinderSurface*>(&targetSurface);
1700  double s[9] = {
1701  T(0, 3), T(1, 3), T(2, 3), T(0, 2), T(1, 2), T(2, 2), cyl->bounds().r(), Trk::alongMomentum, 0.};
1702  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1703  return std::nullopt;
1704  }
1705  }
1706 
1707  else if (ty == Trk::SurfaceType::Cone) {
1708 
1709  double k = static_cast<const Trk::ConeSurface*>(&targetSurface)->bounds().tanAlpha();
1710  k = k * k + 1.;
1711  double s[9] = {T(0, 3), T(1, 3), T(2, 3), T(0, 2), T(1, 2), T(2, 2), k, Trk::alongMomentum, 0.};
1712  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1713  return std::nullopt;
1714  }
1715  }
1716 
1717  else if (ty == Trk::SurfaceType::Perigee) {
1718 
1719  double s[6] = {T(0, 3), T(1, 3), T(2, 3), 0., 0., 1.};
1720  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1721  return std::nullopt;
1722  }
1723  }
1724 
1725  else { // presumably curvilinear
1726 
1727  double s[4];
1728  double d = T(0, 3) * T(0, 2) + T(1, 3) * T(1, 2) + T(2, 3) * T(2, 2);
1729 
1730  if (d >= 0.) {
1731  s[0] = T(0, 2);
1732  s[1] = T(1, 2);
1733  s[2] = T(2, 2);
1734  s[3] = d;
1735  } else {
1736  s[0] = -T(0, 2);
1737  s[1] = -T(1, 2);
1738  s[2] = -T(2, 2);
1739  s[3] = -d;
1740  }
1741  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1742  return std::nullopt;
1743  }
1744  }
1745 
1746  Amg::Vector3D globalPosition(cache.m_P[0], cache.m_P[1], cache.m_P[2]);
1747  Amg::Vector3D direction(cache.m_P[3], cache.m_P[4], cache.m_P[5]);
1748  return std::make_optional<Trk::TrackSurfaceIntersection>(globalPosition, direction, path);
1749 }

◆ intersectSurface()

std::optional< Trk::TrackSurfaceIntersection > Trk::STEP_Propagator::intersectSurface ( const EventContext &  ctx,
const Surface surface,
const TrackSurfaceIntersection trackIntersection,
const double  qOverP,
const MagneticFieldProperties mft,
ParticleHypothesis  particle 
) const
finaloverridevirtual

Intersection and propagation:

Implements Trk::IPropagator.

Definition at line 1752 of file STEP_Propagator.cxx.

1756  {
1757 
1758  const Amg::Vector3D& origin = trackIntersection.position();
1759  const Amg::Vector3D& direction = trackIntersection.direction();
1760 
1761  auto perigeeSurface = PerigeeSurface(origin);
1762  perigeeSurface.setOwner(Trk::userOwn); // tmp ones
1763 
1764  auto tmpTrackParameters =
1765  Trk::Perigee(0., 0., direction.phi(), direction.theta(), qOverP, perigeeSurface, std::nullopt);
1766 
1767  std::optional<Trk::TrackSurfaceIntersection> solution =
1768  qOverP == 0
1769  ? intersect(ctx, tmpTrackParameters, surface,
1771  : intersect(ctx, tmpTrackParameters, surface, mft, particle, nullptr);
1772 
1773  return solution;
1774 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ multiStatePropagate()

virtual Trk::MultiComponentState Trk::STEP_Propagator::multiStatePropagate ( const EventContext &  ,
const MultiComponentState ,
const Surface ,
const MagneticFieldProperties ,
const  PropDirection,
const BoundaryCheck ,
const  ParticleHypothesis 
) const
inlinefinaloverridevirtual

unimplemented multiStatePropagate

Implements Trk::IPropagator.

Definition at line 325 of file STEP_Propagator.h.

333  {
334  ATH_MSG_ERROR("Call to non-implemented multiStatePropagate");
335  return {};
336  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ propagate() [1/11]

virtual Trk::ExtrapolationCode Trk::STEP_Propagator::propagate ( const EventContext &  ctx,
Trk::ExCellCharged eCell,
Trk::TargetSurfaces sfs,
Trk::TargetSurfaceVector solutions 
) const
inlinefinaloverridevirtual

Propagation method needed for StepEngine.

Implements Trk::IPropagator.

Definition at line 337 of file STEP_Propagator.h.

342  {
344  }

◆ propagate() [2/11]

virtual std::unique_ptr<TrackParameters> Trk::IPropagator::propagate

Main propagation method without transport jacobian production.

◆ propagate() [3/11]

virtual std::unique_ptr<TrackParameters> Trk::IPropagator::propagate ( const EventContext &  ctx,
const TrackParameters parm,
const Surface sf,
PropDirection  dir,
const BoundaryCheck bcheck,
const MagneticFieldProperties mprop,
std::optional< TransportJacobian > &  jacob,
double &  pathLength,
ParticleHypothesis  particle = pion,
bool  returnCurv = false,
const TrackingVolume tVol = nullptr 
) const
pure virtualinherited

Main propagation method with transport jacobian production.

Implemented in Trk::IntersectorWrapper, and Trk::RungeKuttaPropagator.

◆ propagate() [4/11]

virtual std::unique_ptr<TrackParameters> Trk::IPropagator::propagate

Main propagation method with transport jacobian production.

◆ propagate() [5/11]

virtual std::unique_ptr<TrackParameters> Trk::IPropagator::propagate

Propagate parameters and covariance with search of closest surface.

◆ propagate() [6/11]

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagate ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
const Trk::Surface targetSurface,
Trk::PropDirection  propagationDirection,
const Trk::BoundaryCheck boundaryCheck,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters and covariance without returning the Jacobian.

Implements Trk::IPropagator.

Definition at line 1238 of file STEP_Propagator.cxx.

1242  {
1243 
1244  // ATH_MSG_WARNING( "[STEP_Propagator] enter 1");
1245 
1246  double Jacobian[25];
1247  Cache cache(ctx);
1248 
1249  // Get field cache object
1250  getFieldCacheObject(cache, ctx);
1251  setCacheFromProperties(cache);
1252  clearMaterialEffects(cache);
1253 
1254  // Check for tracking volume (materialproperties)
1255  cache.m_trackingVolume = tVol;
1256  cache.m_material = tVol;
1257  cache.m_matPropOK = tVol != nullptr;
1258 
1259  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1260  cache.m_matupd_lastpath = 0.;
1261  cache.m_matdump_lastpath = 0.;
1262 
1263  // no identified intersections needed/ no material dump / no path cache
1264  cache.m_identifiedParameters = nullptr;
1265  cache.m_matstates = nullptr;
1266  cache.m_extrapolationCache = nullptr;
1267  cache.m_hitVector = nullptr;
1268 
1269  return propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1270  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1271 }

◆ propagate() [7/11]

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagate ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
const Trk::Surface targetSurface,
Trk::PropDirection  propagationDirection,
const Trk::BoundaryCheck boundaryCheck,
const MagneticFieldProperties magneticFieldProperties,
std::optional< Trk::TransportJacobian > &  jacobian,
double &  pathLimit,
ParticleHypothesis  particle,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters and covariance, and return the Jacobian.

WARNING: Multiple Scattering is not included in the Jacobian!

Definition at line 1470 of file STEP_Propagator.cxx.

1481  {
1482 
1483  double Jacobian[25];
1484  Cache cache(ctx);
1485 
1486  // Get field cache object
1487  getFieldCacheObject(cache, ctx);
1488  setCacheFromProperties(cache);
1489  clearMaterialEffects(cache);
1490 
1491  // Check for tracking volume (materialproperties)
1492  cache.m_trackingVolume = tVol;
1493  cache.m_material = tVol;
1494  cache.m_matPropOK = tVol != nullptr;
1495 
1496  // no identified intersections needed/ no material dump
1497  cache.m_identifiedParameters = nullptr;
1498  cache.m_matstates = nullptr;
1499  cache.m_extrapolationCache = nullptr;
1500  cache.m_hitVector = nullptr;
1501 
1502  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1503  cache.m_matupd_lastpath = 0.;
1504  cache.m_matdump_lastpath = 0.;
1505 
1506  std::unique_ptr<Trk::TrackParameters> parameters =
1507  propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1508  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1509 
1510  if (parameters) {
1511  Jacobian[24] = Jacobian[20];
1512  Jacobian[23] = 0.;
1513  Jacobian[22] = 0.;
1514  Jacobian[21] = 0.;
1515  Jacobian[20] = 0.;
1516  jacobian = std::make_optional<Trk::TransportJacobian>(Jacobian);
1517  } else {
1518  jacobian.reset();
1519  }
1520 
1521  return parameters;
1522 }

◆ propagate() [8/11]

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagate ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
std::vector< Trk::DestSurf > &  targetSurfaces,
Trk::PropDirection  propagationDirection,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
std::vector< unsigned int > &  solutions,
double &  path,
bool  usePathLimit = false,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters and covariance with search of closest surface.

Implements Trk::IPropagator.

Definition at line 1277 of file STEP_Propagator.cxx.

1282  {
1283 
1284  Cache cache(ctx);
1285 
1286  // Get field cache object
1287  getFieldCacheObject(cache, ctx);
1288  setCacheFromProperties(cache);
1289  clearMaterialEffects(cache);
1290 
1291  // Check for tracking volume (materialproperties)
1292  cache.m_trackingVolume = tVol;
1293  cache.m_material = tVol;
1294  cache.m_matPropOK = tVol != nullptr;
1295 
1296  // no identified intersections needed/ no material dump
1297  cache.m_identifiedParameters = nullptr;
1298  cache.m_matstates = nullptr;
1299  cache.m_extrapolationCache = nullptr;
1300  cache.m_hitVector = nullptr;
1301 
1302  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1303  cache.m_matupd_lastpath = 0.;
1304  cache.m_matdump_lastpath = 0.;
1305 
1306  // resolve path limit input
1307  if (path > 0.) {
1308  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1309  cache.m_pathLimit = path;
1310  path = 0.;
1311  } else {
1312  cache.m_propagateWithPathLimit = 0;
1313  cache.m_pathLimit = -1.;
1314  path = 0.;
1315  }
1316  if (particle == Trk::neutron || particle == Trk::photon || particle == Trk::pi0 || particle == Trk::k0)
1317  return propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1318  usePathLimit, returnCurv);
1319 
1320  return propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1321  magneticFieldProperties, particle, solutions, path, returnCurv);
1322 }

◆ propagate() [9/11]

virtual Trk::ExtrapolationCode Trk::IPropagator::propagate

Propagation method needed for StepEngine.

◆ propagate() [10/11]

virtual std::unique_ptr<NeutralParameters> Trk::IPropagator::propagate

Main propagation method for NeutralParameters.

◆ propagate() [11/11]

std::unique_ptr< Trk::NeutralParameters > Trk::STEP_Propagator::propagate ( const Trk::NeutralParameters ,
const Trk::Surface ,
Trk::PropDirection  ,
const Trk::BoundaryCheck ,
bool  rC = false 
) const
finaloverridevirtual

Main propagation method NeutralParameters.

It is not implemented for STEP propagator.

Use StraightLinePropagator for neutrals

Implements Trk::IPropagator.

Definition at line 1225 of file STEP_Propagator.cxx.

1229  {
1230  ATH_MSG_WARNING("[STEP_Propagator] STEP_Propagator does not handle neutral track parameters."
1231  << "Use the StraightLinePropagator instead.");
1232  return nullptr;
1233 }

◆ propagateM()

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagateM ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
std::vector< Trk::DestSurf > &  targetSurfaces,
Trk::PropDirection  propagationDirection,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
std::vector< unsigned int > &  solutions,
std::vector< const Trk::TrackStateOnSurface * > *&  matstates,
std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int >> *  intersections,
double &  path,
bool  usePathLimit = false,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr,
Trk::ExtrapolationCache extrapCache = nullptr 
) const
finaloverridevirtual

Propagate parameters and covariance with search of closest surface and material collection.

Implements Trk::IPropagator.

Definition at line 1414 of file STEP_Propagator.cxx.

1421  {
1422 
1423  Cache cache(ctx);
1424 
1425  // Get field cache object
1426  getFieldCacheObject(cache, ctx);
1427  setCacheFromProperties(cache);
1428  clearMaterialEffects(cache);
1429 
1430  // Check for tracking volume (materialproperties)
1431  cache.m_trackingVolume = tVol;
1432  cache.m_material = tVol;
1433  cache.m_matPropOK = tVol != nullptr;
1434 
1435  cache.m_matstates = matstates;
1436  cache.m_identifiedParameters = intersections;
1437  cache.m_extrapolationCache = extrapCache;
1438  cache.m_hitVector = nullptr;
1439 
1440  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1441  cache.m_matupd_lastpath = 0.;
1442  cache.m_matdump_lastpath = 0.;
1443  cache.m_extrapolationCache = extrapCache;
1444 
1445  // switch on the detailed energy loss
1446  if (cache.m_extrapolationCache) {
1447  cache.m_detailedElossFlag = true;
1448  }
1449  // resolve path limit input
1450  if (path > 0.) {
1451  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1452  cache.m_pathLimit = path;
1453  path = 0.;
1454  } else {
1455  cache.m_propagateWithPathLimit = 0;
1456  cache.m_pathLimit = -1.;
1457  path = 0.;
1458  }
1459  if (particle == Trk::neutron || particle == Trk::photon || particle == Trk::pi0 || particle == Trk::k0) {
1460  return propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1461  usePathLimit, returnCurv);
1462  }
1463  return propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1464  magneticFieldProperties, particle, solutions, path, returnCurv);
1465 }

◆ propagateParameters() [1/3]

virtual std::unique_ptr<TrackParameters> Trk::IPropagator::propagateParameters ( const EventContext &  ctx,
const TrackParameters parm,
const Surface sf,
PropDirection  dir,
const BoundaryCheck bcheck,
const MagneticFieldProperties mprop,
std::optional< TransportJacobian > &  jacob,
ParticleHypothesis  particle = pion,
bool  returnCurv = false,
const TrackingVolume tVol = nullptr 
) const
pure virtualinherited

Main propagation method for parameters only with transport jacobian production.

Implemented in Trk::IntersectorWrapper, and Trk::RungeKuttaPropagator.

◆ propagateParameters() [2/3]

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagateParameters ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
const Trk::Surface targetSurface,
Trk::PropDirection  propagationDirection,
const Trk::BoundaryCheck boundaryCheck,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters only.

Implements Trk::IPropagator.

Definition at line 1528 of file STEP_Propagator.cxx.

1532  {
1533 
1534  double Jacobian[25];
1535  Cache cache(ctx);
1536 
1537  // Get field cache object
1538  getFieldCacheObject(cache, ctx);
1539  setCacheFromProperties(cache);
1540  clearMaterialEffects(cache);
1541 
1542  // Check for tracking volume (materialproperties)
1543  cache.m_trackingVolume = tVol;
1544  cache.m_material = tVol;
1545  cache.m_matPropOK = tVol != nullptr;
1546 
1547  // no identified intersections needed/ no material dump
1548  cache.m_identifiedParameters = nullptr;
1549  cache.m_matstates = nullptr;
1550  cache.m_hitVector = nullptr;
1551 
1552  return propagateRungeKuttaImpl(cache, false, trackParameters, targetSurface, propagationDirection,
1553  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1554 }

◆ propagateParameters() [3/3]

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagateParameters ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
const Trk::Surface targetSurface,
Trk::PropDirection  propagationDirection,
const Trk::BoundaryCheck boundaryCheck,
const MagneticFieldProperties magneticFieldProperties,
std::optional< Trk::TransportJacobian > &  jacobian,
ParticleHypothesis  particle,
bool  returnCurv = false,
const Trk::TrackingVolume tVol = nullptr 
) const
finaloverridevirtual

Propagate parameters and return Jacobian.

WARNING: Multiple Scattering is not included in the Jacobian!

Definition at line 1559 of file STEP_Propagator.cxx.

1569  {
1570 
1571  double Jacobian[25];
1572 
1573  Cache cache(ctx);
1574 
1575  // Get field cache object
1576  getFieldCacheObject(cache, ctx);
1577  setCacheFromProperties(cache);
1578  clearMaterialEffects(cache);
1579 
1580  // Check for tracking volume (materialproperties)
1581  cache.m_trackingVolume = tVol;
1582  cache.m_material = tVol;
1583  cache.m_matPropOK = tVol != nullptr;
1584 
1585  // no identified intersections needed/ no material dump
1586  cache.m_identifiedParameters = nullptr;
1587  cache.m_matstates = nullptr;
1588  cache.m_extrapolationCache = nullptr;
1589  cache.m_hitVector = nullptr;
1590 
1591  std::unique_ptr<Trk::TrackParameters> parameters =
1592  propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1593  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1594 
1595  if (parameters) {
1596  Jacobian[24] = Jacobian[20];
1597  Jacobian[23] = 0.;
1598  Jacobian[22] = 0.;
1599  Jacobian[21] = 0.;
1600  Jacobian[20] = 0.;
1601  jacobian = std::make_optional<Trk::TransportJacobian>(Jacobian);
1602  } else {
1603  jacobian.reset();
1604  }
1605 
1606  return parameters;
1607 }

◆ propagateRungeKutta()

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagateRungeKutta ( Cache cache,
bool  errorPropagation,
const Trk::TrackParameters trackParameters,
std::vector< DestSurf > &  targetSurfaces,
Trk::PropDirection  propagationDirection,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
std::vector< unsigned int > &  solutions,
double &  path,
bool  returnCurv = false 
) const
private

Check first that the jacobian does not have crazy entries

Definition at line 1890 of file STEP_Propagator.cxx.

1894  {
1895  // Store for later use
1896  cache.m_particle = particle;
1897  cache.m_charge = inputTrackParameters.charge();
1898  cache.m_inputThetaVariance = 0.;
1899 
1900  std::unique_ptr<Trk::TrackParameters> trackParameters{};
1901 
1902  // Bfield mode
1903  mft.magneticFieldMode() == Trk::FastField ? cache.m_solenoid = true : cache.m_solenoid = false;
1904 
1905  // Check inputvalues
1906  if (cache.m_tolerance <= 0.)
1907  return nullptr;
1908  if (cache.m_momentumCutOff < 0.)
1909  return nullptr;
1910 
1911  // Set momentum to 1e10 (straight line) and charge to + if q/p is zero
1912  if (inputTrackParameters.parameters()[Trk::qOverP] == 0) {
1913  trackParameters = createStraightLine(&inputTrackParameters);
1914  if (!trackParameters) {
1915  return nullptr;
1916  }
1917  } else {
1918  trackParameters.reset(inputTrackParameters.clone());
1919  }
1920 
1921  if (std::abs(1. / trackParameters->parameters()[Trk::qOverP]) <= cache.m_momentumCutOff) {
1922  return nullptr;
1923  }
1924 
1925  // Check for empty volumes. If x != x then x is not a number.
1926  if (cache.m_matPropOK && ((cache.m_material->zOverAtimesRho() == 0.) || (cache.m_material->x0() == 0.) ||
1927  (cache.m_material->zOverAtimesRho() != cache.m_material->zOverAtimesRho()))) {
1928  cache.m_matPropOK = false;
1929  }
1930 
1931  if (errorPropagation && !trackParameters->covariance()) {
1932  errorPropagation = false;
1933  }
1934 
1935  if (cache.m_matPropOK && errorPropagation && cache.m_straggling)
1936  cache.m_stragglingVariance = 0.;
1937  cache.m_combinedCovariance.setZero();
1938  cache.m_covariance.setZero();
1939 
1940  if (errorPropagation || cache.m_matstates) {
1941  // this needs debugging
1942  cache.m_inputThetaVariance = trackParameters->covariance() ? (*trackParameters->covariance())(3, 3) : 0.;
1943  cache.m_combinedEloss.set(0., 0., 0., 0., 0., 0.);
1944  cache.m_combinedThickness = 0.;
1945  }
1946 
1947  // double P[45]; // Track parameters and jacobian
1948  if (!Trk::RungeKuttaUtils::transformLocalToGlobal(errorPropagation, *trackParameters, cache.m_P)) {
1949  return nullptr;
1950  }
1951 
1952  double path = 0.;
1953 
1954  // activate brem photon emission if required
1955  cache.m_brem = m_simulation && particle == Trk::electron && m_simMatUpdator;
1956 
1957  // loop while valid solutions
1958  bool validStep = true;
1959  totalPath = 0.;
1960  cache.m_timeOfFlight = 0.;
1961  // Common transformation for all surfaces (angles and momentum)
1962  double localp[5];
1963  double Jacobian[21];
1964  while (validStep) {
1965  // propagation to next surface
1966  validStep = propagateWithJacobian(cache, errorPropagation, targetSurfaces, cache.m_P,
1967  propagationDirection, solutions, path, totalPath);
1968  if (!validStep) {
1969  return nullptr;
1970  }
1971  if (propagationDirection * path <= 0.) {
1972  return nullptr;
1973  }
1974  totalPath += path;
1975  cache.m_timeOfFlight += cache.m_timeStep;
1976  if (cache.m_propagateWithPathLimit > 1 || cache.m_binMat) {
1977  // make sure that for sliding surfaces the result does not get distorted
1978  // return curvilinear parameters
1979  std::unique_ptr<Trk::CurvilinearParameters> cPar = nullptr;
1981  if (!errorPropagation) {
1982  cPar = std::make_unique<Trk::CurvilinearParameters>(
1983  Amg::Vector3D(cache.m_P[0], cache.m_P[1], cache.m_P[2]), localp[2], localp[3], localp[4]);
1984  } else {
1985  double useless[2];
1986  Trk::RungeKuttaUtils::transformGlobalToCurvilinear(true, cache.m_P, useless, Jacobian);
1987  AmgSymMatrix(5) measurementCovariance =
1988  Trk::RungeKuttaUtils::newCovarianceMatrix(Jacobian, *trackParameters->covariance());
1989  // Calculate multiple scattering and straggling covariance contribution.
1990  if (cache.m_matPropOK && (cache.m_multipleScattering || cache.m_straggling) &&
1991  std::abs(totalPath) > 0.) {
1992  covarianceContribution(cache, trackParameters.get(), totalPath, std::abs(1. / cache.m_P[6]),
1993  measurementCovariance);
1994  }
1995  cPar = std::make_unique<Trk::CurvilinearParameters>(
1996  Amg::Vector3D(cache.m_P[0], cache.m_P[1], cache.m_P[2]), localp[2], localp[3], localp[4],
1997  std::move(measurementCovariance));
1998  }
1999  // material collection : first iteration, bin material averaged
2000  // collect material
2001  if (cache.m_binMat && (cache.m_matstates || (errorPropagation && cache.m_extrapolationCache)) &&
2002  std::abs(totalPath - cache.m_matdump_lastpath) > 1.) {
2003  dumpMaterialEffects(cache, cPar.get(), totalPath);
2004  }
2005  return cPar;
2006  }
2007  if (cache.m_propagateWithPathLimit > 0)
2008  cache.m_pathLimit -= path;
2009  // boundary check
2010  // take into account that there may be many identical surfaces with different boundaries
2011  Amg::Vector3D gp(cache.m_P[0], cache.m_P[1], cache.m_P[2]);
2012  bool solution = false;
2013  std::vector<unsigned int> valid_solutions;
2014  valid_solutions.reserve(solutions.size());
2015 
2016  std::vector<unsigned int>::iterator iSol = solutions.begin();
2017  while (iSol != solutions.end()) {
2018  if (targetSurfaces[*iSol].first->isOnSurface(gp, targetSurfaces[*iSol].second, 0.001, 0.001)) {
2019  if (!solution) {
2021  if (returnCurv || targetSurfaces[*iSol].first->type() == Trk::SurfaceType::Cone) {
2022  Trk::RungeKuttaUtils::transformGlobalToCurvilinear(errorPropagation, cache.m_P, localp, Jacobian);
2023  } else
2024  Trk::RungeKuttaUtils::transformGlobalToLocal(targetSurfaces[*iSol].first, errorPropagation,
2025  cache.m_P, localp, Jacobian);
2026  solution = true;
2027  }
2028  valid_solutions.push_back(*iSol);
2029  }
2030  ++iSol;
2031  }
2032  solutions = std::move(valid_solutions);
2033  if (solution)
2034  break;
2035  }
2036 
2037  if (solutions.empty()) {
2038  return nullptr;
2039  }
2040 
2041  // simulation mode : smear momentum
2042  if (m_simulation && cache.m_matPropOK) {
2043  double radDist = totalPath / cache.m_material->x0();
2044  smear(cache, localp[2], localp[3], trackParameters.get(), radDist);
2045  }
2046 
2047  std::unique_ptr<Trk::TrackParameters> onTargetSurf =
2048  (returnCurv || targetSurfaces[solutions[0]].first->type() == Trk::SurfaceType::Cone)
2049  ? nullptr
2050  : targetSurfaces[solutions[0]].first->createUniqueTrackParameters(
2051  localp[0], localp[1], localp[2], localp[3], localp[4], std::nullopt);
2052 
2053  if (!errorPropagation) {
2054  if (returnCurv || targetSurfaces[solutions[0]].first->type() == Trk::SurfaceType::Cone) {
2055  Amg::Vector3D gp(cache.m_P[0], cache.m_P[1], cache.m_P[2]);
2056  return std::make_unique<Trk::CurvilinearParameters>(gp, localp[2], localp[3], localp[4]);
2057  }
2058  return onTargetSurf;
2059  }
2060 
2061  // Errormatrix is included. Use Jacobian to calculate new covariance
2063  for (double i : Jacobian) {
2064  if (!Amg::saneCovarianceElement(i)) {
2065  return nullptr;
2066  }
2067  }
2068 
2069  AmgSymMatrix(5) measurementCovariance =
2070  Trk::RungeKuttaUtils::newCovarianceMatrix(Jacobian, *trackParameters->covariance());
2071  if (!Amg::hasPositiveOrZeroDiagElems(measurementCovariance))
2072  return nullptr;
2073 
2074  // Calculate multiple scattering and straggling covariance contribution.
2075  if (cache.m_matPropOK && (cache.m_multipleScattering || cache.m_straggling) && std::abs(totalPath) > 0.) {
2076  if (returnCurv || targetSurfaces[solutions[0]].first->type() == Trk::SurfaceType::Cone) {
2077  covarianceContribution(cache, trackParameters.get(), totalPath, std::abs(1. / cache.m_P[6]),
2078  measurementCovariance);
2079  } else {
2080  covarianceContribution(cache, trackParameters.get(), totalPath, onTargetSurf.get(),
2081  measurementCovariance);
2082  }
2083  }
2084 
2085  if (returnCurv || targetSurfaces[solutions[0]].first->type() == Trk::SurfaceType::Cone) {
2086  Amg::Vector3D gp(cache.m_P[0], cache.m_P[1], cache.m_P[2]);
2087  return std::make_unique<Trk::CurvilinearParameters>(gp, localp[2], localp[3], localp[4],
2088  std::move(measurementCovariance));
2089  }
2090 
2091  // delete onTargetSurf; // the covariance matrix can be just added instead of recreating ?
2092  return targetSurfaces[solutions[0]].first->createUniqueTrackParameters(
2093  localp[0], localp[1], localp[2], localp[3], localp[4], std::move(measurementCovariance));
2094 }

◆ propagateT()

std::unique_ptr< Trk::TrackParameters > Trk::STEP_Propagator::propagateT ( const EventContext &  ctx,
const Trk::TrackParameters trackParameters,
std::vector< Trk::DestSurf > &  targetSurfaces,
Trk::PropDirection  propagationDirection,
const MagneticFieldProperties magneticFieldProperties,
ParticleHypothesis  particle,
std::vector< unsigned int > &  solutions,
Trk::PathLimit path,
Trk::TimeLimit time,
bool  returnCurv,
const Trk::TrackingVolume tVol,
std::vector< Trk::HitInfo > *&  hitVector 
) const
finaloverridevirtual

Propagate parameters and covariance with search of closest surface time included.

Implements Trk::IPropagator.

Definition at line 1328 of file STEP_Propagator.cxx.

1333  {
1334 
1335  Cache cache(ctx);
1336 
1337  // Get field cache object
1338  getFieldCacheObject(cache, ctx);
1339  setCacheFromProperties(cache);
1340  clearMaterialEffects(cache);
1341 
1342  // cache particle mass
1343  cache.m_particleMass = Trk::ParticleMasses::mass[particle]; // Get particle mass from ParticleHypothesis
1344 
1345  // cache input timing - for secondary track emission
1346  cache.m_timeIn = timeLim.time;
1347 
1348  // Check for tracking volume (materialproperties)
1349  cache.m_trackingVolume = tVol;
1350  cache.m_material = tVol;
1351  cache.m_matPropOK = tVol != nullptr;
1352 
1353  // no identified intersections needed/ no material dump
1354  cache.m_identifiedParameters = nullptr;
1355  cache.m_matstates = nullptr;
1356  cache.m_extrapolationCache = nullptr;
1357  cache.m_hitVector = hitVector;
1358 
1359  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1360  cache.m_matupd_lastpath = 0.;
1361  cache.m_matdump_lastpath = 0.;
1362 
1363  // convert time/path limits into trajectory limit (in mm)
1364  double dMat = pathLim.x0Max - pathLim.x0Collected;
1365  double path =
1366  dMat > 0 && cache.m_matPropOK && cache.m_material->x0() > 0. ? dMat * cache.m_material->x0() : -1.;
1367 
1368  double dTim = timeLim.tMax - timeLim.time;
1369  double beta = 1.;
1370  if (dTim > 0.) {
1371  double mom = trackParameters.momentum().mag();
1372  beta = mom / std::sqrt(mom * mom + cache.m_particleMass * cache.m_particleMass);
1373  }
1374  double timMax = dTim > 0 ? dTim * beta * Gaudi::Units::c_light : -1.;
1375 
1376  if (timMax > 0. && timMax < path)
1377  path = timMax;
1378  bool usePathLimit = (path > 0.);
1379 
1380  // resolve path limit input
1381  if (path > 0.) {
1382  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1383  cache.m_pathLimit = path;
1384  path = 0.;
1385  } else {
1386  cache.m_propagateWithPathLimit = 0;
1387  cache.m_pathLimit = -1.;
1388  path = 0.;
1389  }
1390 
1391  std::unique_ptr<Trk::TrackParameters> nextPar{};
1392 
1393  if (particle == Trk::neutron || particle == Trk::photon || particle == Trk::pi0 || particle == Trk::k0) {
1394  nextPar = propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1395  usePathLimit, returnCurv);
1396  } else {
1397  nextPar = propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1398  magneticFieldProperties, particle, solutions, path, returnCurv);
1399  }
1400  // update material path
1401  if (cache.m_matPropOK && cache.m_material->x0() > 0. && path > 0.) {
1402  pathLim.updateMat(path / cache.m_material->x0(), cache.m_material->averageZ(), 0.);
1403  }
1404  // return value
1405  timeLim.time += cache.m_timeOfFlight;
1406  return nextPar;
1407 }

◆ propagateWithJacobian()

bool Trk::STEP_Propagator::propagateWithJacobian ( Cache cache,
bool  errorPropagation,
std::vector< DestSurf > &  sfs,
double *  P,
Trk::PropDirection  propDir,
std::vector< unsigned int > &  solutions,
double &  path,
double  sumPath 
) const
private

Definition at line 2100 of file STEP_Propagator.cxx.

2104  {
2105  double maxPath = cache.m_maxPath; // Max path allowed
2106  double* pos = &P[0]; // Start coordinates
2107  double* dir = &P[3]; // Start directions
2108  double dDir[3] = {0., 0., 0.}; // Start directions derivs. Zero in case of no RK steps
2109  // int targetPassed = 0; // how many times have we passed the target?
2110  double previousDistance = 0.;
2111  double distanceStepped = 0.;
2112  double BG1[12] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; // Bx, By, Bz, dBx/dx, dBx/dy, dBx/dz,
2113  // dBy/dx, dBy/dy, dBy/dz, dBz/dx, dBz/dy, dBz/dz at first point
2114  bool firstStep = true; // Poll BG1, else recycle BG4
2115  int steps = 0;
2116  path = 0.; // path of the trajectory
2117  cache.m_timeStep = 0.; // time separation corresponding to the trajectory
2118  double mom = 0.; // need momentum and beta for timing
2119  double beta = 1.; // need momentum and beta for timing
2120 
2121  // factor to stabilize iteration for soft tracks
2122  double helpSoft = 1.;
2123 
2124  // limit number of recovery attempts
2125  int restartLimit = 10;
2126 
2127  Amg::Vector3D position(P[0], P[1], P[2]);
2128  Amg::Vector3D direction0(P[3], P[4], P[5]);
2129 
2130  // binned material ?
2131  cache.m_binMat = nullptr;
2132  if (cache.m_trackingVolume && cache.m_trackingVolume->isAlignable()) {
2133  const Trk::AlignableTrackingVolume* aliTV =
2134  static_cast<const Trk::AlignableTrackingVolume*>(cache.m_trackingVolume);
2135  cache.m_binMat = aliTV->binnedMaterial();
2136  }
2137 
2138  // closest distance estimate
2139  // maintain count of oscilations and previous distance for each surface;
2140  // skip initial trivial solutions (input parameters at surface) - should be treated before call to the
2141  // propagator
2142  // !
2143  double tol = 0.001;
2144  solutions.clear();
2145  double distanceToTarget = propDir * maxPath;
2146  cache.m_currentDist.resize(sfs.size()); // keep size through the call
2147 
2148  int nextSf = sfs.size();
2149  int nextSfCand = nextSf;
2150  std::vector<DestSurf>::iterator sIter = sfs.begin();
2151  std::vector<DestSurf>::iterator sBeg = sfs.begin();
2152  unsigned int numSf = 0;
2153  unsigned int iCurr = 0; // index for m_currentDist
2154  int startSf = -99;
2155  for (; sIter != sfs.end(); ++sIter) {
2156  Trk::DistanceSolution distSol = (*sIter).first->straightLineDistanceEstimate(position, direction0);
2157  double distEst = -propDir * maxPath;
2158  double dist1Est = distEst;
2159  if (distSol.numberOfSolutions() > 0) {
2160  distEst = distSol.first();
2161  dist1Est = distSol.first();
2162  if (distSol.numberOfSolutions() > 1 &&
2163  (std::abs(distEst) < tol || (propDir * distEst < -tol && propDir * distSol.second() > tol)))
2164  distEst = distSol.second();
2165  }
2166  // select input surfaces;
2167  // do not accept trivial solutions (at the surface)
2168  // but include them into further distance estimate (aca return to the same surface)
2169  if (distEst * propDir > -tol) {
2170  if (distSol.currentDistance() > 500.) {
2171  cache.m_currentDist[iCurr] = std::pair<int, std::pair<double, double>>(
2172  0, std::pair<double, double>(distEst, distSol.currentDistance(true)));
2173  } else {
2174  cache.m_currentDist[iCurr] = std::pair<int, std::pair<double, double>>(
2175  1, std::pair<double, double>(distEst, distSol.currentDistance(true)));
2176  }
2177  if (tol < propDir * distEst && propDir * distEst < propDir * distanceToTarget) {
2178  distanceToTarget = distEst;
2179  nextSf = iCurr;
2180  }
2181  ++numSf;
2182  } else {
2183  // save the nearest distance to surface
2184  cache.m_currentDist[iCurr] = std::pair<int, std::pair<double, double>>(
2185  -1, std::pair<double, double>(distSol.currentDistance(), distSol.currentDistance(true)));
2186  }
2187  if (std::abs(dist1Est) < tol)
2188  startSf = (int)iCurr;
2189  ++iCurr;
2190  }
2191 
2192  if (distanceToTarget == maxPath || numSf == 0)
2193  return false;
2194 
2195  // these do not change
2196  std::vector<std::pair<int, std::pair<double, double>>>::iterator vsBeg = cache.m_currentDist.begin();
2197  std::vector<std::pair<int, std::pair<double, double>>>::iterator vsEnd = cache.m_currentDist.end();
2198  const int num_vs_dist = cache.m_currentDist.size();
2199 
2200  // Set initial step length to 100mm or the distance to the target surface.
2201  double h = 0;
2202  double absPath = 0.;
2203  distanceToTarget > 100. ? h = 100. : distanceToTarget < -100. ? h = -100. : h = distanceToTarget;
2204 
2205  const Trk::IdentifiedMaterial* binIDMat = nullptr;
2206  // Adapt step size to the material binning : change of bin layer triggers dump of material effects
2207  if (cache.m_binMat) {
2208  const Trk::BinUtility* lbu = cache.m_binMat->layerBinUtility(position);
2209  if (lbu) {
2210  cache.m_currentLayerBin = cache.m_binMat->layerBin(position);
2211  binIDMat = cache.m_binMat->material(position);
2212  std::pair<size_t, float> dist2next = lbu->distanceToNext(position, propDir * direction0);
2213  if (dist2next.first < lbu->bins() && std::abs(dist2next.second) > 1. &&
2214  std::abs(dist2next.second) < std::abs(h)) {
2215  h = dist2next.second * propDir;
2216  }
2217  if (binIDMat)
2218  cache.m_material = binIDMat->first;
2219  }
2220  }
2221 
2222  // Step to within distanceTolerance, then do the rest as a Taylor expansion.
2223  // Keep distanceTolerance within [1 nanometer, 10 microns].
2224  // This means that no final Taylor expansions beyond 10 microns and no
2225  // Runge-Kutta steps less than 1 nanometer are allowed.
2226  double distanceTolerance = std::min(std::max(std::abs(distanceToTarget) * cache.m_tolerance, 1e-6), 1e-2);
2227 
2228  // bremstrahlung : sample if activated
2229  if (cache.m_brem) {
2230  mom = std::abs(1. / P[6]);
2231  sampleBrem(cache, mom);
2232  }
2233 
2234  while (numSf > 0 && (std::abs(distanceToTarget) > distanceTolerance ||
2235  std::abs(path + distanceStepped) < tol)) { // Step until within tolerance
2236  // Do the step. Stop the propagation if the energy goes below m_momentumCutOff
2237  if (!rungeKuttaStep(cache, errorPropagation, h, P, dDir, BG1, firstStep, distanceStepped)) {
2238  // emit brem photon before stopped ?
2239  if (cache.m_brem) {
2240  if (m_momentumCutOff < cache.m_bremEmitThreshold && m_simMatUpdator) {
2241  Amg::Vector3D position(P[0], P[1], P[2]);
2242  Amg::Vector3D direction(P[3], P[4], P[5]);
2243  m_simMatUpdator->recordBremPhoton(cache.m_timeIn + cache.m_timeOfFlight + cache.m_timeStep,
2244  m_momentumCutOff, cache.m_bremMom, position, direction,
2245  cache.m_particle);
2246  // the recoil can be skipped here
2247  for (int i = 0; i < 3; ++i)
2248  P[3 + i] = direction[i];
2249  // end recoil ( momentum not adjusted here ! continuous energy loss maintained for the moment)
2250  }
2251  }
2252  // collect material and update timing
2253  path = path + distanceStepped;
2254  // timing
2255  mom = std::abs(1. / P[6]);
2256  beta = mom / std::sqrt(mom * mom + cache.m_particleMass * cache.m_particleMass);
2257  cache.m_timeStep += distanceStepped / beta / Gaudi::Units::c_light;
2258 
2259  if (std::abs(distanceStepped) > 0.001) {
2260  cache.m_sigmaIoni = cache.m_sigmaIoni - cache.m_kazL * log(std::abs(distanceStepped));
2261  }
2262  // update straggling covariance
2263  if (errorPropagation && cache.m_straggling) {
2264  // 15% of the Radition moves the MOP value thus only 85% is accounted for by the Mean-MOP shift
2265  double sigTot2 = cache.m_sigmaIoni * cache.m_sigmaIoni + cache.m_sigmaRad * cache.m_sigmaRad;
2266  // /(beta*beta*p*p*p*p) transforms Var(E) to Var(q/p)
2267  double bp2 = beta * mom * mom;
2268  cache.m_stragglingVariance += sigTot2 / (bp2 * bp2) * distanceStepped * distanceStepped;
2269  }
2270  if (cache.m_matstates || errorPropagation) {
2271  cache.m_combinedEloss.update(
2272  cache.m_delIoni * distanceStepped, cache.m_sigmaIoni * std::abs(distanceStepped),
2273  cache.m_delRad * distanceStepped, cache.m_sigmaRad * std::abs(distanceStepped), cache.m_MPV);
2274  }
2275  if (cache.m_material && cache.m_material->x0() != 0.) {
2276  cache.m_combinedThickness += propDir * distanceStepped / cache.m_material->x0();
2277  }
2278 
2279  return false;
2280  }
2281  path = path + distanceStepped;
2282  absPath += std::abs(distanceStepped);
2283 
2284  // timing
2285  mom = std::abs(1. / P[6]);
2286  beta = mom / std::sqrt(mom * mom + cache.m_particleMass * cache.m_particleMass);
2287  cache.m_timeStep += distanceStepped / beta / Gaudi::Units::c_light;
2288 
2289  if (std::abs(distanceStepped) > 0.001)
2290  cache.m_sigmaIoni = cache.m_sigmaIoni - cache.m_kazL * log(std::abs(distanceStepped));
2291  // update straggling covariance
2292  if (errorPropagation && cache.m_straggling) {
2293  // 15% of the Radition moves the MOP value thus only 85% is accounted for by the Mean-MOP shift
2294  double sigTot2 = cache.m_sigmaIoni * cache.m_sigmaIoni + cache.m_sigmaRad * cache.m_sigmaRad;
2295  // /(beta*beta*p*p*p*p) transforms Var(E) to Var(q/p)
2296  double bp2 = beta * mom * mom;
2297  cache.m_stragglingVariance += sigTot2 / (bp2 * bp2) * distanceStepped * distanceStepped;
2298  }
2299  if (cache.m_matstates || errorPropagation) {
2300  cache.m_combinedEloss.update(
2301  cache.m_delIoni * distanceStepped, cache.m_sigmaIoni * std::abs(distanceStepped),
2302  cache.m_delRad * distanceStepped, cache.m_sigmaRad * std::abs(distanceStepped), cache.m_MPV);
2303  }
2304  if (cache.m_material && cache.m_material->x0() != 0.) {
2305  cache.m_combinedThickness += propDir * distanceStepped / cache.m_material->x0();
2306  }
2307 
2308  if (absPath > maxPath)
2309  return false;
2310 
2311  // path limit implemented
2312  if (cache.m_propagateWithPathLimit > 0 && cache.m_pathLimit <= path) {
2313  ++cache.m_propagateWithPathLimit;
2314  return true;
2315  }
2316 
2317  bool restart = false;
2318  // in case of problems, make shorter steps
2319  if (propDir * path < -tol || absPath - std::abs(path) > 10.) {
2320  helpSoft = std::abs(path) / absPath > 0.5 ? std::abs(path) / absPath : 0.5;
2321  }
2322 
2323  Amg::Vector3D position(P[0], P[1], P[2]);
2324  Amg::Vector3D direction(P[3], P[4], P[5]);
2325 
2326  // Adapt step size to the material binning : change of bin layer triggers dump of material effects
2327  float distanceToNextBin = h; // default
2328  if (cache.m_binMat) {
2329  const Trk::BinUtility* lbu = cache.m_binMat->layerBinUtility(position);
2330  if (lbu) {
2331  size_t layerBin = cache.m_binMat->layerBin(position);
2332  const Trk::IdentifiedMaterial* iMat = cache.m_binMat->material(position);
2333  std::pair<size_t, float> dist2next = lbu->distanceToNext(position, propDir * direction);
2334  distanceToNextBin = dist2next.second;
2335  if (layerBin != cache.m_currentLayerBin) { // step into new bin
2336  // check the overshoot
2337  std::pair<size_t, float> dist2previous = lbu->distanceToNext(position, -propDir * direction);
2338  float stepOver = dist2previous.second;
2339  double localp[5];
2341  auto cPar = std::make_unique<Trk::CurvilinearParameters>(Amg::Vector3D(P[0], P[1], P[2]), localp[2],
2342  localp[3], localp[4]);
2343  if (cache.m_identifiedParameters) {
2344  if (binIDMat && binIDMat->second > 0 && !iMat) { // exit from active layer
2345  cache.m_identifiedParameters->emplace_back(cPar->clone(), -binIDMat->second);
2346  } else if (binIDMat && binIDMat->second > 0 &&
2347  (iMat->second == 0 || iMat->second == binIDMat->second)) { // exit from active layer
2348  cache.m_identifiedParameters->emplace_back(cPar->clone(), -binIDMat->second);
2349  } else if (iMat && iMat->second > 0) { // entry active layer
2350  cache.m_identifiedParameters->emplace_back(cPar->clone(), iMat->second);
2351  }
2352  }
2353  if (cache.m_hitVector) {
2354  double hitTiming = cache.m_timeIn + cache.m_timeOfFlight + cache.m_timeStep;
2355  if (binIDMat && binIDMat->second > 0 && !iMat) { // exit from active layer
2356  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, -binIDMat->second, 0.);
2357  } else if (binIDMat && binIDMat->second > 0 &&
2358  (iMat->second == 0 || iMat->second == binIDMat->second)) { // exit from active layer
2359  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, -binIDMat->second, 0.);
2360  } else if (iMat && iMat->second > 0) { // entry active layer
2361  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, iMat->second, 0.);
2362  }
2363  }
2364 
2365  cache.m_currentLayerBin = layerBin;
2366  binIDMat = iMat;
2367  if (binIDMat) {
2368  // change of material triggers update of the cache
2369  // @TODO Coverity complains about a possible NULL pointer dereferencing here
2370  // because the code above does not explicitly forbid m_material to be NULL and m_material is used
2371  // unchecked inside updateMaterialEffects.
2372  // Can m_material be NULL at this point ?
2373  if (cache.m_material) {
2374  updateMaterialEffects(cache, mom, sin(direction.theta()), sumPath + path - stepOver);
2375  }
2376  cache.m_material = binIDMat->first;
2377  }
2378  // recalculate distance to next bin
2379  if (distanceToNextBin < h) {
2380  Amg::Vector3D probe = position + (distanceToNextBin + h) * propDir * direction;
2381  std::pair<size_t, float> d2n = lbu->distanceToNext(probe, propDir * direction);
2382  distanceToNextBin += d2n.second + h;
2383  }
2384  } else if (dist2next.first < lbu->bins() && std::abs(distanceToNextBin) < 0.01 &&
2385  h > 0.01) { // tolerance 10 microns ?
2386  double localp[5];
2388  auto cPar = std::make_unique<Trk::CurvilinearParameters>(Amg::Vector3D(P[0], P[1], P[2]), localp[2],
2389  localp[3], localp[4]);
2390 
2391  const Trk::IdentifiedMaterial* nextMat = binIDMat;
2392  // need to know what comes next
2393  Amg::Vector3D probe = position + (distanceToNextBin + 0.01) * propDir * direction.normalized();
2394  nextMat = cache.m_binMat->material(probe);
2395 
2396  if (cache.m_identifiedParameters) {
2397  if (binIDMat && binIDMat->second > 0 && !nextMat) { // exit from active layer
2398  cache.m_identifiedParameters->emplace_back(cPar->clone(), -binIDMat->second);
2399  } else if (binIDMat && binIDMat->second > 0 &&
2400  (nextMat->second == 0 || nextMat->second == binIDMat->second)) {
2401  // exit from active layer
2402  cache.m_identifiedParameters->emplace_back(cPar->clone(), -binIDMat->second);
2403  } else if (nextMat && nextMat->second > 0) { // entry active layer
2404  cache.m_identifiedParameters->emplace_back(cPar->clone(), nextMat->second);
2405  }
2406  }
2407  if (cache.m_hitVector) {
2408  double hitTiming = cache.m_timeIn + cache.m_timeOfFlight + cache.m_timeStep;
2409  if (binIDMat && binIDMat->second > 0 && !nextMat) { // exit from active layer
2410  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, -binIDMat->second, 0.);
2411  } else if (binIDMat && binIDMat->second > 0 &&
2412  (nextMat->second == 0 ||
2413  nextMat->second == binIDMat->second)) { // exit from active layer
2414  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, -binIDMat->second, 0.);
2415  } else if (nextMat && nextMat->second > 0) { // entry active layer
2416  cache.m_hitVector->emplace_back(cPar->uniqueClone(), hitTiming, nextMat->second, 0.);
2417  }
2418  }
2419 
2420  cache.m_currentLayerBin = dist2next.first;
2421  if (binIDMat != nextMat) { // change of material triggers update of the cache
2422  binIDMat = nextMat;
2423  if (binIDMat) {
2424  assert(cache.m_material);
2425  updateMaterialEffects(cache, mom, sin(direction.theta()), sumPath + path);
2426  cache.m_material = binIDMat->first;
2427  }
2428  }
2429  // recalculate distance to next bin
2430  std::pair<size_t, float> d2n = lbu->distanceToNext(probe, propDir * direction.normalized());
2431  distanceToNextBin += d2n.second + 0.01;
2432  }
2433  // TODO: trigger the update of material properties and recalculation of distance to the target sliding
2434  // surface
2435  }
2436  }
2437 
2438  // Calculate new distance to targets
2439  bool flipDirection = false;
2440  numSf = 0;
2441  nextSfCand = nextSf;
2442  double dev = direction0.dot(direction);
2443  std::vector<DestSurf>::iterator sIter = sBeg;
2444  std::vector<std::pair<int, std::pair<double, double>>>::iterator vsIter = vsBeg;
2445  int ic = 0;
2446  int numRestart = 0;
2447 
2448  if (cache.m_brem) {
2449  if (mom < cache.m_bremEmitThreshold && m_simMatUpdator) {
2450  // ST : strictly speaking, the emission point should be shifted backwards a bit
2451  // (mom-m_bremEmitThreshold) this seems to be a minor point
2452  m_simMatUpdator->recordBremPhoton(cache.m_timeIn + cache.m_timeOfFlight + cache.m_timeStep, mom,
2453  cache.m_bremMom, position, direction, cache.m_particle);
2454  cache.m_bremEmitThreshold = 0.;
2455  }
2456  if (mom < cache.m_bremSampleThreshold)
2457  sampleBrem(cache, cache.m_bremSampleThreshold);
2458  }
2459 
2460  for (; vsIter != vsEnd; ++vsIter) {
2461  if (restart) {
2462  ++numRestart;
2463  if (numRestart > restartLimit)
2464  return false;
2465 
2466  vsIter = vsBeg;
2467  ic = 0;
2468  sIter = sBeg;
2469  distanceToTarget = propDir * maxPath;
2470  nextSf = -1;
2471  nextSfCand = -1;
2472  restart = false;
2473  helpSoft = 1.;
2474  }
2475  if ((*vsIter).first != -1 &&
2476  (ic == nextSf || (*vsIter).first == 1 || nextSf < 0 || std::abs((*vsIter).second.first) < 500. ||
2477  std::abs(path) > 0.5 * std::abs((*vsIter).second.second))) {
2478  previousDistance = (*vsIter).second.first;
2479  Trk::DistanceSolution distSol =
2480  (*sIter).first->straightLineDistanceEstimate(position, propDir * direction);
2481  double distanceEst = -propDir * maxPath;
2482  if (distSol.numberOfSolutions() > 0) {
2483  distanceEst = distSol.first();
2484  if (distSol.numberOfSolutions() > 1 &&
2485  std::abs(distSol.first() * propDir + distanceStepped - previousDistance) >
2486  std::abs(distSol.second() * propDir + distanceStepped - previousDistance)) {
2487  distanceEst = distSol.second();
2488  }
2489  // Peter Kluit: avoid jumping into other (distSol.first->second) distance solution for start surface
2490  // with negative distance solution
2491  // negative distanceEst will trigger flipDirection = true and will iterate to the start
2492  // surface this will lead to very similar positions for multiple propagator calls and
2493  // many tiny X0 scatterers
2494  if (ic == startSf && distanceEst < 0 && distSol.first() > 0)
2495  distanceEst = distSol.first();
2496  }
2497  // eliminate close surface if path too small
2498  if (ic == nextSf && std::abs(distanceEst) < tol && std::abs(path) < tol) {
2499  (*vsIter).first = -1;
2500  vsIter = vsBeg;
2501  restart = true;
2502  distanceToTarget = maxPath;
2503  nextSf = -1;
2504  continue;
2505  }
2506 
2507  // If h and distance are in opposite directions, target is passed. Flip propagation direction
2508  // Verify if true intersection
2509  // if ( h * propDir * distanceEst < 0. && std::abs(distanceEst)>distanceTolerance ) {
2510  if ((*vsIter).second.first * propDir * distanceEst < 0. &&
2511  std::abs(distanceEst) > distanceTolerance) {
2512  // verify change of sign in signedDistance ( after eliminating situations where this is meaningless
2513  // )
2514  if (!distSol.signedDistance() || std::abs(distSol.currentDistance(true)) < tol ||
2515  std::abs((*vsIter).second.second) < tol ||
2516  (*vsIter).second.second * distSol.currentDistance(true) < 0) { // true intersection
2517  if (ic == nextSf) {
2518  ((*vsIter).first)++;
2519  // eliminate surface if diverging
2520  if ((*vsIter).first > 3) {
2521  helpSoft = fmax(0.05, 1. - 0.05 * (*vsIter).first);
2522  if ((*vsIter).first > 20)
2523  helpSoft = 1. / (*vsIter).first;
2524  }
2525  // take care of eliminating when number of flips even - otherwise it may end up at the start !
2526  if ((*vsIter).first > 50 && h * propDir > 0) {
2527  // std::abs(distanceEst) >= std::abs(previousDistance) ) {
2528  (*vsIter).first = -1;
2529  vsIter = vsBeg;
2530  restart = true;
2531  continue;
2532  }
2533  if ((*vsIter).first != -1)
2534  flipDirection = true;
2535  } else if (std::abs((*vsIter).second.second) > tol &&
2536  std::abs(distSol.currentDistance(true)) > tol) {
2537  // here we need to compare with distance from current closest
2538  if (ic > nextSf && nextSf != -1) { // easy case, already calculated
2539  if (propDir * distanceEst < (cache.m_currentDist.at(nextSf)).second.first - tol) {
2540  if ((*vsIter).first != -1) {
2541  ((*vsIter).first)++;
2542  flipDirection = true;
2543  nextSf = ic;
2544  }
2545  }
2546  } else if (distanceToTarget >
2547  0.) { // set as nearest (if not iterating already), will be rewritten later
2548  if ((*vsIter).first != -1) {
2549  ((*vsIter).first)++;
2550  flipDirection = true;
2551  nextSf = ic;
2552  }
2553  }
2554  }
2555  } else if (ic == nextSf) {
2556  vsIter = vsBeg;
2557  restart = true;
2558  continue;
2559  }
2560  }
2561 
2562  // save current distance to surface
2563  (*vsIter).second.first = propDir * distanceEst;
2564  (*vsIter).second.second = distSol.currentDistance(true);
2565 
2566  // find closest surface: the step may have been beyond several surfaces
2567  // from all surfaces with 'negative' distance, consider only the one currently designed as 'closest'
2568  // mw if ((*vsIter).first!=-1 && ( distanceEst>-tol || ic==nextSf ) ) {
2569  if ((*vsIter).first != -1 && (distanceEst > 0. || ic == nextSf)) {
2570  ++numSf;
2571  if (distanceEst < std::abs(distanceToTarget)) {
2572  distanceToTarget = propDir * distanceEst;
2573  nextSfCand = ic;
2574  }
2575  }
2576  } else if (std::abs(path) > std::abs((*vsIter).second.second) || dev < 0.985 ||
2577  nextSf < 0) { // keep an eye on surfaces with negative distance; tracks are curved !
2578  Trk::DistanceSolution distSol =
2579  (*sIter).first->straightLineDistanceEstimate(position, propDir * direction);
2580  double distanceEst = -propDir * maxPath;
2581  if (distSol.numberOfSolutions() > 0) {
2582  distanceEst = distSol.first();
2583  }
2584  // save current distance to surface
2585  (*vsIter).second.first = propDir * distanceEst;
2586  (*vsIter).second.second = distSol.currentDistance(true);
2587  // reactivate surface
2588  if (distanceEst > tol && distanceEst < maxPath) {
2589  (*vsIter).first = 0;
2590  } else {
2591  (*vsIter).second.first = distSol.currentDistance() + std::abs(path);
2592  }
2593  if ((*vsIter).first != -1 && distanceEst > 0.) {
2594  ++numSf;
2595  if (distanceEst < std::abs(distanceToTarget)) {
2596  distanceToTarget = propDir * distanceEst;
2597  nextSfCand = ic;
2598  }
2599  }
2600  }
2601  // additional protection - return to the same surface
2602  // eliminate the surface and restart the search
2603  // 04/10/10 ST:infinite loop due to distanceTolerance>tol fixed;
2604  if (std::abs(distanceToTarget) <= distanceTolerance && path * propDir < distanceTolerance) {
2605  (*vsIter).first = -1;
2606  vsIter = vsBeg;
2607  restart = true;
2608  continue;
2609  }
2610  ++sIter;
2611  ++ic;
2612  }
2613  // if next closest not found, propagation failed
2614  if (nextSf < 0 && nextSfCand < 0)
2615  return false;
2616  // flip direction
2617  if (flipDirection) {
2618  // Out of bounds protection
2619  if (nextSf < 0 || nextSf >= num_vs_dist)
2620  return false;
2621  distanceToTarget = (*(vsBeg + nextSf)).second.first;
2622  h = -h;
2623  } else if (nextSfCand != nextSf) {
2624  nextSf = nextSfCand;
2625  // Out of bounds protection
2626  if (nextSf < 0 || nextSf >= num_vs_dist)
2627  return false;
2628  if (cache.m_currentDist[nextSf].first < 3)
2629  helpSoft = 1.;
2630  }
2631 
2632  // don't step beyond surfaces - adjust step
2633  if (std::abs(h) > std::abs(distanceToTarget))
2634  h = distanceToTarget;
2635 
2636  // don't step beyond bin boundary - adjust step
2637  if (cache.m_binMat && std::abs(h) > std::abs(distanceToNextBin) + 0.001) {
2638  if (distanceToNextBin > 0) { // TODO : investigate source of negative distance in BinningData
2639  h = distanceToNextBin * propDir;
2640  }
2641  }
2642 
2643  if (helpSoft < 1.)
2644  h *= helpSoft;
2645 
2646  // don't step much beyond path limit
2647  if (cache.m_propagateWithPathLimit > 0 && h > cache.m_pathLimit)
2648  h = cache.m_pathLimit + tol;
2649 
2650  // Abort if maxPath is reached
2651  if (std::abs(path) > maxPath)
2652  return false;
2653 
2654  if (steps++ > cache.m_maxSteps)
2655  return false; // Too many steps, something is wrong
2656  }
2657 
2658  if (!numSf)
2659  return false;
2660 
2661  // Use Taylor expansions to step the remaining distance (typically microns).
2662  path = path + distanceToTarget;
2663 
2664  // timing
2665  mom = std::abs(1. / P[6]);
2666  beta = mom / std::sqrt(mom * mom + cache.m_particleMass * cache.m_particleMass);
2667  cache.m_timeStep += distanceToTarget / beta / Gaudi::Units::c_light;
2668 
2669  // pos = pos + h*dir + 1/2*h*h*dDir. Second order Taylor expansion.
2670  pos[0] = pos[0] + distanceToTarget * (dir[0] + 0.5 * distanceToTarget * dDir[0]);
2671  pos[1] = pos[1] + distanceToTarget * (dir[1] + 0.5 * distanceToTarget * dDir[1]);
2672  pos[2] = pos[2] + distanceToTarget * (dir[2] + 0.5 * distanceToTarget * dDir[2]);
2673 
2674  // dir = dir + h*dDir. First order Taylor expansion (Euler).
2675  dir[0] = dir[0] + distanceToTarget * dDir[0];
2676  dir[1] = dir[1] + distanceToTarget * dDir[1];
2677  dir[2] = dir[2] + distanceToTarget * dDir[2];
2678 
2679  // Normalize dir
2680  double norm = 1. / std::sqrt(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
2681  dir[0] = norm * dir[0];
2682  dir[1] = norm * dir[1];
2683  dir[2] = norm * dir[2];
2684  P[42] = dDir[0];
2685  P[43] = dDir[1];
2686  P[44] = dDir[2];
2687 
2688  // collect all surfaces with distance below tolerance
2689  std::vector<std::pair<int, std::pair<double, double>>>::iterator vsIter = vsBeg;
2690 
2691  int index = 0;
2692  for (; vsIter != vsEnd; ++vsIter) {
2693  if ((*vsIter).first != -1 && propDir * (*vsIter).second.first >= propDir * distanceToTarget - tol &&
2694  propDir * (*vsIter).second.first < 0.01 && index != nextSf) {
2695  solutions.push_back(index);
2696  }
2697  if (index == nextSf)
2698  solutions.push_back(index);
2699  ++index;
2700  }
2701 
2702  return true;
2703 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sampleBrem()

void Trk::STEP_Propagator::sampleBrem ( Cache cache,
double  mom 
) const
private

Definition at line 2792 of file STEP_Propagator.cxx.

2792  {
2793  if (!cache.m_randomEngine) {
2794  cache.m_randomEngine = getRandomEngine(cache.m_ctx);
2795  }
2796  double rndx = CLHEP::RandFlat::shoot(cache.m_randomEngine);
2797  double rnde = CLHEP::RandFlat::shoot(cache.m_randomEngine);
2798 
2799  // sample visible fraction of the mother momentum taken according to 1/f
2800  double eps = cache.m_momentumCutOff / mom;
2801  cache.m_bremMom = pow(eps, pow(rndx, exp(1.))) * mom; // adjustment here ?
2802  cache.m_bremSampleThreshold = mom - cache.m_bremMom;
2803  cache.m_bremEmitThreshold = mom - rnde * cache.m_bremMom;
2804 }

◆ setCacheFromProperties()

void Trk::STEP_Propagator::setCacheFromProperties ( Cache cache) const
inlineprivate

initialize cache with the variables we need to take from

Definition at line 430 of file STEP_Propagator.h.

431  {
432  cache.m_includeBgradients = m_includeBgradients;
433  cache.m_includeGgradient = m_includeGgradient;
434  cache.m_energyLoss = m_energyLoss;
435  cache.m_detailedElossFlag = m_detailedEloss;
436  cache.m_MPV = m_MPV;
437  cache.m_multipleScattering = m_multipleScattering;
438  cache.m_straggling = m_straggling;
439  cache.m_tolerance = m_tolerance;
440  cache.m_momentumCutOff = m_momentumCutOff;
441  cache.m_scatteringScale = m_scatteringScale;
442  cache.m_maxPath = m_maxPath;
443  cache.m_maxSteps = m_maxSteps;
444  cache.m_layXmax = m_layXmax;
445  }

◆ smear()

void Trk::STEP_Propagator::smear ( Cache cache,
double &  phi,
double &  theta,
const Trk::TrackParameters parms,
double  radDist 
) const
private

Definition at line 2755 of file STEP_Propagator.cxx.

2756  {
2757  if (cache.m_particle == Trk::geantino)
2758  return;
2759  if (!parms)
2760  return;
2761 
2762  if (!cache.m_randomEngine) {
2763  cache.m_randomEngine = getRandomEngine(cache.m_ctx);
2764  }
2765 
2766  // Calculate polar angle
2767  double particleMass = Trk::ParticleMasses::mass[cache.m_particle]; // Get particle mass from
2768  // ParticleHypothesis
2769  double momentum = parms->momentum().mag();
2770  double energy = std::sqrt(momentum * momentum + particleMass * particleMass);
2771  double beta = momentum / energy;
2772  double th = std::sqrt(2.) * 15. * std::sqrt(radDist) / (beta * momentum) *
2773  CLHEP::RandGauss::shoot(cache.m_randomEngine); // Moliere
2774  // double th = (sqrt(2.)*13.6*std::sqrt(radDist)/(beta*momentum)) *
2775  // (1.+0.038*log(radDist/(beta*beta))) * m_gaussian->shoot(); //Highland
2776 
2777  // Calculate azimuthal angle
2778  double ph = 2. * M_PI * CLHEP::RandFlat::shoot(cache.m_randomEngine);
2779 
2781  Amg::AngleAxis3D(-phi, Amg::Vector3D(0., 0., 1.)));
2782  Amg::Vector3D dir0(0., 0., 1.);
2783  Amg::Vector3D rotated = rot.inverse() * Amg::AngleAxis3D(ph, Amg::Vector3D(0., 0., 1.)) *
2784  Amg::AngleAxis3D(th, Amg::Vector3D(0., 1., 0.)) * dir0;
2785 
2786  theta = rotated.theta();
2787  phi = rotated.phi();
2788 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detailedEloss

BooleanProperty Trk::STEP_Propagator::m_detailedEloss
private
Initial value:
{this, "DetailedEloss", true,
"Provide the extended EnergyLoss object with MopIonization etc."}

Definition at line 508 of file STEP_Propagator.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_energyLoss

BooleanProperty Trk::STEP_Propagator::m_energyLoss {this, "EnergyLoss", true, "Include energy loss?"}
private

Definition at line 507 of file STEP_Propagator.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> Trk::STEP_Propagator::m_fieldCacheCondObjInputKey
private
Initial value:
{
this,
"AtlasFieldCacheCondObj",
"fieldCondObj",
"Name of the Magnetic Field conditions object key"
}

Definition at line 540 of file STEP_Propagator.h.

◆ m_includeBgradients

BooleanProperty Trk::STEP_Propagator::m_includeBgradients
private
Initial value:
{this, "IncludeBgradients", true,
"Include B-field gradients in the error propagation"}

Definition at line 499 of file STEP_Propagator.h.

◆ m_includeGgradient

BooleanProperty Trk::STEP_Propagator::m_includeGgradient
private
Initial value:
{this, "IncludeGgradient", false,
"Include dg/dlambda into the error propagation? Only relevant when energy loss is true."}

Definition at line 501 of file STEP_Propagator.h.

◆ m_layXmax

DoubleProperty Trk::STEP_Propagator::m_layXmax
private
Initial value:
{this, "MSstepMax", 1.,
"maximal layer thickness for multiple scattering calculations"}

Definition at line 522 of file STEP_Propagator.h.

◆ m_materialEffects

BooleanProperty Trk::STEP_Propagator::m_materialEffects
private
Initial value:
{this, "MaterialEffects", true,
"Switch material effects on or off"}

Definition at line 497 of file STEP_Propagator.h.

◆ m_maxPath

DoubleProperty Trk::STEP_Propagator::m_maxPath
private
Initial value:
{this, "MaxPath", 100000.,
"Maximum propagation length in mm."}

Definition at line 518 of file STEP_Propagator.h.

◆ m_maxSteps

IntegerProperty Trk::STEP_Propagator::m_maxSteps
private
Initial value:
{this, "MaxSteps", 10000,
"Maximum number of allowed steps (to avoid infinite loops)."}

Definition at line 520 of file STEP_Propagator.h.

◆ m_momentumCutOff

DoubleProperty Trk::STEP_Propagator::m_momentumCutOff
private
Initial value:
{this, "MomentumCutOff", 50.,
"Stop propagation below this momentum in MeV"}

Definition at line 503 of file STEP_Propagator.h.

◆ m_MPV

BooleanProperty Trk::STEP_Propagator::m_MPV
private
Initial value:
{this, "MostProbableEnergyLoss", false,
"Use the most probable value of the energy loss, else use the mean energy loss."}

Definition at line 512 of file STEP_Propagator.h.

◆ m_multipleScattering

BooleanProperty Trk::STEP_Propagator::m_multipleScattering
private
Initial value:
{this, "MultipleScattering", true,
"Add multiple scattering to the covariance matrix?"}

Definition at line 505 of file STEP_Propagator.h.

◆ m_randomEngineName

StringProperty Trk::STEP_Propagator::m_randomEngineName
private
Initial value:
{this, "RandomStreamName", "FatrasRnd",
"Name of the random number stream"}

Definition at line 536 of file STEP_Propagator.h.

◆ m_rndGenSvc

ServiceHandle<IAthRNGSvc> Trk::STEP_Propagator::m_rndGenSvc
private
Initial value:
{this, "RandomNumberService", "AthRNGSvc",
"Random number generator"}

Random Generator service.

Definition at line 532 of file STEP_Propagator.h.

◆ m_rngWrapper

ATHRNG::RNGWrapper* Trk::STEP_Propagator::m_rngWrapper = nullptr
private

Random engine.

Definition at line 535 of file STEP_Propagator.h.

◆ m_scatteringScale

DoubleProperty Trk::STEP_Propagator::m_scatteringScale
private
Initial value:
{this, "MultipleScatteringScale", 1.,
"Scale for adjusting the multiple scattering contribution to the covariance matrix."}

Definition at line 516 of file STEP_Propagator.h.

◆ m_simMatUpdator

ToolHandle<ITimedMatEffUpdator> Trk::STEP_Propagator::m_simMatUpdator {this, "SimMatEffUpdator", ""}
private

secondary interactions (brem photon emission)

Definition at line 530 of file STEP_Propagator.h.

◆ m_simulation

BooleanProperty Trk::STEP_Propagator::m_simulation
private
Initial value:
{this, "SimulationMode", false,
"flag for simulation mode"}

Definition at line 527 of file STEP_Propagator.h.

◆ m_straggling

BooleanProperty Trk::STEP_Propagator::m_straggling
private
Initial value:
{this, "Straggling", true,
"Add energy loss fluctuations (straggling) to the covariance matrix?"}

Definition at line 510 of file STEP_Propagator.h.

◆ m_stragglingScale

DoubleProperty Trk::STEP_Propagator::m_stragglingScale
private
Initial value:
{this, "StragglingScale", 1.,
"Scale for adjusting the width of the energy loss fluctuations."}

Definition at line 514 of file STEP_Propagator.h.

◆ m_tolerance

DoubleProperty Trk::STEP_Propagator::m_tolerance
private
Initial value:
{this, "Tolerance", 1e-05,
"Error tolerance. Low tolerance gives igh accuracy"}

Definition at line 495 of file STEP_Propagator.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::DistanceSolution::currentDistance
double currentDistance(bool signedDist=false) const
Current distance to surface (spatial), signed (along/opposite to surface normal) if input argument tr...
Trk::STEP_Propagator::dumpMaterialEffects
void dumpMaterialEffects(Cache &cache, const Trk::CurvilinearParameters *trackParameters, double path) const
Definition: STEP_Propagator.cxx:2708
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::DistanceSolution::signedDistance
bool signedDistance() const
This method indicates availability of signed current distance (false for Perigee and StraighLineSurfa...
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
Trk::STEP_Propagator::m_includeGgradient
BooleanProperty m_includeGgradient
Definition: STEP_Propagator.h:501
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Trk::ParametersCommon::m_covariance
std::optional< AmgSymMatrix(DIM)> m_covariance
charge definition for this track
Definition: ParametersCommon.h:147
Trk::k0
@ k0
Definition: ParticleHypothesis.h:35
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trk::STEP_Propagator::m_maxSteps
IntegerProperty m_maxSteps
Definition: STEP_Propagator.h:520
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
Trk::RungeKuttaUtils::transformGlobalToCurvilinear
void transformGlobalToCurvilinear(bool, double *ATH_RESTRICT, double *ATH_RESTRICT, double *ATH_RESTRICT)
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
Trk::STEP_Propagator::m_tolerance
DoubleProperty m_tolerance
Definition: STEP_Propagator.h:495
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
Trk::DistanceSolution
Definition: DistanceSolution.h:25
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
Trk::DistanceSolution::numberOfSolutions
int numberOfSolutions() const
Number of intersection solutions.
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:143
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
Trk::pi0
@ pi0
Definition: ParticleHypothesis.h:34
DMTest::P
P_v1 P
Definition: P.h:23
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
hitVector
std::vector< FPGATrackSimHit > hitVector
Definition: FPGATrackSimCluster.h:22
Amg::saneCovarianceElement
bool saneCovarianceElement(double ele)
A covariance matrix formally needs to be positive semi definite.
Definition: EventPrimitivesCovarianceHelpers.h:63
Trk::STEP_Propagator::m_maxPath
DoubleProperty m_maxPath
Definition: STEP_Propagator.h:518
Trk::BinUtility::distanceToNext
std::pair< size_t, float > distanceToNext(const Amg::Vector3D &position, const Amg::Vector3D &direction, size_t ba=0) const
Distance estimate to next bin
Definition: BinUtility.h:154
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::ScatteringAngles
represents a deflection of the track caused through multiple scattering in material.
Definition: ScatteringAngles.h:26
Trk::CylinderSurface::bounds
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::DistanceSolution::first
double first() const
Distance to first intersection solution along direction.
Trk::STEP_Propagator::m_simulation
BooleanProperty m_simulation
Definition: STEP_Propagator.h:527
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
Trk::RungeKuttaUtils::transformLocalToGlobal
bool transformLocalToGlobal(bool, const Trk::TrackParameters &, double *ATH_RESTRICT)
python.copyTCTOutput.dDir
dDir
Definition: copyTCTOutput.py:61
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
Trk::AlignableTrackingVolume::binnedMaterial
const BinnedMaterial * binnedMaterial() const
access to binned material
Definition: AlignableTrackingVolume.h:74
Trk::RungeKuttaUtils::transformGlobalToLocal
void transformGlobalToLocal(double *ATH_RESTRICT, double *ATH_RESTRICT)
Trk::BinUtility::bins
size_t bins(size_t ba=0) const
Number of bins.
Definition: BinUtility.h:221
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::STEP_Propagator::m_multipleScattering
BooleanProperty m_multipleScattering
Definition: STEP_Propagator.h:505
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Trk::STEP_Propagator::m_randomEngineName
StringProperty m_randomEngineName
Definition: STEP_Propagator.h:536
Trk::STEP_Propagator::m_scatteringScale
DoubleProperty m_scatteringScale
Definition: STEP_Propagator.h:516
Trk::FastField
@ FastField
call the fast field access method of the FieldSvc
Definition: MagneticFieldMode.h:20
Trk::STEP_Propagator::m_energyLoss
BooleanProperty m_energyLoss
Definition: STEP_Propagator.h:507
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::STEP_Propagator::sampleBrem
void sampleBrem(Cache &cache, double mom) const
Definition: STEP_Propagator.cxx:2792
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
beamspotman.steps
int steps
Definition: beamspotman.py:505
python.TriggerHandler.th
th
Definition: TriggerHandler.py:296
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::STEP_Propagator::propagateWithJacobian
bool propagateWithJacobian(Cache &cache, bool errorPropagation, std::vector< DestSurf > &sfs, double *P, Trk::PropDirection propDir, std::vector< unsigned int > &solutions, double &path, double sumPath) const
Definition: STEP_Propagator.cxx:2100
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:66
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
extractSporadic.h
list h
Definition: extractSporadic.py:97
Trk::STEP_Propagator::m_layXmax
DoubleProperty m_layXmax
Definition: STEP_Propagator.h:522
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::DistanceSolution::second
double second() const
Distance to second intersection solution along direction (for a cylinder surface)
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::geantino
@ geantino
Definition: ParticleHypothesis.h:26
Trk::STEP_Propagator::m_includeBgradients
BooleanProperty m_includeBgradients
Definition: STEP_Propagator.h:499
Trk::STEP_Propagator::getFieldCacheObject
void getFieldCacheObject(Cache &cache, const EventContext &ctx) const
Definition: STEP_Propagator.cxx:2806
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::STEP_Propagator::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
Definition: STEP_Propagator.cxx:2818
Trk::SurfaceType::Cone
@ Cone
Trk::STEP_Propagator::m_simMatUpdator
ToolHandle< ITimedMatEffUpdator > m_simMatUpdator
secondary interactions (brem photon emission)
Definition: STEP_Propagator.h:530
Trk::neutron
@ neutron
Definition: ParticleHypothesis.h:33
Trk::STEP_Propagator::m_rngWrapper
ATHRNG::RNGWrapper * m_rngWrapper
Random engine.
Definition: STEP_Propagator.h:535
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
RungeKuttaUtils
Definition: RungeKuttaUtils.h:30
Trk::STEP_Propagator::intersect
virtual std::optional< TrackSurfaceIntersection > intersect(const EventContext &ctx, const Trk::TrackParameters &trackParameters, const Trk::Surface &targetSurface, const Trk::MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, const Trk::TrackingVolume *tVol=nullptr) const override final
Propagate parameters and return path (Similar to propagateParameters.
Definition: STEP_Propagator.cxx:1612
beamspotman.dir
string dir
Definition: beamspotman.py:623
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::BinUtility
Definition: BinUtility.h:39
grepfile.ic
int ic
Definition: grepfile.py:33
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::STEP_Propagator::m_detailedEloss
BooleanProperty m_detailedEloss
Definition: STEP_Propagator.h:508
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
Trk::NoField
@ NoField
Field is set to 0., 0., 0.,.
Definition: MagneticFieldMode.h:18
Trk::STEP_Propagator::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: STEP_Propagator.h:540
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::SurfaceType::Perigee
@ Perigee
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
Trk::STEP_Propagator::propagateRungeKutta
std::unique_ptr< Trk::TrackParameters > propagateRungeKutta(Cache &cache, bool errorPropagation, const Trk::TrackParameters &trackParameters, std::vector< DestSurf > &targetSurfaces, Trk::PropDirection propagationDirection, const MagneticFieldProperties &magneticFieldProperties, ParticleHypothesis particle, std::vector< unsigned int > &solutions, double &path, bool returnCurv=false) const
Definition: STEP_Propagator.cxx:1890
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::ExtrapolationCode::FailureConfiguration
@ FailureConfiguration
Definition: ExtrapolationCell.h:124
Trk::STEP_Propagator::smear
void smear(Cache &cache, double &phi, double &theta, const Trk::TrackParameters *parms, double radDist) const
Definition: STEP_Propagator.cxx:2755
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::userOwn
@ userOwn
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:57
Trk::STEP_Propagator::m_rndGenSvc
ServiceHandle< IAthRNGSvc > m_rndGenSvc
Random Generator service.
Definition: STEP_Propagator.h:532
Trk::STEP_Propagator::m_momentumCutOff
DoubleProperty m_momentumCutOff
Definition: STEP_Propagator.h:503
DeMoScan.first
bool first
Definition: DeMoScan.py:536
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
Trk::SurfaceType::Disc
@ Disc
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::SurfaceType::Cylinder
@ Cylinder
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Trk::photon
@ photon
Definition: ParticleHypothesis.h:32
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::ConeSurface
Definition: ConeSurface.h:51
Trk::STEP_Propagator::setCacheFromProperties
void setCacheFromProperties(Cache &cache) const
initialize cache with the variables we need to take from
Definition: STEP_Propagator.h:430
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
Trk::SurfaceType::Plane
@ Plane
Trk::phi
@ phi
Definition: ParamDefs.h:75
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::SurfaceType::Line
@ Line
Amg::hasPositiveOrZeroDiagElems
bool hasPositiveOrZeroDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Definition: EventPrimitivesCovarianceHelpers.h:73
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
Trk::IdentifiedMaterial
std::pair< const Material *, int > IdentifiedMaterial
Definition: BinnedMaterial.h:28
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
ATHRNG::RNGWrapper::evtSeeded
EventContext::ContextEvt_t evtSeeded() const
Return the event count at which the current slot was last seeded.
Definition: RNGWrapper.h:139
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
Trk::STEP_Propagator::m_MPV
BooleanProperty m_MPV
Definition: STEP_Propagator.h:512
Trk::STEP_Propagator::m_materialEffects
BooleanProperty m_materialEffects
Definition: STEP_Propagator.h:497
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
fitman.k
k
Definition: fitman.py:528
Trk::CylinderBounds::r
virtual double r() const override final
This method returns the radius.
Trk::STEP_Propagator::m_straggling
BooleanProperty m_straggling
Definition: STEP_Propagator.h:510
Trk::AlignableTrackingVolume
Definition: AlignableTrackingVolume.h:36