44 if (header ==
runInfo->headers_end()) {
60 tmp = tag.empty() ?
"<!--" : (tag ==
"<>") ?
"" : (
"<" + tag +
">");
61 iter = header->begin();
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 <<
" "
85 << heprup.
IDBMUP.second <<
" " << heprup.
EBMUP.first <<
" " << heprup.
EBMUP.second <<
" "
86 << heprup.
PDFGUP.first <<
" " << heprup.
PDFGUP.second <<
" " << heprup.
PDFSUP.first <<
" "
87 << heprup.
PDFSUP.second <<
" " << heprup.
IDWTUP <<
" " << heprup.
NPRUP << std::endl;
95 }
else if (
line >= (
unsigned int)heprup.
NPRUP + 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";
133 result.
tmp =
"<init>\n";
139 static const std::string theEnd(
"</LesHouchesEvents>\n");
146 inline XSec() : xsec(0.0),
err(0.0),
max(0.0) {}
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"};
183 return checklist.end() != std::find_if(checklist.begin(), checklist.end(), [&](
const std::string &
y) {
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;
214 for (
const auto &header2 :
headers_) {
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();
227 if (headers.count(*header)) {
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)
258 headers.insert(*header);
266 compatibleHeaders =
true;
270 if (!compatibleHeaders) {
void addHeader(const Header &header)
std::pair< double, double > EBMUP
const LHERunInfoProduct * runInfo
headers_const_iterator headers_end() const
std::pair< int, int > IDBMUP
bool equal(const T &first, const T &second)
const lhef::HEPRUP & heprup() const
std::pair< int, int > PDFGUP
void swap(LHERunInfoProduct &other)
bool operator==(const const_iterator &other) const
headers_const_iterator headers_begin() const
static std::vector< std::string > tag_comparison_checklist
static bool isTagComparedInMerge(const std::string &tag)
Header::const_iterator iter
std::vector< double > XERRUP
headers_const_iterator header
std::vector< double > XMAXUP
std::pair< int, int > PDFSUP
bool mergeProduct(const LHERunInfoProduct &other)
bool find_if_checklist(const std::string x, std::vector< std::string > checklist)
std::vector< Header > headers_
static const std::string & endOfFile()
std::vector< double > XSECUP
const_iterator end() const
const_iterator init() const
std::vector< std::string > comments_
const_iterator begin() const