CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
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  const G4SimTrack& g4track(int i) const { return *g4tracks[i - 1]; }
36  const G4SimVertex& g4vertex(int i) const { return *g4vertices[i - 1]; }
37 
38 protected:
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:29
const edm::EventSetup & c
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:24
std::vector< G4SimTrack * > g4tracks
Definition: G4SimEvent.h:44
int nparam_
Definition: G4SimEvent.h:42
const std::vector< float > & param() const
Definition: G4SimEvent.h:32
float weight_
Definition: G4SimEvent.h:40
void weight(float w)
Definition: G4SimEvent.h:25
void add(G4SimTrack *t)
Definition: G4SimEvent.h:33
void param(const std::vector< float > &p)
Definition: G4SimEvent.h:31
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:23
const HepMC::GenEvent * hepMCEvent
Definition: G4SimEvent.h:39
unsigned int nTracks() const
Definition: G4SimEvent.h:20
unsigned int nVertices() const
Definition: G4SimEvent.h:21
void load(edm::SimTrackContainer &c) const
Definition: G4SimEvent.cc:37
unsigned int nGenParts() const
Definition: G4SimEvent.h:22
void add(G4SimVertex *v)
Definition: G4SimEvent.h:34
std::vector< SimVertex > SimVertexContainer
std::vector< G4SimVertex * > g4vertices
Definition: G4SimEvent.h:45
virtual ~G4SimEvent()
Definition: G4SimEvent.cc:18
const G4SimTrack & g4track(int i) const
Definition: G4SimEvent.h:35
std::vector< float > param_
Definition: G4SimEvent.h:43
const int nparam() const
Definition: G4SimEvent.h:30
float weight() const
Definition: G4SimEvent.h:26
const math::XYZTLorentzVectorD & collisionPoint() const
Definition: G4SimEvent.h:28
math::XYZTLorentzVectorD collisionPoint_
Definition: G4SimEvent.h:41
const G4SimVertex & g4vertex(int i) const
Definition: G4SimEvent.h:36
std::vector< SimTrack > SimTrackContainer
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:27