CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
TrackingVertex.cc File Reference
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertexContainer.h"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"

Go to the source code of this file.

Typedefs

typedef edm::Ref
< edm::HepMCProduct,
HepMC::GenVertex > 
GenVertexRef
 
typedef edm::RefVector
< edm::HepMCProduct,
HepMC::GenVertex > 
GenVertexRefVector
 

Functions

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

Typedef Documentation

typedef edm::Ref<edm::HepMCProduct, HepMC::GenVertex > GenVertexRef

Definition at line 5 of file TrackingVertex.cc.

Definition at line 4 of file TrackingVertex.cc.

Function Documentation

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

Definition at line 110 of file TrackingVertex.cc.

References EncodedEventId::bunchCrossing(), TrackingVertex::daughterTracks(), TrackingVertex::daughterTracks_begin(), TrackingVertex::daughterTracks_end(), EncodedEventId::event(), TrackingVertex::eventId(), TrackingVertex::g4Vertices_begin(), TrackingVertex::g4Vertices_end(), TrackingVertex::genVertices_begin(), TrackingVertex::genVertices_end(), TrackingVertex::position(), position, alignCSCRings::s, edm::RefVector< C, T, F >::size(), TrackingVertex::sourceTracks_begin(), and TrackingVertex::sourceTracks_end().

111 {
112 
113  using std::endl;
115  typedef std::vector<SimVertex>::const_iterator g4v_iterator;
117  typedef std::vector<SimTrack>::const_iterator g4t_iterator;
118 
119  s << "Vertex Position & Event #" << v.position() << " " << v.eventId().bunchCrossing() << "." << v.eventId().event() << endl;
120  s << " Associated with " << v.daughterTracks().size() << " tracks" << endl;
121  for (genv_iterator genV = v.genVertices_begin(); genV != v.genVertices_end(); ++genV)
122  {
123  s << " HepMC vertex position " << (*(*genV)).position().x() << ","<< (*(*genV)).position().y() << (*(*genV)).position().z() << endl;
124  }
125 
126  for (g4v_iterator g4V = v.g4Vertices_begin(); g4V != v.g4Vertices_end(); ++g4V)
127  {
128  s << " Geant vertex position " << (*g4V).position() << endl;
129  // Probably empty all the time, currently
130  }
131 
132  // Loop over daughter track(s)
133  for (tp_iterator iTP = v.daughterTracks_begin(); iTP != v.daughterTracks_end(); ++iTP)
134  {
135  s << " Daughter starts: " << (*(*iTP)).vertex();
136  for (g4t_iterator g4T = (*(*iTP)).g4Track_begin(); g4T != (*(*iTP)).g4Track_end(); ++g4T)
137  {
138  s << " p " << g4T->momentum();
139  }
140  s << endl;
141  }
142 
143  // Loop over source track(s) (can be multiple since vertices are collapsed)
144  for (tp_iterator iTP = v.sourceTracks_begin(); iTP != v.sourceTracks_end(); ++iTP)
145  {
146  s << " Source starts: " << (*(*iTP)).vertex();
147  for (g4t_iterator g4T = (*iTP)->g4Track_begin(); g4T != (*iTP)->g4Track_end(); ++g4T)
148  {
149  s << ", p " << g4T ->momentum();
150  }
151  s << endl;
152  }
153  return s;
154 }
tp_iterator daughterTracks_begin() const
int event() const
get the contents of the subdetector field (should be protected?)
TrackingVertex::g4v_iterator g4v_iterator
g4v_iterator g4Vertices_end() const
TrackingParticleRefVector::iterator tp_iterator
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
g4v_iterator g4Vertices_begin() const
genv_iterator genVertices_end() const
TrackingVertex::genv_iterator genv_iterator
int bunchCrossing() const
get the detector field from this detid
tp_iterator daughterTracks_end() const
tp_iterator sourceTracks_begin() const
tp_iterator sourceTracks_end() const
const EncodedEventId & eventId() const
const TrackingParticleRefVector & daughterTracks() const
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
genv_iterator genVertices_begin() const
const LorentzVector & position() const
TrackingParticle::g4t_iterator g4t_iterator