Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:33

0001 #include "DataFormats/Provenance/interface/RunAuxiliary.h"
0002 #include <cassert>
0003 #include <ostream>
0004 
0005 /*----------------------------------------------------------------------
0006 
0007 ----------------------------------------------------------------------*/
0008 
0009 namespace edm {
0010   void RunAuxiliary::write(std::ostream& os) const {
0011     os << "Process History ID = " << processHistoryID_ << std::endl;
0012     os << id_ << std::endl;
0013   }
0014 
0015   void RunAuxiliary::mergeAuxiliary(RunAuxiliary const& newAux) {
0016     assert(id_ == newAux.id_);
0017     mergeNewTimestampsIntoThis_(newAux);
0018   }
0019 
0020   void RunAuxiliary::mergeNewTimestampsIntoThis_(RunAuxiliary const& newAux) {
0021     if (beginTime_ == Timestamp::invalidTimestamp() || newAux.beginTime() == Timestamp::invalidTimestamp()) {
0022       beginTime_ = Timestamp::invalidTimestamp();
0023     } else if (newAux.beginTime() < beginTime_) {
0024       beginTime_ = newAux.beginTime();
0025     }
0026 
0027     if (endTime_ == Timestamp::invalidTimestamp() || newAux.endTime() == Timestamp::invalidTimestamp()) {
0028       endTime_ = Timestamp::invalidTimestamp();
0029     } else if (newAux.endTime() > endTime_) {
0030       endTime_ = newAux.endTime();
0031     }
0032   }
0033 }  // namespace edm