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
GsfBetheHeitlerUpdator::theNrComponents
int theNrComponents
Definition: GsfBetheHeitlerUpdator.h:85
mps_fire.i
i
Definition: mps_fire.py:428
materialEffect::Effect
Definition: MaterialEffectsUpdator.h:40
GsfBetheHeitlerUpdator::CorrectionFlag
CorrectionFlag
Definition: GsfBetheHeitlerUpdator.h:52
GsfBetheHeitlerUpdator::correctedFirstMean
float correctedFirstMean(const float, const GSContainer &) const
Correction for mean of component 1.
Definition: GsfBetheHeitlerUpdator.cc:207
GsfBetheHeitlerUpdator::correctWeights
void correctWeights(GSContainer &) const
Correction for weight of component 1.
Definition: GsfBetheHeitlerUpdator.cc:190
GsfBetheHeitlerUpdator::Polynomial::theCoeffs
float theCoeffs[MaxOrder]
Definition: GsfBetheHeitlerUpdator.h:47
GsfBetheHeitlerUpdator::clone
GsfBetheHeitlerUpdator * clone() const override
Definition: GsfBetheHeitlerUpdator.h:55
DDAxes::x
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
GsfBetheHeitlerUpdator::compute
void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect[]) const override
Computation: generates vectors of weights, means and standard deviations.
Definition: GsfBetheHeitlerUpdator.cc:96
GsfBetheHeitlerUpdator::readPolynomial
Polynomial readPolynomial(std::ifstream &, const unsigned int)
Read coefficients of one polynomial from file.
Definition: GsfBetheHeitlerUpdator.cc:88
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
GsfBetheHeitlerUpdator::correctedFirstVar
float correctedFirstVar(const float, const GSContainer &) const
Correction for variance of component 1.
Definition: GsfBetheHeitlerUpdator.cc:222
GsfBetheHeitlerUpdator::GSContainer::first
float * first
Definition: GsfBetheHeitlerUpdator.h:63
GsfBetheHeitlerUpdator::GSContainer
Definition: GsfBetheHeitlerUpdator.h:62
GsfBetheHeitlerUpdator::GSContainer::third
float * third
Definition: GsfBetheHeitlerUpdator.h:63
GsfBetheHeitlerUpdator::MaxSize
static constexpr int MaxSize
Definition: GsfBetheHeitlerUpdator.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
approx_log.h
GsfBetheHeitlerUpdator::Polynomial::m_size
int m_size
Definition: GsfBetheHeitlerUpdator.h:48
GsfBetheHeitlerUpdator::Polynomial::Polynomial
Polynomial()
Default constructor (needed for construction of a vector)
Definition: GsfBetheHeitlerUpdator.h:30
GsfBetheHeitlerUpdator::FullCorrection
Definition: GsfBetheHeitlerUpdator.h:52
GsfBetheHeitlerUpdator::readParameters
void readParameters(const std::string)
Read parametrization from file.
Definition: GsfBetheHeitlerUpdator.cc:65
GsfBetheHeitlerUpdator::thePolyMeans
Polynomial thePolyMeans[MaxSize]
parametrisation of weight for each component
Definition: GsfBetheHeitlerUpdator.h:90
GsfBetheHeitlerUpdator::MeanCorrection
Definition: GsfBetheHeitlerUpdator.h:52
GsfMaterialEffectsUpdator
Definition: GsfMaterialEffectsUpdator.h:15
GsfBetheHeitlerUpdator::thePolyWeights
Polynomial thePolyWeights[MaxSize]
correction of 1st or 1st&2nd moments
Definition: GsfBetheHeitlerUpdator.h:89
GsfBetheHeitlerUpdator::Polynomial::operator()
float operator()(float x) const
Evaluation of the polynomial.
Definition: GsfBetheHeitlerUpdator.h:39
GsfBetheHeitlerUpdator::NoCorrection
Definition: GsfBetheHeitlerUpdator.h:52
GsfBetheHeitlerUpdator::Polynomial::Polynomial
Polynomial(float coefficients[], int is)
Definition: GsfBetheHeitlerUpdator.h:34
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
GsfBetheHeitlerUpdator::Polynomial
Definition: GsfBetheHeitlerUpdator.h:27
GsfMaterialEffectsUpdator.h
GsfBetheHeitlerUpdator::theTransformationCode
int theTransformationCode
number of components used for parameterisation
Definition: GsfBetheHeitlerUpdator.h:86
GsfBetheHeitlerUpdator::thePolyVars
Polynomial thePolyVars[MaxSize]
parametrisation of mean for each componentP
Definition: GsfBetheHeitlerUpdator.h:91
approx_exp.h
GsfBetheHeitlerUpdator::getMixtureParameters
void getMixtureParameters(const float, GSContainer &) const
Filling of mixture (in terms of z=E/E0)
Definition: GsfBetheHeitlerUpdator.cc:165
GsfBetheHeitlerUpdator::MaxOrder
static constexpr int MaxOrder
Definition: GsfBetheHeitlerUpdator.h:23
GsfBetheHeitlerUpdator::GsfBetheHeitlerUpdator
GsfBetheHeitlerUpdator(const std::string fileName, const int correctionFlag)
constructor with explicit filename and correction flag
Definition: GsfBetheHeitlerUpdator.cc:53
GsfBetheHeitlerUpdator
Definition: GsfBetheHeitlerUpdator.h:20
GsfBetheHeitlerUpdator::theCorrectionFlag
int theCorrectionFlag
values to be transformed by logistic / exp. function?
Definition: GsfBetheHeitlerUpdator.h:87
GsfBetheHeitlerUpdator::GSContainer::second
float * second
Definition: GsfBetheHeitlerUpdator.h:63