File indexing completed on 2024-04-06 12:05:02
0001 #ifndef DataFormats_Provenance_LuminosityBlockRange_h
0002 #define DataFormats_Provenance_LuminosityBlockRange_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <functional>
0021 #include <iosfwd>
0022 #include <vector>
0023
0024
0025 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
0026
0027
0028 namespace edm {
0029
0030
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
0044
0045
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
0054
0055
0056
0057 private:
0058
0059
0060
0061
0062
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 }
0076 #endif