CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
KinematicVertex Class Reference

#include <KinematicVertex.h>

Inheritance diagram for KinematicVertex:
ReferenceCounted

Public Member Functions

float chiSquared () const
 
KinematicTreecorrespondingTree () const
 
float degreesOfFreedom () const
 
GlobalError error () const
 
 KinematicVertex ()
 
 KinematicVertex (const VertexState state, float totalChiSq, float degreesOfFr)
 
 KinematicVertex (const VertexState state, const ReferenceCountingPointer< KinematicVertex > prVertex, float totalChiSq, float degreesOfFr)
 
 KinematicVertex (const CachingVertex< 6 > &vertex)
 
 operator reco::Vertex ()
 
bool operator< (const KinematicVertex &other) const
 
bool operator== (const KinematicVertex &other) const
 
bool operator== (const ReferenceCountingPointer< KinematicVertex > other) const
 
GlobalPoint position () const
 
ReferenceCountingPointer< KinematicVertexvertexBeforeConstraint () const
 
bool vertexIsValid () const
 
VertexState vertexState () const
 
virtual ~KinematicVertex ()
 

Private Member Functions

void setTreePointer (KinematicTree *tr) const
 

Private Attributes

ReferenceCountingPointer< KinematicVertexpVertex
 
float theChiSquared
 
float theNDF
 
VertexState theState
 
KinematicTreetree
 
bool vl
 

Friends

class KinematicTree
 

Detailed Description

Class representing a Decay Vertex Caches a vertex position, covariance matrix, chi squared and number of degrees of freedom. Class is usually created by KinematicParticleVertexFitter

Kirill Prokofiev, December 2002

Definition at line 21 of file KinematicVertex.h.

Constructor & Destructor Documentation

KinematicVertex::KinematicVertex ( )

Empty default constructor for invalid vertices

Definition at line 8 of file KinematicVertex.cc.

References vl.

9 {vl = false;}
KinematicVertex::KinematicVertex ( const VertexState  state,
float  totalChiSq,
float  degreesOfFr 
)

Constructor with vertex state, chi2 and ndf. Previous state of the vertex pointer is set to 0.

Definition at line 11 of file KinematicVertex.cc.

References pVertex, and vl.

12  :
13  theState(state),theChiSquared(totalChiSq),theNDF(degreesOfFr)
14 
15 {
16  vl = true;
17  tree = 0;
18  pVertex = 0;
19 }
VertexState theState
ReferenceCountingPointer< KinematicVertex > pVertex
Definition: tree.py:1
KinematicVertex::KinematicVertex ( const VertexState  state,
const ReferenceCountingPointer< KinematicVertex prVertex,
float  totalChiSq,
float  degreesOfFr 
)

Constructor with previous (before constraint) state of the vertex

Definition at line 33 of file KinematicVertex.cc.

References vl.

35  :
36  theState(state) ,
37  theChiSquared(totalChiSq),theNDF(degreesOfFr) , pVertex(prVertex)
38 {
39  vl = true;
40  tree = 0;
41 }
VertexState theState
ReferenceCountingPointer< KinematicVertex > pVertex
Definition: tree.py:1
KinematicVertex::KinematicVertex ( const CachingVertex< 6 > &  vertex)

Direct transformation from caching vertex

Definition at line 21 of file KinematicVertex.cc.

References CachingVertex< N >::degreesOfFreedom(), CachingVertex< N >::error(), CachingVertex< N >::position(), pVertex, theChiSquared, theNDF, theState, CachingVertex< N >::totalChiSquared(), and vl.

22 {
23 // theVertexPosition = vertex.position();
24 // theVPositionError = vertex.error();
25  vl = true;
26  theState = VertexState(vertex.position(), vertex.error());
27  theChiSquared = vertex.totalChiSquared();
28  theNDF = vertex.degreesOfFreedom();
29  tree = 0;
30  pVertex = 0;
31 }
VertexState theState
float totalChiSquared() const
float degreesOfFreedom() const
ReferenceCountingPointer< KinematicVertex > pVertex
GlobalPoint position() const
Definition: tree.py:1
GlobalError error() const
KinematicVertex::~KinematicVertex ( )
virtual

Definition at line 81 of file KinematicVertex.cc.

82 {}

Member Function Documentation

float KinematicVertex::chiSquared ( ) const

Definition at line 94 of file KinematicVertex.cc.

References theChiSquared.

Referenced by operator reco::Vertex().

95 {return theChiSquared;}
KinematicTree * KinematicVertex::correspondingTree ( ) const

Returns the pointer to the kinematic tree (if any) current vertex belongs to returned in case of not any tree build yet

Definition at line 100 of file KinematicVertex.cc.

References tree.

101 {return tree;}
KinematicTree * tree
float KinematicVertex::degreesOfFreedom ( ) const

Definition at line 97 of file KinematicVertex.cc.

References theNDF.

Referenced by operator reco::Vertex().

98 {return theNDF;}
GlobalError KinematicVertex::error ( ) const

Definition at line 89 of file KinematicVertex.cc.

References VertexState::error(), and theState.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag(), and operator==().

90 {
91  return theState.error();
92 }
VertexState theState
GlobalError error() const
Definition: VertexState.h:74
KinematicVertex::operator reco::Vertex ( )

Definition at line 112 of file KinematicVertex.cc.

References reco::TransientTrack::basicTransientTrack(), chiSquared(), BPhysicsValidation_cfi::daughters, degreesOfFreedom(), VertexState::error(), mps_fire::i, TransientTrackKinematicParticle::initialTransientTrack(), edm::Ref< C, T, F >::isNonnull(), GlobalErrorBase< T, ErrorWeightType >::matrix(), reco::TrackTransientTrack::persistentTrackRef(), reco::GsfTransientTrack::persistentTrackRef(), VertexState::position(), KinematicParticle::refittedTransientTrack(), theState, reco::TransientTrack::track(), and vertexIsValid().

