CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Definition at line 33 of file TrackingVertex.h.

Definition at line 32 of file TrackingVertex.h.

Definition at line 30 of file TrackingVertex.h.

Definition at line 29 of file TrackingVertex.h.

Definition at line 31 of file TrackingVertex.h.

Definition at line 34 of file TrackingVertex.h.

Constructor & Destructor Documentation

TrackingVertex::TrackingVertex ( )

Definition at line 10 of file TrackingVertex.cc.

10  : position_(LorentzVector(0,0,0,0)), eId_(0)
11 {
12 // daughterTracks_.clear();
13 }
LorentzVector position_
EncodedEventId eId_
math::XYZTLorentzVectorD LorentzVector
TrackingVertex::TrackingVertex ( const LorentzVector position,
const bool  inVolume,
const EncodedEventId  e = EncodedEventId(0) 
)

Definition at line 15 of file TrackingVertex.cc.

15  :
17 {
18 // daughterTracks_.clear();
19 }
LorentzVector position_
EncodedEventId eId_
const bool inVolume() const

Member Function Documentation

void TrackingVertex::addDaughterTrack ( const TrackingParticleRef ref)

Definition at line 35 of file TrackingVertex.cc.

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

36 {
38 }
TrackingParticleRefVector daughterTracks_
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
void TrackingVertex::addG4Vertex ( const SimVertex v)

Definition at line 23 of file TrackingVertex.cc.

References g4Vertices_.

24 {
25  g4Vertices_.push_back(v);
26 }
std::vector< SimVertex > g4Vertices_
void TrackingVertex::addGenVertex ( const GenVertexRef ref)

Definition at line 28 of file TrackingVertex.cc.

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

29 {
31 }
GenVertexRefVector genVertices_
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
void TrackingVertex::addParentTrack ( const TrackingParticleRef ref)

Definition at line 40 of file TrackingVertex.cc.

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

41 {
43 }
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
TrackingParticleRefVector sourceTracks_
void TrackingVertex::clearDaughterTracks ( )

Definition at line 45 of file TrackingVertex.cc.

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

46 {
48 }
TrackingParticleRefVector daughterTracks_
void clear()
Clear the vector.
Definition: RefVector.h:139
void TrackingVertex::clearParentTracks ( )

Definition at line 50 of file TrackingVertex.cc.

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

51 {
53 }
void clear()
Clear the vector.
Definition: RefVector.h:139
TrackingParticleRefVector sourceTracks_
const TrackingParticleRefVector & TrackingVertex::daughterTracks ( ) const

Definition at line 106 of file TrackingVertex.cc.

References daughterTracks_.

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

107 {
108  return daughterTracks_;
109 }
TrackingParticleRefVector daughterTracks_
TrackingVertex::tp_iterator TrackingVertex::daughterTracks_begin ( ) const

Definition at line 75 of file TrackingVertex.cc.

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

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

76 {
77  return daughterTracks_.begin();
78 }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:250
TrackingParticleRefVector daughterTracks_
TrackingVertex::tp_iterator TrackingVertex::daughterTracks_end ( ) const

Definition at line 79 of file TrackingVertex.cc.

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

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

