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 <>
32  struct HepMCTraits<HepMC::GenEvent> : public HepMCTraitsBase<HepMC::GenEvent,
33  HepMC::GenParticle,
34  HepMC::GenParticle *,
35  HepMC::GenVertex,
36  HepMC::GenVertex *,
37  HepMC::Polarization,
38  HepMC::PdfInfo> {};
39 
40 } // namespace ThePEG
41 
42 namespace CLHEP {
43  class HepRandomEngine;
44 }
45 
47  public:
48  Herwig7Interface(const edm::ParameterSet &params);
50 
51  void setPEGRandomEngine(CLHEP::HepRandomEngine*);
52 
53  ThePEG::EGPtr eg_;
54 
55 
56 
57  protected:
58  void initRepository(const edm::ParameterSet &params);
59  bool initGenerator();
60  void flushRandomNumberGenerator();
61 
62  static std::auto_ptr<HepMC::GenEvent>
63  convert(const ThePEG::EventPtr &event);
64 
65  static double pthat(const ThePEG::EventPtr &event);
66 
67 
68 
69  std::auto_ptr<HepMC::IO_BaseClass> iobc_;
70 
71  // HerwigUi contains settings piped to Herwig7
72  std::shared_ptr<Herwig::HerwigUIProvider> HwUI_;
73 
79  void callHerwigGenerator();
80 
81 
82  // The Inputfile ist created according to the parameter set
83  void createInputFile(const edm::ParameterSet &params);
84 
85 
86 
87  private:
88  boost::shared_ptr<ThePEG::RandomEngineGlue::Proxy>
90 
94  // File name containing Herwig input config
96  const unsigned int skipEvents_;
97  CLHEP::HepRandomEngine* randomEngine;
98 };
99 
100 
101 
102 
103 
104 
105 
106 #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