CMS 3D CMS Logo

MaterialEffectsUpdator.h
Go to the documentation of this file.
1 #ifndef _CR_MATERIALEFFECTSUPDATOR_H_
2 #define _CR_MATERIALEFFECTSUPDATOR_H_
3 
17 
18 namespace materialEffect {
19  enum CovIndex { elos = 0, msxx = 1, msxy = 2, msyy = 3 };
20  class Covariance {
21  public:
22  float operator[](CovIndex i) const { return data[i]; }
23  float& operator[](CovIndex i) { return data[i]; }
24  void add(AlgebraicSymMatrix55& cov) const {
25  cov(0, 0) += data[elos];
26  cov(1, 1) += data[msxx];
27  cov(1, 2) += data[msxy];
28  cov(2, 2) += data[msyy];
29  }
31  for (int i = 0; i != 4; ++i)
32  data[i] += cov.data[i];
33  return *this;
34  }
35 
36  private:
37  float data[4] = {0};
38  };
39 
40  struct Effect {
41  float weight = 1.f;
42  // Change in |p| from material effects.
43  float deltaP = 0;
44  // Contribution to covariance matrix (in local co-ordinates) from material effects.
46  void combine(Effect const& e1, Effect const& e2) {
47  weight *= e1.weight * e2.weight;
48  deltaP += e1.deltaP + e2.deltaP;
49  deltaCov += e1.deltaCov;
50  deltaCov += e2.deltaCov;
51  }
52  };
53 
54 } // namespace materialEffect
55 
57 public:
61 
65  virtual ~MaterialEffectsUpdator();
66 
71  const PropagationDirection propDir) const;
72 
79  virtual bool updateStateInPlace(TrajectoryStateOnSurface& TSoS, const PropagationDirection propDir) const;
80 
83  inline float mass() const { return theMass; }
84 
85  virtual MaterialEffectsUpdator* clone() const = 0;
86 
87  // here comes the actual computation of the values
88  virtual void compute(const TrajectoryStateOnSurface&, const PropagationDirection, Effect& effect) const = 0;
89 
90 private:
91  float theMass;
92 };
93 
94 #endif
MaterialEffectsUpdator::updateStateInPlace
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Definition: MaterialEffectsUpdator.cc:26
materialEffect::CovIndex
CovIndex
Definition: MaterialEffectsUpdator.h:19
materialEffect::Covariance::operator[]
float & operator[](CovIndex i)
Definition: MaterialEffectsUpdator.h:23
TrajectoryStateOnSurface.h
mps_fire.i
i
Definition: mps_fire.py:428
materialEffect::Effect
Definition: MaterialEffectsUpdator.h:40
materialEffect::Covariance::data
float data[4]
Definition: MaterialEffectsUpdator.h:37
materialEffect::elos
Definition: MaterialEffectsUpdator.h:19
materialEffect::Covariance::add
void add(AlgebraicSymMatrix55 &cov) const
Definition: MaterialEffectsUpdator.h:24
MaterialEffectsUpdator::MaterialEffectsUpdator
MaterialEffectsUpdator(float mass)
Definition: MaterialEffectsUpdator.cc:8
materialEffect::msyy
Definition: MaterialEffectsUpdator.h:19
MaterialEffectsUpdator::updateState
virtual TrajectoryStateOnSurface updateState(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Definition: MaterialEffectsUpdator.cc:15
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MaterialEffectsUpdator::Covariance
materialEffect::Covariance Covariance
Definition: MaterialEffectsUpdator.h:58
materialEffect::Effect::deltaCov
Covariance deltaCov
Definition: MaterialEffectsUpdator.h:45
materialEffect::Effect::weight
float weight
Definition: MaterialEffectsUpdator.h:41
Surface.h
MaterialEffectsUpdator::clone
virtual MaterialEffectsUpdator * clone() const =0
materialEffect::msxx
Definition: MaterialEffectsUpdator.h:19
MaterialEffectsUpdator::~MaterialEffectsUpdator
virtual ~MaterialEffectsUpdator()
Definition: MaterialEffectsUpdator.cc:10
materialEffect
Definition: MaterialEffectsUpdator.h:18
materialEffect::Covariance
Definition: MaterialEffectsUpdator.h:20
MaterialEffectsUpdator::mass
float mass() const
Definition: MaterialEffectsUpdator.h:83
MaterialEffectsUpdator::Effect
materialEffect::Effect Effect
Definition: MaterialEffectsUpdator.h:59
materialEffect::Effect::combine
void combine(Effect const &e1, Effect const &e2)
Definition: MaterialEffectsUpdator.h:46
MaterialEffectsUpdator::compute
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
materialEffect::Effect::deltaP
float deltaP
Definition: MaterialEffectsUpdator.h:43
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
MaterialEffectsUpdator::theMass
float theMass
Definition: MaterialEffectsUpdator.h:91
materialEffect::msxy
Definition: MaterialEffectsUpdator.h:19
MaterialEffectsUpdator::CovIndex
materialEffect::CovIndex CovIndex
Definition: MaterialEffectsUpdator.h:60
PropagationDirection.h
materialEffect::Covariance::operator[]
float operator[](CovIndex i) const
Definition: MaterialEffectsUpdator.h:22
materialEffect::Covariance::operator+=
Covariance & operator+=(Covariance const &cov)
Definition: MaterialEffectsUpdator.h:30
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
weight
Definition: weight.py:1
MaterialEffectsUpdator
Definition: MaterialEffectsUpdator.h:56