CMS 3D CMS Logo

FBaseSimEvent.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Event_FBaseSimEvent_H
2 #define FastSimulation_Event_FBaseSimEvent_H
3 
4 // Data Formats
7 
8 // HepPDT Headers
10 
11 // Famos Headers
15 
16 #include <vector>
17 
24 //class FSimEvent;
25 class FSimTrack;
26 class FSimVertex;
27 class KineParticleFilter;
28 
29 class SimTrack;
30 class SimVertex;
31 
32 namespace edm {
33  class ParameterSet;
34 }
35 
36 namespace HepMC {
37  class GenEvent;
38  class GenParticle;
39  class GenVertex;
40 } // namespace HepMC
41 
43 public:
45  FBaseSimEvent(const edm::ParameterSet& kine);
46 
49 
51  void initializePdt(const HepPDT::ParticleDataTable* aPdt);
52 
54  inline const HepPDT::ParticleDataTable* theTable() const { return pdt; }
55 
57  void fill(const HepMC::GenEvent& hev);
58 
60  void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
61 
63  void printMCTruth(const HepMC::GenEvent& hev);
64 
66  void addParticles(const HepMC::GenEvent& hev);
67 
69  void print() const;
70 
72  void clear();
73 
75  void addChargedTrack(int id);
76 
78  inline unsigned int nTracks() const { return nSimTracks; }
79 
81  inline unsigned int nVertices() const { return nSimVertices; }
82 
84  inline unsigned int nGenParts() const { return nGenParticles; }
85 
87  inline unsigned int nChargedTracks() const { return nChargedParticleTracks; }
88 
90  inline FSimTrack& track(int id) const;
91 
93  inline FSimVertex& vertex(int id) const;
94 
96  inline FSimVertexType& vertexType(int id) const;
97 
99  int chargedTrack(int id) const;
100 
102  inline const SimTrack& embdTrack(int i) const;
103 
105  inline const SimVertex& embdVertex(int i) const;
106 
108  inline const FSimVertexType& embdVertexType(int i) const;
109 
111  const HepMC::GenParticle* embdGenpart(int i) const;
112 
114  int addSimTrack(const RawParticle* p, int iv, int ig = -1, const HepMC::GenVertex* ev = nullptr);
115 
117  int addSimVertex(const XYZTLorentzVector& decayVertex,
118  int im = -1,
120 
121  const KineParticleFilter& filter() const { return *myFilter; }
122 
123 protected:
125  inline std::vector<FSimTrack>* tracks() const { return theSimTracks; }
126 
128  inline std::vector<FSimVertex>* vertices() const { return theSimVertices; }
129 
131  inline std::vector<HepMC::GenParticle*>* genparts() const { return theGenParticles; }
132 
133 private:
134  std::vector<FSimTrack>* theSimTracks;
135  std::vector<FSimVertex>* theSimVertices;
137  std::vector<HepMC::GenParticle*>* theGenParticles;
138 
139  std::vector<unsigned>* theChargedTracks;
140 
141  unsigned int nSimTracks;
142  unsigned int nSimVertices;
143  unsigned int nGenParticles;
145 
146  unsigned int theTrackSize;
147  unsigned int theVertexSize;
148  unsigned int theGenSize;
149  unsigned int theChargedSize;
150  unsigned int initialSize;
151 
154 
155  double sigmaVerteX;
156  double sigmaVerteY;
157  double sigmaVerteZ;
158 
160 
162 
163  // Histos* myHistos;
164 };
165 
166 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
167 
168 #endif // FBaseSimEvent_H
const ParticleDataTable * pdt
double lateVertexPosition
int addSimVertex(const XYZTLorentzVector &decayVertex, int im=-1, FSimVertexType::VertexType type=FSimVertexType::ANY)
Add a new vertex to the Event and to the various lists.
const HepMC::GenParticle * embdGenpart(int i) const
return MC track with a given id
FSimTrack & track(int id) const
Return track with given Id.
int32_t *__restrict__ iv
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
HepPDT::ParticleDataTable ParticleDataTable
std::vector< FSimTrack > * theSimTracks
std::vector< HepMC::GenParticle * > * genparts() const
The pointer to the vector of GenParticle&#39;s.
std::vector< unsigned > * theChargedTracks
FBaseSimEvent(const edm::ParameterSet &kine)
Default constructor.
unsigned int theTrackSize
unsigned int theVertexSize
KineParticleFilter * myFilter
The particle filter.
int addSimTrack(const RawParticle *p, int iv, int ig=-1, const HepMC::GenVertex *ev=nullptr)
Add a new track to the Event and to the various lists.
double sigmaVerteZ
void addParticles(const HepMC::GenEvent &hev)
Add the particles and their vertices to the list.
void clear()
clear the FBaseSimEvent content before the next event
unsigned int nGenParts() const
Number of generator particles.
Definition: FBaseSimEvent.h:84
std::vector< FSimTrack > * tracks() const
The pointer to the vector of FSimTrack&#39;s.
double sigmaVerteY
unsigned int nSimTracks
unsigned int theGenSize
unsigned int nVertices() const
Number of vertices.
Definition: FBaseSimEvent.h:81
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:78
const HepPDT::ParticleDataTable * theTable() const
Get the pointer to the particle data table.
Definition: FBaseSimEvent.h:54
void print() const
print the FBaseSimEvent in an intelligible way
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
~FBaseSimEvent()
usual virtual destructor
unsigned int nSimVertices
A FSimVertexType hold the information on the vertex origine.
std::vector< FSimVertexType > FSimVertexTypeCollection
collection of FSimVertexType objects
unsigned int nGenParticles
unsigned int initialSize
std::vector< FSimVertex > * theSimVertices
void fill(const HepMC::GenEvent &hev)
fill the FBaseSimEvent from the current HepMC::GenEvent
double sigmaVerteX
unsigned int theChargedSize
std::vector< FSimVertex > * vertices() const
The pointer to the vector of FSimVertex&#39;s.
void addChargedTrack(int id)
Add an id in the vector of charged tracks id&#39;s.
unsigned int nChargedParticleTracks
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
HLT enums.
FSimVertex & vertex(int id) const
Return vertex with given Id.
const KineParticleFilter & filter() const
unsigned int nChargedTracks() const
Number of "reconstructed" charged tracks.
Definition: FBaseSimEvent.h:87
void printMCTruth(const HepMC::GenEvent &hev)
print the original MCTruth event
std::vector< HepMC::GenParticle * > * theGenParticles
int chargedTrack(int id) const
return "reconstructed" charged tracks index.
FSimVertexType & vertexType(int id) const
Return vertex with given Id.
const SimTrack & embdTrack(int i) const
return embedded track with given id
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
FSimVertexTypeCollection * theFSimVerticesType