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 Member Functions | Protected Attributes | Private Member Functions | Private Attributes
GsfMaterialEffectsUpdator Class Referenceabstract

#include <GsfMaterialEffectsUpdator.h>

Inheritance diagram for GsfMaterialEffectsUpdator:
GsfBetheHeitlerUpdator GsfCombinedMaterialEffectsUpdator GsfMaterialEffectsAdapter GsfMultipleScatteringUpdator

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.

virtual GsfMaterialEffectsUpdator::~GsfMaterialEffectsUpdator ( )
inlinevirtual

Definition at line 23 of file GsfMaterialEffectsUpdator.h.

23 {}

Member Function Documentation

virtual GsfMaterialEffectsUpdator* GsfMaterialEffectsUpdator::clone ( ) const
pure virtual
virtual void GsfMaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const
privatepure virtual
virtual std::vector<AlgebraicSymMatrix55> GsfMaterialEffectsUpdator::deltaLocalErrors ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
inlinevirtual

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.

Referenced by GsfCombinedMaterialEffectsUpdator::compute().

53  {
54  // check for material
55  if ( !TSoS.surface().mediumProperties() ) return std::vector<AlgebraicSymMatrix55>();
56  // check for change (avoid using compute method if possible)
57  if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
58  return theDeltaCovs;
59  }
std::vector< AlgebraicSymMatrix55 > theDeltaCovs
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const =0
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
virtual bool newArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
const Surface & surface() const
virtual std::vector<double> GsfMaterialEffectsUpdator::deltaPs ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
inlinevirtual

Change in |p| from material effects.

Definition at line 42 of file GsfMaterialEffectsUpdator.h.

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

Referenced by GsfCombinedMaterialEffectsUpdator::compute().

43  {
44  // check for material
45  if ( !TSoS.surface().mediumProperties() ) return std::vector<double>();
46  // check for change (avoid using compute method if possible)
47  if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
48  return theDeltaPs;
49  }
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const =0
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
virtual bool newArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
const Surface & surface() const
float GsfMaterialEffectsUpdator::mass ( ) const
inline

Particle mass assigned at construction.

Definition at line 62 of file GsfMaterialEffectsUpdator.h.

References theMass.

Referenced by GsfMultipleScatteringUpdator::compute().

62  {
63  return theMass;
64  }
virtual bool GsfMaterialEffectsUpdator::newArguments ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const
inlineprotectedvirtual

Reimplemented in GsfBetheHeitlerUpdator, GsfMultipleScatteringUpdator, and GsfMaterialEffectsAdapter.

Definition at line 74 of file GsfMaterialEffectsUpdator.h.

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

74  {
75  return true;
76  }
virtual void GsfMaterialEffectsUpdator::storeArguments ( const TrajectoryStateOnSurface ,
const PropagationDirection   
) const
inlineprotectedvirtual

Reimplemented in GsfBetheHeitlerUpdator, GsfMultipleScatteringUpdator, and GsfMaterialEffectsAdapter.

Definition at line 78 of file GsfMaterialEffectsUpdator.h.

78  {
79  }
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(), TrajectoryStateOnSurface::weight(), CommonMethods::weight(), and create_public_pileup_plots::weights.

Referenced by FullConvolutionWithMaterial::operator()().

16  {
17  //
18  // get components of input state and check if material is associated to surface
19  //
20  const Surface& surface = TSoS.surface();
21  if ( !surface.mediumProperties() ) return TSoS;
23  // single input state?
24  if ( TSoS.components().size()>1 )
25  throw cms::Exception("LogicError") << "GsfMaterialEffectsUpdator::updateState used with MultiTSOS";
26  double weight = TSoS.weight();
27  //
28  // Get components (will force recalculation, if necessary)
29  //
30  std::vector<double> Ws = weights(TSoS,propDir);
31  if ( Ws.empty() ) return TrajectoryStateOnSurface();
32  std::vector<double> dPs = deltaPs(TSoS,propDir);
33  if ( dPs.size()!=Ws.size() )
34  throw cms::Exception("LogicError")
35  << "GsfMaterialEffectsUpdator: inconsistency in number of components";
36  std::vector<AlgebraicSymMatrix55> deltaErrors;
37  if ( TSoS.hasError() )
38  deltaErrors = deltaLocalErrors(TSoS,propDir);
39  //
40  // prepare output vector
41  //
43  //
44  // loop over components
45  //
46  // edm::LogDebug("GsfMaterialEffectsUpdator") << "found " << Ws.size() << " components\n"
47  // << " input state has weight " << TSoS.weight();
48  for ( unsigned int ic=0; ic<Ws.size(); ic++ ) {
49  // edm::LogDebug("GsfMaterialEffectsUpdator") << "w, dp, sigp = "
50  // << Ws[ic] << ", "
51  // << dPs[ic] << ", "
52  // << sqrt((deltaErrors[ic])[0][0]);
53  //
54  // Update momentum. In case of failure: return invalid state.
55  // Use deltaP method to ensure update of cache, if necessary!
56  //
58  if ( !lp.updateP(dPs[ic]) )
59  return TrajectoryStateOnSurface();
60  //
61  // Update covariance matrix?
62  //
63  if ( TSoS.hasError() ) {
64  AlgebraicSymMatrix55 eloc = TSoS.localError().matrix();
65  eloc += deltaErrors[ic];
68  surface,
69  &(TSoS.globalParameters().magneticField()),
70  side,
71  weight*Ws[ic]));
72  // edm::LogDebug("GsfMaterialEffectsUpdator")
73  // << "adding state with weight " << weight*Ws[ic];
74  }
75  else {
76  result.addState(TrajectoryStateOnSurface(lp,surface,
77  &(TSoS.globalParameters().magneticField()),
78  side));
79  }
80  }
81  // edm::LogDebug("GsfMaterialEffectsUpdator")
82  // << " output state has weight " << result.combinedState().weight();
83  return result.combinedState();
84 }
const LocalTrajectoryParameters & localParameters() const
void addState(const TrajectoryStateOnSurface)
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
tuple result
Definition: query.py:137
virtual std::vector< double > deltaPs(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
virtual std::vector< AlgebraicSymMatrix55 > deltaLocalErrors(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
const Surface & surface() const
const MagneticField & magneticField() const
std::vector< TrajectoryStateOnSurface > components() const
virtual std::vector< double > weights(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
virtual std::vector<double> GsfMaterialEffectsUpdator::weights ( const TrajectoryStateOnSurface TSoS,
const PropagationDirection  propDir 
) const
inlinevirtual

Weights of components.

Definition at line 32 of file GsfMaterialEffectsUpdator.h.

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

Referenced by GsfCombinedMaterialEffectsUpdator::compute().

33  {
34  // check for material
35  if ( !TSoS.surface().mediumProperties() ) return std::vector<double>();
36  // check for change (avoid using compute method if possible)
37  if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
38  return theWeights;
39  }
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const =0
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
virtual bool newArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
const Surface & surface() const

Member Data Documentation

std::vector<AlgebraicSymMatrix55> GsfMaterialEffectsUpdator::theDeltaCovs
mutableprotected
std::vector<double> GsfMaterialEffectsUpdator::theDeltaPs
mutableprotected
float GsfMaterialEffectsUpdator::theMass
private

Definition at line 82 of file GsfMaterialEffectsUpdator.h.

Referenced by mass().

std::vector<double> GsfMaterialEffectsUpdator::theWeights
mutableprotected