CMS 3D CMS Logo

BasicSingleVertexState Class Reference

Single state measurement of a vertex. More...

#include <RecoVertex/VertexPrimitives/interface/BasicSingleVertexState.h>

Inheritance diagram for BasicSingleVertexState:

BasicVertexState ReferenceCounted

List of all members.

Public Member Functions

 BasicSingleVertexState (const AlgebraicVector3 &weightTimesPosition, const GlobalWeight &posWeight, const double &weightInMix=1.0)
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalWeight &posWeight, const double &weightInMix=1.0)
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalError &posErr, const double &weightInMix=1.0)
 BasicSingleVertexState ()
 Constructors.
virtual BasicSingleVertexStateclone () const
 Access methods.
GlobalError error () const
GlobalPoint position () const
 Access methods.
GlobalWeight weight () const
double weightInMixture () const
AlgebraicVector3 weightTimesPosition () const

Private Member Functions

void computeError () const
void computePosition () const
 conversion to VertexSeed
void computeWeight () const
void computeWeightTimesPos () const

Private Attributes

bool isValid
GlobalError theErr
bool theErrAvailable
GlobalPoint thePos
bool thePosAvailable
GlobalWeight theWeight
bool theWeightAvailable
double theWeightInMix
AlgebraicVector3 theWeightTimesPos
bool theWeightTimesPosAvailable


Detailed Description

Single state measurement of a vertex.

Some data is calculated on demand to improve performance.

Definition at line 13 of file BasicSingleVertexState.h.


Constructor & Destructor Documentation

BasicSingleVertexState::BasicSingleVertexState (  ) 

Constructors.

Definition at line 4 of file BasicSingleVertexState.cc.

Referenced by clone().

BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalError posErr,
const double &  weightInMix = 1.0 
)

Definition at line 13 of file BasicSingleVertexState.cc.

00016   : thePos(pos), thePosAvailable(true),
00017     theErr(posErr), theErrAvailable(true),
00018     theWeight(AlgebraicSymMatrix33()), theWeightAvailable(false),
00019     theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false),
00020     isValid(true), theWeightInMix(weightInMix)
00021 {}

BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalWeight posWeight,
const double &  weightInMix = 1.0 
)

BasicSingleVertexState::BasicSingleVertexState ( const AlgebraicVector3 weightTimesPosition,
const GlobalWeight posWeight,
const double &  weightInMix = 1.0 
)

Definition at line 35 of file BasicSingleVertexState.cc.

00038   : thePos(GlobalPoint(0, 0, 0)), thePosAvailable(false),
00039     theErr(AlgebraicSymMatrix33()), theErrAvailable(false),
00040     theWeight(posWeight), theWeightAvailable(true),
00041     theWeightTimesPos(weightTimesPosition), theWeightTimesPosAvailable(true),
00042     isValid(true), theWeightInMix(weightInMix)
00043 {//cout <<"BasicSingleVertexState ctor\n";
00044 }


Member Function Documentation

virtual BasicSingleVertexState* BasicSingleVertexState::clone ( void   )  const [inline, virtual]

Access methods.

Implements BasicVertexState.

Definition at line 30 of file BasicSingleVertexState.h.

References BasicSingleVertexState().

00031   {
00032     return new BasicSingleVertexState(*this);
00033   }

void BasicSingleVertexState::computeError (  )  const [private]

Definition at line 100 of file BasicSingleVertexState.cc.

References isValid, GlobalErrorBase< T, ErrorWeightType >::matrix(), theErr, theErrAvailable, and weight().

Referenced by error().

00101 {
00102   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00103   int ifail;
00104   theErr = weight().matrix().inverse(ifail);
00105   if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert weight matrix");
00106   theErrAvailable = true;
00107 }

void BasicSingleVertexState::computePosition (  )  const [private]

conversion to VertexSeed

Definition at line 91 of file BasicSingleVertexState.cc.

References error(), isValid, GlobalErrorBase< T, ErrorWeightType >::matrix_new(), thePos, thePosAvailable, and weightTimesPosition().

Referenced by position().

00092 {
00093   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00094   AlgebraicVector3 pos = error().matrix_new()*weightTimesPosition();
00095   thePos = GlobalPoint(pos[0], pos[1], pos[2]);
00096   thePosAvailable = true;
00097 }

void BasicSingleVertexState::computeWeight (  )  const [private]

Definition at line 110 of file BasicSingleVertexState.cc.

References error(), isValid, GlobalErrorBase< T, ErrorWeightType >::matrix(), theWeight, and theWeightAvailable.

Referenced by weight().

00111 {
00112   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00113   int ifail;
00114   theWeight = error().matrix().inverse(ifail);
00115   if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert error matrix");
00116   theWeightAvailable = true;
00117 }

