CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MaterialEffectsUpdator.h
Go to the documentation of this file.
1 #ifndef _CR_MATERIALEFFECTSUPDATOR_H_
2 #define _CR_MATERIALEFFECTSUPDATOR_H_
3 
17 
19 
20 namespace materialEffect {
21  enum CovIndex { elos=0, msxx=1, msxy=2, msyy=3};
22  class Covariance {
23  public:
24  float operator[](CovIndex i) const { return data[i];}
25  float & operator[](CovIndex i) { return data[i];}
26  void add(AlgebraicSymMatrix55 & cov) const {
27  cov(0,0) += data[elos];
28  cov(1,1) += data[msxx];
29  cov(1,2) += data[msxy];
30  cov(2,2) += data[msyy];
31 
32  }
33  Covariance & operator+=(Covariance const & cov) {
34  for(int i=0;i!=4;++i) data[i]+=cov.data[i];
35  return *this;
36  }
37  private:
38  float data[4]={0};
39  };
40 
41  struct Effect {
42  float weight=1.f;
43  // Change in |p| from material effects.
44  float deltaP=0;
45  // Contribution to covariance matrix (in local co-ordinates) from material effects.
47  void combine(Effect const & e1,Effect const & e2) {
48  weight *= e1.weight*e2.weight;
49  deltaP+=e1.deltaP+e2.deltaP;
51  }
52  };
53 
54 }
55 
57 public:
61 
64  MaterialEffectsUpdator ( double mass );
65  virtual ~MaterialEffectsUpdator ();
66 
71  const PropagationDirection propDir) const;
72 
79  virtual bool updateStateInPlace (TrajectoryStateOnSurface& TSoS,
80  const PropagationDirection propDir) const;
81 
82 
83 
86  inline double mass () const {
87  return theMass;
88  }
89 
90  virtual MaterialEffectsUpdator* clone() const = 0;
91 
92  // here comes the actual computation of the values
93  virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection, Effect & effect) const = 0;
94 
95  private:
96  double theMass;
97 
98 };
99 
100 #endif
materialEffect::Effect Effect
int i
Definition: DBlmapReader.cc:9
Covariance & operator+=(Covariance const &cov)
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const =0
materialEffect::CovIndex CovIndex
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
virtual bool updateStateInPlace(TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
PropagationDirection
virtual TrajectoryStateOnSurface updateState(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir) const
Float e1
Definition: deltaR.h:22
Float e2
Definition: deltaR.h:23
void add(AlgebraicSymMatrix55 &cov) const
void combine(Effect const &e1, Effect const &e2)
materialEffect::Covariance Covariance
virtual MaterialEffectsUpdator * clone() const =0
float operator[](CovIndex i) const