13 std::set<std::string>
const& processesWithKeptProcessBlockProducts,
22 unsigned int iProcess = 0;
24 if (processesWithKeptProcessBlockProducts.find(
process) != processesWithKeptProcessBlockProducts.end()) {
31 for (
auto const& addedProcess : processBlockHelper.
addedProcesses()) {
58 std::vector<unsigned int> storedCacheIndices;
68 storedCacheIndices.reserve(nStoredProcesses);
69 for (
unsigned int i = 0;
i < nStoredProcesses; ++
i) {
70 storedCacheIndices.push_back(
i);
96 assert(!cacheIndices.empty());
98 unsigned int nInputProcesses = 0;
99 for (
unsigned int iStoredProcess = 0; iStoredProcess < nStoredProcesses; ++iStoredProcess) {
115 unsigned int fileOffset = 0;
119 std::vector<unsigned int> processOffset(nInputProcesses, 0);
126 assert(!nEntries.empty());
127 std::vector<unsigned int> storedProcessOffset(nInputProcesses + 1, 0);
132 std::vector<unsigned int> storedFileInProcessOffset(nInputProcesses, 0);
136 storedCacheIndices.reserve(cacheIndices.size() * nStoredProcesses);
138 unsigned int iFile = 0;
139 unsigned int innerVectorsCurrentFile = 0;
143 for (
auto const& innerVectorOfCacheIndices : cacheIndices) {
149 while (innerVectorsCurrentFile == cacheIndexVectorsPerFile[iFile]) {
152 fileOffset += cacheEntriesPerFile[iFile];
154 innerVectorsCurrentFile = 0;
156 if (innerVectorsCurrentFile == 0) {
161 ++innerVectorsCurrentFile;
166 for (
unsigned int iStoredProcess = 0; iStoredProcess < nStoredProcesses; ++iStoredProcess) {
168 if (iStoredProcess < nInputProcesses) {
173 unsigned int inputOffset = fileOffset + processOffset[iStoredProcess];
174 unsigned int storedOffset = storedProcessOffset[iStoredProcess] + storedFileInProcessOffset[iStoredProcess];
175 storedCacheIndex = cacheIndex - inputOffset + storedOffset;
180 storedCacheIndex = storedProcessOffset[nInputProcesses] + iStoredProcess - nInputProcesses;
182 storedCacheIndices.push_back(storedCacheIndex);
189 std::vector<std::vector<unsigned int>>
const& nEntries,
190 std::vector<unsigned int>& storedProcessOffset)
const {
191 unsigned int iStored = 0;
192 for (
auto&
offset : storedProcessOffset) {
195 for (
unsigned int jStored = 0; jStored < iStored; ++jStored) {
198 for (
auto const& entries : nEntries) {
199 assert(indexInEventProcessor < entries.size());
200 offset += entries[indexInEventProcessor];
208 unsigned int nInputProcesses,
209 std::vector<std::vector<unsigned int>>
const& nEntries,
210 std::vector<unsigned int>& processOffset)
const {
211 unsigned int iStored = 0;
212 for (
auto&
offset : processOffset) {
215 for (
unsigned int jProcess = 0; jProcess < iProcess; ++jProcess) {
216 offset += nEntries[iFile][jProcess];
224 unsigned int nInputProcesses,
225 std::vector<std::vector<unsigned int>>
const& nEntries,
226 std::vector<unsigned int>& storedFileInProcessOffset)
const {
227 unsigned int iStored = 0;
228 for (
auto&
offset : storedFileInProcessOffset) {
232 for (
unsigned int jFile = 0; jFile < iFile; ++jFile) {
233 assert(indexInEventProcessor < nEntries[jFile].
size());
234 offset += nEntries[jFile][indexInEventProcessor];
unsigned int nAddedProcesses_
void setProcessOffset(unsigned int iFile, unsigned int nInputProcesses, std::vector< std::vector< unsigned int >> const &nEntries, std::vector< unsigned int > &processOffset) const
virtual unsigned int nProcessesInFirstFile() const =0
static constexpr unsigned int invalidCacheIndex()
ProcessBlockHelperBase const * processBlockHelper_
bool productsFromInputKept_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual std::vector< std::string > const & topProcessesWithProcessBlockProducts() const =0
void updateAfterProductSelection(std::set< std::string > const &processesWithKeptProcessBlockProducts, ProcessBlockHelperBase const &)
virtual std::vector< unsigned int > const & cacheIndexVectorsPerFile() const =0
void setStoredFileInProcessOffset(unsigned int iFile, unsigned int nInputProcesses, std::vector< std::vector< unsigned int >> const &nEntries, std::vector< unsigned int > &storedFileInProcessOffset) const
std::vector< std::string > const & processesWithProcessBlockProducts() const
std::vector< std::string > processesWithProcessBlockProducts_
std::vector< std::string > const & processesWithProcessBlockProducts() const
ProcessBlockHelperBase const * processBlockHelper() const
std::vector< unsigned int > translateFromStoredIndex_
std::vector< std::string > const & addedProcesses() const
virtual std::vector< unsigned int > const & cacheEntriesPerFile() const =0
virtual std::vector< std::vector< unsigned int > > const & nEntries() const =0
void setProcessBlockCacheIndices(std::vector< unsigned int > val)
void setStoredProcessOffset(unsigned int nInputProcesses, std::vector< std::vector< unsigned int >> const &nEntries, std::vector< unsigned int > &storedProcessOffset) const
virtual std::vector< std::vector< unsigned int > > const & processBlockCacheIndices() const =0
void fillCacheIndices(StoredProcessBlockHelper &) const
tuple size
Write out results.