CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
GsfMaterialEffectsUpdator Class Referenceabstract

#include <GsfMaterialEffectsUpdator.h>

Inheritance diagram for GsfMaterialEffectsUpdator:
GsfBetheHeitlerUpdator GsfCombinedMaterialEffectsUpdator GsfMaterialEffectsAdapter GsfMultipleScatteringUpdator

Public Types

typedef materialEffect::Covariance Covariance
 
typedef materialEffect::CovIndex CovIndex
 
typedef materialEffect::Effect Effect
 

Public Member Functions

virtual GsfMaterialEffectsUpdatorclone () const =0
 
virtual void compute (const TrajectoryStateOnSurface &, const PropagationDirection, Effect effects[]) const =0
 
 GsfMaterialEffectsUpdator (float mass, uint32_t is)
 
float mass () const
 
size_t size () const
 
virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
 
virtual ~GsfMaterialEffectsUpdator ()
 

Protected Member Functions

void resize (size_t is)
 

Private Attributes

uint32_t m_size
 
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.

Member Typedef Documentation

◆ Covariance

Definition at line 17 of file GsfMaterialEffectsUpdator.h.

◆ CovIndex

Definition at line 19 of file GsfMaterialEffectsUpdator.h.

◆ Effect

Definition at line 18 of file GsfMaterialEffectsUpdator.h.

Constructor & Destructor Documentation

◆ GsfMaterialEffectsUpdator()

GsfMaterialEffectsUpdator::GsfMaterialEffectsUpdator ( float  mass,
uint32_t  is 
)
inline

Constructor with explicit mass hypothesis

Definition at line 23 of file GsfMaterialEffectsUpdator.h.

23 : theMass(mass), m_size(is) {}

◆ ~GsfMaterialEffectsUpdator()

virtual GsfMaterialEffectsUpdator::~GsfMaterialEffectsUpdator ( )
inlinevirtual

Definition at line 25 of file GsfMaterialEffectsUpdator.h.

25 {}

Member Function Documentation

◆ clone()

virtual GsfMaterialEffectsUpdator* GsfMaterialEffectsUpdator::clone ( ) const
pure virtual

◆ compute()

virtual void GsfMaterialEffectsUpdator::compute ( const TrajectoryStateOnSurface ,
const  PropagationDirection,
Effect  effects[] 
) const
pure virtual

◆ mass()

float GsfMaterialEffectsUpdator::mass ( ) const
inline

Particle mass assigned at construction.

Definition at line 35 of file GsfMaterialEffectsUpdator.h.

35 { return theMass; }

References theMass.

Referenced by Particle.Particle::__str__(), DiObject.DiMuon::__str__(), and GsfMultipleScatteringUpdator::compute().

◆ resize()

void GsfMaterialEffectsUpdator::resize ( size_t  is)
inlineprotected

Definition at line 45 of file GsfMaterialEffectsUpdator.h.

45 { m_size = is; }

References m_size.

Referenced by GsfBetheHeitlerUpdator::GsfBetheHeitlerUpdator().

◆ size()

size_t GsfMaterialEffectsUpdator::size ( void  ) const
inline

◆ updateState()

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 14 of file GsfMaterialEffectsUpdator.cc.

15  {
16  //
17  // get components of input state and check if material is associated to surface
18  //
19  const Surface& surface = TSoS.surface();
20  if (!surface.mediumProperties().isValid())
21  return TSoS;
23  // single input state?
24  if (!TSoS.singleState())
25  throw cms::Exception("LogicError") << "GsfMaterialEffectsUpdator::updateState used with MultiTSOS";
26  auto weight = TSoS.weight();
27 //
28 // Get components (will force recalculation, if necessary)
29 //
30 #if __clang__
31  std::vector<Effect> effects(size());
32  compute(TSoS, propDir, effects.data());
33 #else
34  Effect effects[size()];
35  compute(TSoS, propDir, effects);
36 #endif
37 
38  //
39  // prepare output vector
40  //
42  //
43  // loop over components
44  //
45  LogDebug("GsfMaterialEffectsUpdator") << "found " << size() << " components "
46  << " input state has weight " << TSoS.weight();
47  for (auto const& effect : effects) {
48  LogDebug("GsfMaterialEffectsUpdatorDETAIL") << "w, dp, sigp = " << effect.weight << ", " << effect.deltaP << ", "
49  << std::sqrt(effect.deltaCov[materialEffect::elos]);
50  //
51  // Update momentum. In case of failure: return invalid state.
52  // Use deltaP method to ensure update of cache, if necessary!
53  //
55  if (!lp.updateP(effect.deltaP))
56  return TrajectoryStateOnSurface();
57  //
58  // Update covariance matrix?
59  //
60  if (TSoS.hasError()) {
61  AlgebraicSymMatrix55 eloc = TSoS.localError().matrix();
62  effect.deltaCov.add(eloc);
63  result.addState(TrajectoryStateOnSurface(weight * effect.weight,
64  lp,
66  surface,
67  &(TSoS.globalParameters().magneticField()),
68  side));
69  LogDebug("GsfMaterialEffectsUpdatorDETAIL") << "adding state with weight " << weight * effect.weight;
70  } else {
71  result.addState(TrajectoryStateOnSurface(lp, surface, &(TSoS.globalParameters().magneticField()), side));
72  }
73  }
74  LogDebug("GsfMaterialEffectsUpdator") << " output state has weight " << result.combinedState().weight();
75  return result.combinedState();
76 }

