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

Definition at line 58 of file MaterialEffectsUpdator.h.

Definition at line 60 of file MaterialEffectsUpdator.h.

Definition at line 59 of file MaterialEffectsUpdator.h.

Constructor & Destructor Documentation

MaterialEffectsUpdator::MaterialEffectsUpdator ( float  mass)

Constructor with explicit mass hypothesis

Definition at line 8 of file MaterialEffectsUpdator.cc.

MaterialEffectsUpdator::~MaterialEffectsUpdator ( )
virtual

Definition at line 10 of file MaterialEffectsUpdator.cc.

10 {}

Member Function Documentation

virtual MaterialEffectsUpdator* MaterialEffectsUpdator::clone ( ) const
pure virtual
virtual void MaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const PropagationDirection  ,
Effect effect 
) const
pure virtual
float MaterialEffectsUpdator::mass ( ) const
inline
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.

References updateStateInPlace().

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 }
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
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.

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().

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 }
materialEffect::Effect Effect
const LocalTrajectoryParameters & localParameters() const
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
const SurfaceType & surface() const
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
void update(const LocalTrajectoryParameters &p, const SurfaceType &aSurface, const MagneticField *field, SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
bool isValid() const
const MediumProperties & mediumProperties() const
Definition: Surface.h:85
bool updateP(float dP)
Update of momentum by a scalar dP.

Member Data Documentation

float MaterialEffectsUpdator::theMass
private

Definition at line 91 of file MaterialEffectsUpdator.h.