ATLAS Offline Software
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

double m_tolerance
 Error tolerance. More...
 
bool m_materialEffects
 Switch material effects on or off. More...
 
bool m_includeBgradients
 Include B-gradients in the error propagation. More...
 
bool m_includeGgradient
 Include g-gradient in the error propagation. More...
 
double m_momentumCutOff
 Stop propagation below this momentum. More...
 
bool m_multipleScattering
 Switch multiple scattering on or off. More...
 
bool m_energyLoss
 
bool m_detailedEloss
 
bool m_straggling
 
bool m_MPV
 
double m_stragglingScale
 
double m_scatteringScale
 
double m_maxPath
 
double m_maxSteps
 
double m_layXmax
 
bool m_simulation
 
ToolHandle< ITimedMatEffUpdatorm_simMatUpdator
 secondary interactions (brem photon emission) More...
 
ServiceHandle< IAthRNGSvcm_rndGenSvc
 Random Generator service. More...
 
ATHRNG::RNGWrapperm_rngWrapper = nullptr
 Random engine. More...
 
std::string 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 164 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  m_tolerance(1e-5) // Error tolerance of the propagator. A low tolerance gives a high accuracy.
1182  ,m_materialEffects(true) // Switches off all material effects if false. Does nothing when true.
1183  ,m_includeBgradients(true) // Include B-field gradients into the error propagation?
1184  ,m_includeGgradient(false) // Include dg/dlambda into the error propagation? Only relevant when energy loss is true.
1185  ,m_momentumCutOff(50.) // Minimum allowed momentum in MeV.
1186  ,m_multipleScattering(true) // Add multiple scattering to the covariance matrix?
1187  ,m_energyLoss(true) // Include energy loss?
1188  ,m_detailedEloss(true) // Provide the extended EnergyLoss object with MopIonization etc.
1189  ,m_straggling(true) // Add energy loss fluctuations (straggling) to the covariance matrix?
1190  ,m_MPV(false) // Use the most probable value of the energy loss, else use the mean energy loss.
1191  ,m_stragglingScale(1.) // Scale for adjusting the width of the energy loss fluctuations.
1192  ,m_scatteringScale(1.) // Scale for adjusting the multiple scattering contribution to the covariance matrix.
1193  ,m_maxPath(100000.) // Maximum propagation length in mm.
1194  ,m_maxSteps(10000) // Maximum number of allowed steps (to avoid infinite loops).
1195  ,m_layXmax(1.) // maximal layer thickness for multiple scattering calculations
1196  ,m_simulation(false) // flag for simulation mode
1197  ,m_rndGenSvc("AthRNGSvc", n)
1198  ,m_randomEngineName("FatrasRnd") {
1199  declareInterface<Trk::IPropagator>(this);
1200  declareProperty("Tolerance", m_tolerance);
1201  declareProperty("MaterialEffects", m_materialEffects);
1202  declareProperty("IncludeBgradients", m_includeBgradients);
1203  declareProperty("IncludeGgradient", m_includeGgradient);
1204  declareProperty("MomentumCutOff", m_momentumCutOff);
1205  declareProperty("MultipleScattering", m_multipleScattering);
1206  declareProperty("EnergyLoss", m_energyLoss);
1207  declareProperty("Straggling", m_straggling);
1208  declareProperty("MostProbableEnergyLoss", m_MPV);
1209  declareProperty("StragglingScale", m_stragglingScale);
1210  declareProperty("DetailedEloss", m_detailedEloss);
1211  declareProperty("MultipleScatteringScale", m_scatteringScale);
1212  declareProperty("MaxPath", m_maxPath);
1213  declareProperty("MaxSteps", m_maxSteps);
1214  declareProperty("MSstepMax", m_layXmax);
1215  declareProperty("SimulationMode", m_simulation);
1216  declareProperty("SimMatEffUpdator", m_simMatUpdator);
1217  declareProperty("RandomNumberService", m_rndGenSvc, "Random number generator");
1218  declareProperty("RandomStreamName", m_randomEngineName, "Name of the random number stream");
1219 }

◆ ~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 2754 of file STEP_Propagator.cxx.

