ATLAS Offline Software
Herwig7.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // -*- C++ -*-
5 
11 #ifndef GENERATORMODULES_HERWIG7_H
12 #define GENERATORMODULES_HERWIG7_H
13 
15 
16 #include "ThePEG/Repository/Repository.h"
17 #include "ThePEG/Repository/EventGenerator.h"
18 #include "ThePEG/EventRecord/Event.h"
19 #include "Herwig/API/HerwigUI.h"
20 
22 
24 class Herwig7API : public Herwig::HerwigUI {
25 
26 public:
27 
30  // ATH_MSG_DEBUG("HERWIG7_PATH is "+getenv("HERWIG7_PATH"));
31  // ThePEG::Repository::load(getenv("HERWIG7_PATH")+"/share/Herwig/HerwigDefaults.rpo");
32  // };
33 
36 
37 
40 
42  virtual bool resume() const { return(m_resume); }
43 
45  virtual bool tics() const { return(m_tics); }
46 
47 
49  virtual std::string repository() const { return(m_repository); }
50 
52  virtual std::string inputfile() const { return(m_inputfile); }
53  void inputfile(const std::string inputfile) { m_inputfile = inputfile; }
54 
56  virtual std::string setupfile() const { return(m_setupfile); }
57 
59  virtual std::string tag() const { return(m_tag); }
60 
62  virtual std::string integrationList() const { return(m_integrationList); }
63 
64 
66  virtual const std::vector<std::string> & prependReadDirectories() const { return(m_prependReadDirectories); }
67 
69  virtual const std::vector<std::string> & appendReadDirectories() const { return(m_appendReadDirectories); }
70 
71 
72  virtual long N() const { return(m_N); }
73 
74  virtual int seed() const { return(m_seed); }
75  void seed(int seed) { m_seed = seed; }
76 
77  virtual int jobs() const { return(m_jobs); }
78  virtual unsigned int jobSize() const { return(m_jobsize); }
79  virtual unsigned int maxJobs() const { return(m_maxjobs); }
80 
82  virtual void quitWithHelp() const {
83  std::cerr << "=================================\n";
84  std::cerr << "HERE I CAN PUT SOME ERROR MESSAGE\n";
85  std::cerr << "=================================\n";
86  quit();
87  }
88 
90  virtual void quit() const {
91  ThePEG::Repository::cleanup();
92  std::abort();
93  }
94 
96  virtual std::ostream& outStream() const { return(std::cout); }
97 
99  virtual std::ostream& errStream() const { return(std::cerr); }
100 
102  virtual std::istream& inStream() const { return(std::cin); }
103 
104 
105 private:
106 
108 
109  bool m_resume;
110  bool m_tics;
111 
112  std::string m_repository;
113  std::string m_inputfile;
114  std::string m_setupfile;
115  std::string m_tag;
116 
117  std::string m_integrationList;
118 
119  std::vector<std::string> m_prependReadDirectories;
120  std::vector<std::string> m_appendReadDirectories;
121 
122  long m_N;
123  int m_seed;
124  int m_jobs;
125  unsigned int m_jobsize;
126  unsigned int m_maxjobs;
127 
128 };
129 
130 
131 
133 class Herwig7 : public GenModule {
134 
135 public:
136 
138  Herwig7(const std::string& name, ISvcLocator* pSvcLocator);
139 
142 
145 
147  StatusCode fillEvt(HepMC::GenEvent* evt);
148 
151 
152 
153 private:
154 
157 
159  ThePEG::EGPtr m_gen;
160 
162  ThePEG::EventPtr m_event;
163 
164 
166 
167 
169  std::string m_runname;
170 
172  std::string m_runfile;
173 
175  std::string m_setupfile;
176 
177 
180 
183 
185  std::string m_pdfname_me;
186 
188  // std::string m_pdfname_ps;
189 
191  std::string m_pdfname_mpi;
192 
195 
197  double m_xsscale;
198 
200  int m_dsid;
201 
203  , "EventInfo"
204  , "TMPEvtInfo"
205  , "ReadHandleKey for xAOD::EventInfo"};
206 
208 
209 };
210 
211 #endif
Herwig7API::m_inputfile
std::string m_inputfile
Definition: Herwig7.h:113
Herwig7API::m_jobsize
unsigned int m_jobsize
Definition: Herwig7.h:125
Herwig7API::prependReadDirectories
virtual const std::vector< std::string > & prependReadDirectories() const
Directories from which Herwig reads input files, will be prepended to the search path.
Definition: Herwig7.h:66
Herwig7API::inputfile
virtual std::string inputfile() const
Name of the file to be read.
Definition: Herwig7.h:52
Herwig7::m_pdfname_mpi
std::string m_pdfname_mpi
PS PDF name, stored for AMI capture at finalize.
Definition: Herwig7.h:191
Herwig7::m_xsscale
double m_xsscale
Scale integrated cross section by a factor for MetaData output.
Definition: Herwig7.h:197
Herwig7::m_pdfname_me
std::string m_pdfname_me
ME PDF name, stored for AMI capture at finalize.
Definition: Herwig7.h:185
Herwig7API::seed
void seed(int seed)
The seed to use.
Definition: Herwig7.h:75
Herwig7API::Herwig7API
Herwig7API()
Constructor.
Definition: Herwig7.h:29
Herwig7API::tag
virtual std::string tag() const
A user-defined tag to append to the run name.
Definition: Herwig7.h:59
Herwig7API::resume
virtual bool resume() const
Try to resume execution from an earlier interrupted run.
Definition: Herwig7.h:42
Herwig7API::inStream
virtual std::istream & inStream() const
Return the standard in stream to be used.
Definition: Herwig7.h:102
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Herwig7API::m_seed
int m_seed
Definition: Herwig7.h:123
Herwig7API::appendReadDirectories
virtual const std::vector< std::string > & appendReadDirectories() const
Directories from which Herwig reads input files, will be appended to the search path.
Definition: Herwig7.h:69
SG::ReadHandleKey< xAOD::EventInfo >
Herwig7API::quit
virtual void quit() const
Bail out and be quiet.
Definition: Herwig7.h:90
Herwig7::genFinalize
StatusCode genFinalize()
Close down the generator.
Definition: Herwig7.cxx:253
Herwig7::m_seed_from_generatetf
int m_seed_from_generatetf
Random number seed from Generate_tf.py.
Definition: Herwig7.h:182
Herwig7::genInitialize
StatusCode genInitialize()
Initialize the generator.
Definition: Herwig7.cxx:66
Herwig7API::m_jobs
int m_jobs
Definition: Herwig7.h:124
Herwig7API::m_N
long m_N
Definition: Herwig7.h:122
Herwig7::m_runname
std::string m_runname
Run name, used in the Herwig/ThePEG config system.
Definition: Herwig7.h:169
Herwig7::m_event
ThePEG::EventPtr m_event
ThePEG event object.
Definition: Herwig7.h:162
Herwig7::m_evtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: Herwig7.h:202
Herwig7::m_dsid
int m_dsid
Gen_tf.py run args needed in interface.
Definition: Herwig7.h:200
GenModule
Base class for common behaviour of generator interfaces.
Definition: GenModule.h:39
Herwig7API::m_tics
bool m_tics
Definition: Herwig7.h:110
Herwig7API::m_repository
std::string m_repository
Definition: Herwig7.h:112
Herwig7API::m_runMode
Herwig::RunMode::Mode m_runMode
Definition: Herwig7.h:107
Herwig7
Interface to athena.
Definition: Herwig7.h:133
Herwig7API::m_appendReadDirectories
std::vector< std::string > m_appendReadDirectories
Definition: Herwig7.h:120
Herwig7API::m_resume
bool m_resume
Definition: Herwig7.h:109
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Herwig7API::jobSize
virtual unsigned int jobSize() const
The number of jobs to fork.
Definition: Herwig7.h:78
Herwig7API
Interface to the Herwig7 API.
Definition: Herwig7.h:24
Herwig7API::integrationList
virtual std::string integrationList() const
An identifier for the integration job to be handled.
Definition: Herwig7.h:62
Herwig7API::m_maxjobs
unsigned int m_maxjobs
Definition: Herwig7.h:126
Herwig7API::quitWithHelp
virtual void quitWithHelp() const
The maximum number of integration jobs.
Definition: Herwig7.h:82
Herwig7API::maxJobs
virtual unsigned int maxJobs() const
The number of subprocesses to integrate per integratoin job.
Definition: Herwig7.h:79
Herwig7::m_api
Herwig7API m_api
Herwig7 API object.
Definition: Herwig7.h:156
Herwig7API::setupfile
virtual std::string setupfile() const
Name of the setup file to be read, to modify the repository.
Definition: Herwig7.h:56
Herwig7::Herwig7
Herwig7(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: Herwig7.cxx:38
Herwig7API::m_integrationList
std::string m_integrationList
Definition: Herwig7.h:117
Herwig7API::outStream
virtual std::ostream & outStream() const
Return the standard out stream to be used.
Definition: Herwig7.h:96
Herwig7API::runMode
Herwig::RunMode::Mode runMode() const
Requested Herwig run mode.
Definition: Herwig7.h:39
Herwig7API::inputfile
void inputfile(const std::string inputfile)
Definition: Herwig7.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Herwig7API::tics
virtual bool tics() const
Require verbose progress markers.
Definition: Herwig7.h:45
EventContainers::Mode
Mode
Definition: IdentifiableContainerBase.h:13
Herwig7API::jobs
virtual int jobs() const
Definition: Herwig7.h:77
Herwig7::m_gen
ThePEG::EGPtr m_gen
ThePEG generator object.
Definition: Herwig7.h:159
EventInfo.h
Herwig7API::~Herwig7API
~Herwig7API()
Destructor.
Definition: Herwig7.h:35
Herwig7API::repository
virtual std::string repository() const
Repository name to operate on.
Definition: Herwig7.h:49
Herwig7API::m_prependReadDirectories
std::vector< std::string > m_prependReadDirectories
Definition: Herwig7.h:119
Herwig7::m_runfile
std::string m_runfile
Name of run file.
Definition: Herwig7.h:172
Herwig7::callGenerator
StatusCode callGenerator()
Run the generator for one event.
Definition: Herwig7.cxx:164
Herwig7::fillEvt
StatusCode fillEvt(HepMC::GenEvent *evt)
Convert the generated event into the HepMC format.
Definition: Herwig7.cxx:179
GenModule.h
Herwig7::m_use_seed_from_generatetf
bool m_use_seed_from_generatetf
Ignore random number seed provided by athena and use the one from Generate_tf.py instead.
Definition: Herwig7.h:179
Herwig7API::errStream
virtual std::ostream & errStream() const
Return the standard err stream to be used.
Definition: Herwig7.h:99
Herwig7API::seed
virtual int seed() const
The number of events to generate.
Definition: Herwig7.h:74
Herwig7API::N
virtual long N() const
Definition: Herwig7.h:72
Herwig7API::m_setupfile
std::string m_setupfile
Definition: Herwig7.h:114
Herwig7::m_setupfile
std::string m_setupfile
Name of setup file.
Definition: Herwig7.h:175
Herwig7::m_cleanup_herwig_scratch
bool m_cleanup_herwig_scratch
Possibly remove Herwig-scratch folder after finishing the event generation.
Definition: Herwig7.h:194
Herwig7API::m_tag
std::string m_tag
Definition: Herwig7.h:115