CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
BasicSingleVertexState Class Referencefinal

#include <BasicSingleVertexState.h>

Inheritance diagram for BasicSingleVertexState:
BasicVertexState ReferenceCounted

Public Member Functions

 BasicSingleVertexState ()
 
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalError &posErr, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalWeight &posWeight, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const AlgebraicVector3 &weightTimesPosition, const GlobalWeight &posWeight, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalError &posErr, const double time, const double timeError, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const GlobalPoint &pos, const GlobalWeight &posWeight, const double time, const double timeWeight, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const AlgebraicVector3 &weightTimesPosition, const GlobalWeight &posWeight, const double weightTimesTime, const double timeWeight, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const GlobalPoint &pos, const double time, const GlobalError &posTimeErr, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const GlobalPoint &pos, const double time, const GlobalWeight &posTimeWeight, const double &weightInMix=1.0)
 
 BasicSingleVertexState (const AlgebraicVector4 &weightTimesPosition, const GlobalWeight &posTimeWeight, const double &weightInMix=1.0)
 
virtual BasicSingleVertexStateclone () const
 
GlobalError error () const
 
GlobalError error4D () const
 
bool is4D () const
 
bool isValid () const
 
GlobalPoint position () const
 
double time () const
 
double timeError () const
 
GlobalWeight weight () const
 
GlobalWeight weight4D () const
 
double weightInMixture () const
 
AlgebraicVector3 weightTimesPosition () const
 
AlgebraicVector4 weightTimesPosition4D () const
 
- Public Member Functions inherited from BasicVertexState
virtual std::vector< VertexStatecomponents () const
 
virtual ~BasicVertexState ()
 

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
 
double theTime
 
bool theTimeAvailable
 
GlobalWeight theWeight
 
bool theWeightAvailable
 
double theWeightInMix
 
AlgebraicVector4 theWeightTimesPos
 
bool theWeightTimesPosAvailable
 
bool valid
 
bool vertexIs4D
 

Additional Inherited Members

- Public Types inherited from BasicVertexState
typedef ProxyBase< BasicVertexState, CopyUsingClone< BasicVertexState > > Proxy
 
typedef ReferenceCountingPointer< BasicVertexStateRCPtr
 

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 9 of file BasicSingleVertexState.cc.

Referenced by clone().

10  : thePos(GlobalPoint(0, 0, 0)),
11  theTime(dNaN),
16  valid(false), vertexIs4D(false)
17 {}
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalError posErr,
const double &  weightInMix = 1.0 
)

Definition at line 19 of file BasicSingleVertexState.cc.

22  : thePos(pos),
23  theTime(dNaN),
24  theErr(posErr),
27  theWeightInMix(weightInMix),
29  valid(true), vertexIs4D(false)
30 {}
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalWeight posWeight,
const double &  weightInMix = 1.0 
)

Definition at line 33 of file BasicSingleVertexState.cc.

36  : thePos(pos),
37  theTime(dNaN),
39  theWeight(posWeight),
41  theWeightInMix(weightInMix),
43  valid(true), vertexIs4D(false)
44 {}
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const AlgebraicVector3 weightTimesPosition,
const GlobalWeight posWeight,
const double &  weightInMix = 1.0 
)

Definition at line 47 of file BasicSingleVertexState.cc.

50  : thePos(GlobalPoint(0, 0, 0)),
51  theTime(dNaN),
53  theWeight(posWeight),
55  theWeightInMix(weightInMix),
57  valid(true), vertexIs4D(false)
58 {}
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
AlgebraicVector3 weightTimesPosition() const
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalError posErr,
const double  time,
const double  timeError,
const double &  weightInMix = 1.0 
)

Definition at line 61 of file BasicSingleVertexState.cc.

References theErr.

66  : thePos(pos),
67  theTime(time),
68  theErr(posErr),
71  theWeightInMix(weightInMix),
73  valid(true), vertexIs4D(true)
74 {
75  // You dumb bastard. It's not a schooner, its a sailboat.
76  GlobalError timeErrMat(0.,
77  0.,0.,
78  0.,0.,0.,
79  0.,0.,0.,timeErr*timeErr);
80  theErr = theErr + timeErrMat;
81 }
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const GlobalWeight posWeight,
const double  time,
const double  timeWeight,
const double &  weightInMix = 1.0 
)

Definition at line 84 of file BasicSingleVertexState.cc.

References theWeight.

