CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Provenance/interface/EventRange.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_EventRange_h
00002 #define DataFormats_Provenance_EventRange_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     DataFormats/Provenance
00006 // Class  :     EventRange
00007 //
00008 
00009 /*
00010  Description: Holds run and event range.
00011 
00012  Usage:
00013     <usage>
00014 
00015 */
00016 //
00017 //
00018 
00019 // system include files
00020 #include <functional>
00021 #include <iosfwd>
00022 #include <vector>
00023 #include "DataFormats/Provenance/interface/EventID.h"
00024 
00025 // user include files
00026 
00027 // forward declarations
00028 namespace edm {
00029 
00030    typedef unsigned int EventNumber_t;
00031    typedef unsigned int LumiNumber_t;
00032    typedef unsigned int RunNumber_t;
00033 
00034   class EventRange {
00035 
00036    public:
00037 
00038       EventRange();
00039 
00040       EventRange(RunNumber_t startRun, LumiNumber_t startLumi, EventNumber_t startEvent,
00041                  RunNumber_t endRun, LumiNumber_t endLumi, EventNumber_t endEvent);
00042 
00043       EventRange(EventID const& begin, EventID const& end);
00044 //      virtual ~EventRange();
00045 
00046       // ---------- const member functions ---------------------
00047       EventID     startEventID() const {return startEventID_; }
00048       EventID       endEventID() const {return   endEventID_; }
00049       RunNumber_t     startRun() const {return    startEventID_.run(); }
00050       RunNumber_t       endRun() const {return      endEventID_.run(); }
00051       LumiNumber_t   startLumi() const {return startEventID_.luminosityBlock(); }
00052       LumiNumber_t     endLumi() const {return   endEventID_.luminosityBlock(); }
00053       EventNumber_t startEvent() const {return  startEventID_.event(); }
00054       EventNumber_t   endEvent() const {return    endEventID_.event(); }
00055 
00056    private:
00057 
00058       // ---------- member data --------------------------------
00059       //RunNumber_t   startRun_;
00060       //RunNumber_t   endRun_;
00061       //LumiNumber_t   startLumi_;
00062       //LumiNumber_t   endLumi_;
00063       //EventNumber_t startEvent_;
00064       //EventNumber_t endEvent_;
00065       EventID startEventID_;
00066       EventID endEventID_;
00067   };
00068 
00069   std::ostream& operator<<(std::ostream& oStream, EventRange const& iID);
00070   bool contains(EventRange const& lh, EventID const& rh);
00071   bool contains_(EventRange const& lh, EventID const& rh);
00072   bool contains(EventRange const& lh, EventRange const& rh);
00073   bool lessThan(EventRange const& lh, EventRange const& rh);
00074   bool lessThanSpecial(EventRange const& lh, EventRange const& rh);
00075   bool overlaps(EventRange const& lh, EventRange const& rh);
00076   bool distinct(EventRange const& lh, EventRange const& rh);
00077   std::vector<EventRange>& sortAndRemoveOverlaps(std::vector<EventRange>& eventRange);
00078 
00079 }
00080 #endif