#include <MultiGaussianState1D.h>
Public Types | |
typedef std::vector < SingleGaussianState1D > | SingleState1dContainer |
Public Member Functions | |
const SingleState1dContainer & | components () 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 |
One-dimensional multi-Gaussian mixture: weighted sum of single Gaussian components.
Definition at line 12 of file MultiGaussianState1D.h.
typedef std::vector<SingleGaussianState1D> MultiGaussianState1D::SingleState1dContainer |
Definition at line 14 of file MultiGaussianState1D.h.
MultiGaussianState1D::MultiGaussianState1D | ( | ) | [inline] |
Definition at line 18 of file MultiGaussianState1D.h.
: theCombinedStateUp2Date(false) {}
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.
{}
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] |
access to components
Definition at line 32 of file MultiGaussianState1D.h.
References theComponents.
Referenced by MultiGaussianStateCombiner1D::combine(), GaussianSumUtilities1D::components(), and MultiTrajectoryStateMode::momentumFromModeP().
{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().
{ checkCombinedState(); return theCombinedState.mean(); }
double MultiGaussianState1D::variance | ( | ) | const |
combined variance
Definition at line 21 of file MultiGaussianState1D.cc.
References checkCombinedState(), theCombinedState, and SingleGaussianState1D::variance().
Referenced by GaussianSumUtilities1D::variance().
{ checkCombinedState(); return theCombinedState.variance(); }
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; }
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().