CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimG4Core/Application/interface/G4SimEvent.h

Go to the documentation of this file.
00001 #ifndef SimG4Core_G4SimEvent_H
00002 #define SimG4Core_G4SimEvent_H
00003 
00004 #include "SimG4Core/Application/interface/G4SimTrack.h"
00005 #include "SimG4Core/Application/interface/G4SimVertex.h"
00006 
00007 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00008 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00009 
00010 #include "HepMC/GenEvent.h"
00011 // #include "CLHEP/Vector/LorentzVector.h"
00012 
00013 #include <vector>
00014 
00015 class G4SimEvent
00016 {
00017 public:
00018     G4SimEvent();
00019     virtual ~G4SimEvent();
00020     void load(edm::SimTrackContainer & c) const;
00021     void load(edm::SimVertexContainer & c)  const;
00022     unsigned int nTracks() const { return g4tracks.size(); }
00023     unsigned int nVertices() const { return g4vertices.size(); }
00024     unsigned int nGenParts() const { return hepMCEvent->particles_size(); }
00025     void hepEvent(const HepMC::GenEvent * r) { hepMCEvent = r; }
00026     const HepMC::GenEvent * hepEvent() const { return hepMCEvent; }
00027     void weight(float w) { weight_ = w; }
00028     const float weight() const { return weight_; }
00029     void collisionPoint( math::XYZTLorentzVectorD v ) { collisionPoint_ = v ; }
00030     const math::XYZTLorentzVectorD& collisionPoint() const { return collisionPoint_; }
00031     void nparam(int n) { nparam_ = n; }
00032     const int nparam() const { return nparam_; }
00033     void param(std::vector<float> p) { param_ = p; }
00034     const std::vector<float> & param() const { return param_; }
00035     void add(G4SimTrack * t) { g4tracks.push_back(t); }
00036     void add(G4SimVertex * v) { g4vertices.push_back(v); }
00037     const G4SimTrack & g4track(int i) const { return *g4tracks[i-1]; }
00038     const G4SimVertex & g4vertex(int i) const { return *g4vertices[i-1]; }
00039 protected:
00040     const HepMC::GenEvent * hepMCEvent;  
00041     float weight_;
00042     math::XYZTLorentzVectorD collisionPoint_;
00043     int nparam_;
00044     std::vector<float> param_;
00045     std::vector<G4SimTrack *> g4tracks;
00046     std::vector<G4SimVertex *> g4vertices;
00047 };
00048 
00049 #endif