CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Provenance/src/RunAuxiliary.cc

Go to the documentation of this file.
00001 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
00002 #include <cassert>
00003 #include <ostream>
00004 
00005 /*----------------------------------------------------------------------
00006 
00007 ----------------------------------------------------------------------*/
00008 
00009 namespace edm {
00010   void
00011   RunAuxiliary::write(std::ostream& os) const {
00012     os << "Process History ID = " <<  processHistoryID_ << std::endl;
00013     os << id_ << std::endl;
00014   }
00015 
00016   void
00017   RunAuxiliary::mergeAuxiliary(RunAuxiliary const& newAux) {
00018 
00019     assert(id_ == newAux.id_);
00020     assert(processHistoryID_ == newAux.processHistoryID_);
00021     mergeNewTimestampsIntoThis_(newAux);
00022 
00023   }
00024 
00025   void
00026   RunAuxiliary::mergeNewTimestampsIntoThis_(RunAuxiliary const& newAux) {
00027     if (beginTime_ == Timestamp::invalidTimestamp() ||
00028         newAux.beginTime() == Timestamp::invalidTimestamp()) {
00029       beginTime_ = Timestamp::invalidTimestamp();
00030     }
00031     else if (newAux.beginTime() < beginTime_) {
00032       beginTime_ = newAux.beginTime();
00033     }
00034     
00035     if (endTime_ == Timestamp::invalidTimestamp() ||
00036         newAux.endTime() == Timestamp::invalidTimestamp()) {
00037       endTime_ = Timestamp::invalidTimestamp();
00038     }
00039     else if (newAux.endTime() > endTime_) {
00040       endTime_ = newAux.endTime();
00041     }
00042   }
00043 }