CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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;
32 class RandomEngine;
33 //class Histos;
34 
35 namespace edm {
36  class ParameterSet;
37 }
38 
39 namespace HepMC {
40  class GenEvent;
41  class GenParticle;
42  class GenVertex;
43 }
44 
46 {
47 
48 public:
49 
51  FBaseSimEvent(const edm::ParameterSet& kine);
52 
54  const edm::ParameterSet& kine,
55  const RandomEngine* engine);
56 
59 
61  void initializePdt(const HepPDT::ParticleDataTable* aPdt);
62 
64  inline const HepPDT::ParticleDataTable* theTable() const {
65  return pdt;
66  }
67 
69  void fill(const HepMC::GenEvent& hev);
70 
72  void fill(const reco::GenParticleCollection& hev);
73 
75  void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
76 
78  void printMCTruth(const HepMC::GenEvent& hev);
79 
81  void addParticles(const HepMC::GenEvent& hev);
82  void addParticles(const reco::GenParticleCollection& myGenParticles);
83 
85  void print() const;
86 
88  void clear();
89 
90 
92  void addChargedTrack(int id);
93 
95  inline unsigned int nTracks() const {
96  return nSimTracks;
97  }
98 
100  inline unsigned int nVertices() const {
101  return nSimVertices;
102  }
103 
105  inline unsigned int nGenParts() const {
106  return nGenParticles;
107  }
108 
110  inline unsigned int nChargedTracks() const {
111  return nChargedParticleTracks;
112  }
113 
115  inline FSimTrack& track(int id) const;
116 
118  inline FSimVertex& vertex(int id) const;
119 
121  inline FSimVertexType& vertexType(int id) const;
122 
124  int chargedTrack(int id) const;
125 
127  inline const SimTrack & embdTrack(int i) const;
128 
130  inline const SimVertex & embdVertex(int i) const;
131 
133  inline const FSimVertexType & embdVertexType(int i) const;
134 
136  const HepMC::GenParticle* embdGenpart(int i) const;
137 
139  int addSimTrack(const RawParticle* p, int iv, int ig=-1,
140  const HepMC::GenVertex* ev=0);
141 
143  int addSimVertex(const XYZTLorentzVector& decayVertex, int im=-1,
145 
146  const KineParticleFilter& filter() const { return *myFilter; }
147 
149 
151  inline void setBeamSpot(const math::XYZPoint& aBeamSpot) {
152  theBeamSpot = aBeamSpot;
153  }
154 
155  protected:
156 
158  inline std::vector<FSimTrack>* tracks() const {
159  return theSimTracks;
160  }
161 
163  inline std::vector<FSimVertex>* vertices() const {
164  return theSimVertices;
165  }
166 
168  inline std::vector<HepMC::GenParticle*>* genparts() const {
169  return theGenParticles;
170  }
171 
172  private:
173 
174  std::vector<FSimTrack>* theSimTracks;
175  std::vector<FSimVertex>* theSimVertices;
177  std::vector<HepMC::GenParticle*>* theGenParticles;
178 
179  std::vector<unsigned>* theChargedTracks;
180 
181  unsigned int nSimTracks;
182  unsigned int nSimVertices;
183  unsigned int nGenParticles;
185 
186  unsigned int theTrackSize;
187  unsigned int theVertexSize;
188  unsigned int theGenSize;
189  unsigned int theChargedSize;
190  unsigned int initialSize;
191 
194 
195  double sigmaVerteX;
196  double sigmaVerteY;
197  double sigmaVerteZ;
198 
200 
204 
206 
207  // Histos* myHistos;
208 
209 };
210 
211 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
212 
213 #endif // FBaseSimEvent_H
const ParticleDataTable * pdt
double lateVertexPosition
PrimaryVertexGenerator * theVertexGenerator
type
Definition: HCALResponse.h:21
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
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.
int i
Definition: DBlmapReader.cc:9
int addSimTrack(const RawParticle *p, int iv, int ig=-1, const HepMC::GenVertex *ev=0)
Add a new track to the Event and to the various lists.
const HepMC::GenParticle * embdGenpart(int i) const
return MC track with a given id
HepPDT::ParticleDataTable ParticleDataTable
std::vector< FSimTrack > * theSimTracks
std::vector< unsigned > * theChargedTracks
FBaseSimEvent(const edm::ParameterSet &kine)
Default constructor.
unsigned int theTrackSize
unsigned int theVertexSize
KineParticleFilter * myFilter
The particle filter.
double sigmaVerteZ
const HepPDT::ParticleDataTable * theTable() const
Get the pointer to the particle data table.
Definition: FBaseSimEvent.h:64
math::XYZPoint theBeamSpot
void addParticles(const HepMC::GenEvent &hev)
Add the particles and their vertices to the list.
std::vector< FSimVertex > * vertices() const
The pointer to the vector of FSimVertex&#39;s.
void clear()
clear the FBaseSimEvent content before the next event
double sigmaVerteY
unsigned int nSimTracks
unsigned int theGenSize
FSimVertex & vertex(int id) const
Return vertex with given Id.
unsigned int nChargedTracks() const
Number of &quot;reconstructed&quot; charged tracks.
unsigned int nVertices() const
Number of vertices.
FSimVertexType & vertexType(int id) const
Return vertex with given Id.
std::vector< FSimTrack > * tracks() const
The pointer to the vector of FSimTrack&#39;s.
const FSimVertexType & embdVertexType(int i) const
return embedded vertex type with given id
~FBaseSimEvent()
usual virtual destructor
unsigned int nTracks() const
Number of tracks.
Definition: FBaseSimEvent.h:95
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 setBeamSpot(const math::XYZPoint &aBeamSpot)
Set the beam spot position.
void fill(const HepMC::GenEvent &hev)
fill the FBaseSimEvent from the current HepMC::GenEvent
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
double sigmaVerteX
const RandomEngine * random
PrimaryVertexGenerator * thePrimaryVertexGenerator() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
unsigned int theChargedSize
void addChargedTrack(int id)
Add an id in the vector of charged tracks id&#39;s.
const SimTrack & embdTrack(int i) const
return embedded track with given id
unsigned int nChargedParticleTracks
void initializePdt(const HepPDT::ParticleDataTable *aPdt)
Initialize the particle data table.
unsigned int nGenParts() const
Number of generator particles.
std::vector< HepMC::GenParticle * > * genparts() const
The pointer to the vector of GenParticle&#39;s.
const KineParticleFilter & filter() const
int chargedTrack(int id) const
return &quot;reconstructed&quot; charged tracks index.
void printMCTruth(const HepMC::GenEvent &hev)
print the original MCTruth event
std::vector< HepMC::GenParticle * > * theGenParticles
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15
void print() const
print the FBaseSimEvent in an intelligible way
FSimTrack & track(int id) const
Return track with given Id.
FSimVertexTypeCollection * theFSimVerticesType