![]() |
![]() |
#include <SimDataFormats/GeneratorProducts/interface/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] |
LHERunInfoProduct::LHERunInfoProduct | ( | const lhef::HEPRUP & | heprup | ) | [inline] |
LHERunInfoProduct::~LHERunInfoProduct | ( | ) | [inline] |
void LHERunInfoProduct::addComment | ( | const std::string & | line | ) | [inline] |
Definition at line 52 of file LHERunInfoProduct.h.
References comments_.
Referenced by LHESource::beginRun().
Definition at line 51 of file LHERunInfoProduct.h.
References headers_.
Referenced by LHESource::beginRun().
00051 { headers_.push_back(header); }
LHERunInfoProduct::const_iterator LHERunInfoProduct::begin | ( | void | ) | const |
Definition at line 127 of file LHERunInfoProduct.cc.
References LHERunInfoProduct::const_iterator::header, headers_begin(), LHERunInfoProduct::const_iterator::kHeader, LHERunInfoProduct::const_iterator::line, LHERunInfoProduct::const_iterator::mode, HLT_VtxMuL3::result, LHERunInfoProduct::const_iterator::runInfo, and LHERunInfoProduct::const_iterator::tmp.
00128 { 00129 const_iterator result; 00130 00131 result.runInfo = this; 00132 result.header = headers_begin(); 00133 result.mode = const_iterator::kHeader; 00134 result.line = 0; 00135 result.tmp = "<LesHouchesEvents version=\"1.0\">\n"; 00136 00137 return result; 00138 }
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().
00061 { 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().
00062 { 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().
00060 { return comments_.size(); }
const_iterator LHERunInfoProduct::end | ( | void | ) | const [inline] |
const std::string & LHERunInfoProduct::endOfFile | ( | ) | [static] |
Definition at line 152 of file LHERunInfoProduct.cc.
Referenced by LHEWriter::endRun().
00153 { 00154 static const std::string theEnd("</LesHouchesEvents>\n"); 00155 00156 return theEnd; 00157 }
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().
00057 { 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().
00058 { return headers_.end(); }
size_type LHERunInfoProduct::headers_size | ( | ) | const [inline] |
Definition at line 56 of file LHERunInfoProduct.h.
References headers_.
00056 { return headers_.size(); }
const lhef::HEPRUP& LHERunInfoProduct::heprup | ( | ) | const [inline] |
Definition at line 54 of file LHERunInfoProduct.h.
References heprup_.
Referenced by LHERunInfoProduct::const_iterator::next().
00054 { return heprup_; }
LHERunInfoProduct::const_iterator LHERunInfoProduct::init | ( | void | ) | const |
Definition at line 140 of file LHERunInfoProduct.cc.
References LHERunInfoProduct::const_iterator::kInit, LHERunInfoProduct::const_iterator::line, LHERunInfoProduct::const_iterator::mode, HLT_VtxMuL3::result, LHERunInfoProduct::const_iterator::runInfo, and LHERunInfoProduct::const_iterator::tmp.
00141 { 00142 const_iterator result; 00143 00144 result.runInfo = this; 00145 result.mode = const_iterator::kInit; 00146 result.line = 0; 00147 result.tmp = "<init>\n"; 00148 00149 return result; 00150 }
bool LHERunInfoProduct::isProductEqual | ( | const LHERunInfoProduct & | other | ) | [inline] |
bool LHERunInfoProduct::mergeProduct | ( | const LHERunInfoProduct & | other | ) |
Definition at line 169 of file LHERunInfoProduct.cc.
References comments_, lhef::HEPRUP::EBMUP, lat::endl(), Exception, headers_, headers_begin(), headers_end(), heprup_, i, lhef::HEPRUP::IDBMUP, lhef::HEPRUP::IDWTUP, iter, lhef::HEPRUP::LPRUP, max, lhef::HEPRUP::NPRUP, lhef::HEPRUP::PDFGUP, lhef::HEPRUP::PDFSUP, lhef::HEPRUP::resize(), funct::sqrt(), x, lhef::HEPRUP::XERRUP, lhef::HEPRUP::XMAXUP, and lhef::HEPRUP::XSECUP.
00170 { 00171 if (headers_ != other.headers_ || 00172 comments_ != other.comments_ || 00173 heprup_.IDBMUP != other.heprup_.IDBMUP || 00174 heprup_.EBMUP != other.heprup_.EBMUP || 00175 heprup_.PDFGUP != other.heprup_.PDFGUP || 00176 heprup_.PDFSUP != other.heprup_.PDFSUP || 00177 heprup_.IDWTUP != other.heprup_.IDWTUP) { 00178 // okay, something is different. Let us check if it is the AlpgenInterface case. 00179 LHERunInfoProduct::Header::const_iterator theLines = headers_.begin()->begin(); 00180 theLines++; 00181 std::string alpgenComment ("\tExtracted by AlpgenInterface\n"); 00182 std::string initialComment (*theLines); 00183 00184 if(alpgenComment == initialComment) { 00185 // okay, it is AlpgenInterface.Concatenate the headers and add them to this LHERunInfoProduct. 00186 for(std::vector<LHERunInfoProduct::Header>::const_iterator theOtherHeaders = other.headers_begin(); 00187 theOtherHeaders != other.headers_end(); 00188 ++theOtherHeaders) 00189 this->addHeader(*theOtherHeaders); 00190 } 00191 else 00192 throw cms::Exception("ProductsNotMergeable") 00193 << "Error in LHERunInfoProduct: LHE headers differ. " 00194 "Cannot merge products." << std::endl; 00195 } // first if 00196 00197 // it is exactly the same, so merge 00198 if (heprup_ == other.heprup_) 00199 return true; 00200 00201 00202 // the input files are different ones, presumably generation 00203 // of the same process in different runs with identical run number 00204 // attempt merge of processes and cross-sections 00205 00206 std::map<int, XSec> processes; 00207 00208 for(int i = 0; i < heprup_.NPRUP; i++) { 00209 int id = heprup_.LPRUP[i]; 00210 XSec &x = processes[id]; 00211 x.xsec = heprup_.XSECUP[i]; 00212 x.err = heprup_.XERRUP[i]; 00213 x.max = heprup_.XMAXUP[i]; 00214 } 00215 00216 for(int i = 0; i < other.heprup_.NPRUP; i++) { 00217 int id = other.heprup_.LPRUP[i]; 00218 XSec &x = processes[id]; 00219 if (x.xsec) { 00220 double wgt1 = 1.0 / (x.err * x.err); 00221 double wgt2 = 1.0 / (other.heprup_.XERRUP[i] * 00222 other.heprup_.XERRUP[i]); 00223 x.xsec = (wgt1 * x.xsec + 00224 wgt2 * other.heprup_.XSECUP[i]) / 00225 (wgt1 + wgt2); 00226 x.err = 1.0 / std::sqrt(wgt1 + wgt2); 00227 x.max = std::max(x.max, other.heprup_.XMAXUP[i]); 00228 } else { 00229 x.xsec = other.heprup_.XSECUP[i]; 00230 x.err = other.heprup_.XERRUP[i]; 00231 x.max = other.heprup_.XMAXUP[i]; 00232 } 00233 } 00234 00235 heprup_.resize(processes.size()); 00236 unsigned int i = 0; 00237 for(std::map<int, XSec>::const_iterator iter = processes.begin(); 00238 iter != processes.end(); ++iter, i++) { 00239 heprup_.LPRUP[i] = iter->first; 00240 heprup_.XSECUP[i] = iter->second.xsec; 00241 heprup_.XERRUP[i] = iter->second.err; 00242 heprup_.XMAXUP[i] = iter->second.max; 00243 } 00244 00245 return true; 00246 }
bool LHERunInfoProduct::operator!= | ( | const LHERunInfoProduct & | other | ) | const [inline] |
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(), mergeProduct(), 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==().