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;
31 
32 namespace edm {
33  class ParameterSet;
34 }
35 
36 namespace HepMC {
37  class GenEvent;
38  class GenParticle;
39  class GenVertex;
40 }
41 
43 {
44 
45 public:
46 
48  FBaseSimEvent(const edm::ParameterSet& kine);
49 
52 
54  void initializePdt(const HepPDT::ParticleDataTable* aPdt);
55 
57  inline const HepPDT::ParticleDataTable* theTable() const {
58  return pdt;
59  }
60 
62  void fill(const HepMC::GenEvent& hev);
63 
65  void fill(const reco::GenParticleCollection& hev);
66 
68  void fill(const std::vector<SimTrack>&, const std::vector<SimVertex>&);
69 
71  void printMCTruth(const HepMC::GenEvent& hev);
72 
74  void addParticles(const HepMC::GenEvent& hev);
75  void addParticles(const reco::GenParticleCollection& myGenParticles);
76 
78  void print() const;
79 
81  void clear();
82 
83 
85  void addChargedTrack(int id);
86 
88  inline unsigned int nTracks() const {
89  return nSimTracks;
90  }
91 
93  inline unsigned int nVertices() const {
94  return nSimVertices;
95  }
96 
98  inline unsigned int nGenParts() const {
99  return nGenParticles;
100  }
101 
103  inline unsigned int nChargedTracks() const {
104  return nChargedParticleTracks;
105  }
106 
108  inline FSimTrack& track(int id) const;
109 
111  inline FSimVertex& vertex(int id) const;
112 
114  inline FSimVertexType& vertexType(int id) const;
115 
117  int chargedTrack(int id) const;
118 
120  inline const SimTrack & embdTrack(int i) const;
121 
123  inline const SimVertex & embdVertex(int i) const;
124 
126  inline const FSimVertexType & embdVertexType(int i) const;
127 
129  const HepMC::GenParticle* embdGenpart(int i) const;
130 
132  int addSimTrack(const RawParticle* p, int iv, int ig=-1,
133  const HepMC::GenVertex* ev=0);
134 
136  int addSimVertex(const XYZTLorentzVector& decayVertex, int im=-1,
138 
139  const KineParticleFilter& filter() const { return *myFilter; }
140 
142  inline void setBeamSpot(const math::XYZPoint& aBeamSpot) {
143  theBeamSpot = aBeamSpot;
144  }
145 
146  protected:
147 
149  inline std::vector<FSimTrack>* tracks() const {
150  return theSimTracks;
151  }
152 
154  inline std::vector<FSimVertex>* vertices() const {
155  return theSimVertices;
156  }
157 
159  inline std::vector<HepMC::GenParticle*>* genparts() const {
160  return theGenParticles;
161  }
162 
163  private:
164 
165  std::vector<FSimTrack>* theSimTracks;
166  std::vector<FSimVertex>* theSimVertices;
168  std::vector<HepMC::GenParticle*>* theGenParticles;
169 
170  std::vector<unsigned>* theChargedTracks;
171 
172  unsigned int nSimTracks;
173  unsigned int nSimVertices;
174  unsigned int nGenParticles;
176 
177  unsigned int theTrackSize;
178  unsigned int theVertexSize;
179  unsigned int theGenSize;
180  unsigned int theChargedSize;
181  unsigned int initialSize;
182 
185 
186  double sigmaVerteX;
187  double sigmaVerteY;
188  double sigmaVerteZ;
189 
191 
194 
195  // Histos* myHistos;
196 
197 };
198 
199 #include "FastSimulation/Event/interface/FBaseSimEvent.icc"
200 
201 #endif // FBaseSimEvent_H
const ParticleDataTable * pdt
double lateVertexPosition
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:57
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
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:93
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:88
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
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.
Definition: FBaseSimEvent.h:98
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