EventRange

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
#ifndef DataFormats_Provenance_EventRange_h
#define DataFormats_Provenance_EventRange_h
// -*- C++ -*-
//
// Package:     DataFormats/Provenance
// Class  :     EventRange
//

/*
 Description: Holds run and event range.

 Usage:
    <usage>

*/
//
//

// system include files
#include <functional>
#include <iosfwd>
#include <vector>
#include "DataFormats/Provenance/interface/EventID.h"
#include "DataFormats/Provenance/interface/RunLumiEventNumber.h"

// user include files

// forward declarations
namespace edm {

  class EventRange {
  public:
    EventRange();

    EventRange(RunNumber_t startRun,
               LuminosityBlockNumber_t startLumi,
               EventNumber_t startEvent,
               RunNumber_t endRun,
               LuminosityBlockNumber_t endLumi,
               EventNumber_t endEvent);

    EventRange(EventID const& begin, EventID const& end);
    //      virtual ~EventRange();

    // ---------- const member functions ---------------------
    EventID startEventID() const { return startEventID_; }
    EventID endEventID() const { return endEventID_; }
    RunNumber_t startRun() const { return startEventID_.run(); }
    RunNumber_t endRun() const { return endEventID_.run(); }
    LuminosityBlockNumber_t startLumi() const { return startEventID_.luminosityBlock(); }
    LuminosityBlockNumber_t endLumi() const { return endEventID_.luminosityBlock(); }
    EventNumber_t startEvent() const { return startEventID_.event(); }
    EventNumber_t endEvent() const { return endEventID_.event(); }

  private:
    // ---------- member data --------------------------------
    //RunNumber_t   startRun_;
    //RunNumber_t   endRun_;
    //LuminosityBlockNumber_t   startLumi_;
    //LuminosityBlockNumber_t   endLumi_;
    //EventNumber_t startEvent_;
    //EventNumber_t endEvent_;
    EventID startEventID_;
    EventID endEventID_;
  };

  std::ostream& operator<<(std::ostream& oStream, EventRange const& iID);
  bool contains(EventRange const& lh, EventID const& rh);
  bool contains_(EventRange const& lh, EventID const& rh);
  bool contains(EventRange const& lh, EventRange const& rh);
  bool lessThan(EventRange const& lh, EventRange const& rh);
  bool lessThanSpecial(EventRange const& lh, EventRange const& rh);
  bool overlaps(EventRange const& lh, EventRange const& rh);
  bool distinct(EventRange const& lh, EventRange const& rh);
  std::vector<EventRange>& sortAndRemoveOverlaps(std::vector<EventRange>& eventRange);

}  // namespace edm
#endif