ATLAS Offline Software
Loading...
Searching...
No Matches
STEP_Propagator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4
6// Header file for class STEP_Propagator
8// (c) ATLAS Detector software
10// Class for track status propagation through magnetic field
12// Based on RungeKuttaPropagator Version 1.0 21/05/2004 I.Gavrilenko
13// Version 0.1 16/2/2005 Esben Lund
14// Extended by S.Todorova for propagation to multiple surfaces
16
17#ifndef STEP_Propagator_H
18#define STEP_Propagator_H
19
22#include "GaudiKernel/ToolHandle.h"
26//
29#include "TrkGeometry/BinnedMaterial.h" //Identified material typedef
31#include "TrkParameters/TrackParameters.h" //TrackParameters typedef
32//#include "TrkExUtils/ExtrapolationCache.h"
33// Amg
36// MagField cache
39//
40#include "CxxUtils/restrict.h"
41#include <list>
42#include <vector>
43
44namespace CLHEP{
45 class HepRandomEngine;
46}
47
49namespace Trk {
50class Surface;
51class TrackingVolume;
162
164 : public AthAlgTool
165 , virtual public IPropagator
166{
168 // Public methods:
170public:
172
173 STEP_Propagator(const std::string&, const std::string&, const IInterface*);
174
176
178 virtual StatusCode initialize() override final;
179
181 virtual StatusCode finalize() override final;
182
187 const Trk::Surface&,
190 bool rC = false) const override final;
191
194 const EventContext& ctx,
195 const Trk::TrackParameters& trackParameters,
196 const Trk::Surface& targetSurface,
197 Trk::PropDirection propagationDirection,
198 const Trk::BoundaryCheck& boundaryCheck,
199 const MagneticFieldProperties& magneticFieldProperties,
200 ParticleHypothesis particle,
201 bool returnCurv = false,
202 const Trk::TrackingVolume* tVol = nullptr) const override final;
203
206 const EventContext& ctx,
207 const Trk::TrackParameters& trackParameters,
208 std::vector<Trk::DestSurf>& targetSurfaces,
209 Trk::PropDirection propagationDirection,
210 const MagneticFieldProperties& magneticFieldProperties,
211 ParticleHypothesis particle,
212 std::vector<unsigned int>& solutions,
213 double& path,
214 bool usePathLimit = false,
215 bool returnCurv = false,
216 const Trk::TrackingVolume* tVol = nullptr) const override final;
217
221 const EventContext& ctx,
222 const Trk::TrackParameters& trackParameters,
223 std::vector<Trk::DestSurf>& targetSurfaces,
224 Trk::PropDirection propagationDirection,
225 const MagneticFieldProperties& magneticFieldProperties,
226 ParticleHypothesis particle,
227 std::vector<unsigned int>& solutions,
228 Trk::PathLimit& path,
229 Trk::TimeLimit& time,
230 bool returnCurv,
231 const Trk::TrackingVolume* tVol,
232 std::vector<Trk::HitInfo>*& hitVector) const override final;
233
237 const EventContext& ctx,
238 const Trk::TrackParameters& trackParameters,
239 std::vector<Trk::DestSurf>& targetSurfaces,
240 Trk::PropDirection propagationDirection,
241 const MagneticFieldProperties& magneticFieldProperties,
242 ParticleHypothesis particle,
243 std::vector<unsigned int>& solutions,
244 std::vector<const Trk::TrackStateOnSurface*>* matstates,
246 intersections,
247 double& path,
248 bool usePathLimit = false,
249 bool returnCurv = false,
250 const Trk::TrackingVolume* tVol = nullptr,
251 Trk::ExtrapolationCache* = nullptr) const override final;
252
256 const EventContext& ctx,
257 const Trk::TrackParameters& trackParameters,
258 const Trk::Surface& targetSurface,
259 Trk::PropDirection propagationDirection,
260 const Trk::BoundaryCheck& boundaryCheck,
261 const MagneticFieldProperties& magneticFieldProperties,
262 std::optional<Trk::TransportJacobian>& jacobian,
263 double& pathLimit,
264 ParticleHypothesis particle,
265 bool returnCurv = false,
266 const Trk::TrackingVolume* tVol = nullptr) const override final;
267
270 const EventContext& ctx,
271 const Trk::TrackParameters& trackParameters,
272 const Trk::Surface& targetSurface,
273 Trk::PropDirection propagationDirection,
274 const Trk::BoundaryCheck& boundaryCheck,
275 const MagneticFieldProperties& magneticFieldProperties,
276 ParticleHypothesis particle,
277 bool returnCurv = false,
278 const Trk::TrackingVolume* tVol = nullptr) const override final;
279
283 const EventContext& ctx,
284 const Trk::TrackParameters& trackParameters,
285 const Trk::Surface& targetSurface,
286 Trk::PropDirection propagationDirection,
287 const Trk::BoundaryCheck& boundaryCheck,
288 const MagneticFieldProperties& magneticFieldProperties,
289 std::optional<Trk::TransportJacobian>& jacobian,
290 ParticleHypothesis particle,
291 bool returnCurv = false,
292 const Trk::TrackingVolume* tVol = nullptr) const override final;
293
295 virtual std::optional<TrackSurfaceIntersection> intersect(
296 const EventContext& ctx,
297 const Trk::TrackParameters& trackParameters,
298 const Trk::Surface& targetSurface,
299 const Trk::MagneticFieldProperties& magneticFieldProperties,
300 ParticleHypothesis particle,
301 const Trk::TrackingVolume* tVol = nullptr) const override final;
302
306 const EventContext& ctx,
307 const Surface& surface,
308 const TrackSurfaceIntersection& trackIntersection,
309 const double qOverP,
311 ParticleHypothesis particle) const override final;
312
314 virtual void globalPositions(
315 const EventContext& ctx,
316 std::deque<Amg::Vector3D>& positionsList,
317 const TrackParameters& trackParameters,
318 const MagneticFieldProperties& magneticFieldProperties,
319 const CylinderBounds& cylinderBounds,
320 double maxStepSize,
321 ParticleHypothesis particle,
322 const Trk::TrackingVolume* tVol = 0) const override final;
323
326 const EventContext&,
328 const Surface&,
332 const ParticleHypothesis) const override final
333 {
334 ATH_MSG_ERROR("Call to non-implemented multiStatePropagate");
335 return {};
336 }
337
338 // Private methods:
340
344 struct Cache
345 {
346 bool m_energyLoss{ true };
348 bool m_straggling{ true };
349 bool m_solenoid{ false };
351 bool m_matPropOK{ true };
352 bool m_brem{ false };
354 bool m_includeGgradient{ false };
355 bool m_MPV{ false };
362 double m_delRad{ 0 }; // deRad/dl;
363 double m_delIoni{ 0 }; // deIoni/dl;
364 double m_sigmaIoni{ 0 }; // dsigma(ioni)/dl;
365 double m_kazL{ 0 }; // kazL constant;
366 double m_sigmaRad{ 0 }; // dsigma(rad)/dl;
367 // cache for input variance
370 double m_pathLimit{};
372 double m_timeStep{};
373 double m_particleMass{ 0 };
374 double m_charge{};
376 double m_tolerance{ 1e-05 };
377 double m_momentumCutOff{ 50. };
378 double m_scatteringScale{ 1. };
379 double m_maxPath{ 100000. };
380 int m_maxSteps{ 10000 };
381 double m_layXmax{ 1. };
382 // secondary interactions
383 double m_timeIn{};
384 double m_bremMom{ 0. };
387 double m_P[45]{};
388
389 const Trk::BinnedMaterial* m_binMat{ nullptr };
391 std::vector<const Trk::TrackStateOnSurface*>* m_matstates{ nullptr };
393 std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>, int>>*
395
397 std::vector<Trk::HitInfo>* m_hitVector{ nullptr };
398
401 const Material* m_material{ nullptr };
404 // cache for combined covariance matrix contribution
405 AmgSymMatrix(5) m_combinedCovariance;
406 // cache for differential covariance matrix contribution ( partial material
407 // dump )
408 AmgSymMatrix(5) m_covariance;
410 std::vector<std::pair<int, std::pair<double, double>>> m_currentDist;
411 MagField::AtlasFieldCache m_fieldCache;
412 CLHEP::HepRandomEngine* m_randomEngine { nullptr };
413 const EventContext& m_ctx;
414
415 Cache (const EventContext& ctx) : m_ctx (ctx) {}
416 };
417
418private:
420 // the configured properties.
437
439 // Main function for propagation
440 // with search of closest surface (ST)
442 std::unique_ptr<Trk::TrackParameters> propagateRungeKutta(
443 Cache& cache,
444 bool errorPropagation,
445 const Trk::TrackParameters& trackParameters,
446 std::vector<DestSurf>& targetSurfaces,
447 Trk::PropDirection propagationDirection,
448 const MagneticFieldProperties& magneticFieldProperties,
449 ParticleHypothesis particle,
450 std::vector<unsigned int>& solutions,
451 double& path,
452 bool returnCurv = false) const;
453
455 // Method for propagation with search of closest surface (ST)
457 bool propagateWithJacobian(Cache& cache,
458 bool errorPropagation,
459 std::vector<DestSurf>& sfs,
460 double* P,
461 Trk::PropDirection propDir,
462 std::vector<unsigned int>& solutions,
463 double& path,
464 double sumPath) const;
465
467 // dump material effects
469 void dumpMaterialEffects(Cache& cache,
470 const Trk::CurvilinearParameters* trackParameters,
471 double path) const;
472
474 // Momentum smearing (simulation mode)
476 void smear(Cache& cache,
477 double& phi,
478 double& theta,
479 const Trk::TrackParameters* parms,
480 double radDist) const;
482 // Bremstrahlung (simulation mode)
484 void sampleBrem(Cache& cache, double mom) const;
485
486 DoubleProperty m_tolerance{this, "Tolerance", 1e-05,
487 "Error tolerance. Low tolerance gives igh accuracy"};
488 BooleanProperty m_materialEffects{this, "MaterialEffects", true,
489 "Switch material effects on or off"};
490 BooleanProperty m_includeBgradients{this, "IncludeBgradients", true,
491 "Include B-field gradients in the error propagation"};
492 BooleanProperty m_includeGgradient{this, "IncludeGgradient", false,
493 "Include dg/dlambda into the error propagation? Only relevant when energy loss is true."};
494 DoubleProperty m_momentumCutOff{this, "MomentumCutOff", 50.,
495 "Stop propagation below this momentum in MeV"};
496 BooleanProperty m_multipleScattering{this, "MultipleScattering", true,
497 "Add multiple scattering to the covariance matrix?"};
498 BooleanProperty m_energyLoss{this, "EnergyLoss", true, "Include energy loss?"};
499 BooleanProperty m_detailedEloss{this, "DetailedEloss", true,
500 "Provide the extended EnergyLoss object with MopIonization etc."};
501 BooleanProperty m_straggling{this, "Straggling", true,
502 "Add energy loss fluctuations (straggling) to the covariance matrix?"};
503 BooleanProperty m_MPV{this, "MostProbableEnergyLoss", false,
504 "Use the most probable value of the energy loss, else use the mean energy loss."};
505 DoubleProperty m_stragglingScale{this, "StragglingScale", 1.,
506 "Scale for adjusting the width of the energy loss fluctuations."};
507 DoubleProperty m_scatteringScale{this, "MultipleScatteringScale", 1.,
508 "Scale for adjusting the multiple scattering contribution to the covariance matrix."};
509 DoubleProperty m_maxPath{this, "MaxPath", 100000.,
510 "Maximum propagation length in mm."};
511 IntegerProperty m_maxSteps{this, "MaxSteps", 10000,
512 "Maximum number of allowed steps (to avoid infinite loops)."};
513 DoubleProperty m_layXmax{this, "MSstepMax", 1.,
514 "maximal layer thickness for multiple scattering calculations"};
515
516 // The following are needed for simulation
517 // enable simulation mode
518 BooleanProperty m_simulation{this, "SimulationMode", false,
519 "flag for simulation mode"};
520
521 ToolHandle<ITimedMatEffUpdator> m_simMatUpdator{this, "SimMatEffUpdator", ""};
523 ServiceHandle<IAthRNGSvc> m_rndGenSvc{this, "RandomNumberService", "AthRNGSvc",
524 "Random number generator"};
525
527 StringProperty m_randomEngineName{this, "RandomStreamName", "FatrasRnd",
528 "Name of the random number stream"};
529
530 // Read handle for conditions object to get the field cache
532 this,
533 "AtlasFieldCacheCondObj",
534 "fieldCondObj",
535 "Name of the Magnetic Field conditions object key"
536 };
537 void getFieldCacheObject(Cache& cache, const EventContext& ctx) const;
538
539 CLHEP::HepRandomEngine* getRandomEngine (const EventContext& ctx) const;
540};
541
542} // end of namespace Trk
543
544#endif // STEP_Propagator_H
#define ATH_MSG_ERROR(x)
std::vector< FPGATrackSimHit > hitVector
static Double_t P(Double_t *tt, Double_t *par)
Eigen::Matrix< double, 3, 1 > Vector3D
A wrapper class for event-slot-local random engines.
Definition RNGWrapper.h:56
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Base Class for a navigation object (active) in the Calo realm.
for description of non-homogenous dense volumes
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Bounds for a cylindrical Surface.
This class describes energy loss material effects in the ATLAS tracking EDM.
Definition EnergyLoss.h:34
Interface class IPropagators It inherits from IAlgTool.
Definition IPropagator.h:55
virtual std::unique_ptr< NeutralParameters > propagate(const NeutralParameters &parameters, const Surface &sf, PropDirection dir, const BoundaryCheck &bcheck, bool returnCurv=false) const =0
Main propagation method for NeutralParameters.
magnetic field properties to steer the behavior of the extrapolation
A common object to be contained by.
Definition Material.h:117
void smear(Cache &cache, double &phi, double &theta, const Trk::TrackParameters *parms, double radDist) const
ToolHandle< ITimedMatEffUpdator > m_simMatUpdator
secondary interactions (brem photon emission)
virtual std::unique_ptr< Trk::NeutralParameters > propagate(const Trk::NeutralParameters &, const Trk::Surface &, Trk::PropDirection, const Trk::BoundaryCheck &, bool rC=false) const override final
Main propagation method NeutralParameters.
void dumpMaterialEffects(Cache &cache, const Trk::CurvilinearParameters *trackParameters, double path) const
virtual std::optional< TrackSurfaceIntersection > intersectSurface(const EventContext &ctx, const Surface &surface, const TrackSurfaceIntersection &trackIntersection, const double qOverP, const MagneticFieldProperties &mft, ParticleHypothesis particle) const override final
Intersection and propagation:
virtual StatusCode finalize() override final
AlgTool finalize method.
BooleanProperty m_detailedEloss
virtual StatusCode initialize() override final
AlgTool initialize method.
STEP_Propagator(const std::string &, const std::string &, const IInterface *)
DoubleProperty m_tolerance
virtual std::unique_ptr< Trk::TrackParameters > 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 override final
Propagate parameters and covariance with search of closest surface time included.
IntegerProperty m_maxSteps
BooleanProperty m_materialEffects
BooleanProperty m_simulation
StringProperty m_randomEngineName
virtual std::unique_ptr< Trk::TrackParameters > 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 override final
Propagate parameters only.
BooleanProperty m_MPV
void setCacheFromProperties(Cache &cache) const
initialize cache with the variables we need to take from
BooleanProperty m_includeGgradient
virtual ~STEP_Propagator()
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
DoubleProperty m_maxPath
DoubleProperty m_layXmax
BooleanProperty m_multipleScattering
BooleanProperty m_straggling
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
BooleanProperty m_includeBgradients
DoubleProperty m_momentumCutOff
void sampleBrem(Cache &cache, double mom) const
DoubleProperty m_scatteringScale
virtual Trk::MultiComponentState multiStatePropagate(const EventContext &, const MultiComponentState &, const Surface &, const MagneticFieldProperties &, const PropDirection, const BoundaryCheck &, const ParticleHypothesis) const override final
unimplemented multiStatePropagate
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.
ServiceHandle< IAthRNGSvc > m_rndGenSvc
Random Generator service.
DoubleProperty m_stragglingScale
void getFieldCacheObject(Cache &cache, const EventContext &ctx) const
virtual std::unique_ptr< Trk::TrackParameters > 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 *=nullptr) const override final
Propagate parameters and covariance with search of closest surface and material collection.
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
ATHRNG::RNGWrapper * m_rngWrapper
Random engine.
BooleanProperty m_energyLoss
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.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
represents a deflection of the track caused through multiple scattering in material.
Abstract Base Class for tracking surfaces.
represents the track state (measurement, material, fit parameters and quality) at a surface.
An intersection with a Surface is given by.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
This class represents the jacobian for transforming initial track parameters to new track parameters ...
STL class.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg)
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
std::vector< ComponentParameters > MultiComponentState
ParametersBase< NeutralParametersDim, Neutral > NeutralParameters
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
std::pair< const Surface *, BoundaryCheck > DestSurf
typedef for input surfaces, boundary check
Definition IPropagator.h:45
ParametersBase< TrackParametersDim, Charged > TrackParameters
STL namespace.
Macro wrapping the nonstandard restrict keyword.
stuct to pass information to the heavy lifting calculation internal methods
bool m_solenoid
Switch for turning off material effects temporarily.
const TrackingVolume * m_trackingVolume
std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int > > * m_identifiedParameters
cache of intersections/hit info
std::vector< Trk::HitInfo > * m_hitVector
ParticleHypothesis m_particle
std::vector< const Trk::TrackStateOnSurface * > * m_matstates
cache of intersections
MagField::AtlasFieldCache m_fieldCache
Cache(const EventContext &ctx)
const Trk::BinnedMaterial * m_binMat
cache of TrackStateOnSurfaces
std::vector< std::pair< int, std::pair< double, double > > > m_currentDist
AmgSymMatrix(5) m_combinedCovariance
const EventContext & m_ctx
CLHEP::HepRandomEngine * m_randomEngine
const Material * m_material
cache for collecting the total X0 ans Elos
Trk::ExtrapolationCache * m_extrapolationCache