CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes | Friends

TrackingVertex Class Reference

#include <TrackingVertex.h>

List of all members.

Public Types

typedef std::vector< SimVertex >
::const_iterator 
g4v_iterator
typedef
GenVertexRefVector::iterator 
genv_iterator
typedef edm::Ref
< edm::HepMCProduct,
HepMC::GenVertex > 
GenVertexRef
typedef edm::RefVector
< edm::HepMCProduct,
HepMC::GenVertex > 
GenVertexRefVector
typedef math::XYZTLorentzVectorD LorentzVector
typedef
TrackingParticleRefVector::iterator 
tp_iterator

Public Member Functions

void addDaughterTrack (const TrackingParticleRef &)
void addG4Vertex (const SimVertex &)
void addGenVertex (const GenVertexRef &)
void addParentTrack (const TrackingParticleRef &)
void clearDaughterTracks ()
void clearParentTracks ()
const TrackingParticleRefVectordaughterTracks () const
tp_iterator daughterTracks_begin () const
tp_iterator daughterTracks_end () const
const EncodedEventIdeventId () const
const std::vector< SimVertex > & g4Vertices () const
g4v_iterator g4Vertices_begin () const
g4v_iterator g4Vertices_end () const
const GenVertexRefVectorgenVertices () const
genv_iterator genVertices_begin () const
genv_iterator genVertices_end () const
const bool inVolume () const
unsigned int nDaughterTracks () const
unsigned int nG4Vertices () const
unsigned int nGenVertices () const
unsigned int nSourceTracks () const
const LorentzVectorposition () const
void setEventId (EncodedEventId e)
const TrackingParticleRefVectorsourceTracks () const
tp_iterator sourceTracks_begin () const
tp_iterator sourceTracks_end () const
 TrackingVertex (const LorentzVector &position, const bool inVolume, const EncodedEventId e=EncodedEventId(0))
 TrackingVertex ()

Private Attributes

TrackingParticleRefVector daughterTracks_
EncodedEventId eId_
std::vector< SimVertexg4Vertices_
GenVertexRefVector genVertices_
bool inVolume_
LorentzVector position_
TrackingParticleRefVector sourceTracks_

Friends

std::ostream & operator<< (std::ostream &s, const TrackingVertex &tv)

Detailed Description

A simulated Vertex with links to TrackingParticles for analysis of track and vertex reconstruction

Version:
Id:
TrackingVertex.h,v 1.26 2008/12/11 23:03:08 bazterra Exp

Definition at line 23 of file TrackingVertex.h.


Member Typedef Documentation

typedef std::vector<SimVertex>::const_iterator TrackingVertex::g4v_iterator

Definition at line 34 of file TrackingVertex.h.

Definition at line 33 of file TrackingVertex.h.

Definition at line 31 of file TrackingVertex.h.

Definition at line 30 of file TrackingVertex.h.

Definition at line 32 of file TrackingVertex.h.

Definition at line 35 of file TrackingVertex.h.


Constructor & Destructor Documentation

TrackingVertex::TrackingVertex ( )

Definition at line 9 of file TrackingVertex.cc.

                               : position_(LorentzVector(0,0,0,0)), eId_(0)
{
//  daughterTracks_.clear();
}
TrackingVertex::TrackingVertex ( const LorentzVector position,
const bool  inVolume,
const EncodedEventId  e = EncodedEventId(0) 
)

Definition at line 14 of file TrackingVertex.cc.

                                                                                                    :
        position_(p), inVolume_(inVolume), eId_(eId)
{
//  daughterTracks_.clear();
}

Member Function Documentation

void TrackingVertex::addDaughterTrack ( const TrackingParticleRef ref)
void TrackingVertex::addG4Vertex ( const SimVertex v)

Definition at line 22 of file TrackingVertex.cc.

References g4Vertices_.

Referenced by TrackingTruthProducer::setTrackingVertex().

{
    g4Vertices_.push_back(v);
}
void TrackingVertex::addGenVertex ( const GenVertexRef ref)
void TrackingVertex::addParentTrack ( const TrackingParticleRef ref)
void TrackingVertex::clearDaughterTracks ( )
void TrackingVertex::clearParentTracks ( )
const TrackingParticleRefVector & TrackingVertex::daughterTracks ( ) const

Definition at line 105 of file TrackingVertex.cc.

References daughterTracks_.

Referenced by VertexFitterResult::fill(), and operator<<().

{
    return  daughterTracks_;
}
TrackingVertex::tp_iterator TrackingVertex::daughterTracks_begin ( ) const
TrackingVertex::tp_iterator TrackingVertex::daughterTracks_end ( ) const
const EncodedEventId& TrackingVertex::eventId ( ) const [inline]

Definition at line 95 of file TrackingVertex.h.

References eId_.

Referenced by TrackingTruthProducer::addCloseGenVertexes(), PrimaryVertexAnalyzer4PU::getSimEvents(), and operator<<().

    {
        return eId_;
    };
const std::vector< SimVertex > & TrackingVertex::g4Vertices ( ) const

Definition at line 93 of file TrackingVertex.cc.

References g4Vertices_.

{
    return  g4Vertices_;
}
TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_begin ( ) const

Definition at line 65 of file TrackingVertex.cc.

References g4Vertices_.

Referenced by operator<<().

{
    return  g4Vertices_.begin();
}
TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_end ( ) const

Definition at line 69 of file TrackingVertex.cc.

