CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Herwig7Interface.h
Go to the documentation of this file.
1 
5 #ifndef GeneratorInterface_Herwig7Interface_Herwig7Interface_h
6 #define GeneratorInterface_Herwig7Interface_Herwig7Interface_h
7 
8 #include <memory>
9 #include <string>
10 
11 #include <HepMC/GenEvent.h>
12 #include <HepMC/PdfInfo.h>
13 #include <HepMC/IO_BaseClass.h>
14 
15 #include <ThePEG/Repository/EventGenerator.h>
16 #include <ThePEG/EventRecord/Event.h>
17 #include <ThePEG/Vectors/HepMCTraits.h>
18 
20 
23 
24 namespace ThePEG {
25 
26  template <>
27  struct HepMCTraits<HepMC::GenEvent> : public HepMCTraitsBase<HepMC::GenEvent,
28  HepMC::GenParticle,
29  HepMC::GenParticle *,
30  HepMC::GenVertex,
31  HepMC::GenVertex *,
32  HepMC::Polarization,
33  HepMC::PdfInfo> {};
34 
35 } // namespace ThePEG
36 
37 namespace CLHEP {
38  class HepRandomEngine;
39 }
40 
42 public:
44  ~Herwig7Interface() noexcept;
45 
46  void setPEGRandomEngine(CLHEP::HepRandomEngine *);
47 
48  ThePEG::EGPtr eg_;
49 
50 protected:
51  void initRepository(const edm::ParameterSet &params);
52  bool initGenerator();
54 
55  static std::auto_ptr<HepMC::GenEvent> convert(const ThePEG::EventPtr &event);
56 
57  static double pthat(const ThePEG::EventPtr &event);
58 
59  std::auto_ptr<HepMC::IO_BaseClass> iobc_;
60 
61  // HerwigUi contains settings piped to Herwig7
62  std::shared_ptr<Herwig::HerwigUIProvider> HwUI_;
63 
69  void callHerwigGenerator();
70 
71  // The Inputfile ist created according to the parameter set
72  void createInputFile(const edm::ParameterSet &params);
73 
74 private:
75  std::shared_ptr<ThePEG::RandomEngineGlue::Proxy> randomEngineGlueProxy_;
76 
80  // File name containing Herwig input config
82  const unsigned int skipEvents_;
83  CLHEP::HepRandomEngine *randomEngine;
84 };
85 
86 #endif // GeneratorInterface_Herwig7Interface_Herwig7Interface_h
static double pthat(const ThePEG::EventPtr &event)
void initRepository(const edm::ParameterSet &params)
void createInputFile(const edm::ParameterSet &params)
std::shared_ptr< Herwig::HerwigUIProvider > HwUI_
void setPEGRandomEngine(CLHEP::HepRandomEngine *)
std::auto_ptr< HepMC::IO_BaseClass > iobc_
CLHEP::HepRandomEngine * randomEngine
const std::string dataLocation_
~Herwig7Interface() noexcept
std::string dumpConfig_
ThePEG::EGPtr eg_
std::shared_ptr< ThePEG::RandomEngineGlue::Proxy > randomEngineGlueProxy_
const std::string run_
static std::auto_ptr< HepMC::GenEvent > convert(const ThePEG::EventPtr &event)
Herwig7Interface(const edm::ParameterSet &params)
const std::string generator_
const unsigned int skipEvents_
void flushRandomNumberGenerator()