CMS 3D CMS Logo

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

GsfMaterialEffectsUpdator Class Reference

#include <GsfMaterialEffectsUpdator.h>

Inheritance diagram for GsfMaterialEffectsUpdator:
GsfBetheHeitlerUpdator GsfCombinedMaterialEffectsUpdator GsfMaterialEffectsAdapter GsfMultipleScatteringUpdator

List of all members.

Public Member Functions

virtual GsfMaterialEffectsUpdatorclone () const =0
virtual std::vector
< AlgebraicSymMatrix55
deltaLocalErrors (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
virtual std::vector< double > deltaPs (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 GsfMaterialEffectsUpdator (float mass)
float mass () const
virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
virtual std::vector< double > weights (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
virtual ~GsfMaterialEffectsUpdator ()

Protected Member Functions

virtual bool newArguments (const TrajectoryStateOnSurface &, const PropagationDirection) const
virtual void storeArguments (const TrajectoryStateOnSurface &, const PropagationDirection) const

Protected Attributes

std::vector< AlgebraicSymMatrix55theDeltaCovs
std::vector< double > theDeltaPs
std::vector< double > theWeights

Private Member Functions

virtual void compute (const TrajectoryStateOnSurface &, const PropagationDirection) const =0

Private Attributes

float theMass

Detailed Description

Interface for adding material effects during propagation as a Gaussian mixture. Similar to MaterialEffectsUpdator, but returns MultiTrajectoryState.

Definition at line 15 of file GsfMaterialEffectsUpdator.h.


Constructor & Destructor Documentation

GsfMaterialEffectsUpdator::GsfMaterialEffectsUpdator ( float  mass) [inline]

Constructor with explicit mass hypothesis

Definition at line 20 of file GsfMaterialEffectsUpdator.h.

                                           :
    theMass(mass) {}
virtual GsfMaterialEffectsUpdator::~GsfMaterialEffectsUpdator ( ) [inline, virtual]

Definition at line 23 of file GsfMaterialEffectsUpdator.h.

{}

Member Function Documentation

virtual GsfMaterialEffectsUpdator* GsfMaterialEffectsUpdator::clone ( ) const [pure virtual]
virtual void GsfMaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const [private, pure virtual]
virtual std::vector<AlgebraicSymMatrix55> GsfMaterialEffectsUpdator::deltaLocalErrors ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const [inline, virtual]

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

Definition at line 52 of file GsfMaterialEffectsUpdator.h.

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

                                                                                                      {
    // check for material
    if ( !TSoS.surface().mediumProperties() )  return std::vector<AlgebraicSymMatrix55>();
    // check for change (avoid using compute method if possible)
    if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
    return theDeltaCovs;
  }  
virtual std::vector<double> GsfMaterialEffectsUpdator::deltaPs ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const [inline, virtual]

Change in |p| from material effects.

Definition at line 42 of file GsfMaterialEffectsUpdator.h.

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

                                                                                 {
    // check for material
    if ( !TSoS.surface().mediumProperties() )  return std::vector<double>();
    // check for change (avoid using compute method if possible)
    if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
    return theDeltaPs;
  }
float GsfMaterialEffectsUpdator::mass ( ) const [inline]

Particle mass assigned at construction.

Definition at line 62 of file GsfMaterialEffectsUpdator.h.

References theMass.

Referenced by GsfMultipleScatteringUpdator::compute().

                             {
    return theMass;
  }
virtual bool GsfMaterialEffectsUpdator::newArguments ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const [inline, protected, virtual]

Reimplemented in GsfBetheHeitlerUpdator, GsfMaterialEffectsAdapter, and GsfMultipleScatteringUpdator.

Definition at line 74 of file GsfMaterialEffectsUpdator.h.

Referenced by deltaLocalErrors(), deltaPs(), and weights().

                                                                                                {
    return true;
  }
virtual void GsfMaterialEffectsUpdator::storeArguments ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const [inline, protected, virtual]
TrajectoryStateOnSurface GsfMaterialEffectsUpdator::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 GsfMaterialEffectsUpdator.cc.

References MultiTrajectoryStateAssembler::addState(), SurfaceSideDefinition::afterSurface, alongMomentum, SurfaceSideDefinition::beforeSurface, MultiTrajectoryStateAssembler::combinedState(), TrajectoryStateOnSurface::components(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), GlobalTrajectoryParameters::magneticField(), LocalTrajectoryError::matrix(), Surface::mediumProperties(), query::result, TrajectoryStateOnSurface::surface(), LocalTrajectoryParameters::updateP(), CommonMethods::weight(), TrajectoryStateOnSurface::weight(), and create_public_pileup_plots::weights.

                                                                                  {
  //
  // get components of input state and check if material is associated to surface
  //
  const Surface& surface = TSoS.surface();
  if ( !surface.mediumProperties() )  return TSoS;
  SurfaceSide side = propDir==alongMomentum ? afterSurface : beforeSurface;
  // single input state?
  if ( TSoS.components().size()>1 )
    throw cms::Exception("LogicError") << "GsfMaterialEffectsUpdator::updateState used with MultiTSOS";
  double weight = TSoS.weight();
  //
  // Get components (will force recalculation, if necessary)
  //
  std::vector<double> Ws = weights(TSoS,propDir);
  if ( Ws.empty() )  return TrajectoryStateOnSurface();
  std::vector<double> dPs = deltaPs(TSoS,propDir);
  if ( dPs.size()!=Ws.size() )
    throw cms::Exception("LogicError") 
      << "GsfMaterialEffectsUpdator: inconsistency in number of components";  
  std::vector<AlgebraicSymMatrix55> deltaErrors;
  if ( TSoS.hasError() )
    deltaErrors = deltaLocalErrors(TSoS,propDir);
  //
  // prepare output vector
  //
  MultiTrajectoryStateAssembler result;
  //
  // loop over components
  //
  //   edm::LogDebug("GsfMaterialEffectsUpdator") << "found " << Ws.size() << " components\n"
  //                                         << "  input state has weight " << TSoS.weight();
  for ( unsigned int ic=0; ic<Ws.size(); ic++ ) {
    //      edm::LogDebug("GsfMaterialEffectsUpdator") << "w, dp, sigp = "
    //           << Ws[ic] << ", "
    //           << dPs[ic] << ", "
    //           << sqrt((deltaErrors[ic])[0][0]);
    //
    // Update momentum. In case of failure: return invalid state.
    // Use deltaP method to ensure update of cache, if necessary!
    //
    LocalTrajectoryParameters lp = TSoS.localParameters();
    if ( !lp.updateP(dPs[ic]) )  
      return TrajectoryStateOnSurface();
    //
    // Update covariance matrix?
    //
    if ( TSoS.hasError() ) {
      AlgebraicSymMatrix55 eloc = TSoS.localError().matrix();
      eloc += deltaErrors[ic];
      result.addState(TrajectoryStateOnSurface(lp,
                                               LocalTrajectoryError(eloc),
                                               surface,
                                               &(TSoS.globalParameters().magneticField()),
                                               side,
                                               weight*Ws[ic]));
      //       edm::LogDebug("GsfMaterialEffectsUpdator") 
      //        << "adding state with weight " << weight*Ws[ic];
    }
    else {
      result.addState(TrajectoryStateOnSurface(lp,surface,
                                               &(TSoS.globalParameters().magneticField()),
                                               side));
    }
  }
  //   edm::LogDebug("GsfMaterialEffectsUpdator") 
  //     << "  output state has weight " << result.combinedState().weight();
  return result.combinedState();
}
virtual std::vector<double> GsfMaterialEffectsUpdator::weights ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const [inline, virtual]

Weights of components.

Definition at line 32 of file GsfMaterialEffectsUpdator.h.

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

                                                                                 {
    // check for material
    if ( !TSoS.surface().mediumProperties() )  return std::vector<double>();
    // check for change (avoid using compute method if possible)
    if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
    return theWeights;
  }

Member Data Documentation

std::vector<double> GsfMaterialEffectsUpdator::theDeltaPs [mutable, protected]

Definition at line 82 of file GsfMaterialEffectsUpdator.h.

Referenced by mass().

std::vector<double> GsfMaterialEffectsUpdator::theWeights [mutable, protected]