CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
MaterialEffectsUpdator Class Referenceabstract

#include <MaterialEffectsUpdator.h>

Inheritance diagram for MaterialEffectsUpdator:
CombinedMaterialEffectsUpdator EnergyLossUpdator MultipleScatteringUpdator

Public Types

typedef materialEffect::Covariance Covariance
 
typedef materialEffect::CovIndex CovIndex
 
typedef materialEffect::Effect Effect
 

Public Member Functions

virtual MaterialEffectsUpdatorclone () const =0
 
virtual void compute (const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
 
float mass () const
 
 MaterialEffectsUpdator (float mass)
 
virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual bool updateStateInPlace (TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual ~MaterialEffectsUpdator ()
 

Private Attributes

float theMass
 

Detailed Description

Interface for adding material effects during propagation. Updates to TrajectoryStateOnSurface are implemented in this class. Ported from ORCA.

Moved "state" into an independent struct "Effect"

Definition at line 56 of file MaterialEffectsUpdator.h.

Member Typedef Documentation

◆ Covariance

Definition at line 58 of file MaterialEffectsUpdator.h.

◆ CovIndex

Definition at line 60 of file MaterialEffectsUpdator.h.

◆ Effect

Definition at line 59 of file MaterialEffectsUpdator.h.

Constructor & Destructor Documentation

◆ MaterialEffectsUpdator()

MaterialEffectsUpdator::MaterialEffectsUpdator ( float  mass)

Constructor with explicit mass hypothesis

Definition at line 8 of file MaterialEffectsUpdator.cc.

8 : theMass(mass) {}

◆ ~MaterialEffectsUpdator()

MaterialEffectsUpdator::~MaterialEffectsUpdator ( )
virtual

Definition at line 10 of file MaterialEffectsUpdator.cc.

10 {}

Member Function Documentation

◆ clone()

virtual MaterialEffectsUpdator* MaterialEffectsUpdator::clone ( ) const
pure virtual

◆ compute()

virtual void MaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const  PropagationDirection,
Effect effect 
) const
pure virtual

◆ mass()

float MaterialEffectsUpdator::mass ( ) const
inline

◆ updateState()

TrajectoryStateOnSurface MaterialEffectsUpdator::updateState ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
virtual

Updates TrajectoryStateOnSurface with material effects (momentum and covariance matrix are potentially affected.

Definition at line 15 of file MaterialEffectsUpdator.cc.

16  {
17  TrajectoryStateOnSurface shallowCopy = TSoS;
18  // A TSOS is a proxy. Its contents will be really copied only if/when the updateStateInPlace attempts to change them
19  return updateStateInPlace(shallowCopy, propDir) ? shallowCopy : TrajectoryStateOnSurface();
20 }

References updateStateInPlace().

◆ updateStateInPlace()

bool MaterialEffectsUpdator::updateStateInPlace ( TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
virtual

Updates in place TrajectoryStateOnSurface with material effects (momentum and covariance matrix are potentially affected) Will return 'false' if the 'updateState' would have returned an invalid TSOS Note that the TSoS might be very well unchanged from this method (just like 'updateState' can return the same TSOS)

Definition at line 26 of file MaterialEffectsUpdator.cc.

27  {
28  //
29  // Check if
30  // - material is associated to surface
31  // - propagation direction is not anyDirection
32  // - side of surface is not atCenterOfSurface (could be handled with 50% material?)
33  //
34  const Surface& surface = TSoS.surface();
35  if (!surface.mediumProperties().isValid() || propDir == anyDirection || TSoS.surfaceSide() == atCenterOfSurface)
36  return true;
37  //
38  // Check, if already on right side of surface
39  //
40  if ((propDir == alongMomentum && TSoS.surfaceSide() == afterSurface) ||
41  (propDir == oppositeToMomentum && TSoS.surfaceSide() == beforeSurface))
42  return true;
43  //
44  // Update momentum. In case of failure: return invalid state
45  //
47  Effect effect;
48  compute(TSoS, propDir, effect);
49  if (!lp.updateP(effect.deltaP))
50  return false;
51  //
52  // Update covariance matrix?
53  //
55  if (TSoS.hasError()) {
56  AlgebraicSymMatrix55 eloc = TSoS.localError().matrix();
57  effect.deltaCov.add(eloc);
58  //TSoS = TrajectoryStateOnSurface(lp,LocalTrajectoryError(eloc),surface, &(TSoS.globalParameters().magneticField()),side);
59  //TSoS.update(lp,LocalTrajectoryError(eloc),side);
60  TSoS.update(lp, eloc, side);
61  } else {
62  TSoS.update(lp, side);
63  //TSoS = TrajectoryStateOnSurface(lp,surface,&(TSoS.globalParameters().magneticField()),side);
64  }
65  return true;
66 }

References materialEffect::Covariance::add(), SurfaceSideDefinition::afterSurface, alongMomentum, anyDirection, SurfaceSideDefinition::atCenterOfSurface, SurfaceSideDefinition::beforeSurface, compute(), materialEffect::Effect::deltaCov, materialEffect::Effect::deltaP, TrajectoryStateOnSurface::hasError(), MediumProperties::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LocalTrajectoryError::matrix(), Surface::mediumProperties(), oppositeToMomentum, TrajectoryStateOnSurface::surface(), TrajectoryStateOnSurface::surfaceSide(), TrajectoryStateOnSurface::update(), and LocalTrajectoryParameters::updateP().

Referenced by PropagatorWithMaterial::propagateWithPath(), and updateState().

Member Data Documentation

◆ theMass

float MaterialEffectsUpdator::theMass
private

Definition at line 91 of file MaterialEffectsUpdator.h.

Referenced by mass().

MaterialEffectsUpdator::updateStateInPlace
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Definition: MaterialEffectsUpdator.cc:26
anyDirection
Definition: PropagationDirection.h:4
oppositeToMomentum
Definition: PropagationDirection.h:4
Surface
Definition: Surface.h:36
SurfaceSideDefinition::SurfaceSide
SurfaceSide
Definition: SurfaceSideDefinition.h:8
SurfaceSideDefinition::afterSurface
Definition: SurfaceSideDefinition.h:8
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
SurfaceSideDefinition::atCenterOfSurface
Definition: SurfaceSideDefinition.h:8
Surface::mediumProperties
const MediumProperties & mediumProperties() const
Definition: Surface.h:83
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
SurfaceSideDefinition::beforeSurface
Definition: SurfaceSideDefinition.h:8
LocalTrajectoryParameters::updateP
bool updateP(float dP)
Update of momentum by a scalar dP.
Definition: LocalTrajectoryParameters.h:149
MaterialEffectsUpdator::mass
float mass() const
Definition: MaterialEffectsUpdator.h:83
MaterialEffectsUpdator::Effect
materialEffect::Effect Effect
Definition: MaterialEffectsUpdator.h:59
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
MaterialEffectsUpdator::compute
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
TrajectoryStateOnSurface::update
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
Definition: TrajectoryStateOnSurface.cc:6
MaterialEffectsUpdator::theMass
float theMass
Definition: MaterialEffectsUpdator.h:91
MediumProperties::isValid
bool isValid() const
Definition: MediumProperties.h:26
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
TrajectoryStateOnSurface::surfaceSide
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
Definition: TrajectoryStateOnSurface.h:89
alongMomentum
Definition: PropagationDirection.h:4