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 }
LorentzVector position_
EncodedEventId eId_
math::XYZTLorentzVectorD LorentzVector

◆ 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 }
LorentzVector position_
EncodedEventId eId_
const bool inVolume() const

Member Function Documentation

◆ addDaughterTrack()

void TrackingVertex::addDaughterTrack ( const TrackingParticleRef ref)

Definition at line 27 of file TrackingVertex.cc.

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

27 { daughterTracks_.push_back(ref); }
TrackingParticleRefVector daughterTracks_
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ addG4Vertex()

void TrackingVertex::addG4Vertex ( const SimVertex v)

Definition at line 21 of file TrackingVertex.cc.

References g4Vertices_, and findQualityFiles::v.

21 { g4Vertices_.push_back(v); }
std::vector< SimVertex > g4Vertices_

◆ addGenVertex()

void TrackingVertex::addGenVertex ( const GenVertexRef ref)

Definition at line 23 of file TrackingVertex.cc.

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

23 { genVertices_.push_back(ref); }
GenVertexRefVector genVertices_
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67

◆ addParentTrack()

void TrackingVertex::addParentTrack ( const TrackingParticleRef ref)

Definition at line 29 of file TrackingVertex.cc.

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

29 { sourceTracks_.push_back(ref); }
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
TrackingParticleRefVector sourceTracks_

◆ clearDaughterTracks()

void TrackingVertex::clearDaughterTracks ( )

Definition at line 31 of file TrackingVertex.cc.

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

TrackingParticleRefVector daughterTracks_
void clear()
Clear the vector.
Definition: RefVector.h:142

◆ clearParentTracks()

void TrackingVertex::clearParentTracks ( )

Definition at line 33 of file TrackingVertex.cc.

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

33 { sourceTracks_.clear(); }
void clear()
Clear the vector.
Definition: RefVector.h:142
TrackingParticleRefVector sourceTracks_

◆ daughterTracks()

const TrackingParticleRefVector & TrackingVertex::daughterTracks ( ) const

Definition at line 52 of file TrackingVertex.cc.

References daughterTracks_.

Referenced by VertexFitterResult::fill().

52 { return daughterTracks_; }
TrackingParticleRefVector daughterTracks_

◆ daughterTracks_begin()

TrackingVertex::tp_iterator TrackingVertex::daughterTracks_begin ( ) const

Definition at line 42 of file TrackingVertex.cc.

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

Referenced by calculateVertexSharedTracks(), and VertexFitterResult::fill().

42 { return daughterTracks_.begin(); }
TrackingParticleRefVector daughterTracks_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ daughterTracks_end()

TrackingVertex::tp_iterator TrackingVertex::daughterTracks_end ( ) const

Definition at line 43 of file TrackingVertex.cc.

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

Referenced by calculateVertexSharedTracks(), and VertexFitterResult::fill().

43 { return daughterTracks_.end(); }
TrackingParticleRefVector daughterTracks_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228

◆ eventId()

const EncodedEventId& TrackingVertex::eventId ( ) const
inline

Definition at line 72 of file TrackingVertex.h.

References eId_.

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

72 { return eId_; };
EncodedEventId eId_

◆ g4Vertices()

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

Definition at line 49 of file TrackingVertex.cc.

References g4Vertices_.

49 { return g4Vertices_; }
std::vector< SimVertex > g4Vertices_

◆ g4Vertices_begin()

TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_begin ( ) const

Definition at line 39 of file TrackingVertex.cc.

References g4Vertices_.

39 { return g4Vertices_.begin(); }
std::vector< SimVertex > g4Vertices_

◆ g4Vertices_end()

TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_end ( ) const

Definition at line 40 of file TrackingVertex.cc.

References g4Vertices_.

40 { return g4Vertices_.end(); }
std::vector< SimVertex > g4Vertices_

◆ genVertices()

const GenVertexRefVector & TrackingVertex::genVertices ( ) const

Definition at line 50 of file TrackingVertex.cc.

References genVertices_.

50 { return genVertices_; }
GenVertexRefVector genVertices_

◆ genVertices_begin()

TrackingVertex::genv_iterator TrackingVertex::genVertices_begin ( ) const

Definition at line 37 of file TrackingVertex.cc.

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

37 { return genVertices_.begin(); }
GenVertexRefVector genVertices_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ genVertices_end()

TrackingVertex::genv_iterator TrackingVertex::genVertices_end ( ) const

Definition at line 38 of file TrackingVertex.cc.

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

38 { return genVertices_.end(); }
GenVertexRefVector genVertices_
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228

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

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

53 { return daughterTracks_.size(); };
TrackingParticleRefVector daughterTracks_
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102

◆ nG4Vertices()

unsigned int TrackingVertex::nG4Vertices ( ) const
inline

Definition at line 51 of file TrackingVertex.h.

References g4Vertices_.

51 { return g4Vertices_.size(); };
std::vector< SimVertex > g4Vertices_

◆ nGenVertices()

unsigned int TrackingVertex::nGenVertices ( ) const
inline

Definition at line 52 of file TrackingVertex.h.

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

52 { return genVertices_.size(); };
GenVertexRefVector genVertices_
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102

◆ nSourceTracks()

unsigned int TrackingVertex::nSourceTracks ( ) const
inline

Definition at line 54 of file TrackingVertex.h.

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

54 { return sourceTracks_.size(); };
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
TrackingParticleRefVector sourceTracks_

◆ position()

const LorentzVector& TrackingVertex::position ( ) const
inline

Definition at line 71 of file TrackingVertex.h.

References position_.

Referenced by FWTrackingVertexProxyBuilder::build(), VertexFitterResult::fill(), and ShallowSimTracksProducer::produce().

71 { return position_; };
LorentzVector position_

◆ setEventId()

void TrackingVertex::setEventId ( EncodedEventId  e)
inline

Definition at line 38 of file TrackingVertex.h.

References MillePedeFileConverter_cfg::e, and eId_.

◆ sourceTracks()

const TrackingParticleRefVector & TrackingVertex::sourceTracks ( ) const

Definition at line 51 of file TrackingVertex.cc.

References sourceTracks_.

51 { return sourceTracks_; }
TrackingParticleRefVector sourceTracks_

◆ sourceTracks_begin()

TrackingVertex::tp_iterator TrackingVertex::sourceTracks_begin ( ) const

Definition at line 44 of file TrackingVertex.cc.

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

44 { return sourceTracks_.begin(); }
TrackingParticleRefVector sourceTracks_
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223

◆ sourceTracks_end()

TrackingVertex::tp_iterator TrackingVertex::sourceTracks_end ( ) const

Definition at line 45 of file TrackingVertex.cc.

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

45 { return sourceTracks_.end(); }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
TrackingParticleRefVector 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 }
GenVertexRefVector::iterator genv_iterator
TrackingVertex::g4v_iterator g4v_iterator
std::vector< SimVertex >::const_iterator g4v_iterator
const LorentzVector & position() const
TrackingParticleRefVector::iterator tp_iterator
TrackingParticle::g4t_iterator g4t_iterator

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