CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

BasicSingleVertexState Class Reference

#include <BasicSingleVertexState.h>

Inheritance diagram for BasicSingleVertexState:
BasicVertexState ReferenceCounted

List of all members.

Public Member Functions

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

Private Member Functions

void computeError () const
void computePosition () const
void computeWeight () const
void computeWeightTimesPos () const

Private Attributes

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

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 ( )
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalError posErr,
const double &  weightInMix = 1.0 
)
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.

  : 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";
}

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

  {
    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]
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 ( void  ) 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;
}

Member Data Documentation

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

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

Definition at line 57 of file BasicSingleVertexState.h.

Referenced by computeWeight(), and weight().

Definition at line 58 of file BasicSingleVertexState.h.

Referenced by computeWeight(), and weight().

Definition at line 63 of file BasicSingleVertexState.h.

Referenced by weightInMixture().

Definition at line 59 of file BasicSingleVertexState.h.

Referenced by computeWeightTimesPos(), and weightTimesPosition().

Definition at line 60 of file BasicSingleVertexState.h.

Referenced by computeWeightTimesPos(), and weightTimesPosition().