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