2755  {
2756 
2757  // kinematics
2758  double mom = parms->momentum().mag();
2759 
2760  // first update to make sure all material counted
2761  updateMaterialEffects(cache, mom, sin(parms->momentum().theta()), path);
2762 
2763  if (cache.m_extrapolationCache) {
2764  cache.m_extrapolationCache->updateX0(cache.m_combinedThickness);
2765  cache.m_extrapolationCache->updateEloss(
2766  cache.m_combinedEloss.meanIoni(), cache.m_combinedEloss.sigmaIoni(), cache.m_combinedEloss.meanRad(),
2767  cache.m_combinedEloss.sigmaRad());
2768  }
2769  // output
2770  if (cache.m_matstates) {
2771  auto eloss = !m_detailedEloss
2772  ? std::make_unique<Trk::EnergyLoss>(cache.m_combinedEloss.deltaE(),
2773  cache.m_combinedEloss.sigmaDeltaE())
2774  : std::make_unique<Trk::EnergyLoss>(
2775  cache.m_combinedEloss.deltaE(), cache.m_combinedEloss.sigmaDeltaE(),
2776  cache.m_combinedEloss.sigmaDeltaE(), cache.m_combinedEloss.sigmaDeltaE(),
2777  cache.m_combinedEloss.meanIoni(), cache.m_combinedEloss.sigmaIoni(),
2778  cache.m_combinedEloss.meanRad(), cache.m_combinedEloss.sigmaRad(), path);
2779 
2780  auto sa = Trk::ScatteringAngles(0., 0., std::sqrt(cache.m_covariance(2, 2)),
2781  std::sqrt(cache.m_covariance(3, 3)));
2782 
2783  auto cvlTP = parms->uniqueClone();
2784  auto mefot = std::make_unique<Trk::MaterialEffectsOnTrack>(cache.m_combinedThickness, sa,
2785  std::move(eloss), cvlTP->associatedSurface());
2786 
2787  cache.m_matstates->push_back(new TrackStateOnSurface(nullptr, std::move(cvlTP), std::move(mefot)));
2788  }
2789 
2790  cache.m_matdump_lastpath = path;
2791 
2792  // clean-up
2793  cache.m_combinedCovariance += cache.m_covariance;
2794  cache.m_covariance.setZero();
2795  cache.m_combinedThickness = 0.;
2796  cache.m_combinedEloss.set(0., 0., 0., 0., 0., 0.);
2797 }

◆ 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 1256 of file STEP_Propagator.cxx.

1256  {
1257  return StatusCode::SUCCESS;
1258 }

◆ getFieldCacheObject()

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

Definition at line 2852 of file STEP_Propagator.cxx.

2852  {
2854  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
2855  if (fieldCondObj == nullptr) {
2856  ATH_MSG_ERROR("extrapolate: Failed to retrieve AtlasFieldCacheCondObj with key "
2858  return;
2859  }
2860  fieldCondObj->getInitializedCache(cache.m_fieldCache);
2861 }

◆ getRandomEngine()

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

Definition at line 2864 of file STEP_Propagator.cxx.

2865 {
2866  if (!m_simulation || !m_rngWrapper) {
2867  return nullptr;
2868  }
2869  if (m_rngWrapper->evtSeeded(ctx) != ctx.evt()) {
2870  // Ok, the wrappers are unique to this algorithm and a given slot,
2871  // so cannot be accessed concurrently.
2873  wrapper_nc->setSeed (this->name(), ctx);
2874  }
2875  return m_rngWrapper->getEngine (ctx);
2876 }

◆ 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 1816 of file STEP_Propagator.cxx.

1821  {
1822  Cache cache(ctx);
1823 
1824  // Get field cache object
1825  getFieldCacheObject(cache, ctx);
1826  setCacheFromProperties(cache);
1827  clearMaterialEffects(cache);
1828 
1829  cache.m_particle = particle; // Store for later use
1830 
1831  // Check for tracking volume (materialproperties)
1832  cache.m_trackingVolume = tVol;
1833  cache.m_material = tVol;
1834  cache.m_matPropOK = tVol != nullptr;
1835 
1836  // Check for empty volumes. If x != x then x is not a number.
1837  if (cache.m_matPropOK && ((cache.m_material->zOverAtimesRho() == 0.) || (cache.m_material->x0() == 0.) ||
1838  (cache.m_material->zOverAtimesRho() != cache.m_material->zOverAtimesRho()))) {
1839  cache.m_matPropOK = false;
1840  }
1841 
1842  mft.magneticFieldMode() == Trk::FastField ? cache.m_solenoid = true : cache.m_solenoid = false;
1843 
1844  // Check inputvalues
1845  if (cache.m_tolerance <= 0.)
1846  return;
1847 
1848  double PP[7];
1849  if (!Trk::RungeKuttaUtils::transformLocalToGlobal(false, trackParameters, PP))
1850  return;
1851 
1852  double maxPath = cache.m_maxPath; // Max path allowed
1853  double dDir[3] = {0., 0., 0.}; // Start directions derivs. Zero in case of no RK steps
1854  double distanceStepped = 0.;
1855  double BG1[12] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}; // Bx, By, Bz, dBx/dx, dBx/dy, dBx/dz,
1856  // dBy/dx, dBy/dy, dBy/dz, dBz/dx, dBz/dy, dBz/dz
1857  bool firstStep = true; // Poll B1, else recycle B4
1858  double path = 0.; // path of the trajectory
1859  double radius2Max = cylinderBounds.r() * cylinderBounds.r(); // max. radius**2 of region
1860  double zMax = cylinderBounds.halflengthZ(); // max. Z of region
1861  double radius2 = PP[0] * PP[0] + PP[1] * PP[1]; // Start radius**2
1862  double direction = PP[0] * PP[3] + PP[1] * PP[4]; // Direction
1863  double h = maxStepSize; // max step allowed
1864 
1865  // Test position of the track
1866  if ((std::abs(PP[2]) > zMax) || (radius2 > radius2Max))
1867  return;
1868 
1869  // Store initial position
1870  Amg::Vector3D initialPosition(PP[0], PP[1], PP[2]);
1871  positionsList.push_back(initialPosition);
1872 
1873  bool perigee = false;
1874  if (std::abs(direction) < 0.00001) {
1875  perigee = true;
1876  }
1877 
1878  for (int i = 0; i != 2; ++i) {
1879  if (i) {
1880  if (perigee)
1881  return;
1882  h = -h;
1883  }
1884  double p[7] = {PP[0], PP[1], PP[2], PP[3], PP[4], PP[5], PP[6]};
1885 
1886  while (std::abs(path) < maxPath) {
1887  // Do the step.
1888  if (!rungeKuttaStep(cache, false, h, p, dDir, BG1, firstStep, distanceStepped))
1889  break;
1890  path = path + distanceStepped;
1891 
1892  // Keep h within max stepsize
1893  if (h > maxStepSize) {
1894  h = maxStepSize;
1895  } else if (h < -maxStepSize) {
1896  h = -maxStepSize;
1897  }
1898 
1899  // store current step
1900  Amg::Vector3D globalPosition(p[0], p[1], p[2]);
1901  if (!i) {
1902  positionsList.push_back(globalPosition);
1903  } else {
1904  positionsList.push_front(globalPosition);
1905  }
1906 
1907  // Test position of the track
1908  radius2 = p[0] * p[0] + p[1] * p[1];
1909  if ((std::abs(p[2]) > zMax) || (radius2 > radius2Max))
1910  break;
1911 
1912  // Test perigee
1913  if ((p[0] * p[3] + p[1] * p[4]) * direction < 0.) {
1914  if (i)
1915  return;
1916  perigee = true;
1917  }
1918  }
1919  }
1920 }