89  : thePos(pos),
90  theTime(time),
92  theWeight(posWeight),
94  theWeightInMix(weightInMix),
96  valid(true), vertexIs4D(true)
97 {
98  GlobalWeight timeWeightMat(0.,
99  0.,0.,
100  0.,0.,0.,
101  0.,0.,0.,timeWeight);
102  theWeight = theWeight + timeWeightMat;
103 }
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const AlgebraicVector3 weightTimesPosition,
const GlobalWeight posWeight,
const double  weightTimesTime,
const double  timeWeight,
const double &  weightInMix = 1.0 
)

Definition at line 106 of file BasicSingleVertexState.cc.

References theWeight.

111  : thePos(GlobalPoint(0, 0, 0)),
112  theTime(dNaN),
114  theWeight(posWeight),
116  theWeightInMix(weightInMix),
118  valid(true), vertexIs4D(true)
119 {
120  GlobalWeight timeWeightMat(0.,
121  0.,0.,
122  0.,0.,0.,
123  0.,0.,0.,timeWeight);
124  theWeight = theWeight + timeWeightMat;
125 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
AlgebraicVector3 weightTimesPosition() const
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const double  time,
const GlobalError posTimeErr,
const double &  weightInMix = 1.0 
)

Definition at line 128 of file BasicSingleVertexState.cc.

132  : thePos(pos),
133  theTime(time),
134  theErr(posTimeErr),
137  theWeightInMix(weightInMix),
139  valid(true), vertexIs4D(true)
140 {}
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const GlobalPoint pos,
const double  time,
const GlobalWeight posTimeWeight,
const double &  weightInMix = 1.0 
)

Definition at line 143 of file BasicSingleVertexState.cc.

147  : thePos(pos),
148  theTime(time),
150  theWeight(posTimeWeight),
152  theWeightInMix(weightInMix),
154  valid(true), vertexIs4D(true)
155 {}
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 theWeightTimesPos
BasicSingleVertexState::BasicSingleVertexState ( const AlgebraicVector4 weightTimesPosition,
const GlobalWeight posTimeWeight,
const double &  weightInMix = 1.0 
)

Definition at line 158 of file BasicSingleVertexState.cc.

161  : thePos(GlobalPoint(0, 0, 0)),
162  theTime(dNaN),
164  theWeight(posWeight),
166  theWeightInMix(weightInMix),
168  valid(true), vertexIs4D(true)
169 {}
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
AlgebraicVector3 weightTimesPosition() const
AlgebraicVector4 theWeightTimesPos

Member Function Documentation

virtual BasicSingleVertexState* BasicSingleVertexState::clone ( void  ) const
inlinevirtual
void BasicSingleVertexState::computeError ( ) const
private

Definition at line 256 of file BasicSingleVertexState.cc.

References GlobalErrorBase< T, ErrorWeightType >::matrix(), GlobalErrorBase< T, ErrorWeightType >::matrix4D(), theErr, theErrAvailable, valid, vertexIs4D, and weight4D().

Referenced by error(), error4D(), is4D(), and timeError().

257 {
258  if (!valid) throw VertexException("BasicSingleVertexState::computeError::invalid");
259  int ifail;
260  if( vertexIs4D ) {
261  theErr = weight4D().matrix4D().Inverse(ifail);
262  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert weight matrix");
263  } else {
264  theErr = weight4D().matrix().Inverse(ifail);
265  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert weight matrix");
266  }
267  theErrAvailable = true;
268 }
Common base class.
const AlgebraicSymMatrix33 matrix() const
GlobalWeight weight4D() const
const AlgebraicSymMatrix44 & matrix4D() const
void BasicSingleVertexState::computePosition ( ) const
private

Definition at line 246 of file BasicSingleVertexState.cc.

References error4D(), GlobalErrorBase< T, ErrorWeightType >::matrix4D(), thePos, thePosAvailable, theTime, theTimeAvailable, valid, and weightTimesPosition4D().

Referenced by is4D(), position(), and time().

247 {
248  if (!valid) throw VertexException("BasicSingleVertexState::computePosition::invalid");
250  thePos = GlobalPoint(pos[0], pos[1], pos[2]);
251  theTime = pos[3];
252  thePosAvailable = true;
253  theTimeAvailable = true;
254 }
GlobalError error4D() const
Common base class.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
AlgebraicVector4 weightTimesPosition4D() const
const AlgebraicSymMatrix44 & matrix4D() const
ROOT::Math::SVector< double, 4 > AlgebraicVector4
void BasicSingleVertexState::computeWeight ( ) const
private

Definition at line 271 of file BasicSingleVertexState.cc.

