CMS 3D CMS Logo

MultiGaussianState1D Class Reference

One-dimensional multi-Gaussian mixture: weighted sum of single Gaussian components. More...

#include <TrackingTools/GsfTools/interface/MultiGaussianState1D.h>

List of all members.

Public Types

typedef std::vector
< SingleGaussianState1D
SingleState1dContainer

Public Member Functions

const SingleState1dContainercomponents () const
 access to components
double mean () const
 combined mean
 MultiGaussianState1D (const SingleState1dContainer &stateV)
 MultiGaussianState1D ()
double variance () const
 combined variance
double weight () const
 combined weight
 ~MultiGaussianState1D ()

Private Member Functions

void checkCombinedState () const
 calculation of the combined state (on demand)

Private Attributes

SingleGaussianState1D theCombinedState
bool theCombinedStateUp2Date
const SingleState1dContainer theComponents


Detailed Description

One-dimensional multi-Gaussian mixture: weighted sum of single Gaussian components.

Definition at line 12 of file MultiGaussianState1D.h.


Member Typedef Documentation

typedef std::vector<SingleGaussianState1D> MultiGaussianState1D::SingleState1dContainer

Definition at line 14 of file MultiGaussianState1D.h.


Constructor & Destructor Documentation

MultiGaussianState1D::MultiGaussianState1D (  )  [inline]

Definition at line 18 of file MultiGaussianState1D.h.

00018 : theCombinedStateUp2Date(false) {}

MultiGaussianState1D::MultiGaussianState1D ( const SingleState1dContainer stateV  )  [inline]

Definition at line 20 of file MultiGaussianState1D.h.

00021     : theComponents(stateV), theCombinedStateUp2Date(false) {}

MultiGaussianState1D::~MultiGaussianState1D (  )  [inline]

Definition at line 23 of file MultiGaussianState1D.h.

00023 {}


Member Function Documentation

void MultiGaussianState1D::checkCombinedState (  )  const [private]

calculation of the combined state (on demand)

Definition at line 27 of file MultiGaussianState1D.cc.

References MultiGaussianStateCombiner1D::combine(), theCombinedState, theCombinedStateUp2Date, and theComponents.

Referenced by mean(), and variance().

00028 {
00029   if (theCombinedStateUp2Date) return;
00030 
00031   MultiGaussianStateCombiner1D combiner;
00032   theCombinedState = combiner.combine(theComponents);
00033 
00034 //   typedef SingleGaussianState<1> SingleState;
00035 //   typedef boost::shared_ptr< SingleGaussianState<1> > SingleStatePtr;
00036 //   typedef std::vector< SingleStatePtr > SingleStateContainer;
00037 
00038 //   SingleStateContainer components;
00039 //   for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
00040 //      ic!=theComponents.end(); ic++ ) {
00041 //     SingleStatePtr ssp(new SingleState(SingleState::Vector((*ic).mean()),
00042 //                                     SingleState::Matrix((*ic).variance()),
00043 //                                     (*ic).weight()));
00044 //     components.push_back(ssp);
00045 //   }
00046 //   MultiGaussianState<1> multiState(components);
00047 
00048 //   theCombinedState = SingleGaussianState1D(multiState.mean()(0),
00049 //                                         multiState.covariance()(0,0),
00050 //                                         multiState.weight());
00051 
00052   theCombinedStateUp2Date = true;
00053 
00054 }

const SingleState1dContainer& MultiGaussianState1D::components (  )  const [inline]

access to components

Definition at line 32 of file MultiGaussianState1D.h.

References theComponents.

Referenced by MultiGaussianStateCombiner1D::combine(), and GaussianSumUtilities1D::components().

00032 {return theComponents;}

double MultiGaussianState1D::mean (  )  const

combined mean

Definition at line 15 of file MultiGaussianState1D.cc.

References checkCombinedState(), SingleGaussianState1D::mean(), and theCombinedState.

Referenced by GaussianSumUtilities1D::mean().

00016 {
00017   checkCombinedState();
00018   return theCombinedState.mean();
00019 }

double MultiGaussianState1D::variance (  )  const

combined variance

Definition at line 21 of file MultiGaussianState1D.cc.

References checkCombinedState(), theCombinedState, and SingleGaussianState1D::variance().

Referenced by GaussianSumUtilities1D::variance().

00022 {
00023   checkCombinedState();
00024   return theCombinedState.variance();
00025 }

double MultiGaussianState1D::weight (  )  const

combined weight

Definition at line 5 of file MultiGaussianState1D.cc.

References HLT_VtxMuL3::result, theCombinedState, theCombinedStateUp2Date, theComponents, and SingleGaussianState1D::weight().

Referenced by GaussianSumUtilities1D::weight().

00006 {
00007   if (theCombinedStateUp2Date) return theCombinedState.weight();
00008   
00009   double result(0.);
00010   for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
00011         ic!=theComponents.end(); ic++ )  result += (*ic).weight();
00012   return result;
00013 }


Member Data Documentation

SingleGaussianState1D MultiGaussianState1D::theCombinedState [mutable, private]

Definition at line 41 of file MultiGaussianState1D.h.

Referenced by checkCombinedState(), mean(), variance(), and weight().

bool MultiGaussianState1D::theCombinedStateUp2Date [mutable, private]

Definition at line 42 of file MultiGaussianState1D.h.

Referenced by checkCombinedState(), and weight().

const SingleState1dContainer MultiGaussianState1D::theComponents [private]

Definition at line 40 of file MultiGaussianState1D.h.

Referenced by checkCombinedState(), components(), and weight().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:30 2009 for CMSSW by  doxygen 1.5.4