CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
MaterialEffectsUpdator Class Referenceabstract

#include <MaterialEffectsUpdator.h>

Inheritance diagram for MaterialEffectsUpdator:
CombinedMaterialEffectsUpdator EnergyLossUpdator MultipleScatteringUpdator

Public Member Functions

virtual MaterialEffectsUpdatorclone () const =0
 
virtual const
AlgebraicSymMatrix55
deltaLocalError (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual double deltaP (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
double mass () const
 
 MaterialEffectsUpdator (double mass)
 
virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual bool updateStateInPlace (TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual ~MaterialEffectsUpdator ()
 

Protected Attributes

AlgebraicSymMatrix55 theDeltaCov
 
double theDeltaP
 

Static Protected Attributes

static AlgebraicSymMatrix55 theNullMatrix
 

Private Member Functions

virtual void compute (const TrajectoryStateOnSurface &, const PropagationDirection) const dso_internal=0
 
bool newArguments (const TrajectoryStateOnSurface &TSoS, PropagationDirection propDir) const dso_internal
 

Private Attributes

double theLastDxdz
 
double theLastOverP
 
PropagationDirection theLastPropDir
 
float theLastRL
 
double theMass
 

Detailed Description

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

Date:
2011/04/16 14:51:22
Revision:
1.13
Author
todorov, cerati

Definition at line 20 of file MaterialEffectsUpdator.h.

Constructor & Destructor Documentation

MaterialEffectsUpdator::MaterialEffectsUpdator ( double  mass)

Constructor with explicit mass hypothesis

Definition at line 13 of file MaterialEffectsUpdator.cc.

MaterialEffectsUpdator::~MaterialEffectsUpdator ( )
virtual

Definition at line 22 of file MaterialEffectsUpdator.cc.

22 {}

Member Function Documentation

virtual MaterialEffectsUpdator* MaterialEffectsUpdator::clone ( ) const
pure virtual
virtual void MaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const
privatepure virtual
const AlgebraicSymMatrix55 & MaterialEffectsUpdator::deltaLocalError ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
virtual

Contribution to covariance matrix (in local co-ordinates) from material effects.

Definition at line 48 of file MaterialEffectsUpdator.cc.

References compute(), Surface::mediumProperties(), newArguments(), TrajectoryStateOnSurface::surface(), theDeltaCov, and theNullMatrix.

Referenced by GsfMaterialEffectsAdapter::compute(), CombinedMaterialEffectsUpdator::compute(), and updateStateInPlace().

49  {
50  // check for material
51  if ( !TSoS.surface().mediumProperties() ) return theNullMatrix;
52  // check for change (avoid using compute method if possible)
53  if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
54  return theDeltaCov;
55 }
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const dso_internal=0
const Surface & surface() const
static AlgebraicSymMatrix55 theNullMatrix
bool newArguments(const TrajectoryStateOnSurface &TSoS, PropagationDirection propDir) const dso_internal
AlgebraicSymMatrix55 theDeltaCov
double MaterialEffectsUpdator::deltaP ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
virtual

Change in |p| from material effects.

Reimplemented in MultipleScatteringUpdator.

Definition at line 37 of file MaterialEffectsUpdator.cc.

References compute(), Surface::mediumProperties(), newArguments(), TrajectoryStateOnSurface::surface(), and theDeltaP.

Referenced by GsfMaterialEffectsAdapter::compute(), CombinedMaterialEffectsUpdator::compute(), and updateStateInPlace().

37  {
38  // check for material
39  if ( !TSoS.surface().mediumProperties() ) return 0.;
40  // check for change (avoid using compute method if possible)
41  if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
42  return theDeltaP;
43 }
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const dso_internal=0
const Surface & surface() const
bool newArguments(const TrajectoryStateOnSurface &TSoS, PropagationDirection propDir) const dso_internal
double MaterialEffectsUpdator::mass ( ) const
inline

Particle mass assigned at construction.

Definition at line 56 of file MaterialEffectsUpdator.h.

References theMass.

Referenced by EnergyLossUpdator::compute(), MultipleScatteringUpdator::compute(), and EnergyLossUpdator::computeBetheBloch().

56  {
57  return theMass;
58  }
bool MaterialEffectsUpdator::newArguments ( const TrajectoryStateOnSurface TSoS,
PropagationDirection  propDir 
) const
private

Definition at line 101 of file MaterialEffectsUpdator.cc.

References LocalTrajectoryParameters::dxdz(), TrajectoryStateOnSurface::localParameters(), Surface::mediumProperties(), convertSQLiteXML::ok, LocalTrajectoryParameters::qbp(), MediumProperties::radLen(), TrajectoryStateOnSurface::surface(), theLastDxdz, theLastOverP, theLastPropDir, and theLastRL.

Referenced by deltaLocalError(), and deltaP().

101  {
102  // check that track as same momentum and direction, surface has same radLen
103  // it optimize also against multiple evaluations on different "surfaces"
104  // belonging to contigous detectors with same radLem
105  bool ok =
106  theLastOverP != TSoS.localParameters().qbp() ||
107  theLastDxdz != TSoS.localParameters().dxdz() ||
108  theLastRL != TSoS.surface().mediumProperties()->radLen() ||
109  theLastPropDir != propDir;
110  if (ok) {
111  theLastOverP = TSoS.localParameters().qbp();
112  theLastDxdz = TSoS.localParameters().dxdz();
114  theLastPropDir = propDir;
115  }
116  return ok;
117 }
float radLen() const
const LocalTrajectoryParameters & localParameters() const
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
PropagationDirection theLastPropDir
const Surface & surface() const
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 27 of file MaterialEffectsUpdator.cc.

References updateStateInPlace().

28  {
29  TrajectoryStateOnSurface shallowCopy = TSoS;
30  // A TSOS is a proxy. Its contents will be really copied only if/when the updateStateInPlace attempts to change them
31  return updateStateInPlace(shallowCopy, propDir) ? shallowCopy : TrajectoryStateOnSurface();
32 }
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 62 of file MaterialEffectsUpdator.cc.

References SurfaceSideDefinition::afterSurface, alongMomentum, anyDirection, SurfaceSideDefinition::atCenterOfSurface, SurfaceSideDefinition::beforeSurface, deltaLocalError(), deltaP(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), GlobalTrajectoryParameters::magneticField(), LocalTrajectoryError::matrix(), Surface::mediumProperties(), oppositeToMomentum, TrajectoryStateOnSurface::surface(), TrajectoryStateOnSurface::surfaceSide(), TrajectoryStateOnSurface::update(), and LocalTrajectoryParameters::updateP().

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

63  {
64  //
65  // Check if
66  // - material is associated to surface
67  // - propagation direction is not anyDirection
68  // - side of surface is not atCenterOfSurface (could be handled with 50% material?)
69  //
70  const Surface& surface = TSoS.surface();
71  if ( !surface.mediumProperties() || propDir==anyDirection ||
72  TSoS.surfaceSide()==atCenterOfSurface ) return true;
73  //
74  // Check, if already on right side of surface
75  //
76  if ( (propDir==alongMomentum && TSoS.surfaceSide()==afterSurface ) ||
77  (propDir==oppositeToMomentum && TSoS.surfaceSide()==beforeSurface ) ) return true;
78  //
79  // Update momentum. In case of failure: return invalid state
80  //
82  if ( !lp.updateP(deltaP(TSoS,propDir)) )
83  return false;
84  //
85  // Update covariance matrix?
86  //
88  if ( TSoS.hasError() ) {
89  AlgebraicSymMatrix55 eloc = TSoS.localError().matrix() + deltaLocalError(TSoS,propDir);
90  //TSoS = TrajectoryStateOnSurface(lp,LocalTrajectoryError(eloc),surface, &(TSoS.globalParameters().magneticField()),side);
91  TSoS.update(lp,LocalTrajectoryError(eloc),surface,
92  &(TSoS.globalParameters().magneticField()),side);
93  }
94  else {
95  TSoS.update(lp,surface,&(TSoS.globalParameters().magneticField()),side);
96  //TSoS = TrajectoryStateOnSurface(lp,surface,&(TSoS.globalParameters().magneticField()),side);
97  }
98  return true;
99 }
void update(const LocalTrajectoryParameters &p, const Surface &aSurface, const MagneticField *field, const SurfaceSide side=SurfaceSideDefinition::atCenterOfSurface)
const LocalTrajectoryParameters & localParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
bool updateP(double dP)
Update of momentum by a scalar dP.
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
virtual const AlgebraicSymMatrix55 & deltaLocalError(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
virtual double deltaP(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
const GlobalTrajectoryParameters & globalParameters() const
const Surface & surface() const
const MagneticField & magneticField() const

Member Data Documentation

AlgebraicSymMatrix55 MaterialEffectsUpdator::theDeltaCov
mutableprotected
double MaterialEffectsUpdator::theDeltaP
mutableprotected
double MaterialEffectsUpdator::theLastDxdz
mutableprivate

Definition at line 74 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

double MaterialEffectsUpdator::theLastOverP
mutableprivate

Definition at line 73 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

PropagationDirection MaterialEffectsUpdator::theLastPropDir
mutableprivate

Definition at line 76 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

float MaterialEffectsUpdator::theLastRL
mutableprivate

Definition at line 75 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

double MaterialEffectsUpdator::theMass
private

Definition at line 70 of file MaterialEffectsUpdator.h.

Referenced by mass().

AlgebraicSymMatrix55 MaterialEffectsUpdator::theNullMatrix
staticprotected

Definition at line 82 of file MaterialEffectsUpdator.h.

Referenced by deltaLocalError().