CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/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     mergeNewTimestampsIntoThis_(newAux);
00021   }
00022 
00023   void
00024   RunAuxiliary::mergeNewTimestampsIntoThis_(RunAuxiliary const& newAux) {
00025     if (beginTime_ == Timestamp::invalidTimestamp() ||
00026         newAux.beginTime() == Timestamp::invalidTimestamp()) {
00027       beginTime_ = Timestamp::invalidTimestamp();
00028     }
00029     else if (newAux.beginTime() < beginTime_) {
00030       beginTime_ = newAux.beginTime();
00031     }
00032     
00033     if (endTime_ == Timestamp::invalidTimestamp() ||
00034         newAux.endTime() == Timestamp::invalidTimestamp()) {
00035       endTime_ = Timestamp::invalidTimestamp();
00036     }
00037     else if (newAux.endTime() > endTime_) {
00038       endTime_ = newAux.endTime();
00039     }
00040   }
00041 }