CMS 3D CMS Logo

Herwig7Interface.h
Go to the documentation of this file.
1 
6 #ifndef GeneratorInterface_Herwig7Interface_Herwig7Interface_h
7 #define GeneratorInterface_Herwig7Interface_Herwig7Interface_h
8 
9 
10 
11 #include <memory>
12 #include <string>
13 
14 #include <boost/shared_ptr.hpp>
15 
16 #include <HepMC/GenEvent.h>
17 #include <HepMC/PdfInfo.h>
18 #include <HepMC/IO_BaseClass.h>
19 
20 #include <ThePEG/Repository/EventGenerator.h>
21 #include <ThePEG/EventRecord/Event.h>
22 #include <ThePEG/Vectors/HepMCTraits.h>
23 
25 
28 
29 namespace ThePEG {
30 
31  template<> struct HepMCTraits<HepMC::GenEvent> :
32  public HepMCTraitsBase<
33  HepMC::GenEvent, HepMC::GenParticle,
34  HepMC::GenVertex, HepMC::Polarization,
35  HepMC::PdfInfo> {};
36 
37 }
38 
39 namespace CLHEP {
40  class HepRandomEngine;
41 }
42 
44  public:
45  Herwig7Interface(const edm::ParameterSet &params);
47 
48  void setPEGRandomEngine(CLHEP::HepRandomEngine*);
49 
50  ThePEG::EGPtr eg_;
51 
52 
53 
54  protected:
55  void initRepository(const edm::ParameterSet &params);
56  bool initGenerator();
57  void flushRandomNumberGenerator();
58 
59  static std::auto_ptr<HepMC::GenEvent>
60  convert(const ThePEG::EventPtr &event);
61 
62  static double pthat(const ThePEG::EventPtr &event);
63 
64 
65 
66  std::auto_ptr<HepMC::IO_BaseClass> iobc_;
67 
68  // HerwigUi contains settings piped to Herwig7
69  std::shared_ptr<Herwig::HerwigUIProvider> HwUI_;
70 
76  void callHerwigGenerator();
77 
78 
79  // The Inputfile ist created according to the parameter set
80  void createInputFile(const edm::ParameterSet &params);
81 
82 
83 
84  private:
85  boost::shared_ptr<ThePEG::RandomEngineGlue::Proxy>
87 
91  // File name containing Herwig input config
93  const unsigned int skipEvents_;
94  CLHEP::HepRandomEngine* randomEngine;
95 };
96 
97 
98 
99 
100 
101 
102 
103 #endif // GeneratorInterface_Herwig7Interface_Herwig7Interface_h
std::shared_ptr< Herwig::HerwigUIProvider > HwUI_
std::auto_ptr< HepMC::IO_BaseClass > iobc_
#define noexcept
CLHEP::HepRandomEngine * randomEngine
const std::string dataLocation_
std::string dumpConfig_
ThePEG::EGPtr eg_
const std::string run_
def convert(infile, ofile)
const std::string generator_
const unsigned int skipEvents_
boost::shared_ptr< ThePEG::RandomEngineGlue::Proxy > randomEngineGlueProxy_
Definition: event.py:1