-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38452 from mkirsano/hepmc3-addp8plugin
Add to Pythia8Interface the plugin that uses HepMC3
- Loading branch information
Showing
9 changed files
with
1,525 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
GeneratorInterface/Pythia8Interface/interface/Py8HMC3InterfaceBase.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#ifndef gen_Py8HMC3InterfaceBase_h | ||
#define gen_Py8HMC3InterfaceBase_h | ||
|
||
#include <vector> | ||
#include <string> | ||
|
||
#include "GeneratorInterface/Core/interface/ParameterCollector.h" | ||
#include "GeneratorInterface/Pythia8Interface/interface/P8RndmEngine.h" | ||
#include "GeneratorInterface/Core/interface/BaseHadronizer.h" | ||
|
||
#include <Pythia8/Pythia.h> | ||
#include <Pythia8Plugins/HepMC3.h> | ||
|
||
namespace Pythia8 { | ||
class EvtGenDecays; | ||
} | ||
|
||
namespace CLHEP { | ||
class HepRandomEngine; | ||
} | ||
|
||
namespace gen { | ||
|
||
class Py8HMC3InterfaceBase : public BaseHadronizer { | ||
public: | ||
Py8HMC3InterfaceBase(edm::ParameterSet const& ps); | ||
~Py8HMC3InterfaceBase() override = default; | ||
|
||
virtual bool generatePartonsAndHadronize() = 0; | ||
bool decay() { return true; } // NOT used - let's call it "design imperfection" | ||
bool readSettings(int); // common func | ||
void makeTmpSLHA(const std::string&); //helper for above | ||
virtual bool initializeForInternalPartons() = 0; | ||
bool declareStableParticles(const std::vector<int>&); // common func | ||
bool declareSpecialSettings(const std::vector<std::string>&); // common func | ||
virtual void finalizeEvent() = 0; | ||
virtual void statistics(); | ||
virtual const char* classname() const = 0; | ||
|
||
void p8SetRandomEngine(CLHEP::HepRandomEngine* v) { p8RndmEngine_.setRandomEngine(v); } | ||
P8RndmEngine& randomEngine() { return p8RndmEngine_; } | ||
|
||
protected: | ||
std::unique_ptr<Pythia8::Pythia> fMasterGen; | ||
std::unique_ptr<Pythia8::Pythia> fDecayer; | ||
HepMC3::Pythia8ToHepMC3 toHepMC; | ||
edm::ParameterSet fParameters; | ||
|
||
unsigned int pythiaPylistVerbosity; | ||
bool pythiaHepMCVerbosity; | ||
bool pythiaHepMCVerbosityParticles; | ||
unsigned int maxEventsToPrint; | ||
|
||
// EvtGen plugin | ||
// | ||
bool useEvtGen; | ||
std::shared_ptr<Pythia8::EvtGenDecays> evtgenDecays; | ||
std::string evtgenDecFile; | ||
std::string evtgenPdlFile; | ||
std::vector<std::string> evtgenUserFiles; | ||
|
||
std::string slhafile_; | ||
|
||
private: | ||
P8RndmEngine p8RndmEngine_; | ||
}; | ||
} // namespace gen | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.