19 if (
mode != other.mode)
28 return header == other.header;
31 return header == other.header && iter == other.iter;
34 return line == other.line;
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) {
114 (
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();
209 return !(tag ==
"" || tag.find(
"Alpgen") == 0 || tag ==
"MGGridCard" || tag ==
"MGGenerationInfo");
220 <<
"Error in LHERunInfoProduct: LHE headers differ. "
221 "Cannot merge products." << std::endl;
227 while(!compatibleHeaders) {
232 std::set<Header, HeaderLess> headers;
234 std::inserter(headers, headers.begin()));
237 for(std::vector<LHERunInfoProduct::Header>::const_iterator
240 if (headers.count(*header)) {
248 headers.insert(*header);
255 compatibleHeaders =
true;
259 if (!compatibleHeaders) {
261 <<
"Error in LHERunInfoProduct: LHE headers differ. "
262 "Cannot merge products." << std::endl;
273 std::map<int, XSec> processes;
277 XSec &
x = processes[id];
285 XSec &
x = processes[id];
287 double wgt1 = 1.0 / (x.err * x.err);
290 x.xsec = (wgt1 * x.xsec +
304 for(std::map<int, XSec>::const_iterator iter = processes.begin();
305 iter != processes.end(); ++iter, i++) {
void addHeader(const Header &header)
std::pair< double, double > EBMUP
const LHERunInfoProduct * runInfo
headers_const_iterator headers_end() const
std::pair< int, int > IDBMUP
const lhef::HEPRUP & heprup() const
std::pair< int, int > PDFGUP
const T & max(const T &a, const T &b)
headers_const_iterator headers_begin() const
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)
std::vector< Header > headers_
static const std::string & endOfFile()
std::vector< double > XSECUP
const_iterator init() const
const_iterator begin() const