◆ initialize()

StatusCode Trk::STEP_Propagator::initialize ( )
finaloverridevirtual

AlgTool initialize method.

Definition at line 1229 of file STEP_Propagator.cxx.

1229  {
1230 
1231  // Read handle for AtlasFieldCacheCondObj
1233 
1234  if (!m_materialEffects) { // override all material interactions
1235  m_multipleScattering = false;
1236  m_energyLoss = false;
1237  m_straggling = false;
1238  } else if (!m_energyLoss) { // override straggling
1239  m_straggling = false;
1240  }
1241 
1242  if (m_simulation && m_simMatUpdator.retrieve().isFailure()) {
1243  ATH_MSG_WARNING("Simulation mode requested but material updator not found - no brem photon emission.");
1244  }
1245 
1246  if (m_simulation) {
1247  // get the random generator serice
1248  ATH_CHECK(m_rndGenSvc.retrieve());
1249  m_rngWrapper = m_rndGenSvc->getEngine(this, m_randomEngineName);
1250  }
1251 
1252  return StatusCode::SUCCESS;
1253 }

◆ 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 1648 of file STEP_Propagator.cxx.

1654  {
1655 
1656  Cache cache(ctx);
1657 
1658  // Get field cache object
1659  getFieldCacheObject(cache, ctx);
1660  setCacheFromProperties(cache);
1661  clearMaterialEffects(cache);
1662 
1663  cache.m_particle = particle; // Store for later use
1664 
1665  // Check for tracking volume (materialproperties)
1666  cache.m_trackingVolume = tVol;
1667  cache.m_material = tVol;
1668  cache.m_matPropOK = tVol != nullptr;
1669 
1670  // no identified intersections needed/ no material dump
1671  cache.m_identifiedParameters = nullptr;
1672  cache.m_matstates = nullptr;
1673  cache.m_extrapolationCache = nullptr;
1674  cache.m_hitVector = nullptr;
1675 
1676  // Bfield mode
1677  mft.magneticFieldMode() == Trk::FastField ? cache.m_solenoid = true : cache.m_solenoid = false;
1678 
1679  // Check inputvalues
1680  if (cache.m_tolerance <= 0.) {
1681  return std::nullopt;
1682  }
1683  if (cache.m_momentumCutOff < 0.) {
1684  return std::nullopt;
1685  }
1686  if (std::abs(1. / trackParameters.parameters()[Trk::qOverP]) <= cache.m_momentumCutOff) {
1687  return std::nullopt;
1688  }
1689 
1690  // Check for empty volumes. If x != x then x is not a number.
1691  if (cache.m_matPropOK && ((cache.m_material->zOverAtimesRho() == 0.) || (cache.m_material->x0() == 0.) ||
1692  (cache.m_material->zOverAtimesRho() != cache.m_material->zOverAtimesRho()))) {
1693  cache.m_matPropOK = false;
1694  }
1695 
1696  // double P[45];
1697  if (!Trk::RungeKuttaUtils::transformLocalToGlobal(false, trackParameters, cache.m_P)) {
1698  return std::nullopt;
1699  }
1700  double path = 0.;
1701 
1702  const Amg::Transform3D& T = targetSurface.transform();
1703  Trk::SurfaceType ty = targetSurface.type();
1704 
1705  if (ty == Trk::SurfaceType::Plane || ty == Trk::SurfaceType::Disc) {
1706  double s[4];
1707  double d = T(0, 3) * T(0, 2) + T(1, 3) * T(1, 2) + T(2, 3) * T(2, 2);
1708 
1709  if (d >= 0.) {
1710  s[0] = T(0, 2);
1711  s[1] = T(1, 2);
1712  s[2] = T(2, 2);
1713  s[3] = d;
1714  } else {
1715  s[0] = -T(0, 2);
1716  s[1] = -T(1, 2);
1717  s[2] = -T(2, 2);
1718  s[3] = -d;
1719  }
1720  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)){
1721  return std::nullopt;
1722  }
1723  }
1724 
1725  else if (ty == Trk::SurfaceType::Line) {
1726 
1727  double s[6] = {T(0, 3), T(1, 3), T(2, 3), T(0, 2), T(1, 2), T(2, 2)};
1728  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1729  return std::nullopt;
1730  }
1731  }
1732 
1733  else if (ty == Trk::SurfaceType::Cylinder) {
1734 
1735  const Trk::CylinderSurface* cyl = static_cast<const Trk::CylinderSurface*>(&targetSurface);
1736  double s[9] = {
1737  T(0, 3), T(1, 3), T(2, 3), T(0, 2), T(1, 2), T(2, 2), cyl->bounds().r(), Trk::alongMomentum, 0.};
1738  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1739  return std::nullopt;
1740  }
1741  }
1742 
1743  else if (ty == Trk::SurfaceType::Cone) {
1744 
1745  double k = static_cast<const Trk::ConeSurface*>(&targetSurface)->bounds().tanAlpha();
1746  k = k * k + 1.;
1747  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.};
1748  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1749  return std::nullopt;
1750  }
1751  }
1752 
1753  else if (ty == Trk::SurfaceType::Perigee) {
1754 
1755  double s[6] = {T(0, 3), T(1, 3), T(2, 3), 0., 0., 1.};
1756  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1757  return std::nullopt;
1758  }
1759  }
1760 
1761  else { // presumably curvilinear
1762 
1763  double s[4];
1764  double d = T(0, 3) * T(0, 2) + T(1, 3) * T(1, 2) + T(2, 3) * T(2, 2);
1765 
1766  if (d >= 0.) {
1767  s[0] = T(0, 2);
1768  s[1] = T(1, 2);
1769  s[2] = T(2, 2);
1770  s[3] = d;
1771  } else {
1772  s[0] = -T(0, 2);
1773  s[1] = -T(1, 2);
1774  s[2] = -T(2, 2);
1775  s[3] = -d;
1776  }
1777  if (!propagateWithJacobianImpl(cache, false, ty, s, cache.m_P, path)) {
1778  return std::nullopt;
1779  }
1780  }
1781 
1782  Amg::Vector3D globalPosition(cache.m_P[0], cache.m_P[1], cache.m_P[2]);
1783  Amg::Vector3D direction(cache.m_P[3], cache.m_P[4], cache.m_P[5]);
1784  return std::make_optional<Trk::TrackSurfaceIntersection>(globalPosition, direction, path);
1785 }

