Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_Provenance_EventRange_h
0002 #define DataFormats_Provenance_EventRange_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     DataFormats/Provenance
0006 // Class  :     EventRange
0007 //
0008 
0009 /*
0010  Description: Holds run and event 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 #include "DataFormats/Provenance/interface/EventID.h"
0024 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0025 
0026 // user include files
0027 
0028 // forward declarations
0029 namespace edm {
0030 
0031   class EventRange {
0032   public:
0033     EventRange();
0034 
0035     EventRange(RunNumber_t startRun,
0036                LuminosityBlockNumber_t startLumi,
0037                EventNumber_t startEvent,
0038                RunNumber_t endRun,
0039                LuminosityBlockNumber_t endLumi,
0040                EventNumber_t endEvent);
0041 
0042     EventRange(EventID const& begin, EventID const& end);
0043     //      virtual ~EventRange();
0044 
0045     // ---------- const member functions ---------------------
0046     EventID startEventID() const { return startEventID_; }
0047     EventID endEventID() const { return endEventID_; }
0048     RunNumber_t startRun() const { return startEventID_.run(); }
0049     RunNumber_t endRun() const { return endEventID_.run(); }
0050     LuminosityBlockNumber_t startLumi() const { return startEventID_.luminosityBlock(); }
0051     LuminosityBlockNumber_t endLumi() const { return endEventID_.luminosityBlock(); }
0052     EventNumber_t startEvent() const { return startEventID_.event(); }
0053     EventNumber_t endEvent() const { return endEventID_.event(); }
0054 
0055   private:
0056     // ---------- member data --------------------------------
0057     //RunNumber_t   startRun_;
0058     //RunNumber_t   endRun_;
0059     //LuminosityBlockNumber_t   startLumi_;
0060     //LuminosityBlockNumber_t   endLumi_;
0061     //EventNumber_t startEvent_;
0062     //EventNumber_t endEvent_;
0063     EventID startEventID_;
0064     EventID endEventID_;
0065   };
0066 
0067   std::ostream& operator<<(std::ostream& oStream, EventRange const& iID);
0068   bool contains(EventRange const& lh, EventID const& rh);
0069   bool contains_(EventRange const& lh, EventID const& rh);
0070   bool contains(EventRange const& lh, EventRange const& rh);
0071   bool lessThan(EventRange const& lh, EventRange const& rh);
0072   bool lessThanSpecial(EventRange const& lh, EventRange const& rh);
0073   bool overlaps(EventRange const& lh, EventRange const& rh);
0074   bool distinct(EventRange const& lh, EventRange const& rh);
0075   std::vector<EventRange>& sortAndRemoveOverlaps(std::vector<EventRange>& eventRange);
0076 
0077 }  // namespace edm
0078 #endif