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
 
 ~KinematicVertex () override
 

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 20 of file KinematicVertex.h.

Constructor & Destructor Documentation

◆ KinematicVertex() [1/4]

KinematicVertex::KinematicVertex ( )

Empty default constructor for invalid vertices

Definition at line 8 of file KinematicVertex.cc.

References vl.

8 { vl = false; }

◆ KinematicVertex() [2/4]

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, 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
Definition: tree.py:1

◆ KinematicVertex() [3/4]

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 vl.

36  : theState(state), theChiSquared(totalChiSq), theNDF(degreesOfFr), pVertex(prVertex) {
37  vl = true;
38  tree = nullptr;
39 }
VertexState theState
ReferenceCountingPointer< KinematicVertex > pVertex
Definition: tree.py:1

◆ KinematicVertex() [4/4]

KinematicVertex::KinematicVertex ( const CachingVertex< 6 > &  vertex)

Direct transformation from caching vertex

Definition at line 21 of file KinematicVertex.cc.

References pVertex, theChiSquared, theNDF, theState, bphysicsOniaDQM_cfi::vertex, 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
ReferenceCountingPointer< KinematicVertex > pVertex
Definition: tree.py:1

◆ ~KinematicVertex()

KinematicVertex::~KinematicVertex ( )
override

Definition at line 73 of file KinematicVertex.cc.

73 {}

Member Function Documentation

◆ chiSquared()

float KinematicVertex::chiSquared ( ) const

Definition at line 79 of file KinematicVertex.cc.

References theChiSquared.

79 { return theChiSquared; }

◆ correspondingTree()

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

◆ degreesOfFreedom()

float KinematicVertex::degreesOfFreedom ( ) const

Definition at line 81 of file KinematicVertex.cc.

References theNDF.

81 { return theNDF; }

◆ error()

GlobalError KinematicVertex::error ( ) const

Definition at line 77 of file KinematicVertex.cc.

References VertexState::error(), and theState.

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

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

◆ operator reco::Vertex()

KinematicVertex::operator reco::Vertex ( )

Definition at line 91 of file KinematicVertex.cc.

References reco::TransientTrack::basicTransientTrack(), BPhysicsValidation_cfi::daughters, mps_fire::i, TransientTrackKinematicParticle::initialTransientTrack(), edm::Ref< C, T, F >::isNonnull(), reco::TrackTransientTrack::persistentTrackRef(), reco::GsfTransientTrack::persistentTrackRef(), KinematicParticle::refittedTransientTrack(), reco::TransientTrack::track(), bphysicsOniaDQM_cfi::vertex, and HltBtagValidation_cff::Vertex.

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 }
const reco::TransientTrack * initialTransientTrack() const
float chiSquared() const
const Track & track() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:232
reco::TransientTrack refittedTransientTrack() const
VertexState theState
float degreesOfFreedom() const
GlobalError error() const
Definition: VertexState.h:64
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
const AlgebraicSymMatrix33 matrix() const
bool vertexIsValid() const
GsfTrackRef persistentTrackRef() const
TrackRef persistentTrackRef() const
Definition: tree.py:1
const BasicTransientTrack * basicTransientTrack() const
GlobalPoint position() const
Definition: VertexState.h:62

◆ operator<()

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.

References trackingPlots::other.

64  {
65  bool res = false;
66  if (this < &other)
67  res = true;
68  return res;
69 }
Definition: Electron.h:6

◆ operator==() [1/2]

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(), trackingPlots::other, 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
T z() const
Definition: PV3DBase.h:61
Definition: Electron.h:6
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const AlgebraicSymMatrix33 matrix() const
bool vertexIsValid() const
GlobalPoint position() const
GlobalError error() const

◆ operator==() [2/2]

bool KinematicVertex::operator== ( const ReferenceCountingPointer< KinematicVertex other) const

Definition at line 57 of file KinematicVertex.cc.

References trackingPlots::other.

57  {
58  bool res = false;
59  if (*this == *other)
60  res = true;
61  return res;
62 }
Definition: Electron.h:6

◆ position()

GlobalPoint KinematicVertex::position ( ) const

Definition at line 75 of file KinematicVertex.cc.

References VertexState::position(), and theState.

Referenced by operator==().

75 { return theState.position(); }
VertexState theState
GlobalPoint position() const
Definition: VertexState.h:62

◆ setTreePointer()

void KinematicVertex::setTreePointer ( KinematicTree tr) const
private

Definition at line 85 of file KinematicVertex.cc.

85 { tree = tr; }
Definition: tree.py:1

◆ vertexBeforeConstraint()

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

◆ vertexIsValid()

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

VertexState KinematicVertex::vertexState ( ) const

Definition at line 89 of file KinematicVertex.cc.

References theState.

89 { return theState; }
VertexState theState

Friends And Related Function Documentation

◆ KinematicTree

friend class KinematicTree
friend

Definition at line 22 of file KinematicVertex.h.

Member Data Documentation

◆ pVertex

ReferenceCountingPointer<KinematicVertex> KinematicVertex::pVertex
mutableprivate

Definition at line 118 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexBeforeConstraint().

◆ theChiSquared

float KinematicVertex::theChiSquared
private

Definition at line 116 of file KinematicVertex.h.

Referenced by chiSquared(), and KinematicVertex().

◆ theNDF

float KinematicVertex::theNDF
private

Definition at line 117 of file KinematicVertex.h.

Referenced by degreesOfFreedom(), and KinematicVertex().

◆ theState

VertexState KinematicVertex::theState
private

Definition at line 113 of file KinematicVertex.h.

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

◆ tree

KinematicTree* KinematicVertex::tree
mutableprivate

◆ vl

bool KinematicVertex::vl
mutableprivate

Definition at line 111 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexIsValid().