#include <BasicSingleVertexState.h>
Single state measurement of a vertex. Some data is calculated on demand to improve performance.
Definition at line 13 of file BasicSingleVertexState.h.
BasicSingleVertexState::BasicSingleVertexState | ( | ) |
Constructors
Definition at line 4 of file BasicSingleVertexState.cc.
Referenced by clone().
: thePos(GlobalPoint(0, 0, 0)), thePosAvailable(false), theErr(AlgebraicSymMatrix33()), theErrAvailable(false), theWeight(AlgebraicSymMatrix33()), theWeightAvailable(false), theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false), valid(false), theWeightInMix(0.) {}
BasicSingleVertexState::BasicSingleVertexState | ( | const GlobalPoint & | pos, |
const GlobalError & | posErr, | ||
const double & | weightInMix = 1.0 |
||
) |
Definition at line 13 of file BasicSingleVertexState.cc.
: thePos(pos), thePosAvailable(true), theErr(posErr), theErrAvailable(true), theWeight(AlgebraicSymMatrix33()), theWeightAvailable(false), theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false), valid(true), theWeightInMix(weightInMix) {}
BasicSingleVertexState::BasicSingleVertexState | ( | const GlobalPoint & | pos, |
const GlobalWeight & | posWeight, | ||
const double & | weightInMix = 1.0 |
||
) |
Definition at line 24 of file BasicSingleVertexState.cc.
: thePos(pos), thePosAvailable(true), theErr(AlgebraicSymMatrix33()), theErrAvailable(false), theWeight(posWeight), theWeightAvailable(true), theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false), valid(true), theWeightInMix(weightInMix) {}
BasicSingleVertexState::BasicSingleVertexState | ( | const AlgebraicVector3 & | weightTimesPosition, |
const GlobalWeight & | posWeight, | ||
const double & | weightInMix = 1.0 |
||
) |
Definition at line 35 of file BasicSingleVertexState.cc.
: thePos(GlobalPoint(0, 0, 0)), thePosAvailable(false), theErr(AlgebraicSymMatrix33()), theErrAvailable(false), theWeight(posWeight), theWeightAvailable(true), theWeightTimesPos(weightTimesPosition), theWeightTimesPosAvailable(true), valid(true), theWeightInMix(weightInMix) {//std::cout <<"BasicSingleVertexState ctor\n"; }
virtual BasicSingleVertexState* BasicSingleVertexState::clone | ( | void | ) | const [inline, virtual] |
Access methods
Implements BasicVertexState.
Definition at line 30 of file BasicSingleVertexState.h.
References BasicSingleVertexState().
{ return new BasicSingleVertexState(*this); }
void BasicSingleVertexState::computeError | ( | ) | const [private] |
Definition at line 100 of file BasicSingleVertexState.cc.
References GlobalErrorBase< T, ErrorWeightType >::matrix(), theErr, theErrAvailable, valid, and weight().
Referenced by error().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); int ifail; theErr = weight().matrix().inverse(ifail); if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert weight matrix"); theErrAvailable = true; }
void BasicSingleVertexState::computePosition | ( | ) | const [private] |
Definition at line 91 of file BasicSingleVertexState.cc.
References error(), GlobalErrorBase< T, ErrorWeightType >::matrix_new(), pos, thePos, thePosAvailable, valid, and weightTimesPosition().
Referenced by position().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); AlgebraicVector3 pos = error().matrix_new()*weightTimesPosition(); thePos = GlobalPoint(pos[0], pos[1], pos[2]); thePosAvailable = true; }
void BasicSingleVertexState::computeWeight | ( | ) | const [private] |
Definition at line 110 of file BasicSingleVertexState.cc.
References error(), GlobalErrorBase< T, ErrorWeightType >::matrix(), theWeight, theWeightAvailable, and valid.
Referenced by weight().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); int ifail; theWeight = error().matrix().inverse(ifail); if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert error matrix"); theWeightAvailable = true; }
void BasicSingleVertexState::computeWeightTimesPos | ( | ) | const [private] |
Definition at line 120 of file BasicSingleVertexState.cc.
References GlobalErrorBase< T, ErrorWeightType >::matrix_new(), pos, position(), theWeightTimesPos, theWeightTimesPosAvailable, valid, weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by weightTimesPosition().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); AlgebraicVector3 pos; pos(0) = position().x(); pos(1) = position().y(); pos(2) = position().z(); theWeightTimesPos = weight().matrix_new()*pos; theWeightTimesPosAvailable = true; }
GlobalError BasicSingleVertexState::error | ( | ) | const [virtual] |
Implements BasicVertexState.
Definition at line 54 of file BasicSingleVertexState.cc.
References computeError(), theErr, theErrAvailable, and valid.
Referenced by computePosition(), and computeWeight().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (!theErrAvailable) computeError(); return theErr; }
bool BasicSingleVertexState::isValid | ( | void | ) | const [inline, virtual] |
The validity of the vertex
Implements BasicVertexState.
Definition at line 44 of file BasicSingleVertexState.h.
References valid.
{return valid;}
GlobalPoint BasicSingleVertexState::position | ( | ) | const [virtual] |
Access methods
Implements BasicVertexState.
Definition at line 46 of file BasicSingleVertexState.cc.
References computePosition(), thePos, thePosAvailable, and valid.
Referenced by computeWeightTimesPos().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (!thePosAvailable) computePosition(); return thePos; }
GlobalWeight BasicSingleVertexState::weight | ( | ) | const [virtual] |
Implements BasicVertexState.
Definition at line 62 of file BasicSingleVertexState.cc.
References computeWeight(), theWeight, theWeightAvailable, and valid.
Referenced by computeError(), and computeWeightTimesPos().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (!theWeightAvailable) computeWeight(); return theWeight; }
double BasicSingleVertexState::weightInMixture | ( | ) | const [virtual] |
Implements BasicVertexState.
Definition at line 78 of file BasicSingleVertexState.cc.
References theWeightInMix, and valid.
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); return theWeightInMix; }
AlgebraicVector3 BasicSingleVertexState::weightTimesPosition | ( | ) | const [virtual] |
Implements BasicVertexState.
Definition at line 70 of file BasicSingleVertexState.cc.
References computeWeightTimesPos(), theWeightTimesPos, theWeightTimesPosAvailable, and valid.
Referenced by computePosition().
{ if (!valid) throw VertexException("BasicSingleVertexState::invalid"); if (!theWeightTimesPosAvailable) computeWeightTimesPos(); return theWeightTimesPos; }
GlobalError BasicSingleVertexState::theErr [mutable, private] |
Definition at line 55 of file BasicSingleVertexState.h.
Referenced by computeError(), and error().
bool BasicSingleVertexState::theErrAvailable [mutable, private] |
Definition at line 56 of file BasicSingleVertexState.h.
Referenced by computeError(), and error().
GlobalPoint BasicSingleVertexState::thePos [mutable, private] |
Definition at line 53 of file BasicSingleVertexState.h.
Referenced by computePosition(), and position().
bool BasicSingleVertexState::thePosAvailable [mutable, private] |
Definition at line 54 of file BasicSingleVertexState.h.
Referenced by computePosition(), and position().
GlobalWeight BasicSingleVertexState::theWeight [mutable, private] |
Definition at line 57 of file BasicSingleVertexState.h.
Referenced by computeWeight(), and weight().
bool BasicSingleVertexState::theWeightAvailable [mutable, private] |
Definition at line 58 of file BasicSingleVertexState.h.
Referenced by computeWeight(), and weight().
double BasicSingleVertexState::theWeightInMix [private] |
Definition at line 63 of file BasicSingleVertexState.h.
Referenced by weightInMixture().
AlgebraicVector3 BasicSingleVertexState::theWeightTimesPos [mutable, private] |
Definition at line 59 of file BasicSingleVertexState.h.
Referenced by computeWeightTimesPos(), and weightTimesPosition().
bool BasicSingleVertexState::theWeightTimesPosAvailable [mutable, private] |
Definition at line 60 of file BasicSingleVertexState.h.
Referenced by computeWeightTimesPos(), and weightTimesPosition().
bool BasicSingleVertexState::valid [private] |
Definition at line 62 of file BasicSingleVertexState.h.
Referenced by computeError(), computePosition(), computeWeight(), computeWeightTimesPos(), error(), isValid(), position(), weight(), weightInMixture(), and weightTimesPosition().