00001 #ifndef BaseFlatGunProducer_H 00002 #define BaseFlatGunProducer_H 00003 00009 #include <string> 00010 00011 #include "HepPDT/defs.h" 00012 #include "HepPDT/TableBuilder.hh" 00013 #include "HepPDT/ParticleDataTable.hh" 00014 00015 #include "HepMC/GenEvent.h" 00016 00017 #include "FWCore/Framework/interface/ESHandle.h" 00018 #include "FWCore/Framework/interface/one/EDProducer.h" 00019 #include "FWCore/Framework/interface/EventSetup.h" 00020 #include "FWCore/Framework/interface/Run.h" 00021 00022 #include "CLHEP/Random/JamesRandom.h" 00023 #include "CLHEP/Random/RandFlat.h" 00024 00025 #include <memory> 00026 #include "boost/shared_ptr.hpp" 00027 00028 namespace edm 00029 { 00030 00031 class BaseFlatGunProducer : public one::EDProducer<one::WatchRuns, 00032 EndRunProducer> 00033 { 00034 00035 public: 00036 BaseFlatGunProducer(const ParameterSet &); 00037 virtual ~BaseFlatGunProducer(); 00038 void beginRun(const edm::Run & r, const edm::EventSetup&) override; 00039 void endRun(edm::Run const& r, const edm::EventSetup&) override; 00040 void endRunProduce(edm::Run& r, const edm::EventSetup&) override; 00041 00042 private: 00043 00044 protected: 00045 00046 // non-virtuals ! this and only way ! 00047 // 00048 // data members 00049 00050 // gun particle(s) characteristics 00051 std::vector<int> fPartIDs ; 00052 double fMinEta ; 00053 double fMaxEta ; 00054 double fMinPhi ; 00055 double fMaxPhi ; 00056 00057 // the event format itself 00058 HepMC::GenEvent* fEvt; 00059 00060 // HepMC/HepPDT related things 00061 // (for particle/event construction) 00062 //std::string fPDGTablePath ; 00063 //std::string fPDGTableName ; 00064 // DefaultConfig::ParticleDataTable* fPDGTable; 00065 // DefaultConfig::ParticleDataTable* fTestTable ; 00066 // ESHandle<DefaultConfig::ParticleDataTable> fPDGTable ; 00067 ESHandle<HepPDT::ParticleDataTable> fPDGTable ; 00068 00069 int fVerbosity ; 00070 00071 CLHEP::HepRandomEngine& fRandomEngine ; 00072 CLHEP::RandFlat* fRandomGenerator; 00073 00074 bool fAddAntiParticle; 00075 00076 }; 00077 } 00078 00079 #endif