113 {
114  //If the vertex is invalid, return an invalid TV !
115  if (!vertexIsValid() || tree==0) return reco::Vertex();
116 
117 //accessing the tree components, move pointer to top
118  if (!tree->findDecayVertex(this)) return reco::Vertex();
119  std::vector<RefCountedKinematicParticle> daughters = tree->daughterParticles();
120 
122 // RecoVertex::convertError(theVertexState.error()),
123  theState.error().matrix(),
124  chiSquared(), degreesOfFreedom(), daughters.size() );
125 
126  for (std::vector<RefCountedKinematicParticle>::const_iterator i = daughters.begin();
127  i != daughters.end(); ++i) {
128 
129  const TransientTrackKinematicParticle * ttkp = dynamic_cast<const TransientTrackKinematicParticle * >(&(**i));
130  if(ttkp != 0) {
132  if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull())) {
134  vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.);
135  } else {
136  const reco::GsfTransientTrack * ttt = dynamic_cast<const reco::GsfTransientTrack*>(ttkp->initialTransientTrack()->basicTransientTrack());
137  if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull())) {
139  vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.);
140  }
141  }
142  }
143  }
144  return vertex;
145 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
const reco::TransientTrack * initialTransientTrack() const
float degreesOfFreedom() const
bool vertexIsValid() const
const AlgebraicSymMatrix33 matrix() const
GlobalPoint position() const
Definition: VertexState.h:69
TrackRef persistentTrackRef() const
VertexState theState
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
const BasicTransientTrack * basicTransientTrack() const
const Track & track() const
float chiSquared() const
reco::TransientTrack refittedTransientTrack() const
GlobalError error() const
Definition: VertexState.h:74
Definition: tree.py:1
GsfTrackRef persistentTrackRef() const
bool KinematicVertex::operator< ( const KinematicVertex other) const

comparison by adress operator Has NO physical meaning To be used inside the graph only

Definition at line 71 of file KinematicVertex.cc.

72 {
73  bool res = false;
74  if(this < &other) res=true;
75  return res;
76 }
Definition: Electron.h:4
bool KinematicVertex::operator== ( const KinematicVertex other) const

Comparison by contents operator is true if position AND covariance match

Definition at line 45 of file KinematicVertex.cc.

References error(), GlobalErrorBase< T, ErrorWeightType >::matrix(), position(), vertexIsValid(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

46 {
47  bool res = false;
48  if(vertexIsValid()&& other.vertexIsValid())
49  {
50  GlobalPoint cPos = this->position();
51  GlobalPoint oPos = other.position();
52  AlgebraicMatrix33 const & cCov = this->error().matrix();
53  AlgebraicMatrix33 const & oCov = other.error().matrix();
54  if((cPos.x()==oPos.x())&&(cPos.y()==oPos.y())&&(cPos.z()==oPos.z())
55  &&(cCov==oCov))
56  res = true;
57  }else if(!(vertexIsValid()) && !(other.vertexIsValid())){
58  if(this == &other) res = true;
59  }
60  return res;
61 }
bool vertexIsValid() const
const AlgebraicSymMatrix33 matrix() const
T y() const
Definition: PV3DBase.h:63
GlobalPoint position() const
Definition: Electron.h:4
GlobalError error() const
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
bool KinematicVertex::operator== ( const ReferenceCountingPointer< KinematicVertex other) const

Definition at line 63 of file KinematicVertex.cc.

64 {
65  bool res = false;
66  if(*this == *other) res = true;
67  return res;
68 }
Definition: Electron.h:4
GlobalPoint KinematicVertex::position ( ) const

Definition at line 84 of file KinematicVertex.cc.

References VertexState::position(), and theState.

Referenced by operator==().

85 {
86  return theState.position();
87 }
GlobalPoint position() const
Definition: VertexState.h:69
VertexState theState
void KinematicVertex::setTreePointer ( KinematicTree tr) const
private

Definition at line 103 of file KinematicVertex.cc.

104 { tree = tr;}
Definition: tree.py:1
ReferenceCountingPointer< KinematicVertex > KinematicVertex::vertexBeforeConstraint ( ) const

Previous (before constraint) state of the vertex

Definition at line 106 of file KinematicVertex.cc.

References pVertex.

107 {return pVertex;}
ReferenceCountingPointer< KinematicVertex > pVertex
bool KinematicVertex::vertexIsValid ( ) const

Access methods Checking the validity of the vertex Example: production vertex for the first decayed particle or decay vertices of final state particles can be invalid since we don't know them.

Definition at line 78 of file KinematicVertex.cc.

References vl.

Referenced by operator reco::Vertex(), and operator==().

79 {return vl;}
VertexState KinematicVertex::vertexState ( ) const

Definition at line 109 of file KinematicVertex.cc.

References theState.

110 {return theState;}
VertexState theState

Friends And Related Function Documentation

friend class KinematicTree
friend

Definition at line 25 of file KinematicVertex.h.

Member Data Documentation

ReferenceCountingPointer<KinematicVertex> KinematicVertex::pVertex
mutableprivate

Definition at line 124 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexBeforeConstraint().

float KinematicVertex::theChiSquared
private

Definition at line 122 of file KinematicVertex.h.

Referenced by chiSquared(), and KinematicVertex().

float KinematicVertex::theNDF
private

Definition at line 123 of file KinematicVertex.h.

Referenced by degreesOfFreedom(), and KinematicVertex().

VertexState KinematicVertex::theState
private
KinematicTree* KinematicVertex::tree
mutableprivate
bool KinematicVertex::vl
mutableprivate

Definition at line 117 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexIsValid().