CMS 3D CMS Logo

RunAuxiliary.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_RunAuxiliary_h
00002 #define DataFormats_Provenance_RunAuxiliary_h
00003 
00004 #include <iosfwd>
00005 #include <set>
00006 
00007 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
00008 #include "DataFormats/Provenance/interface/RunID.h"
00009 #include "DataFormats/Provenance/interface/Timestamp.h"
00010 
00011 // Auxiliary run data that is persistent
00012 
00013 namespace edm
00014 {
00015   struct RunAuxiliary {
00016     RunAuxiliary() :
00017         processHistoryID_(),
00018         allEventsProcessHistories_(),
00019         id_(),
00020         beginTime_(),
00021         endTime_() {}
00022     RunAuxiliary(RunID const& theId, Timestamp const& theTime, Timestamp const& theEndTime) :
00023         processHistoryID_(),
00024         allEventsProcessHistories_(),
00025         id_(theId),
00026         beginTime_(theTime),
00027         endTime_(theEndTime) {}
00028     RunAuxiliary(RunNumber_t const& run, Timestamp const& theTime, Timestamp const& theEndTime) :
00029         processHistoryID_(),
00030         allEventsProcessHistories_(),
00031         id_(run),
00032         beginTime_(theTime),
00033         endTime_(theEndTime) {}
00034     ~RunAuxiliary() {}
00035     void write(std::ostream& os) const;
00036     ProcessHistoryID& processHistoryID() const {return processHistoryID_;}
00037     RunID const& id() const {return id_;}
00038     Timestamp const& beginTime() const {return beginTime_;}
00039     Timestamp const& endTime() const {return endTime_;}
00040     RunNumber_t run() const {return id_.run();}
00041     void setEndTime(Timestamp const& time) {
00042       if (endTime_ == Timestamp::invalidTimestamp()) endTime_ = time;
00043     }
00044     bool mergeAuxiliary(RunAuxiliary const& aux);
00045 
00046     // most recent process that put a RunProduct into this run
00047     // is the last on the list, this defines what "latest" is
00048     mutable ProcessHistoryID processHistoryID_;
00049 
00050     // allEventsProcessHistories_ contains all the ProcessHistoryIDs for all
00051     // events in this run seen so far.
00052     std::set<ProcessHistoryID> allEventsProcessHistories_;
00053 
00054     // Run ID
00055     RunID id_;
00056     // Times from DAQ
00057     Timestamp beginTime_;
00058     Timestamp endTime_;
00059 
00060   private:
00061     void mergeNewTimestampsIntoThis_(RunAuxiliary const& newAux);    
00062     void mergeNewProcessHistoryIntoThis_(RunAuxiliary const& newAux);    
00063   };
00064 
00065   inline
00066   std::ostream&
00067   operator<<(std::ostream& os, const RunAuxiliary& p) {
00068     p.write(os);
00069     return os;
00070   }
00071 
00072 }
00073 
00074 #endif

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