Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:29

0001 #ifndef MultiGaussianState1D_H_
0002 #define MultiGaussianState1D_H_
0003 
0004 #include "TrackingTools/GsfTools/interface/SingleGaussianState1D.h"
0005 
0006 #include <vector>
0007 
0008 /** One-dimensional multi-Gaussian mixture: weighted sum of single
0009  *  Gaussian components.
0010  */
0011 
0012 class MultiGaussianState1D {
0013 public:
0014   typedef std::vector<SingleGaussianState1D> SingleState1dContainer;
0015 
0016 public:
0017   MultiGaussianState1D() : theCombinedStateUp2Date(false) {}
0018 
0019   MultiGaussianState1D(const SingleState1dContainer& stateV) : theComponents(stateV), theCombinedStateUp2Date(false) {}
0020 
0021   ~MultiGaussianState1D() {}
0022 
0023   /// combined weight
0024   double weight() const;
0025   /// combined mean
0026   double mean() const;
0027   /// combined variance
0028   double variance() const;
0029   /// access to components
0030   const SingleState1dContainer& components() const { return theComponents; }
0031 
0032   // protected:
0033 private:
0034   /// calculation of the combined state (on demand)
0035   void checkCombinedState() const;
0036 
0037   // should become a vector of pointers to const SingleState
0038   const SingleState1dContainer theComponents;
0039   mutable SingleGaussianState1D theCombinedState;
0040   mutable bool theCombinedStateUp2Date;
0041 };
0042 
0043 #endif