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 
70  virtual TrajectoryStateOnSurface updateState(const TrajectoryStateOnSurface& TSoS,
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
materialEffect::Effect Effect
Covariance & operator+=(Covariance const &cov)
materialEffect::CovIndex CovIndex
Definition: weight.py:1
PropagationDirection
def compute(min, max)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
void add(AlgebraicSymMatrix55 &cov) const
void combine(Effect const &e1, Effect const &e2)
materialEffect::Covariance Covariance
float operator[](CovIndex i) const