File indexing completed on 2024-04-06 12:11:55
0001 #ifndef FWCore_Common_ProcessBlockHelper_h
0002 #define FWCore_Common_ProcessBlockHelper_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "DataFormats/Provenance/interface/ProvenanceFwd.h"
0011 #include "FWCore/Common/interface/ProcessBlockHelperBase.h"
0012
0013 #include <set>
0014 #include <string>
0015 #include <vector>
0016
0017 namespace edm {
0018
0019 class ProcessBlockHelper : public ProcessBlockHelperBase {
0020 public:
0021 ProcessBlockHelperBase const* topProcessBlockHelper() const final;
0022 std::vector<std::string> const& topProcessesWithProcessBlockProducts() const final;
0023 unsigned int nProcessesInFirstFile() const final;
0024 std::vector<std::vector<unsigned int>> const& processBlockCacheIndices() const final;
0025 std::vector<std::vector<unsigned int>> const& nEntries() const final;
0026 std::vector<unsigned int> const& cacheIndexVectorsPerFile() const final;
0027 std::vector<unsigned int> const& cacheEntriesPerFile() const final;
0028 unsigned int processBlockIndex(std::string const& processName, EventToProcessBlockIndexes const&) const final;
0029 unsigned int outerOffset() const final;
0030
0031 bool initializedFromInput() const { return initializedFromInput_; }
0032
0033 bool firstFileDropProcessesAndReorderStored(StoredProcessBlockHelper& storedProcessBlockHelper,
0034 std::set<std::string> const& processesToKeep,
0035 std::vector<unsigned int> const& nEntries,
0036 std::vector<unsigned int>& finalIndexToStoredIndex) const;
0037
0038 bool dropProcessesAndReorderStored(StoredProcessBlockHelper& storedProcessBlockHelper,
0039 std::set<std::string> const& processesToKeep,
0040 std::vector<unsigned int> const& nEntries,
0041 std::vector<unsigned int>& finalIndexToStoredIndex,
0042 std::vector<std::string> const& firstFileFinalProcesses) const;
0043
0044 void initializeFromPrimaryInput(StoredProcessBlockHelper const& storedProcessBlockHelper);
0045
0046 void fillFromPrimaryInput(StoredProcessBlockHelper const& storedProcessBlockHelper,
0047 std::vector<unsigned int> const& nEntries);
0048
0049 void clearAfterOutputFilesClose();
0050
0051 private:
0052 void dropProcessesAndReorderStoredImpl(StoredProcessBlockHelper& storedProcessBlockHelper,
0053 std::vector<std::string>& finalProcesses,
0054 std::vector<unsigned int> const& nEntries,
0055 std::vector<unsigned int> const& finalIndexToStoredIndex) const;
0056
0057 void fillFromPrimaryInputWhenNotEmpty(std::vector<std::string> const& storedProcesses,
0058 std::vector<unsigned int> const& storedCacheIndices,
0059 std::vector<unsigned int> const& nEntries);
0060
0061 void fillEntriesFromPrimaryInput(std::vector<unsigned int> nEntries);
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 std::vector<std::vector<unsigned int>> processBlockCacheIndices_;
0088
0089
0090
0091
0092
0093
0094 std::vector<std::vector<unsigned int>> nEntries_;
0095
0096
0097
0098
0099 std::vector<unsigned int> cacheIndexVectorsPerFile_;
0100 std::vector<unsigned int> cacheEntriesPerFile_;
0101
0102 unsigned int nProcessesInFirstFile_ = 0;
0103
0104 bool initializedFromInput_ = false;
0105
0106
0107
0108
0109
0110 unsigned int outerOffset_ = 0;
0111
0112
0113
0114 unsigned int cacheIndexOffset_ = 0;
0115 };
0116 }
0117 #endif