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 CachingVertex< 6 > &vertex)
 
 KinematicVertex (const VertexState state, const ReferenceCountingPointer< KinematicVertex > prVertex, float totalChiSq, float degreesOfFr)
 
 KinematicVertex (const VertexState state, float totalChiSq, float degreesOfFr)
 
 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.

8 { vl = false; }

References vl.

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

11  : theState(state),
12  theChiSquared(totalChiSq),
13  theNDF(degreesOfFr)
14 
15 {
16  vl = true;
17  tree = nullptr;
18  pVertex = nullptr;
19 }

References pVertex, and vl.

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

36  : theState(state), theChiSquared(totalChiSq), theNDF(degreesOfFr), pVertex(prVertex) {
37  vl = true;
38  tree = nullptr;
39 }

References vl.

◆ KinematicVertex() [4/4]

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

Direct transformation from caching vertex

Definition at line 21 of file KinematicVertex.cc.

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 }

References pVertex, theChiSquared, theNDF, theState, bphysicsOniaDQM_cfi::vertex, and vl.

◆ ~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.

79 { return theChiSquared; }

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

83 { return tree; }

References tree.

◆ degreesOfFreedom()

float KinematicVertex::degreesOfFreedom ( ) const

Definition at line 81 of file KinematicVertex.cc.

81 { return theNDF; }

References theNDF.

◆ error()

GlobalError KinematicVertex::error ( ) const

Definition at line 77 of file KinematicVertex.cc.

77 { return theState.error(); }

References VertexState::error(), and theState.

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

◆ operator reco::Vertex()

KinematicVertex::operator reco::Vertex ( )

Definition at line 91 of file KinematicVertex.cc.

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 =
112  dynamic_cast<const reco::TrackTransientTrack*>(ttkp->initialTransientTrack()->basicTransientTrack());
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 }

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.

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

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

References trackingPlots::other.

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

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 }

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

◆ operator==() [2/2]

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 }

References trackingPlots::other.

◆ position()

GlobalPoint KinematicVertex::position ( ) const

Definition at line 75 of file KinematicVertex.cc.

75 { return theState.position(); }

References VertexState::position(), and theState.

Referenced by operator==().

◆ setTreePointer()

void KinematicVertex::setTreePointer ( KinematicTree tr) const
private

Definition at line 85 of file KinematicVertex.cc.

85 { tree = tr; }

◆ vertexBeforeConstraint()

ReferenceCountingPointer< KinematicVertex > KinematicVertex::vertexBeforeConstraint ( ) const

Previous (before constraint) state of the vertex

Definition at line 87 of file KinematicVertex.cc.

87 { return pVertex; }

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

71 { return vl; }

References vl.

Referenced by operator==().

◆ vertexState()

VertexState KinematicVertex::vertexState ( ) const

Definition at line 89 of file KinematicVertex.cc.

89 { return theState; }

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

KinematicVertex::pVertex
ReferenceCountingPointer< KinematicVertex > pVertex
Definition: KinematicVertex.h:118
mps_fire.i
i
Definition: mps_fire.py:355
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
reco::GsfTransientTrack
Definition: GsfTransientTrack.h:18
KinematicVertex::vertexIsValid
bool vertexIsValid() const
Definition: KinematicVertex.cc:71
KinematicParticle::refittedTransientTrack
reco::TransientTrack refittedTransientTrack() const
Definition: KinematicParticle.cc:30
tree
Definition: tree.py:1
KinematicVertex::chiSquared
float chiSquared() const
Definition: KinematicVertex.cc:79
KinematicVertex::theChiSquared
float theChiSquared
Definition: KinematicVertex.h:116
GlobalErrorBase::matrix
const AlgebraicSymMatrix33 matrix() const
Definition: GlobalErrorBase.h:121
AlgebraicMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
Definition: AlgebraicROOTObjects.h:41
edm::Ref< TrackCollection >
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
reco::TransientTrack::basicTransientTrack
const BasicTransientTrack * basicTransientTrack() const
Definition: TransientTrack.h:112
KinematicVertex::theNDF
float theNDF
Definition: KinematicVertex.h:117
BPhysicsValidation_cfi.daughters
daughters
Definition: BPhysicsValidation_cfi.py:11
KinematicVertex::vl
bool vl
Definition: KinematicVertex.h:111
VertexState::error
GlobalError error() const
Definition: VertexState.h:64
trackingPlots.other
other
Definition: trackingPlots.py:1465
Point3DBase< float, GlobalTag >
KinematicVertex::degreesOfFreedom
float degreesOfFreedom() const
Definition: KinematicVertex.cc:81
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
KinematicVertex::position
GlobalPoint position() const
Definition: KinematicVertex.cc:75
KinematicVertex::tree
KinematicTree * tree
Definition: KinematicVertex.h:110
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
reco::GsfTransientTrack::persistentTrackRef
GsfTrackRef persistentTrackRef() const
Definition: GsfTransientTrack.h:92
KinematicVertex::theState
VertexState theState
Definition: KinematicVertex.h:113
res
Definition: Electron.h:6
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
reco::TransientTrack::track
const Track & track() const
Definition: TransientTrack.h:117
KinematicVertex::error
GlobalError error() const
Definition: KinematicVertex.cc:77
VertexState
Definition: VertexState.h:13
edm::RefToBase< reco::Track >
VertexState::position
GlobalPoint position() const
Definition: VertexState.h:62
TransientTrackKinematicParticle
Definition: TransientTrackKinematicParticle.h:17
reco::TrackTransientTrack
Definition: TrackTransientTrack.h:18
TransientTrackKinematicParticle::initialTransientTrack
const reco::TransientTrack * initialTransientTrack() const
Definition: TransientTrackKinematicParticle.cc:82
reco::Vertex
Definition: Vertex.h:35
reco::TrackTransientTrack::persistentTrackRef
TrackRef persistentTrackRef() const
Definition: TrackTransientTrack.h:80