63 tmp = tag.empty() ?
"<!--" :
64 (tag ==
"<>") ?
"" : (
"<" + tag +
">");
73 tmp += tag.empty() ?
"-->" :
74 (tag ==
"<>") ?
"" : (
"</" + tag +
">");
81 (
tmp[
tmp.length() - 1] !=
'\r' &&
82 tmp[
tmp.length() - 1] !=
'\n')))
90 std::ostringstream ss;
91 ss << std::setprecision(7)
94 <<
" " << heprup.
IDBMUP.first
95 <<
" " << heprup.
IDBMUP.second
96 <<
" " << heprup.
EBMUP.first
97 <<
" " << heprup.
EBMUP.second
98 <<
" " << heprup.
PDFGUP.first
99 <<
" " << heprup.
PDFGUP.second
100 <<
" " << heprup.
PDFSUP.first
101 <<
" " << heprup.
PDFSUP.second
103 <<
" " << heprup.
NPRUP << std::endl;
112 }
else if (
line >= (
unsigned int)heprup.
NPRUP + 2) {
118 std::ostringstream ss;
119 ss << std::setprecision(7)
125 <<
"\t" << heprup.
LPRUP[
line - 2] << std::endl;
146 result.
tmp =
"<LesHouchesEvents version=\"1.0\">\n";
158 result.
tmp =
"<init>\n";
165 static const std::string theEnd(
"</LesHouchesEvents>\n");
172 inline XSec() : xsec(0.0), err(0.0),
max(0.0) {}
198 for(; iter1 != a.
end() && iter2 != b.
end(); ++iter1, ++iter2) {
201 else if (*iter1 != *iter2)
205 return iter2 != b.
end();
208 static std::vector<std::string>
checklist{
"iseed",
"Random",
".log",
".dat",
".lhe"};
212 return checklist.end() != std::find_if(checklist.begin(),checklist.end(),[&](
const std::string&
y)
213 {
return x.find(
y) != std::string::npos; } );
217 return !(tag.empty() || tag.find(
"Alpgen") == 0 || tag ==
"MGGridCard" || tag==
"MGRunCard" || tag ==
"mgruncard" || tag==
"MadSpin" || tag==
"madspin");
235 while(!compatibleHeaders) {
240 std::set<Header, HeaderLess> headers;
242 std::inserter(headers, headers.begin()));
245 std::vector<std::vector<std::string> > runcard_v2;
246 std::vector<std::string> runcard_v2_header;
250 runcard_v2.push_back(header2.lines());
251 runcard_v2_header.push_back(header2.tag());
257 for(std::vector<LHERunInfoProduct::Header>::const_iterator
261 if (headers.count(*
header)) {
266 bool header_compatible =
false;
267 for (
unsigned int iter_runcard = 0; iter_runcard < runcard_v2.size(); iter_runcard++){
269 std::vector<std::string> runcard_v1 =
header->lines();
270 runcard_v1.erase( std::remove_if( runcard_v1.begin(), runcard_v1.end(),
273 runcard_v2[iter_runcard].erase( std::remove_if( runcard_v2[iter_runcard].
begin(), runcard_v2[iter_runcard].
end(),
275 runcard_v2[iter_runcard].
end() );
277 if(
std::equal(runcard_v1.begin(), runcard_v1.end(), runcard_v2[iter_runcard].begin())){
278 header_compatible =
true;
282 if(header_compatible)
continue;
298 compatibleHeaders =
true;
303 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
static std::vector< std::string > checklist
std::pair< int, int > PDFGUP
void swap(LHERunInfoProduct &other)
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
size_type comments_size() const
comments_const_iterator comments_begin() const
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