References error4D(), GlobalErrorBase< T, ErrorWeightType >::matrix(), GlobalErrorBase< T, ErrorWeightType >::matrix4D(), theWeight, theWeightAvailable, valid, and vertexIs4D.

Referenced by is4D(), weight(), and weight4D().

272 {
273  if (!valid) throw VertexException("BasicSingleVertexState::computeWeight::invalid");
274  int ifail;
275  if( vertexIs4D ) {
276  theWeight = error4D().matrix4D().Inverse(ifail);
277  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert error matrix");
278  } else {
279  theWeight = error4D().matrix().Inverse(ifail);
280  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert error matrix");
281  }
282  theWeightAvailable = true;
283 }
GlobalError error4D() const
Common base class.
const AlgebraicSymMatrix33 matrix() const
const AlgebraicSymMatrix44 & matrix4D() const
void BasicSingleVertexState::computeWeightTimesPos ( ) const
private

Definition at line 286 of file BasicSingleVertexState.cc.

References GlobalErrorBase< T, ErrorWeightType >::matrix4D(), position(), theTime, theWeightTimesPos, theWeightTimesPosAvailable, valid, vertexIs4D, weight4D(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by is4D(), weightTimesPosition(), and weightTimesPosition4D().

287 {
288  if (!valid) throw VertexException("BasicSingleVertexState::computeWeightTimesPos::invalid");
289  AlgebraicVector4 pos; pos(0) = position().x();
290  pos(1) = position().y(); pos(2) = position().z();
291  if ( vertexIs4D ) {
292  pos(3) = theTime;
293  } else {
294  pos(3) = 0.;
295  }
298 }
Common base class.
T y() const
Definition: PV3DBase.h:63
GlobalWeight weight4D() const
const AlgebraicSymMatrix44 & matrix4D() const
T z() const
Definition: PV3DBase.h:64
GlobalPoint position() const
ROOT::Math::SVector< double, 4 > AlgebraicVector4
T x() const
Definition: PV3DBase.h:62
AlgebraicVector4 theWeightTimesPos
GlobalError BasicSingleVertexState::error ( ) const
virtual

Implements BasicVertexState.

Definition at line 178 of file BasicSingleVertexState.cc.

References computeError(), GlobalErrorBase< T, ErrorWeightType >::matrix(), theErr, theErrAvailable, and valid.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag(), and clone().

179 {
180  if (!valid) throw VertexException("BasicSingleVertexState::error::invalid");
182  return GlobalError(theErr.matrix());
183 }
Common base class.
const AlgebraicSymMatrix33 matrix() const
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:13
GlobalError BasicSingleVertexState::error4D ( ) const
virtual

Implements BasicVertexState.

Definition at line 185 of file BasicSingleVertexState.cc.

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

Referenced by clone(), computePosition(), and computeWeight().

186 {
187  if (!valid) throw VertexException("BasicSingleVertexState::error4D::invalid");
189  return theErr;
190 }
Common base class.
bool BasicSingleVertexState::is4D ( ) const
inlinevirtual
bool BasicSingleVertexState::isValid ( void  ) const
inlinevirtual

The validity of the vertex

Implements BasicVertexState.

Definition at line 70 of file BasicSingleVertexState.h.

References valid.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

GlobalPoint BasicSingleVertexState::position ( ) const
virtual

Access methods

Implements BasicVertexState.

Definition at line 171 of file BasicSingleVertexState.cc.

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

Referenced by clone(), and computeWeightTimesPos().

172 {
173  if (!valid) throw VertexException("BasicSingleVertexState::position::invalid");
175  return thePos;
176 }
Common base class.
double BasicSingleVertexState::time ( ) const
virtual

Implements BasicVertexState.

Definition at line 192 of file BasicSingleVertexState.cc.

References computePosition(), theTime, theTimeAvailable, and valid.

Referenced by clone().

192  {
193  if (!valid) throw VertexException("BasicSingleVertexState::time::invalid");
194  if (!theTimeAvailable) computePosition(); // time computed with position (4-vector)
195  return theTime;
196 }
Common base class.
double BasicSingleVertexState::timeError ( ) const
virtual

Implements BasicVertexState.

Definition at line 198 of file BasicSingleVertexState.cc.

References computeError(), GlobalErrorBase< T, ErrorWeightType >::matrix4D(), mathSSE::sqrt(), theErr, theTimeAvailable, and valid.

Referenced by clone().

198  {
199  if (!valid) throw VertexException("BasicSingleVertexState::timeError::invalid");
201  return std::sqrt(theErr.matrix4D()(3,3));
202 }
Common base class.
const AlgebraicSymMatrix44 & matrix4D() const
T sqrt(T t)
Definition: SSEVec.h:18
GlobalWeight BasicSingleVertexState::weight ( void  ) const
virtual

Implements BasicVertexState.

Definition at line 204 of file BasicSingleVertexState.cc.

References computeWeight(), GlobalErrorBase< T, ErrorWeightType >::matrix(), theWeight, theWeightAvailable, and valid.

Referenced by clone().

205 {
206  if (!valid) throw VertexException("BasicSingleVertexState::weight::invalid");
208  return GlobalWeight(theWeight.matrix());
209 }
Common base class.
const AlgebraicSymMatrix33 matrix() const
GlobalErrorBase< double, WeightMatrixTag > GlobalWeight
Definition: GlobalWeight.h:13
GlobalWeight BasicSingleVertexState::weight4D ( ) const
virtual

Implements BasicVertexState.

Definition at line 211 of file BasicSingleVertexState.cc.

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

Referenced by clone(), computeError(), and computeWeightTimesPos().

212 {
213  if (!valid) throw VertexException("BasicSingleVertexState::weight4D::invalid");
215  return theWeight;
216 }
Common base class.
double BasicSingleVertexState::weightInMixture ( ) const
virtual

Implements BasicVertexState.

Definition at line 233 of file BasicSingleVertexState.cc.

References theWeightInMix, and valid.

Referenced by clone().

234 {
235  if (!valid) throw VertexException("BasicSingleVertexState::weightInMixture::invalid");
236  return theWeightInMix;
237 }
Common base class.
AlgebraicVector3 BasicSingleVertexState::weightTimesPosition ( ) const
virtual

Implements BasicVertexState.

Definition at line 218 of file BasicSingleVertexState.cc.

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

Referenced by clone().

219 {
220  if (!valid) throw VertexException("BasicSingleVertexState::weightTimesPosition::invalid");
223 }
Common base class.
ROOT::Math::SVector< double, 3 > AlgebraicVector3
AlgebraicVector4 theWeightTimesPos
AlgebraicVector4 BasicSingleVertexState::weightTimesPosition4D ( ) const
virtual

Implements BasicVertexState.

Definition at line 225 of file BasicSingleVertexState.cc.

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

Referenced by clone(), and computePosition().

226 {
227  if (!valid) throw VertexException("BasicSingleVertexState::weightTimesPosition4D::invalid");
229  return theWeightTimesPos;
230 }
Common base class.
AlgebraicVector4 theWeightTimesPos

Member Data Documentation

GlobalError BasicSingleVertexState::theErr
mutableprivate
bool BasicSingleVertexState::theErrAvailable
mutableprivate

Definition at line 91 of file BasicSingleVertexState.h.

Referenced by computeError(), error(), and error4D().

GlobalPoint BasicSingleVertexState::thePos
mutableprivate

Definition at line 80 of file BasicSingleVertexState.h.

Referenced by computePosition(), and position().

bool BasicSingleVertexState::thePosAvailable
mutableprivate

Definition at line 89 of file BasicSingleVertexState.h.

Referenced by computePosition(), and position().

double BasicSingleVertexState::theTime
mutableprivate

Definition at line 81 of file BasicSingleVertexState.h.

Referenced by computePosition(), computeWeightTimesPos(), and time().

bool BasicSingleVertexState::theTimeAvailable
mutableprivate

Definition at line 90 of file BasicSingleVertexState.h.

Referenced by computePosition(), time(), and timeError().

GlobalWeight BasicSingleVertexState::theWeight
mutableprivate

Definition at line 84 of file BasicSingleVertexState.h.

Referenced by BasicSingleVertexState(), computeWeight(), weight(), and weight4D().

bool BasicSingleVertexState::theWeightAvailable
mutableprivate

Definition at line 92 of file BasicSingleVertexState.h.

Referenced by computeWeight(), weight(), and weight4D().

double BasicSingleVertexState::theWeightInMix
private

Definition at line 87 of file BasicSingleVertexState.h.

Referenced by weightInMixture().

AlgebraicVector4 BasicSingleVertexState::theWeightTimesPos
mutableprivate
bool BasicSingleVertexState::theWeightTimesPosAvailable
mutableprivate
bool BasicSingleVertexState::valid
private
bool BasicSingleVertexState::vertexIs4D
private

Definition at line 96 of file BasicSingleVertexState.h.

Referenced by computeError(), computeWeight(), computeWeightTimesPos(), and is4D().