CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
G4SimEvent.h
Go to the documentation of this file.
1 #ifndef SimG4Core_G4SimEvent_H
2 #define SimG4Core_G4SimEvent_H
3 
6 
9 
10 #include "HepMC/GenEvent.h"
11 // #include "CLHEP/Vector/LorentzVector.h"
12 
13 #include <vector>
14 
16 {
17 public:
18  G4SimEvent();
19  virtual ~G4SimEvent();
20  void load(edm::SimTrackContainer & c) const;
21  void load(edm::SimVertexContainer & c) const;
22  unsigned int nTracks() const { return g4tracks.size(); }
23  unsigned int nVertices() const { return g4vertices.size(); }
24  unsigned int nGenParts() const { return hepMCEvent->particles_size(); }
25  void hepEvent(const HepMC::GenEvent * r) { hepMCEvent = r; }
26  const HepMC::GenEvent * hepEvent() const { return hepMCEvent; }
27  void weight(float w) { weight_ = w; }
28  const float weight() const { return weight_; }
31  void nparam(int n) { nparam_ = n; }
32  const int nparam() const { return nparam_; }
33  void param(std::vector<float> p) { param_ = p; }
34  const std::vector<float> & param() const { return param_; }
35  void add(G4SimTrack * t) { g4tracks.push_back(t); }
36  void add(G4SimVertex * v) { g4vertices.push_back(v); }
37  const G4SimTrack & g4track(int i) const { return *g4tracks[i-1]; }
38  const G4SimVertex & g4vertex(int i) const { return *g4vertices[i-1]; }
39 protected:
40  const HepMC::GenEvent * hepMCEvent;
41  float weight_;
43  int nparam_;
44  std::vector<float> param_;
45  std::vector<G4SimTrack *> g4tracks;
46  std::vector<G4SimVertex *> g4vertices;
47 };
48 
49 #endif
int i
Definition: DBlmapReader.cc:9
void nparam(int n)
Definition: G4SimEvent.h:31
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:15
const float weight() const
Definition: G4SimEvent.h:28
const HepMC::GenEvent * hepEvent() const
Definition: G4SimEvent.h:26
int nparam_
Definition: G4SimEvent.h:43
std::vector< G4SimTrack * > g4tracks
Definition: G4SimEvent.h:45
const std::vector< float > & param() const
Definition: G4SimEvent.h:34
float weight_
Definition: G4SimEvent.h:41
void weight(float w)
Definition: G4SimEvent.h:27
void add(G4SimTrack *t)
Definition: G4SimEvent.h:35
std::vector< G4SimVertex * > g4vertices
Definition: G4SimEvent.h:46
void collisionPoint(math::XYZTLorentzVectorD v)
Definition: G4SimEvent.h:29
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:25
const HepMC::GenEvent * hepMCEvent
Definition: G4SimEvent.h:40
void param(std::vector< float > p)
Definition: G4SimEvent.h:33
unsigned int nTracks() const
Definition: G4SimEvent.h:22
unsigned int nVertices() const
Definition: G4SimEvent.h:23
void load(edm::SimTrackContainer &c) const
Definition: G4SimEvent.cc:55
unsigned int nGenParts() const
Definition: G4SimEvent.h:24
void add(G4SimVertex *v)
Definition: G4SimEvent.h:36
std::vector< SimVertex > SimVertexContainer
virtual ~G4SimEvent()
Definition: G4SimEvent.cc:19
const G4SimTrack & g4track(int i) const
Definition: G4SimEvent.h:37
std::vector< float > param_
Definition: G4SimEvent.h:44
const int nparam() const
Definition: G4SimEvent.h:32
const math::XYZTLorentzVectorD & collisionPoint() const
Definition: G4SimEvent.h:30
math::XYZTLorentzVectorD collisionPoint_
Definition: G4SimEvent.h:42
const G4SimVertex & g4vertex(int i) const
Definition: G4SimEvent.h:38
std::vector< SimTrack > SimTrackContainer
mathSSE::Vec4< T > v
T w() const