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 
12 
13 
23 
24 private:
25  static constexpr int MaxSize=6;
26  static constexpr int MaxOrder=6;
27 
30  class Polynomial {
31  public:
33  Polynomial () {}
37  Polynomial (float coefficients[], int is) :
38  m_size(is) {
39  for (int i=0; i!=m_size; ++i)
40  theCoeffs[i]=coefficients[i];
41  }
43  float operator() (float x) const {
44  float sum=theCoeffs[0];
45  for (int i=1; i!=m_size; ++i)
46  sum = x*sum + theCoeffs[i];
47  return sum;
48  }
49  private:
50  float theCoeffs[MaxOrder] ={0};
51  int m_size=0;
52  };
53 
54 public:
56 
57 public:
58  GsfBetheHeitlerUpdator* clone() const override
59  {
60  return new GsfBetheHeitlerUpdator(*this);
61  }
62 
63 public:
65  GsfBetheHeitlerUpdator (const std::string fileName, const int correctionFlag);
66 
67 private:
68  struct GSContainer {float *first, *second, *third;};
69 
71  void compute (const TrajectoryStateOnSurface&, const PropagationDirection, Effect[]) const override;
72 
73 private:
74 
76  void readParameters (const std::string);
78  Polynomial readPolynomial (std::ifstream&,const int);
79 
80 
82  void getMixtureParameters (const float, GSContainer &) const;
84  void correctWeights (GSContainer&) const;
86  float correctedFirstMean (const float, const GSContainer &) const;
88  float correctedFirstVar (const float,const GSContainer &) const;
89 
90 
91 private:
95 
99 
100 };
101 
102 #endif
Polynomial readPolynomial(std::ifstream &, const int)
Read coefficients of one polynomial from file.
void correctWeights(GSContainer &) const
Correction for weight of component 1.
float operator()(float x) const
Evaluation of the polynomial.
PropagationDirection
void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const override
Computation: generates vectors of weights, means and standard deviations.
Polynomial thePolyWeights[MaxSize]
correction of 1st or 1st&2nd moments
#define constexpr
void getMixtureParameters(const float, GSContainer &) const
Filling of mixture (in terms of z=E/E0)
U second(std::pair< T, U > const &p)
Polynomial(float coefficients[], int is)
GsfBetheHeitlerUpdator * clone() const override
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?
float correctedFirstVar(const float, const GSContainer &) const
Correction for variance of component 1.
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
Polynomial()
Default constructor (needed for construction of a vector)
float correctedFirstMean(const float, const GSContainer &) const
Correction for mean of component 1.