![]() |
![]() |
00001 // ---------------------------------------------------------------------- 00002 // FlatEGunASCIIWriter.h 00003 // Author: Julia Yarba 00004 // 00005 // This code has been molded after examples in HepMC and HepPDT, and 00006 // after single particle gun example (private contacts with Lynn Garren) 00007 // 00008 // Plus, it uses the ParameterSet funtionalities for "user interface" 00009 // 00010 // ---------------------------------------------------------------------- 00011 00012 #ifndef FlatEGunASCIIWriter_h 00013 #define FlatEGunASCIIWriter_h 00014 00015 // base class 00016 #include "FWCore/Framework/interface/EDAnalyzer.h" 00017 00018 // for local things (data members) 00019 #include <string> 00020 00021 #include "HepPDT/defs.h" 00022 #include "HepPDT/TableBuilder.hh" 00023 #include "HepPDT/ParticleDataTable.hh" 00024 00025 #include "HepMC/GenEvent.h" 00026 #include "HepMC/IO_GenEvent.h" 00027 00028 #include "FWCore/Framework/interface/ESHandle.h" 00029 #include "FWCore/Framework/interface/EventSetup.h" 00030 00031 namespace edm 00032 { 00033 00034 class FlatEGunASCIIWriter : public edm::EDAnalyzer 00035 { 00036 00037 public: 00038 00039 // The following is not yet used, but will be the primary 00040 // constructor when the parameter set system is available. 00041 // 00042 explicit FlatEGunASCIIWriter( const edm::ParameterSet& ) ; 00043 00044 virtual ~FlatEGunASCIIWriter() ; 00045 00046 virtual void analyze( const edm::Event&, const edm::EventSetup&) override; 00047 virtual void beginJob() ; 00048 virtual void beginRun(const edm::Run&, const EventSetup&) override; 00049 00050 private: 00051 00052 00053 // gun particle(s) characteristics 00054 std::vector<int> fPartIDs ; 00055 double fMinEta ; 00056 double fMaxEta ; 00057 double fMinPhi ; 00058 double fMaxPhi ; 00059 double fMinE ; 00060 double fMaxE ; 00061 00062 // the event format itself 00063 HepMC::GenEvent* fEvt; 00064 00065 00066 // HepMC/HepPDT related things 00067 ESHandle<HepPDT::ParticleDataTable> fPDGTable ; 00068 00069 std::string fOutFileName; 00070 HepMC::IO_GenEvent * fOutStream ; 00071 00072 int fCurrentEvent ; // event counter - untill I learn how to get it 00073 // from edm::Event ) EventID ??? or what ?) 00074 00075 }; 00076 00077 } 00078 00079 #endif