CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackingVertex.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_TrackingVertex_h
2 #define SimDataFormats_TrackingVertex_h
3 
16 
22 
24 {
25 
26  friend std::ostream& operator<< (std::ostream& s, const TrackingVertex & tv);
27 
28 public:
29 
34  typedef std::vector<SimVertex>::const_iterator g4v_iterator;
36 
37 // Default constructor and constructor from values
39  TrackingVertex(const LorentzVector &position, const bool inVolume,
40  const EncodedEventId e = EncodedEventId(0));
41 
42 // Setters
44  {
45  eId_=e;
46  };
47 
48 // Track and vertex iterators
49  genv_iterator genVertices_begin() const; // Ref's to HepMC and Geant4
50  genv_iterator genVertices_end() const; // vertices associated with
51  g4v_iterator g4Vertices_begin() const; // this vertex, respectively
52  g4v_iterator g4Vertices_end() const; // ....
53 
54  tp_iterator daughterTracks_begin() const; // Ref's to daughter and source
55  tp_iterator daughterTracks_end() const; // tracks associated with
56  tp_iterator sourceTracks_begin() const; // this vertex, respectively
57  tp_iterator sourceTracks_end() const; // ....
58 
59  unsigned int nG4Vertices() const
60  {
61  return g4Vertices_.size();
62  };
63  unsigned int nGenVertices() const
64  {
65  return genVertices_.size();
66  };
67  unsigned int nDaughterTracks() const
68  {
69  return daughterTracks_.size();
70  };
71  unsigned int nSourceTracks() const
72  {
73  return sourceTracks_.size();
74  };
75 
76 // Add references to TrackingParticles, Geant4, and HepMC vertices to containers
77  void addG4Vertex( const SimVertex& );
78  void addGenVertex( const GenVertexRef& );
80  void addParentTrack( const TrackingParticleRef&);
81  void clearDaughterTracks();
82  void clearParentTracks();
83 
84 // Getters for RefVectors
85  const std::vector<SimVertex>& g4Vertices() const;
86  const GenVertexRefVector& genVertices() const;
89 
90 // Getters for other info
91  const LorentzVector& position() const
92  {
93  return position_;
94  };
95  const EncodedEventId& eventId() const
96  {
97  return eId_;
98  };
99  const bool inVolume() const
100  {
101  return inVolume_;
102  };
103 
104 private:
105 
106  LorentzVector position_; // Vertex position and time
107  bool inVolume_; // Is it inside tracker volume?
109 
110 // References to G4 and generator vertices and TrackingParticles
111 
112  std::vector<SimVertex> g4Vertices_;
116 };
117 
118 #endif
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
tp_iterator daughterTracks_begin() const
const TrackingParticleRefVector & sourceTracks() const
void setEventId(EncodedEventId e)
GenVertexRefVector::iterator genv_iterator
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:15
TrackingVertex::g4v_iterator g4v_iterator
std::vector< SimVertex >::const_iterator g4v_iterator
LorentzVector position_
const std::vector< SimVertex > & g4Vertices() const
math::XYZTLorentzVector LorentzVector
g4v_iterator g4Vertices_end() const
const GenVertexRefVector & genVertices() const
void addDaughterTrack(const TrackingParticleRef &)
EncodedEventId eId_
void clearDaughterTracks()
void addParentTrack(const TrackingParticleRef &)
const bool inVolume() const
g4v_iterator g4Vertices_begin() const
void addG4Vertex(const SimVertex &)
math::XYZTLorentzVectorD LorentzVector
genv_iterator genVertices_end() const
TrackingParticleRefVector daughterTracks_
friend std::ostream & operator<<(std::ostream &s, const TrackingVertex &tv)
GenVertexRefVector genVertices_
tp_iterator daughterTracks_end() const
unsigned int nG4Vertices() const
tp_iterator sourceTracks_begin() const
unsigned int nGenVertices() const
unsigned int nDaughterTracks() const
tp_iterator sourceTracks_end() const
void clearParentTracks()
std::vector< SimVertex > g4Vertices_
void addGenVertex(const GenVertexRef &)
const EncodedEventId & eventId() const
const TrackingParticleRefVector & daughterTracks() const
TrackingParticleRefVector::iterator tp_iterator
size_type size() const
Size of the RefVector.
Definition: RefVector.h:89
TrackingParticleRefVector sourceTracks_
edm::Ref< edm::HepMCProduct, HepMC::GenVertex > GenVertexRef
genv_iterator genVertices_begin() const
unsigned int nSourceTracks() const
const LorentzVector & position() const