CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

KinematicVertex Class Reference

#include <KinematicVertex.h>

Inheritance diagram for KinematicVertex:
ReferenceCounted

List of all members.

Public Member Functions

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

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

{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, tree, and vl.

                                                                               :
                  theState(state),theChiSquared(totalChiSq),theNDF(degreesOfFr)                
                                                                   
{
 vl = true;
 tree = 0;
 pVertex = 0;
}
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 tree, and vl.

                                                                        :
                                    theState(state) ,
                                    theChiSquared(totalChiSq),theNDF(degreesOfFr) , pVertex(prVertex)
{
 vl = true;
 tree = 0;
}
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.

{}

Member Function Documentation

float KinematicVertex::chiSquared ( ) const

Definition at line 94 of file KinematicVertex.cc.

References theChiSquared.

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

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

Definition at line 97 of file KinematicVertex.cc.

References theNDF.

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

Definition at line 89 of file KinematicVertex.cc.

References VertexState::error(), and theState.

Referenced by operator==().

{
 return theState.error();
}
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();
  AlgebraicMatrix cCov = this->error().matrix();
  AlgebraicMatrix 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==().

{
 return theState.position(); 
}
void KinematicVertex::setTreePointer ( KinematicTree tr) const [private]

Definition at line 103 of file KinematicVertex.cc.

References tree.

{ tree = tr;}
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

Definition at line 109 of file KinematicVertex.cc.

References theState.

{return theState;}

Friends And Related Function Documentation

friend class KinematicTree [friend]

Definition at line 25 of file KinematicVertex.h.


Member Data Documentation

Definition at line 124 of file KinematicVertex.h.

Referenced by KinematicVertex(), and vertexBeforeConstraint().

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

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