CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< KinematicVertex
vertexBeforeConstraint () const
 
bool vertexIsValid () const
 
VertexState vertexState () const
 
 ~KinematicVertex () override
 

Private Member Functions

void setTreePointer (KinematicTree *tr) const
 

Private Attributes

ReferenceCountingPointer
< KinematicVertex
pVertex
 
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 20 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.

8 { 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 10 of file KinematicVertex.cc.

References pVertex, tree, and vl.

11  : theState(state),
12  theChiSquared(totalChiSq),
13  theNDF(degreesOfFr)
14 
15 {
16  vl = true;
17  tree = nullptr;
18  pVertex = nullptr;
19 }
VertexState theState
ReferenceCountingPointer< KinematicVertex > pVertex
KinematicTree * tree
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 32 of file KinematicVertex.cc.

References tree, and vl.

36  : theState(state), theChiSquared(totalChiSq), theNDF(degreesOfFr), pVertex(prVertex) {
37  vl = true;
38  tree = nullptr;
39 }
VertexState theState
ReferenceCountingPointer< KinematicVertex > pVertex
KinematicTree * tree
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(), tree, and vl.

21  {
22  // theVertexPosition = vertex.position();
23  // theVPositionError = vertex.error();
24  vl = true;
25  theState = VertexState(vertex.position(), vertex.error());
26  theChiSquared = vertex.totalChiSquared();
27  theNDF = vertex.degreesOfFreedom();
28  tree = nullptr;
29  pVertex = nullptr;
30 }
VertexState theState
float totalChiSquared() const
float degreesOfFreedom() const
ReferenceCountingPointer< KinematicVertex > pVertex
GlobalPoint position() const
KinematicTree * tree
GlobalError error() const
KinematicVertex::~KinematicVertex ( )
override

Definition at line 73 of file KinematicVertex.cc.

73 {}

Member Function Documentation

float KinematicVertex::chiSquared ( ) const

Definition at line 79 of file KinematicVertex.cc.

References theChiSquared.

79 { 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 83 of file KinematicVertex.cc.

References tree.

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

Definition at line 81 of file KinematicVertex.cc.

References theNDF.

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

Definition at line 77 of file KinematicVertex.cc.

References VertexState::error(), and theState.

Referenced by operator==().

77 { return theState.error(); }
VertexState theState
GlobalError error() const
Definition: VertexState.h:64
KinematicVertex::operator reco::Vertex ( )

Definition at line 91 of file KinematicVertex.cc.

References reco::TransientTrack::basicTransientTrack(), mps_fire::i, TransientTrackKinematicParticle::initialTransientTrack(), edm::Ref< C, T, F >::isNonnull(), reco::TrackTransientTrack::persistentTrackRef(), reco::GsfTransientTrack::persistentTrackRef(), KinematicParticle::refittedTransientTrack(), reco::TransientTrack::track(), and MainPageGenerator::tree.

91  {
92  //If the vertex is invalid, return an invalid TV !
93  if (!vertexIsValid() || tree == nullptr)
94  return reco::Vertex();
95 
96  //accessing the tree components, move pointer to top
97  if (!tree->findDecayVertex(this))
98  return reco::Vertex();
99  std::vector<RefCountedKinematicParticle> daughters = tree->daughterParticles();
100 
102  // RecoVertex::convertError(theVertexState.error()),
103  theState.error().matrix(),
104  chiSquared(),
106  daughters.size());
107 
108  for (std::vector<RefCountedKinematicParticle>::const_iterator i = daughters.begin(); i != daughters.end(); ++i) {
109  const TransientTrackKinematicParticle* ttkp = dynamic_cast<const TransientTrackKinematicParticle*>(&(**i));
110  if (ttkp != nullptr) {
111  const reco::TrackTransientTrack* ttt =
113  if ((ttt != nullptr) && (ttt->persistentTrackRef().isNonnull())) {
115  vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.);
116  } else {
117  const reco::GsfTransientTrack* ttt =
118  dynamic_cast<const reco::GsfTransientTrack*>(ttkp->initialTransientTrack()->basicTransientTrack());
119  if ((ttt != nullptr) && (ttt->persistentTrackRef().isNonnull())) {
121  vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.);
122  }
123  }
124  }
125  }
126  return vertex;
127 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const reco::TransientTrack * initialTransientTrack() const
float degreesOfFreedom() const
bool vertexIsValid() const
const AlgebraicSymMatrix33 matrix() const
GlobalPoint position() const
Definition: VertexState.h:62
bool findDecayVertex(const RefCountedKinematicVertex vert) const
TrackRef persistentTrackRef() const
VertexState theState
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
std::vector< RefCountedKinematicParticle > daughterParticles() const
const BasicTransientTrack * basicTransientTrack() const
const Track & track() const
float chiSquared() const
KinematicTree * tree
reco::TransientTrack refittedTransientTrack() const
GlobalError error() const
Definition: VertexState.h:64
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 64 of file KinematicVertex.cc.

64  {
65  bool res = false;
66  if (this < &other)
67  res = true;
68  return res;
69 }
bool KinematicVertex::operator== ( const KinematicVertex other) const

Comparison by contents operator is true if position AND covariance match

Definition at line 41 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().

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

Definition at line 57 of file KinematicVertex.cc.

57  {
58  bool res = false;
59  if (*this == *other)
60  res = true;
61  return res;
62 }
GlobalPoint KinematicVertex::position ( ) const

Definition at line 75 of file KinematicVertex.cc.

References VertexState::position(), and theState.

Referenced by operator==().

75 { return theState.position(); }
GlobalPoint position() const
Definition: VertexState.h:62
VertexState theState
void KinematicVertex::setTreePointer ( KinematicTree tr) const
private

Definition at line 85 of file KinematicVertex.cc.

References tree.

85 { tree = tr; }
KinematicTree * tree
ReferenceCountingPointer< KinematicVertex > KinematicVertex::vertexBeforeConstraint ( ) const

Previous (before constraint) state of the vertex

Definition at line 87 of file KinematicVertex.cc.

References pVertex.

87 { 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 71 of file KinematicVertex.cc.

References vl.

Referenced by operator==().

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

Definition at line 89 of file KinematicVertex.cc.

References theState.

89 { return theState; }
VertexState theState

Friends And Related Function Documentation

friend class KinematicTree
friend

Definition at line 22 of file KinematicVertex.h.

Member Data Documentation

ReferenceCountingPointer<KinematicVertex> KinematicVertex::pVertex
mutableprivate

Definition at line 118 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexBeforeConstraint().

float KinematicVertex::theChiSquared
private

Definition at line 116 of file KinematicVertex.h.

Referenced by chiSquared(), and KinematicVertex().

float KinematicVertex::theNDF
private

Definition at line 117 of file KinematicVertex.h.

Referenced by degreesOfFreedom(), and KinematicVertex().

VertexState KinematicVertex::theState
private

Definition at line 113 of file KinematicVertex.h.

Referenced by error(), KinematicVertex(), position(), and vertexState().

KinematicTree* KinematicVertex::tree
mutableprivate
bool KinematicVertex::vl
mutableprivate

Definition at line 111 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexIsValid().