CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfBetheHeitlerUpdator.h
Go to the documentation of this file.
1 #ifndef GsfBetheHeitlerUpdator_h_
2 #define GsfBetheHeitlerUpdator_h_
3 
5 
8 
9 
10 
12 
13 #include <iosfwd>
14 #include <string>
15 
16 
17 
27 
28 private:
29  static constexpr int MaxSize=6;
30  static constexpr int MaxOrder=6;
31 
34  class Polynomial {
35  public:
37  Polynomial () {}
41  Polynomial (float coefficients[], int is) :
42  m_size(is) {
43  for (int i=0; i!=m_size; ++i)
44  theCoeffs[i]=coefficients[i];
45  }
47  float operator() (float x) const {
48  float sum=theCoeffs[0];
49  for (int i=1; i!=m_size; ++i)
50  sum = x*sum + theCoeffs[i];
51  return sum;
52  }
53  private:
54  float theCoeffs[MaxOrder] ={0};
55  int m_size=0;
56  };
57 
58 public:
60 
61 public:
62  virtual GsfBetheHeitlerUpdator* clone() const
63  {
64  return new GsfBetheHeitlerUpdator(*this);
65  }
66 
67 public:
69  GsfBetheHeitlerUpdator (const std::string fileName, const int correctionFlag);
70 
71 private:
73 
75  virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection, Effect[]) const;
76 
77 private:
78 
80  void readParameters (const std::string);
82  Polynomial readPolynomial (std::ifstream&,const int);
83 
84 
86  void getMixtureParameters (const float, GSContainer[]) const;
88  void correctWeights (GSContainer[]) const;
90  float correctedFirstMean (const float, const GSContainer[]) const;
92  float correctedFirstVar (const float,const GSContainer[]) const;
93 
94 
95 private:
99 
103 
104 };
105 
106 #endif
int i
Definition: DBlmapReader.cc:9
Polynomial readPolynomial(std::ifstream &, const int)
Read coefficients of one polynomial from file.
float operator()(float x) const
Evaluation of the polynomial.
PropagationDirection
Definition: Triplet.h:9
Polynomial thePolyWeights[MaxSize]
correction of 1st or 1st&amp;2nd moments
#define constexpr
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const
Computation: generates vectors of weights, means and standard deviations.
void getMixtureParameters(const float, GSContainer[]) const
Filling of mixture (in terms of z=E/E0)
Polynomial(float coefficients[], int is)
void correctWeights(GSContainer[]) const
Correction for weight of component 1.
float correctedFirstVar(const float, const GSContainer[]) const
Correction for variance of component 1.
int theTransformationCode
number of components used for parameterisation
GsfBetheHeitlerUpdator(const std::string fileName, const int correctionFlag)
constructor with explicit filename and correction flag
int theCorrectionFlag
values to be transformed by logistic / exp. function?
Triplet< float, float, float > GSContainer
Polynomial thePolyVars[MaxSize]
parametrisation of mean for each componentP
void readParameters(const std::string)
Read parametrization from file.
Polynomial thePolyMeans[MaxSize]
parametrisation of weight for each component
virtual GsfBetheHeitlerUpdator * clone() const
float correctedFirstMean(const float, const GSContainer[]) const
Correction for mean of component 1.
Polynomial()
Default constructor (needed for construction of a vector)