CMS 3D CMS Logo

GsfBetheHeitlerUpdator.h
Go to the documentation of this file.
1 #ifndef GsfBetheHeitlerUpdator_h_
2 #define GsfBetheHeitlerUpdator_h_
3 
5 
8 
9 #include <iosfwd>
10 #include <string>
11 
21 private:
22  static constexpr int MaxSize = 6;
23  static constexpr int MaxOrder = 6;
24 
27  class Polynomial {
28  public:
34  Polynomial(float coefficients[], int is) : m_size(is) {
35  for (int i = 0; i != m_size; ++i)
36  theCoeffs[i] = coefficients[i];
37  }
39  float operator()(float x) const {
40  float sum = theCoeffs[0];
41  for (int i = 1; i != m_size; ++i)
42  sum = x * sum + theCoeffs[i];
43  return sum;
44  }
45 
46  private:
47  float theCoeffs[MaxOrder] = {0};
48  int m_size = 0;
49  };
50 
51 public:
53 
54 public:
55  GsfBetheHeitlerUpdator *clone() const override { return new GsfBetheHeitlerUpdator(*this); }
56 
57 public:
59  GsfBetheHeitlerUpdator(const std::string fileName, const int correctionFlag);
60 
61 private:
62  struct GSContainer {
63  float *first, *second, *third;
64  };
65 
67  void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const override;
68 
69 private:
71  void readParameters(const std::string);
73  Polynomial readPolynomial(std::ifstream &, const unsigned int);
74 
76  void getMixtureParameters(const float, GSContainer &) const;
78  void correctWeights(GSContainer &) const;
80  float correctedFirstMean(const float, const GSContainer &) const;
82  float correctedFirstVar(const float, const GSContainer &) const;
83 
84 private:
88 
92 };
93 
94 #endif
void correctWeights(GSContainer &) const
Correction for weight of component 1.
PropagationDirection
float operator()(float x) const
Evaluation of the polynomial.
Polynomial thePolyWeights[MaxSize]
correction of 1st or 1st&2nd moments
static constexpr int MaxSize
float correctedFirstVar(const float, const GSContainer &) const
Correction for variance of component 1.
Polynomial(float coefficients[], int is)
GsfBetheHeitlerUpdator * clone() const override
int theTransformationCode
number of components used for parameterisation
void getMixtureParameters(const float, GSContainer &) const
Filling of mixture (in terms of z=E/E0)
void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const override
Computation: generates vectors of weights, means and standard deviations.
Polynomial readPolynomial(std::ifstream &, const unsigned int)
Read coefficients of one polynomial from file.
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?
Polynomial thePolyVars[MaxSize]
parametrisation of mean for each componentP
void readParameters(const std::string)
Read parametrization from file.
static constexpr int MaxOrder
float correctedFirstMean(const float, const GSContainer &) const
Correction for mean of component 1.
Polynomial thePolyMeans[MaxSize]
parametrisation of weight for each component
Polynomial()
Default constructor (needed for construction of a vector)