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 
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 
30  }
31  Covariance & operator+=(Covariance const & cov) {
32  for(int i=0;i!=4;++i) data[i]+=cov.data[i];
33  return *this;
34  }
35  private:
36  float data[4]={0};
37  };
38 
39  struct Effect {
40  float weight=1.f;
41  // Change in |p| from material effects.
42  float deltaP=0;
43  // Contribution to covariance matrix (in local co-ordinates) from material effects.
45  void combine(Effect const & e1,Effect const & e2) {
46  weight *= e1.weight*e2.weight;
47  deltaP+=e1.deltaP+e2.deltaP;
48  deltaCov+=e1.deltaCov; deltaCov+=e2.deltaCov;
49  }
50  };
51 
52 }
53 
55 public:
59 
62  MaterialEffectsUpdator ( float mass );
63  virtual ~MaterialEffectsUpdator ();
64 
68  virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface& TSoS,
69  const PropagationDirection propDir) const;
70 
77  virtual bool updateStateInPlace (TrajectoryStateOnSurface& TSoS,
78  const PropagationDirection propDir) const;
79 
80 
81 
84  inline float mass () const {
85  return theMass;
86  }
87 
88  virtual MaterialEffectsUpdator* clone() const = 0;
89 
90  // here comes the actual computation of the values
91  virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection, Effect & effect) const = 0;
92 
93  private:
94  float theMass;
95 
96 };
97 
98 #endif
materialEffect::Effect Effect
Covariance & operator+=(Covariance const &cov)
materialEffect::CovIndex CovIndex
Definition: weight.py:1
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
Float e1
Definition: deltaR.h:20
def compute(min, max)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Float e2
Definition: deltaR.h:21
void add(AlgebraicSymMatrix55 &cov) const
void combine(Effect const &e1, Effect const &e2)
materialEffect::Covariance Covariance
float operator[](CovIndex i) const