CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
MultiGaussianState1D Class Reference

#include <MultiGaussianState1D.h>

Public Types

typedef std::vector
< SingleGaussianState1D
SingleState1dContainer
 

Public Member Functions

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

Private Member Functions

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

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.

21  : theComponents(stateV), theCombinedStateUp2Date(false) {}
const SingleState1dContainer theComponents
MultiGaussianState1D::~MultiGaussianState1D ( )
inline

Definition at line 23 of file MultiGaussianState1D.h.

23 {}

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().

28 {
29  if (theCombinedStateUp2Date) return;
30 
33 
34 // typedef SingleGaussianState<1> SingleState;
35 // typedef boost::shared_ptr< SingleGaussianState<1> > SingleStatePtr;
36 // typedef std::vector< SingleStatePtr > SingleStateContainer;
37 
38 // SingleStateContainer components;
39 // for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
40 // ic!=theComponents.end(); ic++ ) {
41 // SingleStatePtr ssp(new SingleState(SingleState::Vector((*ic).mean()),
42 // SingleState::Matrix((*ic).variance()),
43 // (*ic).weight()));
44 // components.push_back(ssp);
45 // }
46 // MultiGaussianState<1> multiState(components);
47 
48 // theCombinedState = SingleGaussianState1D(multiState.mean()(0),
49 // multiState.covariance()(0,0),
50 // multiState.weight());
51 
53 
54 }
SingleGaussianState1D theCombinedState
const SingleState1dContainer theComponents
SingleGaussianState1D combine(const MultiGaussianState1D &theState) const
const SingleState1dContainer& MultiGaussianState1D::components ( ) const
inline

access to components

Definition at line 32 of file MultiGaussianState1D.h.

References theComponents.

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

32 {return theComponents;}
const SingleState1dContainer theComponents
double MultiGaussianState1D::mean ( ) const

combined mean

Definition at line 15 of file MultiGaussianState1D.cc.

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

Referenced by GaussianSumUtilities1D::computeMode(), and GaussianSumUtilities1D::mean().

16 {
18  return theCombinedState.mean();
19 }
SingleGaussianState1D theCombinedState
double mean() const
parameter vector
void checkCombinedState() const
calculation of the combined state (on demand)
double MultiGaussianState1D::variance ( ) const

combined variance

Definition at line 21 of file MultiGaussianState1D.cc.

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

Referenced by GaussianSumUtilities1D::computeMode(), and GaussianSumUtilities1D::variance().

22 {
24  return theCombinedState.variance();
25 }
SingleGaussianState1D theCombinedState
double variance() const
variance
void checkCombinedState() const
calculation of the combined state (on demand)
double MultiGaussianState1D::weight ( void  ) const

combined weight

Definition at line 5 of file MultiGaussianState1D.cc.

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

Referenced by GaussianSumUtilities1D::computeMode(), and GaussianSumUtilities1D::weight().

6 {
8 
9  double result(0.);
10  for ( SingleState1dContainer::const_iterator ic=theComponents.begin();
11  ic!=theComponents.end(); ic++ ) result += (*ic).weight();
12  return result;
13 }
SingleGaussianState1D theCombinedState
const SingleState1dContainer theComponents
tuple result
Definition: query.py:137
double weight() const
weight

Member Data Documentation

SingleGaussianState1D MultiGaussianState1D::theCombinedState
mutableprivate

Definition at line 41 of file MultiGaussianState1D.h.

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

bool MultiGaussianState1D::theCombinedStateUp2Date
mutableprivate

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().