Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-03 04:17:52

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