44 if (
header == runInfo->headers_end()) {
60 tmp =
tag.empty() ?
"<!--" : (
tag ==
"<>") ?
"" : (
"<" +
tag +
">");
66 if (iter ==
header->end()) {
69 tmp +=
tag.empty() ?
"-->" : (
tag ==
"<>") ?
"" : (
"</" +
tag +
">");
74 if (iter ==
header->end() &&
75 (
tmp.empty() || (
tmp[
tmp.length() - 1] !=
'\r' &&
tmp[
tmp.length() - 1] !=
'\n')))
83 std::ostringstream
ss;
84 ss << std::setprecision(7) << std::scientific << std::uppercase <<
" " <<
heprup.
IDBMUP.first <<
" "
91 if (
line >= (
unsigned int)
heprup.
NPRUP + runInfo->comments_size() + 2) {
100 std::ostringstream
ss;
101 ss << std::setprecision(7) << std::scientific << std::uppercase <<
"\t" <<
heprup.
XSECUP[
line - 2] <<
"\t"
122 result.tmp =
"<LesHouchesEvents version=\"1.0\">\n";
139 static const std::string theEnd(
"</LesHouchesEvents>\n");
146 inline XSec() : xsec(0.0),
err(0.0),
max(0.0) {}
161 if (
a.tag() <
b.tag())
163 if (
a.tag() >
b.tag())
169 for (; iter1 !=
a.end() && iter2 !=
b.end(); ++iter1, ++iter2) {
172 else if (*iter1 != *iter2)
176 return iter2 !=
b.end();
179 static std::vector<std::string>
checklist{
"iseed",
"Random",
".log",
".dat",
".lhe"};
184 return x.find(
y) != std::string::npos;
189 return !(
tag.empty() ||
tag.find(
"Alpgen") == 0 ||
tag ==
"MGGridCard" ||
tag ==
"MGRunCard" ||
tag ==
"mgruncard" ||
190 tag ==
"MadSpin" ||
tag ==
"madspin");
203 while (!compatibleHeaders) {
208 std::set<Header, HeaderLess>
headers;
212 std::vector<std::vector<std::string> > runcard_v2;
213 std::vector<std::string> runcard_v2_header;
217 runcard_v2.push_back(header2.lines());
218 runcard_v2_header.push_back(header2.tag());
224 for (std::vector<LHERunInfoProduct::Header>::const_iterator
header =
other.headers_begin();
232 bool header_compatible =
false;
233 for (
unsigned int iter_runcard = 0; iter_runcard < runcard_v2.size(); iter_runcard++) {
234 std::vector<std::string> runcard_v1 =
header->lines();
235 runcard_v1.erase(std::remove_if(runcard_v1.begin(),
239 runcard_v2[iter_runcard].erase(
240 std::remove_if(runcard_v2[iter_runcard].
begin(),
241 runcard_v2[iter_runcard].
end(),
243 runcard_v2[iter_runcard].
end());
245 if (
std::equal(runcard_v1.begin(), runcard_v1.end(), runcard_v2[iter_runcard].begin())) {
246 header_compatible =
true;
250 if (header_compatible)
266 compatibleHeaders =
true;
270 if (!compatibleHeaders) {