#include <BasicMultiVertexState.h>
Public Member Functions | |
BasicMultiVertexState () | |
BasicMultiVertexState (const std::vector< VertexState > &vsComp) | |
virtual BasicMultiVertexState * | clone () const |
virtual std::vector< VertexState > | components () const |
GlobalError | error () const |
bool | isValid () const |
GlobalPoint | position () const |
GlobalWeight | weight () const |
double | weightInMixture () const |
AlgebraicVector3 | weightTimesPosition () const |
Private Member Functions | |
void | checkCombinedState () const |
Private Attributes | |
VertexState | theCombinedState |
bool | theCombinedStateUp2Date |
MultiVertexStateCombiner | theCombiner |
std::vector< VertexState > | theComponents |
bool | valid |
Multi state measurement of a vertex. Some data is calculated on demand to improve performance.
Definition at line 12 of file BasicMultiVertexState.h.
BasicMultiVertexState::BasicMultiVertexState | ( | ) | [inline] |
Constructors
Definition at line 18 of file BasicMultiVertexState.h.
Referenced by clone().
: valid(false){}
BasicMultiVertexState::BasicMultiVertexState | ( | const std::vector< VertexState > & | vsComp | ) |
void BasicMultiVertexState::checkCombinedState | ( | ) | const [private] |
Definition at line 61 of file BasicMultiVertexState.cc.
References MultiVertexStateCombiner::combine(), theCombinedState, theCombinedStateUp2Date, theCombiner, theComponents, and valid.
Referenced by error(), position(), weight(), and weightTimesPosition().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (theCombinedStateUp2Date) return; theCombinedState = theCombiner.combine(theComponents); theCombinedStateUp2Date = true; }
virtual BasicMultiVertexState* BasicMultiVertexState::clone | ( | void | ) | const [inline, virtual] |
Access methods
Implements BasicVertexState.
Definition at line 24 of file BasicMultiVertexState.h.
References BasicMultiVertexState().
{ return new BasicMultiVertexState(*this); }
virtual std::vector<VertexState> BasicMultiVertexState::components | ( | ) | const [inline, virtual] |
Vector of individual components in the mixture.
Reimplemented from BasicVertexState.
Definition at line 60 of file BasicMultiVertexState.h.
References theComponents.
{ return theComponents; }
GlobalError BasicMultiVertexState::error | ( | ) | const [virtual] |
Mean covariance matrix of the mixture (covariance matrix of the collapsed state)
Implements BasicVertexState.
Definition at line 18 of file BasicMultiVertexState.cc.
References checkCombinedState(), VertexState::error(), and theCombinedState.
{ checkCombinedState(); return theCombinedState.error(); }
bool BasicMultiVertexState::isValid | ( | void | ) | const [inline, virtual] |
The validity of the vertex
Implements BasicVertexState.
Definition at line 67 of file BasicMultiVertexState.h.
References valid.
{return valid;}
GlobalPoint BasicMultiVertexState::position | ( | ) | const [virtual] |
Mean position of the mixture (position of the collapsed state)
Implements BasicVertexState.
Definition at line 11 of file BasicMultiVertexState.cc.
References checkCombinedState(), VertexState::position(), and theCombinedState.
{ checkCombinedState(); return theCombinedState.position(); }
GlobalWeight BasicMultiVertexState::weight | ( | void | ) | const [virtual] |
Mean weight matrix (inverse of covariance) of the mixture ( weight matrix of the collapsed state)
Implements BasicVertexState.
Definition at line 25 of file BasicMultiVertexState.cc.
References checkCombinedState(), theCombinedState, and VertexState::weight().
Referenced by weightInMixture().
{ checkCombinedState(); return theCombinedState.weight(); }
double BasicMultiVertexState::weightInMixture | ( | ) | const [virtual] |
The weight of this state. It will be the sum of the weights of the individual components in the mixture.
Implements BasicVertexState.
Definition at line 45 of file BasicMultiVertexState.cc.
References gather_cfg::cout, theComponents, valid, and weight().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (theComponents.empty()) { cout << "Asking for weight of empty MultiVertexState, returning zero!" << endl; throw VertexException("Asking for weight of empty MultiVertexState, returning zero!"); return 0.; } double weight = 0.; for (vector<VertexState>::const_iterator it = theComponents.begin(); it != theComponents.end(); it++) { weight += it->weightInMixture(); } return weight; }
AlgebraicVector3 BasicMultiVertexState::weightTimesPosition | ( | ) | const [virtual] |
Mean (weight*position) matrix of the mixture
Implements BasicVertexState.
Definition at line 32 of file BasicMultiVertexState.cc.
References checkCombinedState(), theCombinedState, and VertexState::weightTimesPosition().
{ checkCombinedState(); return theCombinedState.weightTimesPosition(); }
VertexState BasicMultiVertexState::theCombinedState [mutable, private] |
Definition at line 75 of file BasicMultiVertexState.h.
Referenced by checkCombinedState(), error(), position(), weight(), and weightTimesPosition().
bool BasicMultiVertexState::theCombinedStateUp2Date [mutable, private] |
Definition at line 76 of file BasicMultiVertexState.h.
Referenced by checkCombinedState().
Definition at line 78 of file BasicMultiVertexState.h.
Referenced by checkCombinedState().
std::vector<VertexState> BasicMultiVertexState::theComponents [mutable, private] |
Definition at line 74 of file BasicMultiVertexState.h.
Referenced by checkCombinedState(), components(), and weightInMixture().
bool BasicMultiVertexState::valid [private] |
Definition at line 73 of file BasicMultiVertexState.h.
Referenced by checkCombinedState(), isValid(), and weightInMixture().