#include <MaterialEffectsUpdator.h>
Interface for adding material effects during propagation. Updates to TrajectoryStateOnSurface are implemented in this class. Ported from ORCA.
Definition at line 18 of file MaterialEffectsUpdator.h.
MaterialEffectsUpdator::MaterialEffectsUpdator | ( | double | mass | ) |
Constructor with explicit mass hypothesis
Definition at line 13 of file MaterialEffectsUpdator.cc.
: theMass(mass), theLastOverP(0), theLastDxdz(0), theLastRL(0), theLastPropDir(anyDirection), theDeltaP(0.), theDeltaCov() {}
MaterialEffectsUpdator::~MaterialEffectsUpdator | ( | ) | [virtual] |
Definition at line 22 of file MaterialEffectsUpdator.cc.
{}
virtual MaterialEffectsUpdator* MaterialEffectsUpdator::clone | ( | ) | const [pure virtual] |
Implemented in CombinedMaterialEffectsUpdator, EnergyLossUpdator, and MultipleScatteringUpdator.
virtual void MaterialEffectsUpdator::compute | ( | const TrajectoryStateOnSurface & | , |
const PropagationDirection | |||
) | const [private, pure virtual] |
Implemented in CombinedMaterialEffectsUpdator, EnergyLossUpdator, and MultipleScatteringUpdator.
Referenced by deltaLocalError(), and deltaP().
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 CombinedMaterialEffectsUpdator::compute(), and updateStateInPlace().
{ // check for material if ( !TSoS.surface().mediumProperties() ) return theNullMatrix; // check for change (avoid using compute method if possible) if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir); return 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 CombinedMaterialEffectsUpdator::compute(), and updateStateInPlace().
{ // check for material if ( !TSoS.surface().mediumProperties() ) return 0.; // check for change (avoid using compute method if possible) if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir); return theDeltaP; }
double MaterialEffectsUpdator::mass | ( | ) | const [inline] |
Particle mass assigned at construction.
Definition at line 54 of file MaterialEffectsUpdator.h.
References theMass.
Referenced by MultipleScatteringUpdator::compute(), EnergyLossUpdator::compute(), and EnergyLossUpdator::computeBetheBloch().
{ return theMass; }
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().
{ // check that track as same momentum and direction, surface has same radLen // it optimize also against multiple evaluations on different "surfaces" // belonging to contigous detectors with same radLem bool ok = theLastOverP != TSoS.localParameters().qbp() || theLastDxdz != TSoS.localParameters().dxdz() || theLastRL != TSoS.surface().mediumProperties()->radLen() || theLastPropDir != propDir; if (ok) { theLastOverP = TSoS.localParameters().qbp(); theLastDxdz = TSoS.localParameters().dxdz(); theLastRL = TSoS.surface().mediumProperties()->radLen(); theLastPropDir = propDir; } return ok; }
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().
{ TrajectoryStateOnSurface shallowCopy = TSoS; // A TSOS is a proxy. Its contents will be really copied only if/when the updateStateInPlace attempts to change them return updateStateInPlace(shallowCopy, propDir) ? shallowCopy : TrajectoryStateOnSurface(); }
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 updateState().
{ // // Check if // - material is associated to surface // - propagation direction is not anyDirection // - side of surface is not atCenterOfSurface (could be handled with 50% material?) // const Surface& surface = TSoS.surface(); if ( !surface.mediumProperties() || propDir==anyDirection || TSoS.surfaceSide()==atCenterOfSurface ) return true; // // Check, if already on right side of surface // if ( (propDir==alongMomentum && TSoS.surfaceSide()==afterSurface ) || (propDir==oppositeToMomentum && TSoS.surfaceSide()==beforeSurface ) ) return true; // // Update momentum. In case of failure: return invalid state // LocalTrajectoryParameters lp = TSoS.localParameters(); if ( !lp.updateP(deltaP(TSoS,propDir)) ) return false; // // Update covariance matrix? // SurfaceSide side = propDir==alongMomentum ? afterSurface : beforeSurface; if ( TSoS.hasError() ) { AlgebraicSymMatrix55 eloc = TSoS.localError().matrix() + deltaLocalError(TSoS,propDir); //TSoS = TrajectoryStateOnSurface(lp,LocalTrajectoryError(eloc),surface, &(TSoS.globalParameters().magneticField()),side); TSoS.update(lp,LocalTrajectoryError(eloc),surface, &(TSoS.globalParameters().magneticField()),side); } else { TSoS.update(lp,surface,&(TSoS.globalParameters().magneticField()),side); //TSoS = TrajectoryStateOnSurface(lp,surface,&(TSoS.globalParameters().magneticField()),side); } return true; }
AlgebraicSymMatrix55 MaterialEffectsUpdator::theDeltaCov [mutable, protected] |
Definition at line 79 of file MaterialEffectsUpdator.h.
Referenced by MultipleScatteringUpdator::compute(), CombinedMaterialEffectsUpdator::compute(), EnergyLossUpdator::compute(), EnergyLossUpdator::computeBetheBloch(), EnergyLossUpdator::computeElectrons(), and deltaLocalError().
double MaterialEffectsUpdator::theDeltaP [mutable, protected] |
Definition at line 78 of file MaterialEffectsUpdator.h.
Referenced by CombinedMaterialEffectsUpdator::compute(), EnergyLossUpdator::compute(), EnergyLossUpdator::computeBetheBloch(), EnergyLossUpdator::computeElectrons(), and deltaP().
double MaterialEffectsUpdator::theLastDxdz [mutable, private] |
Definition at line 72 of file MaterialEffectsUpdator.h.
Referenced by newArguments().
double MaterialEffectsUpdator::theLastOverP [mutable, private] |
Definition at line 71 of file MaterialEffectsUpdator.h.
Referenced by newArguments().
PropagationDirection MaterialEffectsUpdator::theLastPropDir [mutable, private] |
Definition at line 74 of file MaterialEffectsUpdator.h.
Referenced by newArguments().
float MaterialEffectsUpdator::theLastRL [mutable, private] |
Definition at line 73 of file MaterialEffectsUpdator.h.
Referenced by newArguments().
double MaterialEffectsUpdator::theMass [private] |
Definition at line 68 of file MaterialEffectsUpdator.h.
Referenced by mass().
AlgebraicSymMatrix55 MaterialEffectsUpdator::theNullMatrix [static, protected] |
Definition at line 80 of file MaterialEffectsUpdator.h.
Referenced by deltaLocalError().