◆ 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 1788 of file STEP_Propagator.cxx.

1792  {
1793 
1794  const Amg::Vector3D& origin = trackIntersection.position();
1795  const Amg::Vector3D& direction = trackIntersection.direction();
1796 
1797  auto perigeeSurface = PerigeeSurface(origin);
1798  perigeeSurface.setOwner(Trk::userOwn); // tmp ones
1799 
1800  auto tmpTrackParameters =
1801  Trk::Perigee(0., 0., direction.phi(), direction.theta(), qOverP, perigeeSurface, std::nullopt);
1802 
1803  std::optional<Trk::TrackSurfaceIntersection> solution =
1804  qOverP == 0
1805  ? intersect(ctx, tmpTrackParameters, surface,
1807  : intersect(ctx, tmpTrackParameters, surface, mft, particle, nullptr);
1808 
1809  return solution;
1810 }

◆ 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 326 of file STEP_Propagator.h.

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

◆ 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 338 of file STEP_Propagator.h.

343  {
345  }

◆ 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 1274 of file STEP_Propagator.cxx.

1278  {
1279 
1280  // ATH_MSG_WARNING( "[STEP_Propagator] enter 1");
1281 
1282  double Jacobian[25];
1283  Cache cache(ctx);
1284 
1285  // Get field cache object
1286  getFieldCacheObject(cache, ctx);
1287  setCacheFromProperties(cache);
1288  clearMaterialEffects(cache);
1289 
1290  // Check for tracking volume (materialproperties)
1291  cache.m_trackingVolume = tVol;
1292  cache.m_material = tVol;
1293  cache.m_matPropOK = tVol != nullptr;
1294 
1295  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1296  cache.m_matupd_lastpath = 0.;
1297  cache.m_matdump_lastpath = 0.;
1298 
1299  // no identified intersections needed/ no material dump / no path cache
1300  cache.m_identifiedParameters = nullptr;
1301  cache.m_matstates = nullptr;
1302  cache.m_extrapolationCache = nullptr;
1303  cache.m_hitVector = nullptr;
1304 
1305  return propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1306  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1307 }

◆ 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 1506 of file STEP_Propagator.cxx.

1517  {
1518 
1519  double Jacobian[25];
1520  Cache cache(ctx);
1521 
1522  // Get field cache object
1523  getFieldCacheObject(cache, ctx);
1524  setCacheFromProperties(cache);
1525  clearMaterialEffects(cache);
1526 
1527  // Check for tracking volume (materialproperties)
1528  cache.m_trackingVolume = tVol;
1529  cache.m_material = tVol;
1530  cache.m_matPropOK = tVol != nullptr;
1531 
1532  // no identified intersections needed/ no material dump
1533  cache.m_identifiedParameters = nullptr;
1534  cache.m_matstates = nullptr;
1535  cache.m_extrapolationCache = nullptr;
1536  cache.m_hitVector = nullptr;
1537 
1538  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1539  cache.m_matupd_lastpath = 0.;
1540  cache.m_matdump_lastpath = 0.;
1541 
1542  std::unique_ptr<Trk::TrackParameters> parameters =
1543  propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1544  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1545 
1546  if (parameters) {
1547  Jacobian[24] = Jacobian[20];
1548  Jacobian[23] = 0.;
1549  Jacobian[22] = 0.;
1550  Jacobian[21] = 0.;
1551  Jacobian[20] = 0.;
1552  jacobian = std::make_optional<Trk::TransportJacobian>(Jacobian);
1553  } else {
1554  jacobian.reset();
1555  }
1556 
1557  return parameters;
1558 }

◆ 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 1313 of file STEP_Propagator.cxx.

1318  {
1319 
1320  Cache cache(ctx);
1321 
1322  // Get field cache object
1323  getFieldCacheObject(cache, ctx);
1324  setCacheFromProperties(cache);
1325  clearMaterialEffects(cache);
1326 
1327  // Check for tracking volume (materialproperties)
1328  cache.m_trackingVolume = tVol;
1329  cache.m_material = tVol;
1330  cache.m_matPropOK = tVol != nullptr;
1331 
1332  // no identified intersections needed/ no material dump
1333  cache.m_identifiedParameters = nullptr;
1334  cache.m_matstates = nullptr;
1335  cache.m_extrapolationCache = nullptr;
1336  cache.m_hitVector = nullptr;
1337 
1338  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1339  cache.m_matupd_lastpath = 0.;
1340  cache.m_matdump_lastpath = 0.;
1341 
1342  // resolve path limit input
1343  if (path > 0.) {
1344  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1345  cache.m_pathLimit = path;
1346  path = 0.;
1347  } else {
1348  cache.m_propagateWithPathLimit = 0;
1349  cache.m_pathLimit = -1.;
1350  path = 0.;
1351  }
1353  return propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1354  usePathLimit, returnCurv);
1355 
1356  return propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1357  magneticFieldProperties, particle, solutions, path, returnCurv);
1358 }

