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 
6 
7 #include <vector>
8 #include <iosfwd>
9 #include <string>
10 
20 
21 private:
24  class Polynomial {
25  public:
27  Polynomial () {}
31  Polynomial (const std::vector<double>& coefficients) :
32  theCoeffs(coefficients) {}
34  double operator() (const double& x) const {
35  double sum(0.);
36  for ( std::vector<double>::const_iterator i=theCoeffs.begin();
37  i!=theCoeffs.end(); i++ ) sum = x*sum + *i;
38  return sum;
39  }
40  private:
41  std::vector<double> theCoeffs;
42  };
43 
44 public:
46 
47 public:
48  virtual GsfBetheHeitlerUpdator* clone() const
49  {
50  return new GsfBetheHeitlerUpdator(*this);
51  }
52 
53 public:
55  GsfBetheHeitlerUpdator (const std::string fileName, const int correctionFlag);
56 // GsfBetheHeitlerUpdator (const std::string fileName, const CorrectionFlag correctionFlag);
57 
58 private:
59  typedef std::vector< Triplet<double,double,double> > GSContainer;
60 
61 private:
63  virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection) const;
65  void readParameters (const std::string);
67  Polynomial readPolynomial (std::ifstream&,const int);
69  inline double logisticFunction (const double x) const {return 1./(1.+exp(-x));}
71  inline double BetheHeitlerMean (const double rl) const
72  {
73  return exp(-rl);
74  }
76  inline double BetheHeitlerVariance (const double rl) const
77  {
78  return exp(-rl*log(3.)/log(2.)) - exp(-2*rl);
79  }
81  void getMixtureParameters (const double, GSContainer&) const;
83  void correctWeights (GSContainer&) const;
85  double correctedFirstMean (const double, const GSContainer&) const;
87  double correctedFirstVar (const double,const GSContainer&) const;
88 
89 protected:
91  virtual bool newArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const;
93  virtual void storeArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const;
94 
95 private:
98  std::vector<Polynomial> thePolyWeights;
99  std::vector<Polynomial> thePolyMeans;
100  std::vector<Polynomial> thePolyVars;
101 
103 
104  mutable float theLastDz;
105  mutable float theLastP;
107  mutable float theLastRadLength;
108 };
109 
110 #endif
virtual void storeArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
storage of arguments for later use of
int i
Definition: DBlmapReader.cc:9
std::vector< Polynomial > thePolyVars
parametrisation of mean for each component
std::vector< Polynomial > thePolyMeans
parametrisation of weight for each component
Polynomial readPolynomial(std::ifstream &, const int)
Read coefficients of one polynomial from file.
float theLastDz
correction of 1st or 1st&amp;2nd moments
void correctWeights(GSContainer &) const
Correction for weight of component 1.
double correctedFirstVar(const double, const GSContainer &) const
Correction for variance of component 1.
std::vector< Polynomial > thePolyWeights
values to be transformed by logistic / exp. function?
void getMixtureParameters(const double, GSContainer &) const
Filling of mixture (in terms of z=E/E0)
PropagationDirection
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const
Computation: generates vectors of weights, means and standard deviations.
virtual bool newArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
check of arguments for use with cached values
double BetheHeitlerMean(const double rl) const
First moment of the Bethe-Heitler distribution (in z=E/E0)
std::vector< Triplet< double, double, double > > GSContainer
double BetheHeitlerVariance(const double rl) const
Second moment of the Bethe-Heitler distribution (in z=E/E0)
double operator()(const double &x) const
Evaluation of the polynomial.
double logisticFunction(const double x) const
Logistic function (needed for transformation of weight and mean)
int theTransformationCode
number of components used for parameterisation
PropagationDirection theLastPropDir
Polynomial(const std::vector< double > &coefficients)
GsfBetheHeitlerUpdator(const std::string fileName, const int correctionFlag)
constructor with explicit filename and correction flag
int theCorrectionFlag
parametrisation of variance for each component
double correctedFirstMean(const double, const GSContainer &) const
Correction for mean of component 1.
void readParameters(const std::string)
Read parametrization from file.
virtual GsfBetheHeitlerUpdator * clone() const
x
Definition: VDTMath.h:216
Polynomial()
Default constructor (needed for construction of a vector)