Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-02 05:09:45

0001 #ifndef gen_Py8InterfaceBase_h
0002 #define gen_Py8InterfaceBase_h
0003 
0004 #include <vector>
0005 #include <string>
0006 
0007 #include "GeneratorInterface/Core/interface/ParameterCollector.h"
0008 #include "GeneratorInterface/Pythia8Interface/interface/P8RndmEngine.h"
0009 #include "GeneratorInterface/Core/interface/BaseHadronizer.h"
0010 
0011 #include "HepMC/IO_AsciiParticles.h"
0012 
0013 #include <Pythia8/Pythia.h>
0014 #include <Pythia8Plugins/HepMC2.h>
0015 //#include <Dire/Dire.h>
0016 
0017 namespace Pythia8 {
0018   class EvtGenDecays;
0019 }
0020 
0021 namespace CLHEP {
0022   class HepRandomEngine;
0023 }
0024 
0025 namespace gen {
0026 
0027   class Py8InterfaceBase : public BaseHadronizer {
0028   public:
0029     Py8InterfaceBase(edm::ParameterSet const& ps);
0030     ~Py8InterfaceBase() override {}
0031 
0032     virtual bool generatePartonsAndHadronize() = 0;
0033     bool decay() { return true; }          // NOT used - let's call it "design imperfection"
0034     bool readSettings(int);                // common func
0035     void makeTmpSLHA(const std::string&);  //helper for above
0036     virtual bool initializeForInternalPartons() = 0;
0037     bool declareStableParticles(const std::vector<int>&);          // common func
0038     bool declareSpecialSettings(const std::vector<std::string>&);  // common func
0039     virtual void finalizeEvent() = 0;
0040     virtual void statistics();
0041     virtual const char* classname() const = 0;
0042 
0043     void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_->setRandomEngine(v); }
0044     P8RndmEngine& randomEngine() { return *p8RndmEngine_; }
0045 
0046   protected:
0047     std::unique_ptr<Pythia8::Pythia> fMasterGen;
0048     std::unique_ptr<Pythia8::Pythia> fDecayer;
0049     HepMC::Pythia8ToHepMC toHepMC;
0050     //   ParameterCollector         fParameters;
0051     edm::ParameterSet fParameters;
0052 
0053     unsigned int pythiaPylistVerbosity;
0054     bool pythiaHepMCVerbosity;
0055     bool pythiaHepMCVerbosityParticles;
0056     unsigned int maxEventsToPrint;
0057     HepMC::IO_AsciiParticles* ascii_io;
0058 
0059     // EvtGen plugin
0060     //
0061     bool useEvtGen;
0062     std::shared_ptr<Pythia8::EvtGenDecays> evtgenDecays;
0063     std::string evtgenDecFile;
0064     std::string evtgenPdlFile;
0065     std::vector<std::string> evtgenUserFiles;
0066 
0067     std::string slhafile_;
0068 
0069   private:
0070     std::shared_ptr<P8RndmEngine> p8RndmEngine_;
0071   };
0072 }  // namespace gen
0073 #endif