◆ 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 1261 of file STEP_Propagator.cxx.

1265  {
1266  ATH_MSG_WARNING("[STEP_Propagator] STEP_Propagator does not handle neutral track parameters."
1267  << "Use the StraightLinePropagator instead.");
1268  return nullptr;
1269 }

◆ 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 1450 of file STEP_Propagator.cxx.

1457  {
1458 
1459  Cache cache(ctx);
1460 
1461  // Get field cache object
1462  getFieldCacheObject(cache, ctx);
1463  setCacheFromProperties(cache);
1464  clearMaterialEffects(cache);
1465 
1466  // Check for tracking volume (materialproperties)
1467  cache.m_trackingVolume = tVol;
1468  cache.m_material = tVol;
1469  cache.m_matPropOK = tVol != nullptr;
1470 
1471  cache.m_matstates = matstates;
1472  cache.m_identifiedParameters = intersections;
1473  cache.m_extrapolationCache = extrapCache;
1474  cache.m_hitVector = nullptr;
1475 
1476  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1477  cache.m_matupd_lastpath = 0.;
1478  cache.m_matdump_lastpath = 0.;
1479  cache.m_extrapolationCache = extrapCache;
1480 
1481  // switch on the detailed energy loss
1482  if (cache.m_extrapolationCache) {
1483  cache.m_detailedElossFlag = true;
1484  }
1485  // resolve path limit input
1486  if (path > 0.) {
1487  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1488  cache.m_pathLimit = path;
1489  path = 0.;
1490  } else {
1491  cache.m_propagateWithPathLimit = 0;
1492  cache.m_pathLimit = -1.;
1493  path = 0.;
1494  }
1496  return propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1497  usePathLimit, returnCurv);
1498  }
1499  return propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1500  magneticFieldProperties, particle, solutions, path, returnCurv);
1501 }

◆ 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 1564 of file STEP_Propagator.cxx.