References g4Vertices_.

Referenced by operator<<().

{
    return  g4Vertices_.end();
}
const GenVertexRefVector & TrackingVertex::genVertices ( ) const

Definition at line 97 of file TrackingVertex.cc.

References genVertices_.

{
    return  genVertices_;
}
TrackingVertex::genv_iterator TrackingVertex::genVertices_begin ( ) const

Definition at line 57 of file TrackingVertex.cc.

References edm::RefVector< C, T, F >::begin(), and genVertices_.

Referenced by operator<<().

{
    return genVertices_.begin();
}
TrackingVertex::genv_iterator TrackingVertex::genVertices_end ( ) const

Definition at line 61 of file TrackingVertex.cc.

References edm::RefVector< C, T, F >::end(), and genVertices_.

Referenced by operator<<().

{
    return genVertices_.end();
}
const bool TrackingVertex::inVolume ( ) const [inline]

Definition at line 99 of file TrackingVertex.h.

References inVolume_.

    {
        return inVolume_;
    };
unsigned int TrackingVertex::nDaughterTracks ( ) const [inline]

Definition at line 67 of file TrackingVertex.h.

References daughterTracks_, and edm::RefVector< C, T, F >::size().

    {
        return daughterTracks_.size();
    };
unsigned int TrackingVertex::nG4Vertices ( ) const [inline]

Definition at line 59 of file TrackingVertex.h.

References g4Vertices_.

    {
        return     g4Vertices_.size();
    };
unsigned int TrackingVertex::nGenVertices ( ) const [inline]

Definition at line 63 of file TrackingVertex.h.

References genVertices_, and edm::RefVector< C, T, F >::size().

    {
        return    genVertices_.size();
    };
unsigned int TrackingVertex::nSourceTracks ( ) const [inline]

Definition at line 71 of file TrackingVertex.h.

References edm::RefVector< C, T, F >::size(), and sourceTracks_.

    {
        return   sourceTracks_.size();
    };
const LorentzVector& TrackingVertex::position ( void  ) const [inline]
void TrackingVertex::setEventId ( EncodedEventId  e) [inline]

Definition at line 43 of file TrackingVertex.h.

References alignCSCRings::e, and eId_.

    {
        eId_=e;
    };
const TrackingParticleRefVector & TrackingVertex::sourceTracks ( ) const
TrackingVertex::tp_iterator TrackingVertex::sourceTracks_begin ( ) const

Definition at line 82 of file TrackingVertex.cc.

References edm::RefVector< C, T, F >::begin(), and sourceTracks_.

Referenced by operator<<().

{
    return sourceTracks_.begin();
}
TrackingVertex::tp_iterator TrackingVertex::sourceTracks_end ( ) const

Definition at line 86 of file TrackingVertex.cc.

References edm::RefVector< C, T, F >::end(), and sourceTracks_.

Referenced by operator<<().

{
    return sourceTracks_.end();
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const TrackingVertex tv 
) [friend]

Definition at line 110 of file TrackingVertex.cc.

{

    using std::endl;
    typedef        GenVertexRefVector::iterator                  genv_iterator;
    typedef    std::vector<SimVertex>::const_iterator            g4v_iterator;
    typedef TrackingParticleRefVector::iterator                  tp_iterator;
    typedef       std::vector<SimTrack>::const_iterator             g4t_iterator;

    s << "Vertex Position & Event #" << v.position() << " " << v.eventId().bunchCrossing() << "." << v.eventId().event() << endl;
    s << " Associated with " << v.daughterTracks().size() << " tracks" << endl;
    for (genv_iterator genV = v.genVertices_begin(); genV != v.genVertices_end(); ++genV)
    {
        s << " HepMC vertex position " << (*(*genV)).position().x() << ","<< (*(*genV)).position().y() << (*(*genV)).position().z()  << endl;
    }

    for (g4v_iterator g4V = v.g4Vertices_begin(); g4V != v.g4Vertices_end(); ++g4V)
    {
        s << " Geant vertex position " << (*g4V).position() << endl;
        // Probably empty all the time, currently
    }

    // Loop over daughter track(s)
    for (tp_iterator iTP = v.daughterTracks_begin(); iTP != v.daughterTracks_end(); ++iTP)
    {
        s << " Daughter starts:      " << (*(*iTP)).vertex();
        for (g4t_iterator g4T  = (*(*iTP)).g4Track_begin(); g4T != (*(*iTP)).g4Track_end(); ++g4T)
        {
            s << " p " << g4T->momentum();
        }
        s << endl;
    }

    // Loop over source track(s) (can be multiple since vertices are collapsed)
    for (tp_iterator iTP = v.sourceTracks_begin(); iTP != v.sourceTracks_end(); ++iTP)
    {
        s << " Source   starts: " << (*(*iTP)).vertex();
        for (g4t_iterator g4T  = (*iTP)->g4Track_begin(); g4T != (*iTP)->g4Track_end(); ++g4T)
        {
            s << ", p " <<  g4T ->momentum();
        }
        s << endl;
    }
    return s;
}

Member Data Documentation

Definition at line 108 of file TrackingVertex.h.

Referenced by eventId(), and setEventId().

std::vector<SimVertex> TrackingVertex::g4Vertices_ [private]
bool TrackingVertex::inVolume_ [private]

Definition at line 107 of file TrackingVertex.h.

Referenced by inVolume().

Definition at line 102 of file TrackingVertex.h.

Referenced by position().