CMS 3D CMS Logo

LuminosityBlockAuxiliary.cc

Go to the documentation of this file.
00001 #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h"
00002 #include <ostream>
00003 
00004 /*----------------------------------------------------------------------
00005 
00006 $Id: LuminosityBlockAuxiliary.cc,v 1.2 2008/01/23 23:34:54 wdd Exp $
00007 
00008 ----------------------------------------------------------------------*/
00009 
00010 namespace edm {
00011   void
00012   LuminosityBlockAuxiliary::write(std::ostream& os) const {
00013     os << "Process History ID = " <<  processHistoryID_ << std::endl;
00014     os << id_ << std::endl;
00015   }
00016 
00017   bool
00018   LuminosityBlockAuxiliary::mergeAuxiliary(LuminosityBlockAuxiliary const& newAux) {
00019     if (beginTime_ == Timestamp::invalidTimestamp() ||
00020         newAux.beginTime() == Timestamp::invalidTimestamp()) {
00021       beginTime_ = Timestamp::invalidTimestamp();
00022     }
00023     else if (newAux.beginTime() < beginTime_) {
00024       beginTime_ = newAux.beginTime();
00025     }
00026    
00027     if (endTime_ == Timestamp::invalidTimestamp() ||
00028         newAux.endTime() == Timestamp::invalidTimestamp()) {
00029       endTime_ = Timestamp::invalidTimestamp();
00030     }
00031     else if (newAux.endTime() > endTime_) {
00032       endTime_ = newAux.endTime();
00033     }
00034 
00035     // Keep the process history ID that is in the preexisting principal
00036     // It may have been updated to include the current process.
00037     // There is one strange other case where the two ProcessHistoryIDs
00038     // could be different which should not be important and we just ignore.
00039     // There could have been previous processes which only dropped products.
00040     // These processes could have dropped the same branches but had different
00041     // process names ... Ignore this.
00042 
00043     if (id_ != newAux.id()) return false;
00044     return true;
00045   }
00046 }

Generated on Tue Jun 9 17:31:37 2009 for CMSSW by  doxygen 1.5.4