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"
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.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 6 of file TrackingVertex.cc.

Definition at line 5 of file TrackingVertex.cc.

Function Documentation

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

Definition at line 111 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().

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 }
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
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
static int position[264][3]
Definition: ReadPGInfo.cc:509
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
genv_iterator genVertices_begin() const
const LorentzVector & position() const
TrackingParticle::g4t_iterator g4t_iterator