Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-31 22:26:11

0001 #ifndef SimG4Core_G4SimEvent_H
0002 #define SimG4Core_G4SimEvent_H
0003 
0004 #include "SimG4Core/Notification/interface/G4SimTrack.h"
0005 #include "SimG4Core/Notification/interface/G4SimVertex.h"
0006 
0007 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0008 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0009 
0010 #include "HepMC/GenEvent.h"
0011 
0012 #include <vector>
0013 
0014 class G4SimEvent {
0015 public:
0016   G4SimEvent();
0017   virtual ~G4SimEvent();
0018   void load(edm::SimTrackContainer& c) const;
0019   void load(edm::SimVertexContainer& c) const;
0020   unsigned int nTracks() const { return g4tracks_.size(); }
0021   unsigned int nVertices() const { return g4vertices_.size(); }
0022   unsigned int nGenParts() const { return hepMCEvent_->particles_size(); }
0023   void hepEvent(const HepMC::GenEvent* r) { hepMCEvent_ = r; }
0024   const HepMC::GenEvent* hepEvent() const { return hepMCEvent_; }
0025   void weight(float w) { weight_ = w; }
0026   float weight() const { return weight_; }
0027   void collisionPoint(const math::XYZTLorentzVectorD& v) { collisionPoint_ = v; }
0028   const math::XYZTLorentzVectorD& collisionPoint() const { return collisionPoint_; }
0029   void nparam(int n) { nparam_ = n; }
0030   const int nparam() const { return nparam_; }
0031   void param(const std::vector<float>& p) { param_ = p; }
0032   const std::vector<float>& param() const { return param_; }
0033   void add(G4SimTrack* t) { g4tracks_.push_back(t); }
0034   void add(G4SimVertex* v) { g4vertices_.push_back(v); }
0035   void clear();
0036 
0037 private:
0038   const HepMC::GenEvent* hepMCEvent_;
0039   float weight_;
0040   math::XYZTLorentzVectorD collisionPoint_;
0041   int nparam_;
0042   std::vector<float> param_;
0043   std::vector<G4SimTrack*> g4tracks_;
0044   std::vector<G4SimVertex*> g4vertices_;
0045 };
0046 
0047 #endif