80 {
81  return daughterTracks_.end();
82 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:255
TrackingParticleRefVector daughterTracks_
const EncodedEventId& TrackingVertex::eventId ( ) const
inline
const std::vector< SimVertex > & TrackingVertex::g4Vertices ( ) const

Definition at line 94 of file TrackingVertex.cc.

References g4Vertices_.

95 {
96  return g4Vertices_;
97 }
std::vector< SimVertex > g4Vertices_
TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_begin ( ) const

Definition at line 66 of file TrackingVertex.cc.

References g4Vertices_.

Referenced by operator<<().

67 {
68  return g4Vertices_.begin();
69 }
std::vector< SimVertex > g4Vertices_
TrackingVertex::g4v_iterator TrackingVertex::g4Vertices_end ( ) const

Definition at line 70 of file TrackingVertex.cc.

References g4Vertices_.

Referenced by operator<<().

71 {
72  return g4Vertices_.end();
73 }
std::vector< SimVertex > g4Vertices_
const GenVertexRefVector & TrackingVertex::genVertices ( ) const

Definition at line 98 of file TrackingVertex.cc.

References genVertices_.

99 {
100  return genVertices_;
101 }
GenVertexRefVector genVertices_
TrackingVertex::genv_iterator TrackingVertex::genVertices_begin ( ) const

Definition at line 58 of file TrackingVertex.cc.

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

Referenced by operator<<().

59 {
60  return genVertices_.begin();
61 }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:250
GenVertexRefVector genVertices_
TrackingVertex::genv_iterator TrackingVertex::genVertices_end ( ) const

Definition at line 62 of file TrackingVertex.cc.

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

Referenced by operator<<().

63 {
64  return genVertices_.end();
65 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:255
GenVertexRefVector genVertices_
const bool TrackingVertex::inVolume ( ) const
inline

Definition at line 98 of file TrackingVertex.h.

References inVolume_.

99  {
100  return inVolume_;
101  };
unsigned int TrackingVertex::nDaughterTracks ( ) const
inline

Definition at line 66 of file TrackingVertex.h.

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

Referenced by VertexAssociatorByPositionAndTracks::associateRecoToSim(), and VertexAssociatorByPositionAndTracks::associateSimToReco().

67  {
68  return daughterTracks_.size();
69  };
TrackingParticleRefVector daughterTracks_
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
unsigned int TrackingVertex::nG4Vertices ( ) const
inline

Definition at line 58 of file TrackingVertex.h.

References g4Vertices_.

59  {
60  return g4Vertices_.size();
61  };
std::vector< SimVertex > g4Vertices_
unsigned int TrackingVertex::nGenVertices ( ) const
inline

Definition at line 62 of file TrackingVertex.h.

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

63  {
64  return genVertices_.size();
65  };
GenVertexRefVector genVertices_
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
unsigned int TrackingVertex::nSourceTracks ( ) const
inline

Definition at line 70 of file TrackingVertex.h.

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

71  {
72  return sourceTracks_.size();
73  };
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
TrackingParticleRefVector sourceTracks_
const LorentzVector& TrackingVertex::position ( ) const
inline
void TrackingVertex::setEventId ( EncodedEventId  e)
inline

Definition at line 42 of file TrackingVertex.h.

References alignCSCRings::e, and eId_.

43  {
44  eId_=e;
45  };
EncodedEventId eId_
const TrackingParticleRefVector & TrackingVertex::sourceTracks ( ) const

Definition at line 102 of file TrackingVertex.cc.

References sourceTracks_.

103 {
104  return sourceTracks_;
105 }
TrackingParticleRefVector sourceTracks_
TrackingVertex::tp_iterator TrackingVertex::sourceTracks_begin ( ) const

Definition at line 83 of file TrackingVertex.cc.

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

Referenced by operator<<().

84 {
85  return sourceTracks_.begin();
86 }
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:250
TrackingParticleRefVector sourceTracks_
TrackingVertex::tp_iterator TrackingVertex::sourceTracks_end ( ) const

Definition at line 87 of file TrackingVertex.cc.

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

Referenced by operator<<().

88 {
89  return sourceTracks_.end();
90 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:255
TrackingParticleRefVector sourceTracks_

Friends And Related Function Documentation

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

Definition at line 111 of file TrackingVertex.cc.

112 {
113 
114  using std::endl;
116  typedef std::vector<SimVertex>::const_iterator g4v_iterator;
118  typedef std::vector<SimTrack>::const_iterator g4t_iterator;
119 
120  s << "Vertex Position & Event #" << v.position() << " " << v.eventId().bunchCrossing() << "." << v.eventId().event() << endl;
121  s << " Associated with " << v.daughterTracks().size() << " tracks" << endl;
122  for (genv_iterator genV = v.genVertices_begin(); genV != v.genVertices_end(); ++genV)
123  {
124  s << " HepMC vertex position " << (*(*genV)).position().x() << ","<< (*(*genV)).position().y() << (*(*genV)).position().z() << endl;
125  }
126 
127  for (g4v_iterator g4V = v.g4Vertices_begin(); g4V != v.g4Vertices_end(); ++g4V)
128  {
129  s << " Geant vertex position " << (*g4V).position() << endl;
130  // Probably empty all the time, currently
131  }
132 
133  // Loop over daughter track(s)
134  for (tp_iterator iTP = v.daughterTracks_begin(); iTP != v.daughterTracks_end(); ++iTP)
135  {
136  s << " Daughter starts: " << (*(*iTP)).vertex();
137  for (g4t_iterator g4T = (*(*iTP)).g4Track_begin(); g4T != (*(*iTP)).g4Track_end(); ++g4T)
138  {
139  s << " p " << g4T->momentum();
140  }
141  s << endl;
142  }
143 
144  // Loop over source track(s) (can be multiple since vertices are collapsed)
145  for (tp_iterator iTP = v.sourceTracks_begin(); iTP != v.sourceTracks_end(); ++iTP)
146  {
147  s << " Source starts: " << (*(*iTP)).vertex();
148  for (g4t_iterator g4T = (*iTP)->g4Track_begin(); g4T != (*iTP)->g4Track_end(); ++g4T)
149  {
150  s << ", p " << g4T ->momentum();
151  }
152  s << endl;
153  }
154  return s;
155 }
GenVertexRefVector::iterator genv_iterator
std::vector< SimVertex >::const_iterator g4v_iterator
TrackingParticleRefVector::iterator tp_iterator
const LorentzVector & position() const
TrackingParticle::g4t_iterator g4t_iterator

Member Data Documentation

TrackingParticleRefVector TrackingVertex::daughterTracks_
private
EncodedEventId TrackingVertex::eId_
private

Definition at line 107 of file TrackingVertex.h.

Referenced by eventId(), and setEventId().

std::vector<SimVertex> TrackingVertex::g4Vertices_
private
GenVertexRefVector TrackingVertex::genVertices_
private
bool TrackingVertex::inVolume_
private

Definition at line 106 of file TrackingVertex.h.

Referenced by inVolume().

LorentzVector TrackingVertex::position_
private

Definition at line 101 of file TrackingVertex.h.

Referenced by position().

TrackingParticleRefVector TrackingVertex::sourceTracks_
private