CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes | Friends
TrackingVertex Class Reference

#include <TrackingVertex.h>

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 ()
 
 TrackingVertex (const LorentzVector &position, const bool inVolume, const EncodedEventId e=EncodedEventId(0))
 

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

Definition at line 22 of file TrackingVertex.h.

Member Typedef Documentation

◆ g4v_iterator

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

Definition at line 30 of file TrackingVertex.h.

◆ genv_iterator

Definition at line 29 of file TrackingVertex.h.

◆ GenVertexRef

Definition at line 27 of file TrackingVertex.h.

◆ GenVertexRefVector

Definition at line 26 of file TrackingVertex.h.

◆ LorentzVector

Definition at line 28 of file TrackingVertex.h.

◆ tp_iterator

Definition at line 31 of file TrackingVertex.h.

Constructor & Destructor Documentation

◆ TrackingVertex() [1/2]

TrackingVertex::TrackingVertex ( )

Definition at line 10 of file TrackingVertex.cc.

10  : position_(LorentzVector(0, 0, 0, 0)), eId_(0) {
11  // daughterTracks_.clear();
12 }

◆ TrackingVertex() [2/2]

TrackingVertex::TrackingVertex ( const LorentzVector position,
const bool  inVolume,
const EncodedEventId  e = EncodedEventId(0) 
)

Definition at line 14 of file TrackingVertex.cc.

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

Member Function Documentation

◆ addDaughterTrack()

void TrackingVertex::addDaughterTrack ( const TrackingParticleRef ref)

Definition at line 27 of file TrackingVertex.cc.

27 { daughterTracks_.push_back(ref); }

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

◆ addG4Vertex()

void TrackingVertex::addG4Vertex ( const SimVertex v)

Definition at line 21 of file TrackingVertex.cc.

21 { g4Vertices_.push_back(v); }

References g4Vertices_, and findQualityFiles::v.

◆ addGenVertex()

void TrackingVertex::addGenVertex ( const GenVertexRef ref)

Definition at line 23 of file TrackingVertex.cc.

23 { genVertices_.push_back(ref); }

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

◆ addParentTrack()

void TrackingVertex::addParentTrack ( const TrackingParticleRef ref)

Definition at line 29 of file TrackingVertex.cc.

29 { sourceTracks_.push_back(ref); }

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

◆ clearDaughterTracks()

void TrackingVertex::clearDaughterTracks ( )

Definition at line 31 of file TrackingVertex.cc.

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

◆ clearParentTracks()

void TrackingVertex::clearParentTracks ( )

Definition at line 33 of file TrackingVertex.cc.

33 { sourceTracks_.clear(); }

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

◆ daughterTracks()

const TrackingParticleRefVector & TrackingVertex::daughterTracks ( ) const

Definition at line 52 of file TrackingVertex.cc.

52 { return daughterTracks_; }

References daughterTracks_.

Referenced by VertexFitterResult::fill().

◆ daughterTracks_begin()

TrackingVertex::tp_iterator TrackingVertex::daughterTracks_begin ( ) const

◆ daughterTracks_end()

TrackingVertex::tp_iterator TrackingVertex::daughterTracks_end ( ) const

◆ eventId()

const EncodedEventId& TrackingVertex::eventId ( ) const
inline

Definition at line 72 of file TrackingVertex.h.

72 { return eId_; };

References eId_.

Referenced by ntupleDataFormat.Event::eventIdStr(), and MultiTrackValidator::getRecoPVPosition().

◆ g4Vertices()

const std::vector< SimVertex > & TrackingVertex::g4Vertices ( ) const

Definition at line 49 of file TrackingVertex.cc.

49 { return g4Vertices_; }

References g4Vertices_.

◆ g4Vertices_begin()

TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_begin ( ) const

Definition at line 39 of file TrackingVertex.cc.

39 { return g4Vertices_.begin(); }

References g4Vertices_.

