Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-19 10:28:29

0001 #ifndef gen_Pythia6Gun_h
0002 #define gen_Pythia6Gun_h
0003 
0004 /** \class Pythia6Gun
0005  *
0006  * Generates single particle gun in HepMC format
0007  * Julia Yarba 02/2009 
0008  ***************************************/
0009 
0010 #include <string>
0011 #include <vector>
0012 
0013 //#include "HepPDT/defs.h"
0014 //#include "HepPDT/TableBuilder.hh"
0015 //#include "HepPDT/ParticleDataTable.hh"
0016 
0017 #include "HepMC/GenEvent.h"
0018 
0019 // #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "FWCore/Framework/interface/one/EDProducer.h"
0021 
0022 #include "GeneratorInterface/Pythia6Interface/interface/Pythia6Service.h"
0023 #include "GeneratorInterface/Pythia6Interface/interface/Pythia6Declarations.h"
0024 
0025 #include "HepPID/ParticleIDTranslations.hh"
0026 
0027 namespace CLHEP {
0028   class HepRandomEngine;
0029 }
0030 
0031 namespace edm {
0032   class EventSetup;
0033   class LuminosityBlock;
0034 }  // namespace edm
0035 
0036 namespace gen {
0037 
0038   // class Pythia6Service;
0039 
0040   class Pythia6Gun
0041       : public edm::one::EDProducer<edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources> {
0042   public:
0043     Pythia6Gun(const edm::ParameterSet&);
0044     ~Pythia6Gun() override;
0045     void beginJob() override;
0046     void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0047     void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) final;
0048     void beginRun(edm::Run const&, edm::EventSetup const&) override;
0049     void endRun(edm::Run const&, edm::EventSetup const&) override;
0050     void produce(edm::Event&, const edm::EventSetup&) override;
0051 
0052   protected:
0053     void attachPy6DecaysToGenEvent();
0054     void loadEvent(edm::Event&);
0055     virtual void generateEvent(CLHEP::HepRandomEngine*) = 0;
0056     HepMC::GenParticle* addAntiParticle(int&, int&, double&, double&, double&);
0057 
0058     Pythia6Service* fPy6Service;
0059 
0060     // gun particle(s) characteristics
0061     //
0062     std::vector<int> fPartIDs;
0063     double fMinPhi;
0064     double fMaxPhi;
0065 
0066     // the event format itself
0067     //
0068     HepMC::GenEvent* fEvt;
0069 
0070     // HepMC/HepPDT related things
0071     // (for particle/event construction)
0072     //
0073     // edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
0074 
0075     bool fHepMCVerbosity;
0076     int fPylistVerbosity;
0077     int fMaxEventsToPrint;
0078   };
0079 
0080 }  // namespace gen
0081 
0082 #endif