Go to the documentation of this file.00001 #ifndef GsfBetheHeitlerUpdator_h_
00002 #define GsfBetheHeitlerUpdator_h_
00003
00004 #include "TrackingTools/GsfTracking/interface/GsfMaterialEffectsUpdator.h"
00005
00006 #include "DataFormats/Math/interface/approx_exp.h"
00007 #include "DataFormats/Math/interface/approx_log.h"
00008
00009
00010
00011 #include "TrackingTools/GsfTracking/interface/Triplet.h"
00012
00013 #include <iosfwd>
00014 #include <string>
00015
00016
00017
00026 class GsfBetheHeitlerUpdator GCC11_FINAL: public GsfMaterialEffectsUpdator {
00027
00028 private:
00029 static constexpr int MaxSize=6;
00030 static constexpr int MaxOrder=6;
00031
00034 class Polynomial {
00035 public:
00037 Polynomial () {}
00041 Polynomial (float coefficients[], int is) :
00042 m_size(is) {
00043 for (int i=0; i!=m_size; ++i)
00044 theCoeffs[i]=coefficients[i];
00045 }
00047 float operator() (float x) const {
00048 float sum=theCoeffs[0];
00049 for (int i=1; i!=m_size; ++i)
00050 sum = x*sum + theCoeffs[i];
00051 return sum;
00052 }
00053 private:
00054 float theCoeffs[MaxOrder] ={0};
00055 int m_size=0;
00056 };
00057
00058 public:
00059 enum CorrectionFlag { NoCorrection=0, MeanCorrection=1, FullCorrection=2 };
00060
00061 public:
00062 virtual GsfBetheHeitlerUpdator* clone() const
00063 {
00064 return new GsfBetheHeitlerUpdator(*this);
00065 }
00066
00067 public:
00069 GsfBetheHeitlerUpdator (const std::string fileName, const int correctionFlag);
00070
00071 private:
00072 typedef Triplet<float,float,float> GSContainer;
00073
00075 virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection, Effect[]) const;
00076
00077 private:
00078
00080 void readParameters (const std::string);
00082 Polynomial readPolynomial (std::ifstream&,const int);
00083
00084
00086 void getMixtureParameters (const float, GSContainer[]) const;
00088 void correctWeights (GSContainer[]) const;
00090 float correctedFirstMean (const float, const GSContainer[]) const;
00092 float correctedFirstVar (const float,const GSContainer[]) const;
00093
00094
00095 private:
00096 int theNrComponents;
00097 int theTransformationCode;
00098 int theCorrectionFlag;
00099
00100 Polynomial thePolyWeights[MaxSize];
00101 Polynomial thePolyMeans[MaxSize];
00102 Polynomial thePolyVars[MaxSize];
00103
00104 };
00105
00106 #endif