1 |
#ifndef SimDataFormats_TrackingParticle_h
|
2 |
#define SimDataFormats_TrackingParticle_h
|
3 |
|
4 |
/** Concrete TrackingParticle.
|
5 |
* All track parameters are passed in the constructor and stored internally.
|
6 |
*/
|
7 |
|
8 |
#include <map>
|
9 |
|
10 |
#include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
|
11 |
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
|
12 |
#include "SimDataFormats/TrackingAnalysis/interface/ParticleBase.h"
|
13 |
#include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h"
|
14 |
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h"
|
15 |
#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
|
16 |
#include "SimDataFormats/Track/interface/SimTrackContainer.h"
|
17 |
#include "DataFormats/DetId/interface/DetId.h"
|
18 |
|
19 |
namespace HepMC
|
20 |
{
|
21 |
class GenParticle;
|
22 |
}
|
23 |
class TrackingVertex;
|
24 |
|
25 |
class TrackingParticle : public ParticleBase
|
26 |
{
|
27 |
|
28 |
friend std::ostream& operator<< (std::ostream& s, TrackingParticle const & tp);
|
29 |
|
30 |
public:
|
31 |
|
32 |
/// reference to HepMC::GenParticle
|
33 |
typedef edm::RefVector<edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector;
|
34 |
typedef edm::Ref<edm::HepMCProduct, HepMC::GenParticle > GenParticleRef;
|
35 |
typedef GenParticleRefVector::iterator genp_iterator;
|
36 |
typedef std::vector<SimTrack>::const_iterator g4t_iterator;
|
37 |
|
38 |
typedef std::vector<TrackingVertex> TrackingVertexCollection;
|
39 |
typedef edm::Ref<TrackingVertexCollection> TrackingVertexRef;
|
40 |
typedef edm::RefVector<TrackingVertexCollection> TrackingVertexRefVector;
|
41 |
typedef TrackingVertexRefVector::iterator tv_iterator;
|
42 |
|
43 |
typedef std::multimap<DetId::Detector, PSimHit> DetectorToPSimHit;
|
44 |
|
45 |
/// default constructor
|
46 |
TrackingParticle() {}
|
47 |
|
48 |
/// constructor from pointer to generator particle
|
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
|
53 |
~TrackingParticle();
|
54 |
|
55 |
/// PDG id, signal source, crossing number
|
56 |
int pdgId() const
|
57 |
{
|
58 |
return pdgId_;
|
59 |
}
|
60 |
EncodedEventId eventId() const
|
61 |
{
|
62 |
return eventId_;
|
63 |
}
|
64 |
|
65 |
///iterators
|
66 |
genp_iterator genParticle_begin() const;
|
67 |
genp_iterator genParticle_end() const;
|
68 |
g4t_iterator g4Track_begin() const;
|
69 |
g4t_iterator g4Track_end() const;
|
70 |
|
71 |
/** Returns the begin of the vector of ALL the PSimHits of the TrackingParticle */
|
72 |
const std::vector<PSimHit>::const_iterator pSimHit_begin() const;
|
73 |
/** Returns the end of the vector of ALL the PSimHits of the TrackingParticle */
|
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&);
|
81 |
void setParentVertex(const TrackingVertexRef&);
|
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
|
89 |
const GenParticleRefVector& genParticle() const
|
90 |
{
|
91 |
return genParticles_;
|
92 |
}
|
93 |
const std::vector<SimTrack>& g4Tracks() const
|
94 |
{
|
95 |
return g4Tracks_ ;
|
96 |
}
|
97 |
const TrackingVertexRef& parentVertex() const
|
98 |
{
|
99 |
return parentVertex_;
|
100 |
}
|
101 |
/** The vector of ALL the PSimHits of the TrackingParticle */
|
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
|
111 |
const TrackingVertexRefVector& decayVertices() const
|
112 |
{
|
113 |
return decayVertices_;
|
114 |
}
|
115 |
tv_iterator decayVertices_begin() const
|
116 |
{
|
117 |
return decayVertices_.begin();
|
118 |
}
|
119 |
tv_iterator decayVertices_end() const
|
120 |
{
|
121 |
return decayVertices_.end();
|
122 |
}
|
123 |
int matchedHit() const
|
124 |
{
|
125 |
return matchedHit_;
|
126 |
}
|
127 |
|
128 |
private:
|
129 |
|
130 |
/// production time
|
131 |
float t_;
|
132 |
/// PDG identifier, signal source, crossing number
|
133 |
int pdgId_;
|
134 |
EncodedEventId eventId_;
|
135 |
|
136 |
/// Total Number of Hits belonging to the TrackingParticle
|
137 |
int matchedHit_;
|
138 |
|
139 |
/// references to G4 and HepMC tracks
|
140 |
std::vector<SimTrack> g4Tracks_;
|
141 |
GenParticleRefVector genParticles_;
|
142 |
|
143 |
// TrackPSimHitRefVector trackPSimHit_;
|
144 |
std::vector<PSimHit> trackPSimHit_;
|
145 |
|
146 |
// Source and decay vertices
|
147 |
TrackingVertexRef parentVertex_;
|
148 |
TrackingVertexRefVector decayVertices_;
|
149 |
};
|
150 |
|
151 |
#endif // SimDataFormats_TrackingParticle_H
|