Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-22 02:39:43

0001 #ifndef BaseFlatGunProducer_H
0002 #define BaseFlatGunProducer_H
0003 
0004 /** \class FlatRandomEGunProducer
0005  *
0006  * Generates single particle gun in HepMC format
0007  * Julia Yarba 10/2005 
0008  ***************************************/
0009 #include <string>
0010 
0011 #include "HepPDT/defs.h"
0012 #include "HepPDT/TableBuilder.hh"
0013 #include "HepPDT/ParticleDataTable.hh"
0014 
0015 #include "HepMC/GenEvent.h"
0016 
0017 #include "FWCore/Framework/interface/ESHandle.h"
0018 #include "FWCore/Framework/interface/one/EDProducer.h"
0019 #include "FWCore/Framework/interface/EventSetup.h"
0020 #include "FWCore/Framework/interface/Run.h"
0021 
0022 #include <memory>
0023 
0024 namespace edm {
0025 
0026   class BaseFlatGunProducer : public one::EDProducer<one::WatchRuns, EndRunProducer> {
0027   public:
0028     BaseFlatGunProducer(const ParameterSet&);
0029     ~BaseFlatGunProducer() override;
0030     void beginRun(const edm::Run& r, const edm::EventSetup&) override;
0031     void endRun(edm::Run const& r, const edm::EventSetup&) override;
0032     void endRunProduce(edm::Run& r, const edm::EventSetup&) override;
0033 
0034   private:
0035     const ESGetToken<HepPDT::ParticleDataTable, edm::DefaultRecord> fPDGTableToken;
0036 
0037   protected:
0038     // non-virtuals ! this and only way !
0039     //
0040     // data members
0041 
0042     // gun particle(s) characteristics
0043     std::vector<int> fPartIDs;
0044     double fMinEta;
0045     double fMaxEta;
0046     double fMinPhi;
0047     double fMaxPhi;
0048 
0049     // the event format itself
0050     HepMC::GenEvent* fEvt;
0051 
0052     // HepMC/HepPDT related things
0053     // (for particle/event construction)
0054     //std::string      fPDGTablePath ;
0055     //std::string      fPDGTableName ;
0056     // DefaultConfig::ParticleDataTable* fPDGTable;
0057     // DefaultConfig::ParticleDataTable* fTestTable ;
0058     // ESHandle<DefaultConfig::ParticleDataTable> fPDGTable ;
0059     ESHandle<HepPDT::ParticleDataTable> fPDGTable;
0060 
0061     int fVerbosity;
0062 
0063     bool fAddAntiParticle;
0064   };
0065 }  // namespace edm
0066 
0067 #endif