12 #include <ThePEG/Utilities/DynamicLoader.h> 13 #include <ThePEG/Utilities/Debug.h> 14 #include <ThePEG/Repository/Repository.h> 15 #include <ThePEG/Handlers/SamplerBase.h> 20 edm::LogError(
"Herwig7Interface") <<
"An error occured, interface quits now.";
25 ThePEG::Repository::cleanup();
26 edm::LogInfo(
"Herwig7Interface") <<
"Quitting HerwigUIProvider after ThePEG repository cleanup.";
47 edm::LogError(
"Herwig7Interface") <<
"Invalid run mode: RunMode::ERROR was passed to Herwig.\n";
70 if (
pset.getUntrackedParameter<
int>(
"numberEvents", -1) != -1)
71 nEvents_ =
pset.getUntrackedParameter<
int>(
"numberEvents", 1);
78 if (
pset.getUntrackedParameter<
unsigned int>(
"debugOutput", 0))
79 ThePEG::Debug::setDebug(
pset.getUntrackedParameter<
unsigned int>(
"debugOutput", 0));
82 if (
pset.getUntrackedParameter<
bool>(
"debugFPE",
false))
83 ThePEG::Debug::unmaskFpuErrors();
86 if (
pset.getUntrackedParameter<
bool>(
"exitOnError",
false))
87 ThePEG::Repository::exitOnError() = 1;
90 if (
pset.getUntrackedParameter<
bool>(
"hideTics",
false))
94 if (
pset.getUntrackedParameter<
int>(
"seed", 0) != 0)
95 seed_ =
pset.getUntrackedParameter<
int>(
"seed", 0);
102 if (
pset.getUntrackedParameter<
int>(
"jobs", 1) != 1)
103 jobs_ =
pset.getUntrackedParameter<
int>(
"jobs", 1);
106 std::vector<std::string> aReadDirectories =
107 pset.getUntrackedParameter<std::vector<std::string> >(
"appendReadDirectories", std::vector<std::string>());
108 std::vector<std::string> pReadDirectories =
109 pset.getUntrackedParameter<std::vector<std::string> >(
"prependReadDirectories", std::vector<std::string>());
114 std::vector<std::string> aPath =
115 pset.getUntrackedParameter<std::vector<std::string> >(
"appendPath", std::vector<std::string>());
116 std::vector<std::string> pPath =
117 pset.getUntrackedParameter<std::vector<std::string> >(
"prependPath", std::vector<std::string>());
118 for (
size_t i = 0;
i < aPath.size(); ++
i)
119 ThePEG::DynamicLoader::appendPath(aPath[
i]);
120 for (
size_t i = 0;
i < pPath.size(); ++
i)
121 ThePEG::DynamicLoader::prependPath(pPath[
i]);
124 if (!
pset.getUntrackedParameter<
std::string>(
"integrationList",
"").empty()) {
129 if (
pset.getUntrackedParameter<
unsigned int>(
"jobSize", 0) != 0) {
131 jobsize_ =
pset.getUntrackedParameter<
unsigned int>(
"jobSize", 1);
132 ThePEG::SamplerBase::setIntegratePerJob(
jobsize_);
137 if (
pset.getUntrackedParameter<
unsigned int>(
"maxJobs", 0) != 0) {
139 maxjobs_ =
pset.getUntrackedParameter<
unsigned int>(
"maxJobs", 1);
140 ThePEG::SamplerBase::setIntegrationJobs(
maxjobs_);
145 if (
pset.getUntrackedParameter<
bool>(
"resume",
false))
157 if (
pset.getUntrackedParameter<
unsigned int>(
"jobSize", 0) != 0) {
158 jobsize_ =
pset.getUntrackedParameter<
unsigned int>(
"jobSize", 1);
159 ThePEG::SamplerBase::setIntegratePerJob(
jobsize_);
162 if (
pset.getUntrackedParameter<
unsigned int>(
"maxJobs", 0) != 0) {
163 maxjobs_ =
pset.getUntrackedParameter<
unsigned int>(
"maxJobs", 1);
164 ThePEG::SamplerBase::setIntegrationJobs(
maxjobs_);
168 ThePEG::SamplerBase::setIntegratePerJob(
jobsize_);
170 ThePEG::SamplerBase::setIntegrationJobs(
maxjobs_);
std::vector< std::string > appendReadDirectories_
static std::string resolve(const std::string &line)
void quitWithHelp() const override
Log< level::Error, false > LogError
HerwigUIProvider(const edm::ParameterSet &pset, std::string inputFileName, RunMode::Mode)
Constructor from the arguments provided by CMSSW.
void setRunMode(RunMode::Mode runMode, const edm::ParameterSet &pset, std::string inputFile="")
void quit() const override
RunMode::Mode runMode() const override
Requested Herwig run mode.
~HerwigUIProvider() override
Destructor to leave a clean ThePEG::Repository behind.
std::vector< std::string > prependReadDirectories_
Log< level::Info, false > LogInfo
std::string integrationList_