Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:02

0001 #ifndef DataFormats_Provenance_RunID_h
0002 #define DataFormats_Provenance_RunID_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     DataFormats/Provenance
0006 // Class  :     RunID
0007 //
0008 /**\class edm::RunID
0009 
0010  Description: Holds run number
0011 
0012 */
0013 
0014 #include <iosfwd>
0015 
0016 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0017 
0018 namespace edm {
0019 
0020   class RunID {
0021   public:
0022     RunID() : run_(invalidRunNumber) {}
0023     explicit RunID(RunNumber_t iRun) : run_(iRun) {}
0024 
0025     // ---------- const member functions ---------------------
0026     RunNumber_t run() const { return run_; }
0027 
0028     //moving from one RunID to another one
0029     RunID next() const { return RunID(run_ + 1); }
0030     RunID previous() const {
0031       if (run_ != 0) {
0032         return RunID(run_ - 1);
0033       }
0034       return RunID(0);
0035     }
0036 
0037     bool operator==(RunID const& iRHS) const { return iRHS.run_ == run_; }
0038     bool operator!=(RunID const& iRHS) const { return !(*this == iRHS); }
0039 
0040     bool operator<(RunID const& iRHS) const { return run_ < iRHS.run_; }
0041     bool operator<=(RunID const& iRHS) const { return run_ <= iRHS.run_; }
0042     bool operator>(RunID const& iRHS) const { return run_ > iRHS.run_; }
0043     bool operator>=(RunID const& iRHS) const { return run_ >= iRHS.run_; }
0044     // ---------- static functions ---------------------------
0045 
0046     static RunNumber_t maxRunNumber() { return 0xFFFFFFFFU; }
0047 
0048     static RunID firstValidRun() { return RunID(1); }
0049 
0050   private:
0051     // ---------- member data --------------------------------
0052     RunNumber_t run_;
0053   };
0054 
0055   std::ostream& operator<<(std::ostream& oStream, RunID const& iID);
0056 
0057 }  // namespace edm
0058 #endif