File indexing completed on 2024-04-06 12:05:02
0001 #ifndef DataFormats_Provenance_StoredMergeableRunProductMetadata_h
0002 #define DataFormats_Provenance_StoredMergeableRunProductMetadata_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #include "DataFormats/Provenance/interface/RunLumiEventNumber.h"
0051
0052 #include <string>
0053 #include <vector>
0054
0055 namespace edm {
0056
0057 class StoredMergeableRunProductMetadata {
0058 public:
0059
0060 StoredMergeableRunProductMetadata();
0061
0062
0063
0064 StoredMergeableRunProductMetadata(std::vector<std::string> const& processesWithMergeableRunProducts);
0065
0066 std::vector<std::string> const& processesWithMergeableRunProducts() const {
0067 return processesWithMergeableRunProducts_;
0068 }
0069
0070 class SingleRunEntry {
0071 public:
0072 SingleRunEntry();
0073 SingleRunEntry(unsigned long long iBeginProcess, unsigned long long iEndProcess);
0074
0075 unsigned long long beginProcess() const { return beginProcess_; }
0076 unsigned long long endProcess() const { return endProcess_; }
0077
0078 private:
0079
0080 unsigned long long beginProcess_;
0081 unsigned long long endProcess_;
0082 };
0083
0084 class SingleRunEntryAndProcess {
0085 public:
0086 SingleRunEntryAndProcess();
0087 SingleRunEntryAndProcess(unsigned long long iBeginLumi,
0088 unsigned long long iEndLumi,
0089 unsigned int iProcess,
0090 bool iValid,
0091 bool iUseIndexIntoFile);
0092
0093 unsigned long long beginLumi() const { return beginLumi_; }
0094 unsigned long long endLumi() const { return endLumi_; }
0095
0096 unsigned int process() const { return process_; }
0097
0098 bool valid() const { return valid_; }
0099 bool useIndexIntoFile() const { return useIndexIntoFile_; }
0100
0101 private:
0102
0103
0104 unsigned long long beginLumi_;
0105 unsigned long long endLumi_;
0106
0107
0108 unsigned int process_;
0109
0110
0111
0112
0113 bool valid_;
0114
0115
0116
0117 bool useIndexIntoFile_;
0118 };
0119
0120
0121
0122 std::vector<SingleRunEntry>& singleRunEntries() { return singleRunEntries_; }
0123 std::vector<SingleRunEntryAndProcess>& singleRunEntryAndProcesses() { return singleRunEntryAndProcesses_; }
0124 std::vector<LuminosityBlockNumber_t>& lumis() { return lumis_; }
0125 bool& allValidAndUseIndexIntoFile() { return allValidAndUseIndexIntoFile_; }
0126
0127
0128
0129 void optimizeBeforeWrite();
0130
0131 bool getLumiContent(unsigned long long runEntry,
0132 std::string const& process,
0133 bool& valid,
0134 std::vector<LuminosityBlockNumber_t>::const_iterator& lumisBegin,
0135 std::vector<LuminosityBlockNumber_t>::const_iterator& lumisEnd) const;
0136
0137 private:
0138 std::vector<std::string> processesWithMergeableRunProducts_;
0139 std::vector<SingleRunEntry> singleRunEntries_;
0140 std::vector<SingleRunEntryAndProcess> singleRunEntryAndProcesses_;
0141 std::vector<LuminosityBlockNumber_t> lumis_;
0142 bool allValidAndUseIndexIntoFile_;
0143 };
0144 }
0145 #endif