CMS 3D CMS Logo

StoredMergeableRunProductMetadata.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_StoredMergeableRunProductMetadata_h
2 #define DataFormats_Provenance_StoredMergeableRunProductMetadata_h
3 
51 
52 #include <string>
53 #include <vector>
54 
55 namespace edm {
56 
58  public:
59 
60  // This constructor exists for ROOT I/O
62 
63  // This constructor is used when creating a new object
64  // each time an output file is opened.
66 
67  std::vector<std::string> const& processesWithMergeableRunProducts() const {
69  }
70 
72  public:
73 
75  SingleRunEntry(unsigned long long iBeginProcess, unsigned long long iEndProcess);
76 
77  unsigned long long beginProcess() const { return beginProcess_; }
78  unsigned long long endProcess() const { return endProcess_; }
79 
80  private:
81 
82  // indexes into singleRunEntryAndProcesses_ for a single run entry
83  unsigned long long beginProcess_;
84  unsigned long long endProcess_;
85  };
86 
88  public:
89 
91  SingleRunEntryAndProcess(unsigned long long iBeginLumi,
92  unsigned long long iEndLumi,
93  unsigned int iProcess,
94  bool iValid,
95  bool iUseIndexIntoFile);
96 
97 
98  unsigned long long beginLumi() const { return beginLumi_; }
99  unsigned long long endLumi() const { return endLumi_; }
100 
101  unsigned int process() const { return process_; }
102 
103  bool valid() const { return valid_; }
104  bool useIndexIntoFile() const { return useIndexIntoFile_; }
105 
106  private:
107 
108  // indexes into lumis_ for products created in one process and
109  // written into a single run entry.
110  unsigned long long beginLumi_;
111  unsigned long long endLumi_;
112 
113  // index into processesWithMergeableRunProducts_
114  unsigned int process_;
115 
116  // If false this indicates the way files were split and merged
117  // has created run products that are invalid and probably
118  // double count some of their content.
119  bool valid_;
120 
121  // If true the lumi numbers can be obtained from IndexIntoFile
122  // and are not stored in the vector named lumis_
124  };
125 
126  // These four functions are called by MergeableRunProductMetadata which
127  // fills the vectors.
128  std::vector<SingleRunEntry>& singleRunEntries() { return singleRunEntries_; }
129  std::vector<SingleRunEntryAndProcess>& singleRunEntryAndProcesses() { return singleRunEntryAndProcesses_; }
130  std::vector<LuminosityBlockNumber_t>& lumis() { return lumis_; }
132 
133  // Called by RootOutputFile immediately before writing the object
134  // when an output file is closed.
135  void optimizeBeforeWrite();
136 
137  bool getLumiContent(unsigned long long runEntry,
138  std::string const& process,
139  bool& valid,
140  std::vector<LuminosityBlockNumber_t>::const_iterator & lumisBegin,
141  std::vector<LuminosityBlockNumber_t>::const_iterator & lumisEnd) const;
142 
143  private:
144 
145  std::vector<std::string> processesWithMergeableRunProducts_;
146  std::vector<SingleRunEntry> singleRunEntries_; // index is the run entry
147  std::vector<SingleRunEntryAndProcess> singleRunEntryAndProcesses_;
148  std::vector<LuminosityBlockNumber_t> lumis_;
150  };
151 }
152 #endif
std::vector< std::string > const & processesWithMergeableRunProducts() const
std::vector< SingleRunEntryAndProcess > singleRunEntryAndProcesses_
static const uint16_t valid_
Definition: Constants.h:17
std::vector< SingleRunEntryAndProcess > & singleRunEntryAndProcesses()
std::vector< LuminosityBlockNumber_t > & lumis()
std::vector< LuminosityBlockNumber_t > lumis_
bool getLumiContent(unsigned long long runEntry, std::string const &process, bool &valid, std::vector< LuminosityBlockNumber_t >::const_iterator &lumisBegin, std::vector< LuminosityBlockNumber_t >::const_iterator &lumisEnd) const
HLT enums.