File indexing completed on 2024-04-06 12:31:30
0001 #ifndef SingleGaussianState1D_H
0002 #define SingleGaussianState1D_H
0003
0004 #include "TrackingTools/GsfTools/interface/SingleGaussianState.h"
0005
0006
0007
0008
0009
0010 class SingleGaussianState1D {
0011
0012
0013
0014 public:
0015 SingleGaussianState1D() : theWeight(0.), theMean(0.), theVariance(0.), theStandardDeviation(-1.) {}
0016
0017 SingleGaussianState1D(double aMean, double aVariance, double aWeight = 1.)
0018 : theWeight(aWeight), theMean(aMean), theVariance(aVariance), theStandardDeviation(-1.) {}
0019
0020 ~SingleGaussianState1D() {}
0021
0022
0023 inline double weight() const { return theWeight; }
0024
0025 inline double mean() const { return theMean; }
0026
0027 inline double variance() const { return theVariance; }
0028
0029 double standardDeviation() const {
0030 if (theStandardDeviation < 0.)
0031 theStandardDeviation = sqrt(theVariance);
0032 return theStandardDeviation;
0033 }
0034
0035
0036
0037 private:
0038 double theWeight;
0039 double theMean;
0040 double theVariance;
0041 mutable double theStandardDeviation;
0042 };
0043
0044 #endif