You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (std::filesystem::exists(confpath) &&std::filesystem::file_size(confpath) >0) {
54
88
// Copy the file to the current directory
55
89
ifstreamsrc(confpath);
56
90
ofstreamdst("powheg.input");
57
-
gRandom->SetSeed(0);
58
91
intseed=gRandom->Integer(900000000);
59
92
boolisseed= false;
60
93
boolisnumevts= false;
94
+
if (mCurrFile==mNFiles-1&&getTotalNEvents() % mNMaxPerJob!=0) {
95
+
mNMaxPerJob=getTotalNEvents() % mNMaxPerJob;
96
+
}
61
97
std::stringline;
62
-
while (std::getline(src, line)) {
98
+
while (std::getline(src, line))
99
+
{
63
100
if (line.find("iseed") !=std::string::npos)
64
101
{
65
102
// Set the seed to the random number
@@ -69,56 +106,143 @@ public:
69
106
if (line.find("numevts") !=std::string::npos)
70
107
{
71
108
// Set the number of events to the number of events defined in the configuration
72
-
line="numevts "+std::to_string(nPowhegEvents);
109
+
line="numevts "+std::to_string(mNMaxPerJob);
73
110
// replace it in the file
74
111
isnumevts= true;
75
112
}
76
113
dst << line << std::endl;
77
114
}
78
-
if (!isseed) {
115
+
if (!isseed)
116
+
{
79
117
dst << "iseed " << seed << std::endl;
80
118
}
81
-
if (!isnumevts) {
82
-
dst << "numevts " << nPowhegEvents << std::endl;
119
+
if (!isnumevts)
120
+
{
121
+
dst << "numevts " << mNMaxPerJob << std::endl;
122
+
}
123
+
if (parallel)
124
+
{
125
+
dst << "manyseeds 1" << std::endl; // Enables the usage of pwgseeds.dat file to set the seed in parallel mode
126
+
dst << "parallelstage 4" << std::endl; // Allows event generation based on pre-generated POWHEG configuration files (needed for certain configurations)
83
127
}
84
128
src.close();
85
129
dst.close();
86
130
} else {
87
131
LOG(fatal) << "POWHEG configuration file not found or empty" << std::endl;
88
-
exit(1);
132
+
return false;
89
133
}
90
-
// Get POWHEG executable to use
91
-
if (type >= mPowhegGen.size()) {
92
-
LOG(warn) << "Available POWHEG generators are:";
93
-
for (intk=0; k<mPowhegGen.size(); k++)
94
-
{
95
-
LOG(warn) << "\t" << k << ": " << mPowhegGen[k];
134
+
return true;
135
+
}
136
+
137
+
Bool_tstartPOW()
138
+
{
139
+
if(mCurrFile==1) {
140
+
if (!confMaker(mPowhegConf, true)) {
141
+
LOG(fatal) << "Failed to edit POWHEG configuration with parallelisation";
142
+
return false;
96
143
}
97
-
LOG(fatal) << "POWHEG generator type " << type << " not found";
0 commit comments