1568  {
1569 
1570  double Jacobian[25];
1571  Cache cache(ctx);
1572 
1573  // Get field cache object
1574  getFieldCacheObject(cache, ctx);
1575  setCacheFromProperties(cache);
1576  clearMaterialEffects(cache);
1577 
1578  // Check for tracking volume (materialproperties)
1579  cache.m_trackingVolume = tVol;
1580  cache.m_material = tVol;
1581  cache.m_matPropOK = tVol != nullptr;
1582 
1583  // no identified intersections needed/ no material dump
1584  cache.m_identifiedParameters = nullptr;
1585  cache.m_matstates = nullptr;
1586  cache.m_hitVector = nullptr;
1587 
1588  return propagateRungeKuttaImpl(cache, false, trackParameters, targetSurface, propagationDirection,
1589  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1590 }

◆ 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 1595 of file STEP_Propagator.cxx.

1605  {
1606 
1607  double Jacobian[25];
1608 
1609  Cache cache(ctx);
1610 
1611  // Get field cache object
1612  getFieldCacheObject(cache, ctx);
1613  setCacheFromProperties(cache);
1614  clearMaterialEffects(cache);
1615 
1616  // Check for tracking volume (materialproperties)
1617  cache.m_trackingVolume = tVol;
1618  cache.m_material = tVol;
1619  cache.m_matPropOK = tVol != nullptr;
1620 
1621  // no identified intersections needed/ no material dump
1622  cache.m_identifiedParameters = nullptr;
1623  cache.m_matstates = nullptr;
1624  cache.m_extrapolationCache = nullptr;
1625  cache.m_hitVector = nullptr;
1626 
1627  std::unique_ptr<Trk::TrackParameters> parameters =
1628  propagateRungeKuttaImpl(cache, true, trackParameters, targetSurface, propagationDirection,
1629  magneticFieldProperties, particle, boundaryCheck, Jacobian, returnCurv);
1630 
1631  if (parameters) {
1632  Jacobian[24] = Jacobian[20];
1633  Jacobian[23] = 0.;
1634  Jacobian[22] = 0.;
1635  Jacobian[21] = 0.;
1636  Jacobian[20] = 0.;
1637  jacobian = std::make_optional<Trk::TransportJacobian>(Jacobian);
1638  } else {
1639  jacobian.reset();
1640  }
1641 
1642  return parameters;
1643 }

◆ 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 1926 of file STEP_Propagator.cxx.

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

◆ 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 1364 of file STEP_Propagator.cxx.

1369  {
1370 
1371  Cache cache(ctx);
1372 
1373  // Get field cache object
1374  getFieldCacheObject(cache, ctx);
1375  setCacheFromProperties(cache);
1376  clearMaterialEffects(cache);
1377 
1378  // cache particle mass
1379  cache.m_particleMass = Trk::ParticleMasses::mass[particle]; // Get particle mass from ParticleHypothesis
1380 
1381  // cache input timing - for secondary track emission
1382  cache.m_timeIn = timeLim.time;
1383 
1384  // Check for tracking volume (materialproperties)
1385  cache.m_trackingVolume = tVol;
1386  cache.m_material = tVol;
1387  cache.m_matPropOK = tVol != nullptr;
1388 
1389  // no identified intersections needed/ no material dump
1390  cache.m_identifiedParameters = nullptr;
1391  cache.m_matstates = nullptr;
1392  cache.m_extrapolationCache = nullptr;
1393  cache.m_hitVector = hitVector;
1394 
1395  cache.m_matupd_lastmom = trackParameters.momentum().mag();
1396  cache.m_matupd_lastpath = 0.;
1397  cache.m_matdump_lastpath = 0.;
1398 
1399  // convert time/path limits into trajectory limit (in mm)
1400  double dMat = pathLim.x0Max - pathLim.x0Collected;
1401  double path =
1402  dMat > 0 && cache.m_matPropOK && cache.m_material->x0() > 0. ? dMat * cache.m_material->x0() : -1.;
1403 
1404  double dTim = timeLim.tMax - timeLim.time;
1405  double beta = 1.;
1406  if (dTim > 0.) {
1407  double mom = trackParameters.momentum().mag();
1408  beta = mom / std::sqrt(mom * mom + cache.m_particleMass * cache.m_particleMass);
1409  }
1410  double timMax = dTim > 0 ? dTim * beta * Gaudi::Units::c_light : -1.;
1411 
1412  if (timMax > 0. && timMax < path)
1413  path = timMax;
1414  bool usePathLimit = (path > 0.);
1415 
1416  // resolve path limit input
1417  if (path > 0.) {
1418  cache.m_propagateWithPathLimit = usePathLimit ? 1 : 0;
1419  cache.m_pathLimit = path;
1420  path = 0.;
1421  } else {
1422  cache.m_propagateWithPathLimit = 0;
1423  cache.m_pathLimit = -1.;
1424  path = 0.;
1425  }
1426 
1427  std::unique_ptr<Trk::TrackParameters> nextPar{};
1428 
1430  nextPar = propagateNeutral(trackParameters, targetSurfaces, propagationDirection, solutions, path,
1431  usePathLimit, returnCurv);
1432  } else {
1433  nextPar = propagateRungeKutta(cache, true, trackParameters, targetSurfaces, propagationDirection,
1434  magneticFieldProperties, particle, solutions, path, returnCurv);
1435  }
1436  // update material path
1437  if (cache.m_matPropOK && cache.m_material->x0() > 0. && path > 0.) {
1438  pathLim.updateMat(path / cache.m_material->x0(), cache.m_material->averageZ(), 0.);
1439  }
1440  // return value
1441  timeLim.time += cache.m_timeOfFlight;
1442  return nextPar;
1443 }

◆ 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 2136 of file STEP_Propagator.cxx.

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

◆ 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 2838 of file STEP_Propagator.cxx.

2838  {
2839  if (!cache.m_randomEngine) {
2840  cache.m_randomEngine = getRandomEngine(cache.m_ctx);
2841  }
2842  double rndx = CLHEP::RandFlat::shoot(cache.m_randomEngine);
2843  double rnde = CLHEP::RandFlat::shoot(cache.m_randomEngine);
2844 
2845  // sample visible fraction of the mother momentum taken according to 1/f
2846  double eps = cache.m_momentumCutOff / mom;
2847  cache.m_bremMom = pow(eps, pow(rndx, exp(1.))) * mom; // adjustment here ?
2848  cache.m_bremSampleThreshold = mom - cache.m_bremMom;
2849  cache.m_bremEmitThreshold = mom - rnde * cache.m_bremMom;
2850 }

