00001 #ifndef SimG4Core_Generator_H 00002 #define SimG4Core_Generator_H 00003 00004 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00005 00006 #include "SimG4Core/Generators/interface/HepMCParticle.h" 00007 #include "SimG4Core/Notification/interface/GenParticleInfo.h" 00008 00009 #include "HepMC/GenEvent.h" 00010 #include "HepMC/GenParticle.h" 00011 #include "HepMC/ParticleDataTable.h" 00012 00013 #include "DataFormats/Math/interface/LorentzVector.h" 00014 00015 #include <vector> 00016 #include <map> 00017 #include <string> 00018 00019 class G4Event; 00020 class G4PrimaryParticle; 00021 00022 class Generator 00023 { 00024 public: 00025 Generator(const edm::ParameterSet & p); 00026 virtual ~Generator(); 00027 // temp.(?) method 00028 void setGenEvent( const HepMC::GenEvent* inpevt ) { evt_ = (HepMC::GenEvent*)inpevt; return ; } 00029 void HepMC2G4(const HepMC::GenEvent * g,G4Event * e); 00030 void nonBeamEvent2G4(const HepMC::GenEvent * g,G4Event * e); 00031 virtual const HepMC::GenEvent* genEvent() const { return evt_; } 00032 virtual const math::XYZTLorentzVector* genVertex() const { return vtx_; } 00033 virtual const double eventWeight() const { return weight_; } 00034 private: 00035 bool particlePassesPrimaryCuts(const G4PrimaryParticle * p) const; 00036 bool particlePassesPrimaryCuts( const math::XYZTLorentzVector& mom, const double zimp ) const ; 00037 void particleAssignDaughters(G4PrimaryParticle * p, HepMC::GenParticle * hp, double length); 00038 void setGenId(G4PrimaryParticle* p, int id) const 00039 {p->SetUserInformation(new GenParticleInfo(id));} 00040 00041 private: 00042 bool fPCuts; 00043 bool fEtaCuts; 00044 bool fPhiCuts; 00045 double theMinPhiCut; 00046 double theMaxPhiCut; 00047 double theMinEtaCut; 00048 double theMaxEtaCut; 00049 double theMinPCut; 00050 double theMaxPCut; 00051 double theRDecLenCut; 00052 double theEtaCutForHector; 00053 int verbose; 00054 HepMC::GenEvent* evt_; 00055 math::XYZTLorentzVector* vtx_; 00056 double weight_; 00057 double Z_lmin,Z_lmax,Z_hector; 00058 }; 00059 00060 #endif