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;
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 
58 
60  void initializePdt(const HepPDT::ParticleDataTable* aPdt);
61 
63  inline const HepPDT::ParticleDataTable* theTable() const {
64  return pdt;
65  }
66 
68  void fill(const HepMC::GenEvent& hev, RandomEngineAndDistribution const*);
69 
72 
74  void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
75 
77  void printMCTruth(const HepMC::GenEvent& hev);
78 
80  void addParticles(const HepMC::GenEvent& hev, RandomEngineAndDistribution const*);
81  void addParticles(const reco::GenParticleCollection& myGenParticles, RandomEngineAndDistribution const*);
82 
84  void print() const;
85 
87  void clear();
88 
89 
91  void addChargedTrack(int id);
92 
94  inline unsigned int nTracks() const {
95  return nSimTracks;
96  }
97 
99  inline unsigned int nVertices() const {
100  return nSimVertices;
101  }
102 
104  inline unsigned int nGenParts() const {
105  return nGenParticles;
106  }
107 
109  inline unsigned int nChargedTracks() const {
110  return nChargedParticleTracks;
111  }
112 
114  inline FSimTrack& track(int id) const;
115 
117  inline FSimVertex& vertex(int id) const;
118 
120  inline FSimVertexType& vertexType(int id) const;
121 
123  int chargedTrack(int id) const;
124 
126  inline const SimTrack & embdTrack(int i) const;
127 
129  inline const SimVertex & embdVertex(int i) const;
130 
132  inline const FSimVertexType & embdVertexType(int i) const;
133 
135  const HepMC::GenParticle* embdGenpart(int i) const;
136 
138  int addSimTrack(const RawParticle* p, int iv, int ig=-1,
139  const HepMC::GenVertex* ev=0);
140 
142  int addSimVertex(const XYZTLorentzVector& decayVertex, int im=-1,
144 
145  const KineParticleFilter& filter() const { return *myFilter; }
146 
148 
150  inline void setBeamSpot(const math::XYZPoint& aBeamSpot) {
151  theBeamSpot = aBeamSpot;
152  }
153 
154  protected:
155 
157  inline std::vector<FSimTrack>* tracks() const {
158  return theSimTracks;
159  }
160 
162  inline std::vector<FSimVertex>* vertices() const {
163  return theSimVertices;
164  }
165 
167  inline std::vector<HepMC::GenParticle*>* genparts() const {
168  return theGenParticles;
169  }
170 
171  private:
172 
173  std::vector<FSimTrack>* theSimTracks;
174  std::vector<FSimVertex>* theSimVertices;
176  std::vector<HepMC::GenParticle*>* theGenParticles;
177 
178  std::vector<unsigned>* theChargedTracks;
179 
180  unsigned int nSimTracks;
181  unsigned int nSimVertices;
182  unsigned int nGenParticles;
184 
185  unsigned int theTrackSize;
186  unsigned int theVertexSize;
187  unsigned int theGenSize;
188  unsigned int theChargedSize;
189  unsigned int initialSize;
190 
193 
194  double sigmaVerteX;
195  double sigmaVerteY;
196  double sigmaVerteZ;
197 
199 
203 
204  // Histos* myHistos;
205 
206 };
207 
208 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
209 
210 #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:63
math::XYZPoint theBeamSpot
std::vector< FSimVertex > * vertices() const
The pointer to the vector of FSimVertex&#39;s.
void clear()
clear the FBaseSimEvent content before the next event
bool ev
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.
Definition: FBaseSimEvent.h:99
FSimVertexType & vertexType(int id) const
Return vertex with given Id.
std::vector< FSimTrack > * tracks() const
The pointer to the vector of FSimTrack&#39;s.
void addParticles(const HepMC::GenEvent &hev, RandomEngineAndDistribution const *)
Add the particles and their vertices to the list.
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:94
unsigned int nSimVertices
A FSimVertexType hold the information on the vertex origine.
void fill(const HepMC::GenEvent &hev, RandomEngineAndDistribution const *)
fill the FBaseSimEvent from the current HepMC::GenEvent
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.
const SimVertex & embdVertex(int i) const
return embedded vertex with given id
double sigmaVerteX
PrimaryVertexGenerator * thePrimaryVertexGenerator() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
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