◆ g4Vertices_end()

TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_end ( ) const

Definition at line 40 of file TrackingVertex.cc.

40 { return g4Vertices_.end(); }

References g4Vertices_.

◆ genVertices()

const GenVertexRefVector & TrackingVertex::genVertices ( ) const

Definition at line 50 of file TrackingVertex.cc.

50 { return genVertices_; }

References genVertices_.

◆ genVertices_begin()

TrackingVertex::genv_iterator TrackingVertex::genVertices_begin ( ) const

Definition at line 37 of file TrackingVertex.cc.

37 { return genVertices_.begin(); }

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

◆ genVertices_end()

TrackingVertex::genv_iterator TrackingVertex::genVertices_end ( ) const

Definition at line 38 of file TrackingVertex.cc.

38 { return genVertices_.end(); }

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

◆ inVolume()

const bool TrackingVertex::inVolume ( ) const
inline

Definition at line 73 of file TrackingVertex.h.

73 { return inVolume_; };

◆ nDaughterTracks()

unsigned int TrackingVertex::nDaughterTracks ( ) const
inline

Definition at line 53 of file TrackingVertex.h.

53 { return daughterTracks_.size(); };

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

◆ nG4Vertices()

unsigned int TrackingVertex::nG4Vertices ( ) const
inline

Definition at line 51 of file TrackingVertex.h.

51 { return g4Vertices_.size(); };

References g4Vertices_.

◆ nGenVertices()

unsigned int TrackingVertex::nGenVertices ( ) const
inline

Definition at line 52 of file TrackingVertex.h.

52 { return genVertices_.size(); };

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

◆ nSourceTracks()

unsigned int TrackingVertex::nSourceTracks ( ) const
inline

Definition at line 54 of file TrackingVertex.h.

54 { return sourceTracks_.size(); };

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

◆ position()

const LorentzVector& TrackingVertex::position ( ) const
inline

◆ setEventId()

void TrackingVertex::setEventId ( EncodedEventId  e)
inline

Definition at line 38 of file TrackingVertex.h.

38 { eId_ = e; };

References MillePedeFileConverter_cfg::e, and eId_.

◆ sourceTracks()

const TrackingParticleRefVector & TrackingVertex::sourceTracks ( ) const

Definition at line 51 of file TrackingVertex.cc.

51 { return sourceTracks_; }

References sourceTracks_.

◆ sourceTracks_begin()

TrackingVertex::tp_iterator TrackingVertex::sourceTracks_begin ( ) const

Definition at line 44 of file TrackingVertex.cc.

44 { return sourceTracks_.begin(); }

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

◆ sourceTracks_end()

TrackingVertex::tp_iterator TrackingVertex::sourceTracks_end ( ) const

Definition at line 45 of file TrackingVertex.cc.

45 { return sourceTracks_.end(); }

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

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 54 of file TrackingVertex.cc.

54  {
55  using std::endl;
57  typedef std::vector<SimVertex>::const_iterator g4v_iterator;
59  typedef std::vector<SimTrack>::const_iterator g4t_iterator;
60 
61  s << "Vertex Position & Event #" << v.position() << " " << v.eventId().bunchCrossing() << "." << v.eventId().event()
62  << endl;
63  s << " Associated with " << v.daughterTracks().size() << " tracks" << endl;
64  for (genv_iterator genV = v.genVertices_begin(); genV != v.genVertices_end(); ++genV) {
65  s << " HepMC vertex position " << (*(*genV)).position().x() << "," << (*(*genV)).position().y()
66  << (*(*genV)).position().z() << endl;
67  }
68 
69  for (g4v_iterator g4V = v.g4Vertices_begin(); g4V != v.g4Vertices_end(); ++g4V) {
70  s << " Geant vertex position " << (*g4V).position() << endl;
71  // Probably empty all the time, currently
72  }
73 
74  // Loop over daughter track(s)
75  for (tp_iterator iTP = v.daughterTracks_begin(); iTP != v.daughterTracks_end(); ++iTP) {
76  s << " Daughter starts: " << (*(*iTP)).vertex();
77  for (g4t_iterator g4T = (*(*iTP)).g4Track_begin(); g4T != (*(*iTP)).g4Track_end(); ++g4T) {
78  s << " p " << g4T->momentum();
79  }
80  s << endl;
81  }
82 
83  // Loop over source track(s) (can be multiple since vertices are collapsed)
84  for (tp_iterator iTP = v.sourceTracks_begin(); iTP != v.sourceTracks_end(); ++iTP) {
85  s << " Source starts: " << (*(*iTP)).vertex();
86  for (g4t_iterator g4T = (*iTP)->g4Track_begin(); g4T != (*iTP)->g4Track_end(); ++g4T) {
87  s << ", p " << g4T->momentum();
88  }
89  s << endl;
90  }
91  return s;
92 }