void BasicSingleVertexState::computeWeightTimesPos (  )  const [private]

Definition at line 120 of file BasicSingleVertexState.cc.

References isValid, GlobalErrorBase< T, ErrorWeightType >::matrix_new(), position(), theWeightTimesPos, theWeightTimesPosAvailable, weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by weightTimesPosition().

00121 {
00122   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00123   AlgebraicVector3 pos; pos(0) = position().x();
00124   pos(1) = position().y(); pos(2) = position().z();
00125   theWeightTimesPos = weight().matrix_new()*pos;
00126   theWeightTimesPosAvailable = true;
00127 }

GlobalError BasicSingleVertexState::error (  )  const [virtual]

Implements BasicVertexState.

Definition at line 54 of file BasicSingleVertexState.cc.

References computeError(), isValid, theErr, and theErrAvailable.

Referenced by computePosition(), and computeWeight().

00055 {
00056   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00057   if (!theErrAvailable) computeError();
00058   return theErr;
00059 }

GlobalPoint BasicSingleVertexState::position (  )  const [virtual]

Access methods.

Implements BasicVertexState.

Definition at line 46 of file BasicSingleVertexState.cc.

References computePosition(), isValid, thePos, and thePosAvailable.

Referenced by computeWeightTimesPos().

00047 {
00048   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00049   if (!thePosAvailable) computePosition();
00050   return thePos;
00051 }

GlobalWeight BasicSingleVertexState::weight (  )  const [virtual]

Implements BasicVertexState.

Definition at line 62 of file BasicSingleVertexState.cc.

References computeWeight(), isValid, theWeight, and theWeightAvailable.

Referenced by computeError(), and computeWeightTimesPos().

00063 {
00064   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00065   if (!theWeightAvailable) computeWeight();
00066   return theWeight;
00067 }

double BasicSingleVertexState::weightInMixture (  )  const [virtual]

Implements BasicVertexState.

Definition at line 78 of file BasicSingleVertexState.cc.

References isValid, and theWeightInMix.

00079 {
00080   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00081   return theWeightInMix;
00082 }

AlgebraicVector3 BasicSingleVertexState::weightTimesPosition (  )  const [virtual]

Implements BasicVertexState.

Definition at line 70 of file BasicSingleVertexState.cc.

References computeWeightTimesPos(), isValid, theWeightTimesPos, and theWeightTimesPosAvailable.

Referenced by computePosition().

00071 {
00072   if (!isValid) throw VertexException("BasicSingleVertexState::invalid");
00073   if (!theWeightTimesPosAvailable) computeWeightTimesPos();
00074   return theWeightTimesPos;
00075 }


Member Data Documentation

bool BasicSingleVertexState::isValid [private]

Definition at line 61 of file BasicSingleVertexState.h.

Referenced by computeError(), computePosition(), computeWeight(), computeWeightTimesPos(), error(), position(), weight(), weightInMixture(), and weightTimesPosition().

GlobalError BasicSingleVertexState::theErr [mutable, private]

Definition at line 54 of file BasicSingleVertexState.h.

Referenced by computeError(), and error().

bool BasicSingleVertexState::theErrAvailable [mutable, private]

Definition at line 55 of file BasicSingleVertexState.h.

Referenced by computeError(), and error().

GlobalPoint BasicSingleVertexState::thePos [mutable, private]

Definition at line 52 of file BasicSingleVertexState.h.

Referenced by computePosition(), and position().

bool BasicSingleVertexState::thePosAvailable [mutable, private]

Definition at line 53 of file BasicSingleVertexState.h.

Referenced by computePosition(), and position().

GlobalWeight BasicSingleVertexState::theWeight [mutable, private]

Definition at line 56 of file BasicSingleVertexState.h.

Referenced by computeWeight(), and weight().

bool BasicSingleVertexState::theWeightAvailable [mutable, private]

Definition at line 57 of file BasicSingleVertexState.h.

Referenced by computeWeight(), and weight().

double BasicSingleVertexState::theWeightInMix [private]

Definition at line 62 of file BasicSingleVertexState.h.

Referenced by weightInMixture().

AlgebraicVector3 BasicSingleVertexState::theWeightTimesPos [mutable, private]

Definition at line 58 of file BasicSingleVertexState.h.

Referenced by computeWeightTimesPos(), and weightTimesPosition().

bool BasicSingleVertexState::theWeightTimesPosAvailable [mutable, private]

Definition at line 59 of file BasicSingleVertexState.h.

Referenced by computeWeightTimesPos(), and weightTimesPosition().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:58 2009 for CMSSW by  doxygen 1.5.4