# Project CMSSW displayed by LXR

File indexing completed on 2021-02-14 14:31:36

```0001 #ifndef SingleGaussianState1D_H
0002 #define SingleGaussianState1D_H
0003
0004 #include "TrackingTools/GsfTools/interface/SingleGaussianState.h"
0005
0006 /** One-dimensional (single) Gaussian state. Used for the description
0007  *  of Gaussian mixtures in one dimension.
0008  */
0009
0010 class SingleGaussianState1D {
0011   // private:
0012   //   typedef SingleGaussianState<1> SingleState;
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   /// weight
0023   inline double weight() const { return theWeight; }
0024   /// parameter vector
0025   inline double mean() const { return theMean; }
0026   /// variance
0027   inline double variance() const { return theVariance; }
0028   /// standardDeviation
0029   double standardDeviation() const {
0030     if (theStandardDeviation < 0.)
0031       theStandardDeviation = sqrt(theVariance);
0032     return theStandardDeviation;
0033   }
0034   //   /// state
0035   //   std::shared_ptr<SingleState> state() {return theState;}
0036
0037 private:
0038   double theWeight;
0039   double theMean;
0040   double theVariance;
0041   mutable double theStandardDeviation;
0042 };
0043
0044 #endif```