Member Data Documentation

◆ daughterTracks_

TrackingParticleRefVector TrackingVertex::daughterTracks_
private

◆ eId_

EncodedEventId TrackingVertex::eId_
private

Definition at line 78 of file TrackingVertex.h.

Referenced by eventId(), and setEventId().

◆ g4Vertices_

std::vector<SimVertex> TrackingVertex::g4Vertices_
private

◆ genVertices_

GenVertexRefVector TrackingVertex::genVertices_
private

◆ inVolume_

bool TrackingVertex::inVolume_
private

Definition at line 77 of file TrackingVertex.h.

◆ position_

LorentzVector TrackingVertex::position_
private

Definition at line 73 of file TrackingVertex.h.

Referenced by position().

◆ sourceTracks_

TrackingParticleRefVector TrackingVertex::sourceTracks_
private
edm::RefVector::clear
void clear()
Clear the vector.
Definition: RefVector.h:142
g4t_iterator
TrackingParticle::g4t_iterator g4t_iterator
Definition: TrackingTruthValid.cc:24
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackingVertex::g4v_iterator
std::vector< SimVertex >::const_iterator g4v_iterator
Definition: TrackingVertex.h:30
edm::RefVector::begin
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
TrackingVertex::position
const LorentzVector & position() const
Definition: TrackingVertex.h:71
g4v_iterator
TrackingVertex::g4v_iterator g4v_iterator
Definition: TrackingTruthValid.cc:27
TrackingVertex::tp_iterator
TrackingParticleRefVector::iterator tp_iterator
Definition: TrackingVertex.h:31
findQualityFiles.v
v
Definition: findQualityFiles.py:179
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::RefVector::end
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
TrackingVertex::daughterTracks_
TrackingParticleRefVector daughterTracks_
Definition: TrackingVertex.h:84
TrackingVertex::inVolume_
bool inVolume_
Definition: TrackingVertex.h:77
TrackingVertex::position_
LorentzVector position_
Definition: TrackingVertex.h:73
TrackingVertex::inVolume
const bool inVolume() const
Definition: TrackingVertex.h:73
TrackingVertex::sourceTracks_
TrackingParticleRefVector sourceTracks_
Definition: TrackingVertex.h:85
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
TrackingVertex::genVertices_
GenVertexRefVector genVertices_
Definition: TrackingVertex.h:83
TrackingVertex::eId_
EncodedEventId eId_
Definition: TrackingVertex.h:78
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
TrackingVertex::genv_iterator
GenVertexRefVector::iterator genv_iterator
Definition: TrackingVertex.h:29
edm::RefVectorIterator
Definition: EDProductfwd.h:33
TrackingVertex::g4Vertices_
std::vector< SimVertex > g4Vertices_
Definition: TrackingVertex.h:82
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
TrackingVertex::LorentzVector
math::XYZTLorentzVectorD LorentzVector
Definition: TrackingVertex.h:28
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37