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