![]() |
![]() |
00001 #include <iostream> 00002 #include <algorithm> 00003 00004 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00005 00006 #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h" 00007 00008 using namespace edm; 00009 using namespace std; 00010 00011 GenRunInfoProduct::GenRunInfoProduct() : 00012 externalFilterEfficiency_(-1.) 00013 { 00014 } 00015 00016 GenRunInfoProduct::GenRunInfoProduct(GenRunInfoProduct const &other) : 00017 internalXSec_(other.internalXSec_), 00018 externalXSecLO_(other.externalXSecLO_), 00019 externalXSecNLO_(other.externalXSecNLO_), 00020 externalFilterEfficiency_(other.externalFilterEfficiency_) 00021 { 00022 } 00023 00024 GenRunInfoProduct::~GenRunInfoProduct() 00025 { 00026 } 00027 00028 bool GenRunInfoProduct::mergeProduct(GenRunInfoProduct const &other) 00029 { 00030 // if external xsec and filter efficiency are identical we allow merging 00031 // unfortunately we cannot merge on-the-fly xsec, as we do not have 00032 // information about the corresponding statistics (i.e. uncertainty) 00033 // so we just ignore it. 00034 // So in the end this merger is a dummy (just a safety check) 00035 00036 if (externalXSecLO_ == other.externalXSecLO_ && 00037 externalXSecNLO_ == other.externalXSecNLO_ && 00038 externalFilterEfficiency_ == other.externalFilterEfficiency_) 00039 return true; 00040 00041 edm::LogWarning("GenRunInfoProduct|ProductsNotMergeable") 00042 << "You are merging runs with different cross-sections and/or " 00043 "filter efficiencies (from GenRunInfoProduct)\n" 00044 "The resulting cross-section will not be consistent." << std::endl; 00045 00046 return true; 00047 } 00048 00049 bool GenRunInfoProduct::isProductEqual(GenRunInfoProduct const &other) const 00050 { 00051 return externalXSecLO_ == other.externalXSecLO_ && 00052 externalXSecNLO_ == other.externalXSecNLO_ && 00053 externalFilterEfficiency_ == other.externalFilterEfficiency_; 00054 }