CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackingParticle.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_TrackingParticle_h
2 #define SimDataFormats_TrackingParticle_h
3 
8 #include <map>
9 
18 
19 namespace HepMC
20 {
21 class GenParticle;
22 }
23 class TrackingVertex;
24 
26 {
27 
28  friend std::ostream& operator<< (std::ostream& s, TrackingParticle const & tp);
29 
30 public:
31 
36  typedef std::vector<SimTrack>::const_iterator g4t_iterator;
37 
38  typedef std::vector<TrackingVertex> TrackingVertexCollection;
42 
43  typedef std::multimap<DetId::Detector, PSimHit> DetectorToPSimHit;
44 
47 
49  TrackingParticle( char q, const LorentzVector & p4, const Point & vtx,
50  double t, const int pdgId, const int status, const EncodedEventId eventId);
51 
52  // destructor
54 
56  int pdgId() const
57  {
58  return pdgId_;
59  }
61  {
62  return eventId_;
63  }
64 
69  g4t_iterator g4Track_end() const;
70 
72  const std::vector<PSimHit>::const_iterator pSimHit_begin() const;
74  const std::vector<PSimHit>::const_iterator pSimHit_end() const;
75 
76  // Setters for G4 and HepMC
77  void addG4Track(const SimTrack&);
78  void addGenParticle(const GenParticleRef&);
79 
80  void addPSimHit(const PSimHit&);
82  void addDecayVertex(const TrackingVertexRef&);
83  void clearParentVertex();
84  void clearDecayVertices();
85  void setMatchedHit(const int&);
86  void setVertex(const Point & vtx, double t);
87 
88  // Getters for Embd and Sim Tracks
90  {
91  return genParticles_;
92  }
93  const std::vector<SimTrack>& g4Tracks() const
94  {
95  return g4Tracks_ ;
96  }
98  {
99  return parentVertex_;
100  }
102  const std::vector<PSimHit>& trackPSimHit() const
103  {
104  return trackPSimHit_;
105  }
106 
107  // PSimHits discriminated by subdetector
108  std::vector<PSimHit> trackPSimHit(DetId::Detector) const;
109 
110  // Accessors for vector of decay vertices
112  {
113  return decayVertices_;
114  }
116  {
117  return decayVertices_.begin();
118  }
120  {
121  return decayVertices_.end();
122  }
123  int matchedHit() const
124  {
125  return matchedHit_;
126  }
127 
128 private:
129 
131  float t_;
133  int pdgId_;
135 
138 
140  std::vector<SimTrack> g4Tracks_;
142 
143  // TrackPSimHitRefVector trackPSimHit_;
144  std::vector<PSimHit> trackPSimHit_;
145 
146  // Source and decay vertices
149 };
150 
151 #endif // SimDataFormats_TrackingParticle_H
genp_iterator genParticle_begin() const
iterators
TrackingVertexRefVector::iterator tv_iterator
tv_iterator decayVertices_end() const
tv_iterator decayVertices_begin() const
const std::vector< SimTrack > & g4Tracks() const
TrackingVertexRefVector decayVertices_
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
reference to HepMC::GenParticle
const std::vector< PSimHit > & trackPSimHit() const
g4t_iterator g4Track_begin() const
int pdgId() const
PDG id, signal source, crossing number.
float t_
production time
int pdgId_
PDG identifier, signal source, crossing number.
math::XYZTLorentzVector LorentzVector
TrackingParticle()
default constructor
const std::vector< PSimHit >::const_iterator pSimHit_begin() const
const std::vector< PSimHit >::const_iterator pSimHit_end() const
const GenParticleRefVector & genParticle() const
edm::RefVector< TrackingVertexCollection > TrackingVertexRefVector
int matchedHit() const
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
void setMatchedHit(const int &)
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
std::multimap< DetId::Detector, PSimHit > DetectorToPSimHit
int matchedHit_
Total Number of Hits belonging to the TrackingParticle.
std::vector< TrackingVertex > TrackingVertexCollection
void addPSimHit(const PSimHit &)
void addDecayVertex(const TrackingVertexRef &)
math::XYZPoint Point
std::vector< SimTrack > g4Tracks_
references to G4 and HepMC tracks
const TrackingVertexRef & parentVertex() const
const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: ParticleBase.h:74
void setVertex(const Point &vtx, double t)
std::vector< SimTrack >::const_iterator g4t_iterator
int status() const
status word
Definition: ParticleBase.h:263
genp_iterator genParticle_end() const
Detector
Definition: DetId.h:26
edm::Ref< edm::HepMCProduct, HepMC::GenParticle > GenParticleRef
GenParticleRefVector genParticles_
EncodedEventId eventId() const
edm::Ref< TrackingVertexCollection > TrackingVertexRef
void addGenParticle(const GenParticleRef &)
void addG4Track(const SimTrack &)
std::vector< PSimHit > trackPSimHit_
GenParticleRefVector::iterator genp_iterator
g4t_iterator g4Track_end() const
const TrackingVertexRefVector & decayVertices() const
void setParentVertex(const TrackingVertexRef &)
TrackingVertexRef parentVertex_
EncodedEventId eventId_
friend std::ostream & operator<<(std::ostream &s, TrackingParticle const &tp)
TrackingParticle::g4t_iterator g4t_iterator