CMS 3D CMS Logo

TrackingVertex.cc
Go to the documentation of this file.
4 
7 
8 // Constructors
9 
10 TrackingVertex::TrackingVertex() : position_(LorentzVector(0, 0, 0, 0)), eId_(0) {
11  // daughterTracks_.clear();
12 }
13 
14 TrackingVertex::TrackingVertex(const LorentzVector& p, const bool inVolume, const EncodedEventId eId)
15  : position_(p), inVolume_(inVolume), eId_(eId) {
16  // daughterTracks_.clear();
17 }
18 
19 // Add a reference to vertex vectors
20 
21 void TrackingVertex::addG4Vertex(const SimVertex& v) { g4Vertices_.push_back(v); }
22 
24 
25 // Add a reference to track vectors
26 
28 
30 
32 
34 
35 // Iterators over vertices and tracks
36 
41 
46 
47 // Accessors for whole vectors
48 
49 const std::vector<SimVertex>& TrackingVertex::g4Vertices() const { return g4Vertices_; }
53 
54 std::ostream& operator<<(std::ostream& s, const TrackingVertex& v) {
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 }
TrackingVertex::clearDaughterTracks
void clearDaughterTracks()
Definition: TrackingVertex.cc:31
edm::RefVector::clear
void clear()
Clear the vector.
Definition: RefVector.h:142
SimVertex
Definition: SimVertex.h:5
TrackingVertex::g4Vertices_end
g4v_iterator g4Vertices_end() const
Definition: TrackingVertex.cc:40
g4t_iterator
TrackingParticle::g4t_iterator g4t_iterator
Definition: TrackingTruthValid.cc:24
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackingVertex::daughterTracks_begin
tp_iterator daughterTracks_begin() const
Definition: TrackingVertex.cc:42
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
g4v_iterator
TrackingVertex::g4v_iterator g4v_iterator
Definition: TrackingTruthValid.cc:27
TrackingVertex::daughterTracks_end
tp_iterator daughterTracks_end() const
Definition: TrackingVertex.cc:43
TrackingVertex.h
TrackingVertex::addGenVertex
void addGenVertex(const GenVertexRef &)
Definition: TrackingVertex.cc:23
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex >
findQualityFiles.v
v
Definition: findQualityFiles.py:179
genv_iterator
TrackingVertex::genv_iterator genv_iterator
Definition: TrackingTruthValid.cc:26
GenVertexRefVector
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
Definition: TrackingVertex.cc:5
edm::Ref
Definition: AssociativeIterator.h:58
TrackingVertex::g4Vertices
const std::vector< SimVertex > & g4Vertices() const
Definition: TrackingVertex.cc:49
EncodedEventId
Definition: EncodedEventId.h:11
TrackingVertex::TrackingVertex
TrackingVertex()
Definition: TrackingVertex.cc:10
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::RefVector::end
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
TrackingVertexContainer.h
TrackingVertex::clearParentTracks
void clearParentTracks()
Definition: TrackingVertex.cc:33
TrackingVertex::daughterTracks_
TrackingParticleRefVector daughterTracks_
Definition: TrackingVertex.h:84
TrackingVertex::daughterTracks
const TrackingParticleRefVector & daughterTracks() const
Definition: TrackingVertex.cc:52
TrackingVertex::addG4Vertex
void addG4Vertex(const SimVertex &)
Definition: TrackingVertex.cc:21
TrackingVertex::sourceTracks
const TrackingParticleRefVector & sourceTracks() const
Definition: TrackingVertex.cc:51
TrackingVertex::sourceTracks_
TrackingParticleRefVector sourceTracks_
Definition: TrackingVertex.h:85
TrackingVertex::sourceTracks_end
tp_iterator sourceTracks_end() const
Definition: TrackingVertex.cc:45
operator<<
std::ostream & operator<<(std::ostream &s, const TrackingVertex &v)
Definition: TrackingVertex.cc:54
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
TrackingVertex::genVertices_
GenVertexRefVector genVertices_
Definition: TrackingVertex.h:83
TrackingVertex
Definition: TrackingVertex.h:22
TrackingVertex::g4Vertices_begin
g4v_iterator g4Vertices_begin() const
Definition: TrackingVertex.cc:39
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
TrackingParticle.h
TrackingVertex::genVertices_begin
genv_iterator genVertices_begin() const
Definition: TrackingVertex.cc:37
TrackingVertex::genVertices
const GenVertexRefVector & genVertices() const
Definition: TrackingVertex.cc:50
TrackingVertex::addDaughterTrack
void addDaughterTrack(const TrackingParticleRef &)
Definition: TrackingVertex.cc:27
edm::RefVectorIterator
Definition: EDProductfwd.h:33
tp_iterator
TrackingParticleRefVector::iterator tp_iterator
Definition: TrackingTruthValid.cc:23
TrackingVertex::genVertices_end
genv_iterator genVertices_end() const
Definition: TrackingVertex.cc:38
GenVertexRef
edm::Ref< edm::HepMCProduct, HepMC::GenVertex > GenVertexRef
Definition: TrackingVertex.cc:6
TrackingVertex::g4Vertices_
std::vector< SimVertex > g4Vertices_
Definition: TrackingVertex.h:82
TrackingVertex::sourceTracks_begin
tp_iterator sourceTracks_begin() const
Definition: TrackingVertex.cc:44
TrackingVertex::LorentzVector
math::XYZTLorentzVectorD LorentzVector
Definition: TrackingVertex.h:28
TrackingVertex::addParentTrack
void addParentTrack(const TrackingParticleRef &)
Definition: TrackingVertex.cc:29