Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_Provenance_LuminosityBlockRange_h
0002 #define DataFormats_Provenance_LuminosityBlockRange_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     DataFormats/Provenance
0006 // Class  :     LuminosityBlockRange
0007 //
0008 /**\class LuminosityBlockRange LuminosityBlockRange.h DataFormats/Provenance/interface/LuminosityBlockRange.h
0009 
0010  Description: Holds run and luminosityBlock range.
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 //
0018 
0019 // system include files
0020 #include <functional>
0021 #include <iosfwd>
0022 #include <vector>
0023 
0024 // user include files
0025 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
0026 
0027 // forward declarations
0028 namespace edm {
0029 
0030   //   typedef unsigned int LuminosityBlockNumber_t;
0031 
0032   class LuminosityBlockRange {
0033   public:
0034     LuminosityBlockRange();
0035 
0036     LuminosityBlockRange(RunNumber_t startRun,
0037                          LuminosityBlockNumber_t startLuminosityBlock,
0038                          RunNumber_t endRun,
0039                          LuminosityBlockNumber_t endLuminosityBlock);
0040 
0041     LuminosityBlockRange(LuminosityBlockID const& begin, LuminosityBlockID const& end);
0042 
0043     //virtual ~LuminosityBlockID();
0044 
0045     // ---------- const member functions ---------------------
0046     LuminosityBlockID startLumiID() const { return startLumiID_; }
0047     LuminosityBlockID endLumiID() const { return endLumiID_; }
0048     RunNumber_t startRun() const { return startLumiID_.run(); }
0049     RunNumber_t endRun() const { return endLumiID_.run(); }
0050     LuminosityBlockNumber_t startLumi() const { return startLumiID_.luminosityBlock(); }
0051     LuminosityBlockNumber_t endLumi() const { return endLumiID_.luminosityBlock(); }
0052 
0053     // ---------- static functions ---------------------------
0054 
0055     // ---------- member functions ---------------------------
0056 
0057   private:
0058     // ---------- member data --------------------------------
0059     //RunNumber_t             startRun_;
0060     //RunNumber_t             endRun_;
0061     //LuminosityBlockNumber_t startLumi_;
0062     //LuminosityBlockNumber_t endLumi_;
0063     LuminosityBlockID startLumiID_;
0064     LuminosityBlockID endLumiID_;
0065   };
0066 
0067   std::ostream& operator<<(std::ostream& oStream, LuminosityBlockRange const& iID);
0068   bool contains(LuminosityBlockRange const& lh, LuminosityBlockID const& rh);
0069   bool contains(LuminosityBlockRange const& lh, LuminosityBlockRange const& rh);
0070   bool lessThan(LuminosityBlockRange const& lh, LuminosityBlockRange const& rh);
0071   bool overlaps(LuminosityBlockRange const& lh, LuminosityBlockRange const& rh);
0072   bool distinct(LuminosityBlockRange const& lh, LuminosityBlockRange const& rh);
0073   bool merge(LuminosityBlockRange& lh, LuminosityBlockRange& rh);
0074   std::vector<LuminosityBlockRange>& sortAndRemoveOverlaps(std::vector<LuminosityBlockRange>& lumiRange);
0075 }  // namespace edm
0076 #endif