CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/TrackingTools/GsfTools/interface/SingleGaussianState1D.h

Go to the documentation of this file.
00001 #ifndef SingleGaussianState1D_H
00002 #define SingleGaussianState1D_H
00003 
00004 #include "TrackingTools/GsfTools/interface/SingleGaussianState.h"
00005 #include "boost/shared_ptr.hpp"
00006 
00011 class SingleGaussianState1D {
00012 // private:
00013 //   typedef SingleGaussianState<1> SingleState;
00014   
00015 public:
00016   
00017   SingleGaussianState1D () :
00018     theWeight(0.), theMean(0.), theVariance(0.), theStandardDeviation(-1.) {}
00019   
00020   SingleGaussianState1D (double aMean,
00021                          double aVariance, 
00022                          double aWeight = 1.) : 
00023     theWeight(aWeight), theMean(aMean), theVariance(aVariance), theStandardDeviation(-1.) {}
00024   
00025   ~SingleGaussianState1D () {}
00026   
00028   inline double weight() const {return theWeight;}
00030   inline double mean() const {return theMean;}
00032   inline double variance() const {return theVariance;}
00034   double standardDeviation() const {
00035     if ( theStandardDeviation<0. )  theStandardDeviation = sqrt(theVariance);
00036     return theStandardDeviation;
00037   }
00038 //   /// state
00039 //   boost::shared_ptr<SingleState> state() {return theState;}
00040 
00041 private:
00042   double theWeight;
00043   double theMean;
00044   double theVariance;
00045   mutable double theStandardDeviation;
00046 };
00047 
00048 #endif