#include <KinematicVertex.h>
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.
KinematicVertex::KinematicVertex | ( | ) |
Empty default constructor for invalid vertices
Definition at line 8 of file KinematicVertex.cc.
References vl.
{vl = false;}
KinematicVertex::KinematicVertex | ( | const VertexState | state, |
float | totalChiSq, | ||
float | degreesOfFr | ||
) |
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.
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.
{ // theVertexPosition = vertex.position(); // theVPositionError = vertex.error(); vl = true; theState = VertexState(vertex.position(), vertex.error()); theChiSquared = vertex.totalChiSquared(); theNDF = vertex.degreesOfFreedom(); tree = 0; pVertex = 0; }
KinematicVertex::~KinematicVertex | ( | ) | [virtual] |
Definition at line 81 of file KinematicVertex.cc.
{}
float KinematicVertex::chiSquared | ( | ) | const |
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.
{return tree;}
float KinematicVertex::degreesOfFreedom | ( | ) | const |
GlobalError KinematicVertex::error | ( | ) | const |
Definition at line 89 of file KinematicVertex.cc.
References VertexState::error(), and theState.
Referenced by operator==().
KinematicVertex::operator reco::Vertex | ( | ) |
Definition at line 112 of file KinematicVertex.cc.
References reco::TransientTrack::basicTransientTrack(), i, TransientTrackKinematicParticle::initialTransientTrack(), reco::TrackTransientTrack::persistentTrackRef(), reco::GsfTransientTrack::persistentTrackRef(), KinematicParticle::refittedTransientTrack(), reco::TransientTrack::track(), and diffTreeTool::tree.
{ //If the vertex is invalid, return an invalid TV ! if (!vertexIsValid() || tree==0) return reco::Vertex(); //accessing the tree components, move pointer to top if (!tree->findDecayVertex(this)) return reco::Vertex(); std::vector<RefCountedKinematicParticle> daughters = tree->daughterParticles(); reco::Vertex vertex(reco::Vertex::Point(theState.position()), // RecoVertex::convertError(theVertexState.error()), theState.error().matrix_new(), chiSquared(), degreesOfFreedom(), daughters.size() ); for (std::vector<RefCountedKinematicParticle>::const_iterator i = daughters.begin(); i != daughters.end(); ++i) { const TransientTrackKinematicParticle * ttkp = dynamic_cast<const TransientTrackKinematicParticle * >(&(**i)); if(ttkp != 0) { const reco::TrackTransientTrack * ttt = dynamic_cast<const reco::TrackTransientTrack*>(ttkp->initialTransientTrack()->basicTransientTrack()); if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull())) { reco::TrackRef tr = ttt->persistentTrackRef(); vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.); } else { const reco::GsfTransientTrack * ttt = dynamic_cast<const reco::GsfTransientTrack*>(ttkp->initialTransientTrack()->basicTransientTrack()); if ((ttt!=0) && (ttt->persistentTrackRef().isNonnull())) { reco::GsfTrackRef tr = ttt->persistentTrackRef(); vertex.add(reco::TrackBaseRef(tr), ttkp->refittedTransientTrack().track(), 1.); } } } } return vertex; }
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.
{ bool res = false; if(this < &other) res=true; return res; }
bool KinematicVertex::operator== | ( | const ReferenceCountingPointer< KinematicVertex > | other | ) | const |
Definition at line 63 of file KinematicVertex.cc.
{ bool res = false; if(*this == *other) res = true; return res; }
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().
{ bool res = false; if(vertexIsValid()&& other.vertexIsValid()) { GlobalPoint cPos = this->position(); GlobalPoint oPos = other.position(); AlgebraicMatrix33 const & cCov = this->error().matrix(); AlgebraicMatrix33 const & oCov = other.error().matrix(); if((cPos.x()==oPos.x())&&(cPos.y()==oPos.y())&&(cPos.z()==oPos.z()) &&(cCov==oCov)) res = true; }else if(!(vertexIsValid()) && !(other.vertexIsValid())){ if(this == &other) res = true; } return res; }
GlobalPoint KinematicVertex::position | ( | void | ) | const |
Definition at line 84 of file KinematicVertex.cc.
References VertexState::position(), and theState.
Referenced by operator==().
void KinematicVertex::setTreePointer | ( | KinematicTree * | tr | ) | const [private] |
ReferenceCountingPointer< KinematicVertex > KinematicVertex::vertexBeforeConstraint | ( | ) | const |
Previous (before constraint) state of the vertex
Definition at line 106 of file KinematicVertex.cc.
References pVertex.
{return 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==().
{return vl;}
VertexState KinematicVertex::vertexState | ( | ) | const |
friend class KinematicTree [friend] |
Definition at line 25 of file KinematicVertex.h.
ReferenceCountingPointer<KinematicVertex> KinematicVertex::pVertex [mutable, private] |
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] |
Definition at line 119 of file KinematicVertex.h.
Referenced by error(), KinematicVertex(), position(), and vertexState().
KinematicTree* KinematicVertex::tree [mutable, private] |
Definition at line 116 of file KinematicVertex.h.
Referenced by correspondingTree(), KinematicVertex(), and setTreePointer().
bool KinematicVertex::vl [mutable, private] |
Definition at line 117 of file KinematicVertex.h.
Referenced by KinematicVertex(), and vertexIsValid().