#include <LHERunInfoProduct.h>
Definition at line 13 of file LHERunInfoProduct.h.
typedef std::vector<std::string>::const_iterator LHERunInfoProduct::comments_const_iterator |
Definition at line 45 of file LHERunInfoProduct.h.
typedef std::vector<Header>::const_iterator LHERunInfoProduct::headers_const_iterator |
Definition at line 43 of file LHERunInfoProduct.h.
typedef std::vector<Header>::size_type LHERunInfoProduct::size_type |
Definition at line 42 of file LHERunInfoProduct.h.
LHERunInfoProduct::LHERunInfoProduct | ( | ) | [inline] |
Definition at line 47 of file LHERunInfoProduct.h.
{}
LHERunInfoProduct::LHERunInfoProduct | ( | const lhef::HEPRUP & | heprup | ) | [inline] |
Definition at line 48 of file LHERunInfoProduct.h.
: heprup_(heprup) {}
LHERunInfoProduct::~LHERunInfoProduct | ( | ) | [inline] |
Definition at line 49 of file LHERunInfoProduct.h.
{}
void LHERunInfoProduct::addComment | ( | const std::string & | line | ) | [inline] |
Definition at line 52 of file LHERunInfoProduct.h.
References comments_.
Referenced by LHESource::beginRun(), and LHESource::produce().
void LHERunInfoProduct::addHeader | ( | const Header & | header | ) | [inline] |
Definition at line 51 of file LHERunInfoProduct.h.
References headers_.
Referenced by LHESource::beginRun(), mergeProduct(), and LHESource::produce().
{ headers_.push_back(header); }
LHERunInfoProduct::const_iterator LHERunInfoProduct::begin | ( | void | ) | const |
Definition at line 138 of file LHERunInfoProduct.cc.
References LHERunInfoProduct::const_iterator::header, headers_begin(), LHERunInfoProduct::const_iterator::kHeader, LHERunInfoProduct::const_iterator::line, LHERunInfoProduct::const_iterator::mode, query::result, LHERunInfoProduct::const_iterator::runInfo, and LHERunInfoProduct::const_iterator::tmp.
{ const_iterator result; result.runInfo = this; result.header = headers_begin(); result.mode = const_iterator::kHeader; result.line = 0; result.tmp = "<LesHouchesEvents version=\"1.0\">\n"; return result; }
comments_const_iterator LHERunInfoProduct::comments_begin | ( | ) | const [inline] |
Definition at line 61 of file LHERunInfoProduct.h.
References comments_.
Referenced by lhef::LHERunInfo::LHERunInfo(), and LHERunInfoProduct::const_iterator::next().
{ return comments_.begin(); }
comments_const_iterator LHERunInfoProduct::comments_end | ( | ) | const [inline] |
Definition at line 62 of file LHERunInfoProduct.h.
References comments_.
Referenced by lhef::LHERunInfo::LHERunInfo().
{ return comments_.end(); }
size_type LHERunInfoProduct::comments_size | ( | ) | const [inline] |
Definition at line 60 of file LHERunInfoProduct.h.
References comments_.
Referenced by LHERunInfoProduct::const_iterator::next().
{ return comments_.size(); }
const_iterator LHERunInfoProduct::end | ( | void | ) | const [inline] |
Definition at line 110 of file LHERunInfoProduct.h.
{ return const_iterator(); }
const std::string & LHERunInfoProduct::endOfFile | ( | ) | [static] |
Definition at line 163 of file LHERunInfoProduct.cc.
Referenced by LHEWriter::endRun().
{ static const std::string theEnd("</LesHouchesEvents>\n"); return theEnd; }
headers_const_iterator LHERunInfoProduct::headers_begin | ( | ) | const [inline] |
Definition at line 57 of file LHERunInfoProduct.h.
References headers_.
Referenced by begin(), lhef::LHERunInfo::LHERunInfo(), and mergeProduct().
{ return headers_.begin(); }
headers_const_iterator LHERunInfoProduct::headers_end | ( | ) | const [inline] |
Definition at line 58 of file LHERunInfoProduct.h.
References headers_.
Referenced by lhef::LHERunInfo::LHERunInfo(), mergeProduct(), and LHERunInfoProduct::const_iterator::next().
{ return headers_.end(); }
size_type LHERunInfoProduct::headers_size | ( | ) | const [inline] |
const lhef::HEPRUP& LHERunInfoProduct::heprup | ( | ) | const [inline] |
Definition at line 54 of file LHERunInfoProduct.h.
References heprup_.
Referenced by LHERunInfoProduct::const_iterator::next().
{ return heprup_; }
LHERunInfoProduct::const_iterator LHERunInfoProduct::init | ( | void | ) | const |
Definition at line 151 of file LHERunInfoProduct.cc.
References LHERunInfoProduct::const_iterator::kInit, LHERunInfoProduct::const_iterator::line, LHERunInfoProduct::const_iterator::mode, query::result, LHERunInfoProduct::const_iterator::runInfo, and LHERunInfoProduct::const_iterator::tmp.
{ const_iterator result; result.runInfo = this; result.mode = const_iterator::kInit; result.line = 0; result.tmp = "<init>\n"; return result; }
bool LHERunInfoProduct::isProductEqual | ( | const LHERunInfoProduct & | other | ) | const [inline] |
Definition at line 120 of file LHERunInfoProduct.h.
{ return *this == other; }
bool LHERunInfoProduct::mergeProduct | ( | const LHERunInfoProduct & | other | ) |
Definition at line 208 of file LHERunInfoProduct.cc.
References addHeader(), filterCSVwithJSON::copy, lhef::HEPRUP::EBMUP, Exception, MultipleCompare::header, headers_, headers_begin(), headers_end(), heprup_, i, lhef::HEPRUP::IDBMUP, lhef::HEPRUP::IDWTUP, lhef::HEPRUP::LPRUP, max(), lhef::HEPRUP::NPRUP, lhef::HEPRUP::PDFGUP, lhef::HEPRUP::PDFSUP, lhef::HEPRUP::resize(), mathSSE::sqrt(), x, lhef::HEPRUP::XERRUP, lhef::HEPRUP::XMAXUP, and lhef::HEPRUP::XSECUP.
{ if (heprup_.IDBMUP != other.heprup_.IDBMUP || heprup_.EBMUP != other.heprup_.EBMUP || heprup_.PDFGUP != other.heprup_.PDFGUP || heprup_.PDFSUP != other.heprup_.PDFSUP || heprup_.IDWTUP != other.heprup_.IDWTUP) { throw cms::Exception("ProductsNotMergeable") << "Error in LHERunInfoProduct: LHE headers differ. " "Cannot merge products." << std::endl; } bool compatibleHeaders = headers_ == other.headers_; // try to merge different, but compatible headers while(!compatibleHeaders) { // okay, something is different. // Let's try to merge, but don't duplicate identical headers // and test the rest against a whitelist std::set<Header, HeaderLess> headers; std::copy(headers_begin(), headers_end(), std::inserter(headers, headers.begin())); bool failed = false; for(std::vector<LHERunInfoProduct::Header>::const_iterator header = other.headers_begin(); header != other.headers_end(); ++header) { if (headers.count(*header)) continue; if (header->tag() == "" || header->tag().find("Alpgen") == 0 || header->tag() == "MGGridCard" || header->tag() == "MGGenerationInfo") { addHeader(*header); headers.insert(*header); } else failed = true; } if (failed) break; compatibleHeaders = true; } // still not compatible after fixups if (!compatibleHeaders) { throw cms::Exception("ProductsNotMergeable") << "Error in LHERunInfoProduct: LHE headers differ. " "Cannot merge products." << std::endl; } // it is exactly the same, so merge if (heprup_ == other.heprup_) return true; // the input files are different ones, presumably generation // of the same process in different runs with identical run number // attempt merge of processes and cross-sections std::map<int, XSec> processes; for(int i = 0; i < heprup_.NPRUP; i++) { int id = heprup_.LPRUP[i]; XSec &x = processes[id]; x.xsec = heprup_.XSECUP[i]; x.err = heprup_.XERRUP[i]; x.max = heprup_.XMAXUP[i]; } for(int i = 0; i < other.heprup_.NPRUP; i++) { int id = other.heprup_.LPRUP[i]; XSec &x = processes[id]; if (x.xsec) { double wgt1 = 1.0 / (x.err * x.err); double wgt2 = 1.0 / (other.heprup_.XERRUP[i] * other.heprup_.XERRUP[i]); x.xsec = (wgt1 * x.xsec + wgt2 * other.heprup_.XSECUP[i]) / (wgt1 + wgt2); x.err = 1.0 / std::sqrt(wgt1 + wgt2); x.max = std::max(x.max, other.heprup_.XMAXUP[i]); } else { x.xsec = other.heprup_.XSECUP[i]; x.err = other.heprup_.XERRUP[i]; x.max = other.heprup_.XMAXUP[i]; } } heprup_.resize(processes.size()); unsigned int i = 0; for(std::map<int, XSec>::const_iterator iter = processes.begin(); iter != processes.end(); ++iter, i++) { heprup_.LPRUP[i] = iter->first; heprup_.XSECUP[i] = iter->second.xsec; heprup_.XERRUP[i] = iter->second.err; heprup_.XMAXUP[i] = iter->second.max; } return true; }
bool LHERunInfoProduct::operator!= | ( | const LHERunInfoProduct & | other | ) | const [inline] |
Definition at line 116 of file LHERunInfoProduct.h.
{ return !(*this == other); }
bool LHERunInfoProduct::operator== | ( | const LHERunInfoProduct & | other | ) | const [inline] |
std::vector<std::string> LHERunInfoProduct::comments_ [private] |
Definition at line 126 of file LHERunInfoProduct.h.
Referenced by addComment(), comments_begin(), comments_end(), comments_size(), and operator==().
std::vector<Header> LHERunInfoProduct::headers_ [private] |
Definition at line 125 of file LHERunInfoProduct.h.
Referenced by addHeader(), headers_begin(), headers_end(), headers_size(), mergeProduct(), and operator==().
lhef::HEPRUP LHERunInfoProduct::heprup_ [private] |
Definition at line 124 of file LHERunInfoProduct.h.
Referenced by heprup(), mergeProduct(), and operator==().