CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

MultiGaussianState1D Class Reference

#include <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 ()
 MultiGaussianState1D (const SingleState1dContainer &stateV)
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

Definition at line 14 of file MultiGaussianState1D.h.


Constructor & Destructor Documentation

MultiGaussianState1D::MultiGaussianState1D ( ) [inline]

Definition at line 18 of file MultiGaussianState1D.h.

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

Definition at line 20 of file MultiGaussianState1D.h.

    : theComponents(stateV), theCombinedStateUp2Date(false) {}
MultiGaussianState1D::~MultiGaussianState1D ( ) [inline]

Definition at line 23 of file MultiGaussianState1D.h.

{}

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(), heavyFlavorValidationHarvestingSequence_cff::combiner, theCombinedState, theCombinedStateUp2Date, and theComponents.

Referenced by mean(), and variance().

{
  if (theCombinedStateUp2Date) return;

  MultiGaussianStateCombiner1D combiner;
  theCombinedState = combiner.combine(theComponents);

//   typedef SingleGaussianState<1> SingleState;
//   typedef boost::shared_ptr< SingleGaussianState<1> > SingleStatePtr;
//   typedef std::vector< SingleStatePtr > SingleStateContainer;

//   SingleStateContainer components;
//   for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
//      ic!=theComponents.end(); ic++ ) {
//     SingleStatePtr ssp(new SingleState(SingleState::Vector((*ic).mean()),
//                                     SingleState::Matrix((*ic).variance()),
//                                     (*ic).weight()));
//     components.push_back(ssp);
//   }
//   MultiGaussianState<1> multiState(components);

//   theCombinedState = SingleGaussianState1D(multiState.mean()(0),
//                                         multiState.covariance()(0,0),
//                                         multiState.weight());

  theCombinedStateUp2Date = true;

}
const SingleState1dContainer& MultiGaussianState1D::components ( ) const [inline]
double MultiGaussianState1D::mean ( ) const
double MultiGaussianState1D::variance ( ) const
double MultiGaussianState1D::weight ( ) const

combined weight

Definition at line 5 of file MultiGaussianState1D.cc.

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

Referenced by GaussianSumUtilities1D::weight().

{
  if (theCombinedStateUp2Date) return theCombinedState.weight();
  
  double result(0.);
  for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
        ic!=theComponents.end(); ic++ )  result += (*ic).weight();
  return result;
}

Member Data Documentation

Definition at line 41 of file MultiGaussianState1D.h.

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

Definition at line 42 of file MultiGaussianState1D.h.

Referenced by checkCombinedState(), and weight().

Definition at line 40 of file MultiGaussianState1D.h.

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