◆ setCacheFromProperties()

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

initialize cache with the variables we need to take from

Definition at line 431 of file STEP_Propagator.h.

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

◆ smear()

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

Definition at line 2801 of file STEP_Propagator.cxx.

2802  {
2803  if (cache.m_particle == Trk::geantino)
2804  return;
2805  if (!parms)
2806  return;
2807 
2808  if (!cache.m_randomEngine) {
2809  cache.m_randomEngine = getRandomEngine(cache.m_ctx);
2810  }
2811 
2812  // Calculate polar angle
2813  double particleMass = Trk::ParticleMasses::mass[cache.m_particle]; // Get particle mass from
2814  // ParticleHypothesis
2815  double momentum = parms->momentum().mag();
2816  double energy = std::sqrt(momentum * momentum + particleMass * particleMass);
2817  double beta = momentum / energy;
2818  double th = std::sqrt(2.) * 15. * std::sqrt(radDist) / (beta * momentum) *
2819  CLHEP::RandGauss::shoot(cache.m_randomEngine); // Moliere
2820  // double th = (sqrt(2.)*13.6*std::sqrt(radDist)/(beta*momentum)) *
2821  // (1.+0.038*log(radDist/(beta*beta))) * m_gaussian->shoot(); //Highland
2822 
2823  // Calculate azimuthal angle
2824  double ph = 2. * M_PI * CLHEP::RandFlat::shoot(cache.m_randomEngine);
2825 
2827  Amg::AngleAxis3D(-phi, Amg::Vector3D(0., 0., 1.)));
2828  Amg::Vector3D dir0(0., 0., 1.);
2829  Amg::Vector3D rotated = rot.inverse() * Amg::AngleAxis3D(ph, Amg::Vector3D(0., 0., 1.)) *
2830  Amg::AngleAxis3D(th, Amg::Vector3D(0., 1., 0.)) * dir0;
2831 
2832  theta = rotated.theta();
2833  phi = rotated.phi();
2834 }

◆ 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

bool Trk::STEP_Propagator::m_detailedEloss
private

Definition at line 503 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

bool Trk::STEP_Propagator::m_energyLoss
private

Definition at line 502 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 524 of file STEP_Propagator.h.

◆ m_includeBgradients

bool Trk::STEP_Propagator::m_includeBgradients
private

Include B-gradients in the error propagation.

Definition at line 498 of file STEP_Propagator.h.

◆ m_includeGgradient

bool Trk::STEP_Propagator::m_includeGgradient
private

Include g-gradient in the error propagation.

Definition at line 499 of file STEP_Propagator.h.

◆ m_layXmax

double Trk::STEP_Propagator::m_layXmax
private

Definition at line 510 of file STEP_Propagator.h.

◆ m_materialEffects

bool Trk::STEP_Propagator::m_materialEffects
private

Switch material effects on or off.

Definition at line 497 of file STEP_Propagator.h.

◆ m_maxPath

double Trk::STEP_Propagator::m_maxPath
private

Definition at line 508 of file STEP_Propagator.h.

◆ m_maxSteps

double Trk::STEP_Propagator::m_maxSteps
private

Definition at line 509 of file STEP_Propagator.h.

◆ m_momentumCutOff

double Trk::STEP_Propagator::m_momentumCutOff
private

Stop propagation below this momentum.

Definition at line 500 of file STEP_Propagator.h.

◆ m_MPV

bool Trk::STEP_Propagator::m_MPV
private

Definition at line 505 of file STEP_Propagator.h.

◆ m_multipleScattering

bool Trk::STEP_Propagator::m_multipleScattering
private

Switch multiple scattering on or off.

Definition at line 501 of file STEP_Propagator.h.

◆ m_randomEngineName

std::string Trk::STEP_Propagator::m_randomEngineName
private

Definition at line 521 of file STEP_Propagator.h.

◆ m_rndGenSvc

ServiceHandle<IAthRNGSvc> Trk::STEP_Propagator::m_rndGenSvc
private

Random Generator service.

Definition at line 518 of file STEP_Propagator.h.

◆ m_rngWrapper

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

Random engine.

Definition at line 520 of file STEP_Propagator.h.

◆ m_scatteringScale

double Trk::STEP_Propagator::m_scatteringScale
private

Definition at line 507 of file STEP_Propagator.h.

◆ m_simMatUpdator

ToolHandle<ITimedMatEffUpdator> Trk::STEP_Propagator::m_simMatUpdator
private

secondary interactions (brem photon emission)

Definition at line 516 of file STEP_Propagator.h.

◆ m_simulation

bool Trk::STEP_Propagator::m_simulation
private

Definition at line 514 of file STEP_Propagator.h.

◆ m_straggling

bool Trk::STEP_Propagator::m_straggling
private

Definition at line 504 of file STEP_Propagator.h.

◆ m_stragglingScale

double Trk::STEP_Propagator::m_stragglingScale
private

Definition at line 506 of file STEP_Propagator.h.

◆ m_tolerance

double Trk::STEP_Propagator::m_tolerance
private

Error tolerance.

Low tolerance gives high accuracy

