CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes

MaterialEffectsUpdator Class Reference

#include <MaterialEffectsUpdator.h>

Inheritance diagram for MaterialEffectsUpdator:
CombinedMaterialEffectsUpdator EnergyLossUpdator MultipleScatteringUpdator

List of all members.

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.

{}

Member Function Documentation

virtual MaterialEffectsUpdator* MaterialEffectsUpdator::clone ( ) const [pure virtual]
virtual void MaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const [private, pure 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 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 56 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;
}

Member Data Documentation

double MaterialEffectsUpdator::theDeltaP [mutable, protected]
double MaterialEffectsUpdator::theLastDxdz [mutable, private]

Definition at line 74 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

double MaterialEffectsUpdator::theLastOverP [mutable, private]

Definition at line 73 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

Definition at line 76 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

float MaterialEffectsUpdator::theLastRL [mutable, private]

Definition at line 75 of file MaterialEffectsUpdator.h.

Referenced by newArguments().

Definition at line 70 of file MaterialEffectsUpdator.h.

Referenced by mass().

Definition at line 82 of file MaterialEffectsUpdator.h.

Referenced by deltaLocalError().