1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/**
Marco A. Harrendorf
**/
#ifndef GeneratorInterface_Herwig7Interface_Herwig7Interface_h
#define GeneratorInterface_Herwig7Interface_Herwig7Interface_h
#include <memory>
#include <string>
#include <HepMC/GenEvent.h>
#include <HepMC/PdfInfo.h>
#include <HepMC/IO_BaseClass.h>
#include <ThePEG/Repository/EventGenerator.h>
#include <ThePEG/EventRecord/Event.h>
#include <ThePEG/Vectors/HepMCTraits.h>
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "GeneratorInterface/Herwig7Interface/interface/RandomEngineGlue.h"
#include "GeneratorInterface/Herwig7Interface/interface/HerwigUIProvider.h"
namespace ThePEG {
template <>
struct HepMCTraits<HepMC::GenEvent> : public HepMCTraitsBase<HepMC::GenEvent,
HepMC::GenParticle,
HepMC::GenParticle *,
HepMC::GenVertex,
HepMC::GenVertex *,
HepMC::Polarization,
HepMC::PdfInfo> {};
} // namespace ThePEG
namespace CLHEP {
class HepRandomEngine;
}
class Herwig7Interface {
public:
Herwig7Interface(const edm::ParameterSet ¶ms);
~Herwig7Interface() noexcept;
void setPEGRandomEngine(CLHEP::HepRandomEngine *);
ThePEG::EGPtr eg_;
protected:
void initRepository(const edm::ParameterSet ¶ms);
bool initGenerator();
void flushRandomNumberGenerator();
static std::unique_ptr<HepMC::GenEvent> convert(const ThePEG::EventPtr &event);
static double pthat(const ThePEG::EventPtr &event);
std::unique_ptr<HepMC::IO_BaseClass> iobc_;
// HerwigUi contains settings piped to Herwig7
std::shared_ptr<Herwig::HerwigUIProvider> HwUI_;
/**
* Function calls Herwig event generator via API
*
* According to the run mode different steps of event generation are done
**/
void callHerwigGenerator();
// The Inputfile ist created according to the parameter set
void createInputFile(const edm::ParameterSet ¶ms);
private:
std::shared_ptr<ThePEG::RandomEngineGlue::Proxy> randomEngineGlueProxy_;
const std::string dataLocation_;
const std::string generator_;
const std::string run_;
// File name containing Herwig input config
std::string dumpConfig_;
const unsigned int skipEvents_;
CLHEP::HepRandomEngine *randomEngine;
};
#endif // GeneratorInterface_Herwig7Interface_Herwig7Interface_h
|