CMS 3D CMS Logo

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 
12 #include <vector>
13 
15 {
16 public:
17  G4SimEvent();
18  virtual ~G4SimEvent();
19  void load(edm::SimTrackContainer & c) const;
20  void load(edm::SimVertexContainer & c) const;
21  unsigned int nTracks() const { return g4tracks.size(); }
22  unsigned int nVertices() const { return g4vertices.size(); }
23  unsigned int nGenParts() const { return hepMCEvent->particles_size(); }
24  void hepEvent(const HepMC::GenEvent * r) { hepMCEvent = r; }
25  const HepMC::GenEvent * hepEvent() const { return hepMCEvent; }
26  void weight(float w) { weight_ = w; }
27  float weight() const { return weight_; }
30  void nparam(int n) { nparam_ = n; }
31  const int nparam() const { return nparam_; }
32  void param(const std::vector<float>& p) { param_ = p; }
33  const std::vector<float> & param() const { return param_; }
34  void add(G4SimTrack * t) { g4tracks.push_back(t); }
35  void add(G4SimVertex * v) { g4vertices.push_back(v); }
36  const G4SimTrack & g4track(int i) const { return *g4tracks[i-1]; }
37  const G4SimVertex & g4vertex(int i) const { return *g4vertices[i-1]; }
38 protected:
39  const HepMC::GenEvent * hepMCEvent;
40  float weight_;
42  int nparam_;
43  std::vector<float> param_;
44  std::vector<G4SimTrack *> g4tracks;
45  std::vector<G4SimVertex *> g4vertices;
46 };
47 
48 #endif
void nparam(int n)
Definition: G4SimEvent.h:30
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
const double w
Definition: UKUtility.cc:23
const HepMC::GenEvent * hepEvent() const
Definition: G4SimEvent.h:25
int nparam_
Definition: G4SimEvent.h:42
std::vector< G4SimTrack * > g4tracks
Definition: G4SimEvent.h:44
const std::vector< float > & param() const
Definition: G4SimEvent.h:33
float weight_
Definition: G4SimEvent.h:40
void weight(float w)
Definition: G4SimEvent.h:26
void add(G4SimTrack *t)
Definition: G4SimEvent.h:34
std::vector< G4SimVertex * > g4vertices
Definition: G4SimEvent.h:45
void param(const std::vector< float > &p)
Definition: G4SimEvent.h:32
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:24
const HepMC::GenEvent * hepMCEvent
Definition: G4SimEvent.h:39
unsigned int nTracks() const
Definition: G4SimEvent.h:21
unsigned int nVertices() const
Definition: G4SimEvent.h:22
void load(edm::SimTrackContainer &c) const
Definition: G4SimEvent.cc:40
unsigned int nGenParts() const
Definition: G4SimEvent.h:23
void add(G4SimVertex *v)
Definition: G4SimEvent.h:35
std::vector< SimVertex > SimVertexContainer
virtual ~G4SimEvent()
Definition: G4SimEvent.cc:18
const G4SimTrack & g4track(int i) const
Definition: G4SimEvent.h:36
std::vector< float > param_
Definition: G4SimEvent.h:43
const int nparam() const
Definition: G4SimEvent.h:31
float weight() const
Definition: G4SimEvent.h:27
const math::XYZTLorentzVectorD & collisionPoint() const
Definition: G4SimEvent.h:29
math::XYZTLorentzVectorD collisionPoint_
Definition: G4SimEvent.h:41
const G4SimVertex & g4vertex(int i) const
Definition: G4SimEvent.h:37
std::vector< SimTrack > SimTrackContainer
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:28