References SurfaceSideDefinition::afterSurface, alongMomentum, SurfaceSideDefinition::beforeSurface, bookConverter::compute(), ProxyBase11< T >::data(), materialEffect::elos, TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::hasError(), MediumProperties::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LogDebug, GlobalTrajectoryParameters::magneticField(), LocalTrajectoryError::matrix(), Surface::mediumProperties(), mps_fire::result, TrajectoryStateOnSurface::singleState(), findQualityFiles::size, mathSSE::sqrt(), TrajectoryStateOnSurface::surface(), LocalTrajectoryParameters::updateP(), and TrajectoryStateOnSurface::weight().

Referenced by FullConvolutionWithMaterial::operator()().

Member Data Documentation

◆ m_size

uint32_t GsfMaterialEffectsUpdator::m_size
private

Definition at line 49 of file GsfMaterialEffectsUpdator.h.

Referenced by resize(), and size().

◆ theMass

float GsfMaterialEffectsUpdator::theMass
private

Definition at line 48 of file GsfMaterialEffectsUpdator.h.

Referenced by mass().

GsfMaterialEffectsUpdator::compute
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect effects[]) const =0
MultiTrajectoryStateAssembler
Definition: MultiTrajectoryStateAssembler.h:13
GsfMaterialEffectsUpdator::m_size
uint32_t m_size
Definition: GsfMaterialEffectsUpdator.h:49
Surface
Definition: Surface.h:36
SurfaceSideDefinition::SurfaceSide
SurfaceSide
Definition: SurfaceSideDefinition.h:8
SurfaceSideDefinition::afterSurface
Definition: SurfaceSideDefinition.h:8
LocalTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: LocalTrajectoryError.h:60
materialEffect::elos
Definition: MaterialEffectsUpdator.h:19
Surface::mediumProperties
const MediumProperties & mediumProperties() const
Definition: Surface.h:83
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
GsfMaterialEffectsUpdator::Effect
materialEffect::Effect Effect
Definition: GsfMaterialEffectsUpdator.h:18
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
SurfaceSideDefinition::beforeSurface
Definition: SurfaceSideDefinition.h:8
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GsfMaterialEffectsUpdator::mass
float mass() const
Definition: GsfMaterialEffectsUpdator.h:35
TrajectoryStateOnSurface::weight
double weight() const
Definition: TrajectoryStateOnSurface.h:80
LocalTrajectoryParameters::updateP
bool updateP(float dP)
Update of momentum by a scalar dP.
Definition: LocalTrajectoryParameters.h:149
TrajectoryStateOnSurface::localParameters
const LocalTrajectoryParameters & localParameters() const
Definition: TrajectoryStateOnSurface.h:73
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MediumProperties::isValid
bool isValid() const
Definition: MediumProperties.h:26
GsfMaterialEffectsUpdator::size
size_t size() const
Definition: GsfMaterialEffectsUpdator.h:42
TrajectoryStateOnSurface::singleState
bool singleState() const
Definition: TrajectoryStateOnSurface.h:86
GlobalTrajectoryParameters::magneticField
const MagneticField & magneticField() const
Definition: GlobalTrajectoryParameters.h:106
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
GsfMaterialEffectsUpdator::theMass
float theMass
Definition: GsfMaterialEffectsUpdator.h:48
alongMomentum
Definition: PropagationDirection.h:4
weight
Definition: weight.py:1