Definition at line 496 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::STEP_Propagator::m_includeBgradients
bool m_includeBgradients
Include B-gradients in the error propagation.
Definition: STEP_Propagator.h:498
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:2754
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_energyLoss
bool m_energyLoss
Definition: STEP_Propagator.h:502
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_stragglingScale
double m_stragglingScale
Definition: STEP_Propagator.h:506
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
max
#define max(a, b)
Definition: cfImp.cxx:41
Trk::RungeKuttaUtils::transformGlobalToCurvilinear
void transformGlobalToCurvilinear(bool, double *ATH_RESTRICT, double *ATH_RESTRICT, double *ATH_RESTRICT)
Trk::STEP_Propagator::m_momentumCutOff
double m_momentumCutOff
Stop propagation below this momentum.
Definition: STEP_Propagator.h:500
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::STEP_Propagator::m_includeGgradient
bool m_includeGgradient
Include g-gradient in the error propagation.
Definition: STEP_Propagator.h:499
Trk::MagneticFieldProperties
Definition: MagneticFieldProperties.h:31
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< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::pi0
@ pi0
Definition: ParticleHypothesis.h:34
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
hitVector
std::vector< FPGATrackSimHit > hitVector
Definition: FPGATrackSimCluster.h:23
Amg::saneCovarianceElement
bool saneCovarianceElement(double ele)
A covariance matrix formally needs to be positive semi definite.
Definition: EventPrimitivesCovarianceHelpers.h:63
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:161
Trk::STEP_Propagator::m_MPV
bool m_MPV
Definition: STEP_Propagator.h:505
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
Trk::Perigee
ParametersT< 5, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:29
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
Trk::STEP_Propagator::m_materialEffects
bool m_materialEffects
Switch material effects on or off.
Definition: STEP_Propagator.h:497
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trk::DistanceSolution::first
double first() const
Distance to first intersection solution along direction.
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::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:223
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::STEP_Propagator::m_simulation
bool m_simulation
Definition: STEP_Propagator.h:514
Trk::FastField
@ FastField
call the fast field access method of the FieldSvc
Definition: MagneticFieldMode.h:20
Trk::AmgSymMatrix
AmgSymMatrix(5) &GXFTrackState
Definition: GXFTrackState.h:156
Trk::STEP_Propagator::sampleBrem
void sampleBrem(Cache &cache, double mom) const
Definition: STEP_Propagator.cxx:2838
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
Trk::STEP_Propagator::m_scatteringScale
double m_scatteringScale
Definition: STEP_Propagator.h:507
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::STEP_Propagator::m_layXmax
double m_layXmax
Definition: STEP_Propagator.h:510
lumiFormat.i
int i
Definition: lumiFormat.py:92
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:2136
beamspotman.n
n
Definition: beamspotman.py:731
Trk::theta
@ theta
Definition: ParamDefs.h:72
Trk::electron
@ electron
Definition: ParticleHypothesis.h:27
extractSporadic.h
list h
Definition: extractSporadic.py:97
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::STEP_Propagator::m_maxPath
double m_maxPath
Definition: STEP_Propagator.h:508
Trk::DistanceSolution::second
double second() const
Distance to second intersection solution along direction (for a cylinder surface)
Trk::STEP_Propagator::m_detailedEloss
bool m_detailedEloss
Definition: STEP_Propagator.h:503
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Trk::geantino
@ geantino
Definition: ParticleHypothesis.h:26
Trk::STEP_Propagator::getFieldCacheObject
void getFieldCacheObject(Cache &cache, const EventContext &ctx) const
Definition: STEP_Propagator.cxx:2852
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:2864
Trk::SurfaceType::Cone
@ Cone
Trk::STEP_Propagator::m_simMatUpdator
ToolHandle< ITimedMatEffUpdator > m_simMatUpdator
secondary interactions (brem photon emission)
Definition: STEP_Propagator.h:516
Trk::neutron
@ neutron
Definition: ParticleHypothesis.h:33
Trk::STEP_Propagator::m_rngWrapper
ATHRNG::RNGWrapper * m_rngWrapper
Random engine.
Definition: STEP_Propagator.h:520
Trk::STEP_Propagator::m_multipleScattering
bool m_multipleScattering
Switch multiple scattering on or off.
Definition: STEP_Propagator.h:501
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:1648
beamspotman.dir
string dir
Definition: beamspotman.py:623
min
#define min(a, b)
Definition: cfImp.cxx:40
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::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:524
Trk::STEP_Propagator::m_randomEngineName
std::string m_randomEngineName
Definition: STEP_Propagator.h:521
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:1926
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
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:2801
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:362
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
Trk::STEP_Propagator::m_maxSteps
double m_maxSteps
Definition: STEP_Propagator.h:509
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:518
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
Trk::SurfaceType::Disc
@ Disc
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::SurfaceType::Cylinder
@ Cylinder
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Trk::photon
@ photon
Definition: ParticleHypothesis.h:32
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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:431
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
Trk::STEP_Propagator::m_tolerance
double m_tolerance
Error tolerance.
Definition: STEP_Propagator.h:496
Trk::SurfaceType::Plane
@ Plane
Trk::HitInfo
Definition: HelperStructs.h:12
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::STEP_Propagator::m_straggling
bool m_straggling
Definition: STEP_Propagator.h:504
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
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.
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::AlignableTrackingVolume
Definition: AlignableTrackingVolume.h:36