CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
edm::IndexIntoFile::IndexIntoFileItrEntryOrder Class Reference

#include <IndexIntoFile.h>

Inheritance diagram for edm::IndexIntoFile::IndexIntoFileItrEntryOrder:
edm::IndexIntoFile::IndexIntoFileItrImpl

Classes

class  EntryOrderInitializationInfo
 
struct  TTreeEntryAndIndex
 

Public Member Functions

IndexIntoFileItrImplclone () const override
 
EntryNumber_t entry () const override
 
int indexedSize () const override
 
 IndexIntoFileItrEntryOrder (IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
 
LuminosityBlockNumber_t lumi () const override
 
bool lumiIterationStartingIndex (int index) const override
 
EntryNumber_t peekAheadAtEventEntry () const override
 
LuminosityBlockNumber_t peekAheadAtLumi () const override
 
int processHistoryIDIndex () const override
 
RunNumber_t run () const override
 
bool shouldProcessLumi () const final
 
bool shouldProcessRun () const final
 
bool skipLumiInRun () override
 
- Public Member Functions inherited from edm::IndexIntoFile::IndexIntoFileItrImpl
void advanceToNextLumiOrRun ()
 
void advanceToNextRun ()
 
void copyPosition (IndexIntoFileItrImpl const &position)
 
EntryNumber_t firstEventEntryThisLumi ()
 
EntryNumber_t firstEventEntryThisRun ()
 
EntryType getEntryType () const
 
void getLumisInRun (std::vector< LuminosityBlockNumber_t > &lumis) const
 
IndexIntoFile const * indexIntoFile () const
 
 IndexIntoFileItrImpl (IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
 
long long indexToEvent () const
 
int indexToEventRange () const
 
int indexToLumi () const
 
int indexToRun () const
 
void initializeLumi ()
 
void initializeRun ()
 
long long nEvents () const
 
void next ()
 
bool operator== (IndexIntoFileItrImpl const &right) const
 
int size () const
 
void skipEventBackward (int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
 
void skipEventForward (int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
 
bool skipToNextEventInLumi ()
 
EntryType type () const
 
virtual ~IndexIntoFileItrImpl ()
 

Private Member Functions

void addRunsWithNoEvents (EntryOrderInitializationInfo &, EntryNumber_t maxRunTTreeEntry=invalidEntry)
 
void addToFileOrder (int index, bool processRunOrLumi, bool processEvents)
 
void fillLumisWithNoRemainingEvents (std::vector< TTreeEntryAndIndex > &lumisWithNoRemainingEvents, int startingIndex, EntryNumber_t currentRun, RunOrLumiEntry const *eventSequenceRunOrLumiEntry) const
 
EntryType getRunOrLumiEntryType (int index) const override
 
void handleLumiEntriesNoRemainingEvents (EntryOrderInitializationInfo &info, int &iLumiIndex, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi, bool completeAll=false)
 
void handleLumisWithNoEvents (std::vector< TTreeEntryAndIndex >::const_iterator &nextLumiWithNoEvents, std::vector< TTreeEntryAndIndex >::const_iterator &endLumisWithNoEvents, EntryNumber_t lumiTTreeEntryNumber, bool completeAll=false)
 
void handleLumiWithEvents (EntryOrderInitializationInfo &info, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi)
 
void handleToEndOfContiguousEventsInLumis (EntryOrderInitializationInfo &info, EntryNumber_t currentRun, int endOfRunEntries)
 
void handleToEndOfContiguousEventsInRun (EntryOrderInitializationInfo &info, EntryNumber_t currentRun)
 
void initializeLumi_ () override
 
bool isSameLumi (int index1, int index2) const override
 
bool isSameRun (int index1, int index2) const override
 
EntryNumber_t lowestInLumi (EntryOrderInitializationInfo &info, int currentLumi) const
 
LuminosityBlockNumber_t lumi (int index) const override
 
bool nextEventRange () override
 
bool previousEventRange () override
 
void reserveSpaceInVectors (std::vector< EntryNumber_t >::size_type)
 
RunOrLumiEntry const & runOrLumisEntry (EntryNumber_t iEntry) const
 
bool setToLastEventInRange (int index) override
 
bool shouldProcessEvents (EntryNumber_t iEntry) const
 
bool shouldProcessRunOrLumi (EntryNumber_t iEntry) const
 

Private Attributes

std::vector< EntryNumber_tfileOrderRunOrLumiEntry_
 
int indexedSize_ = 0
 
std::vector< bool > shouldProcessEvents_
 
std::vector< bool > shouldProcessRunOrLumi_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::IndexIntoFile::IndexIntoFileItrImpl
void setIndexToEvent (long long value)
 
void setIndexToEventRange (int value)
 
void setIndexToLumi (int value)
 
void setInvalid ()
 
void setNEvents (long long value)
 

Detailed Description

Definition at line 765 of file IndexIntoFile.h.

Constructor & Destructor Documentation

◆ IndexIntoFileItrEntryOrder()

edm::IndexIntoFile::IndexIntoFileItrEntryOrder::IndexIntoFileItrEntryOrder ( IndexIntoFile const *  indexIntoFile,
EntryType  entryType,
int  indexToRun,
int  indexToLumi,
int  indexToEventRange,
long long  indexToEvent,
long long  nEvents 
)

Definition at line 1784 of file IndexIntoFile.cc.

References addRunsWithNoEvents(), cms::cuda::assert(), edm::IndexIntoFile::currentRun(), fileOrderRunOrLumiEntry_, handleToEndOfContiguousEventsInRun(), indexedSize_, edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile(), info(), edm::IndexIntoFile::invalidEntry, reserveSpaceInVectors(), edm::IndexIntoFile::runOrLumiEntries(), and edm::IndexIntoFile::IndexIntoFileItrImpl::size().

1792  iIndexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent, nEvents) {
1793  EntryOrderInitializationInfo info;
1794  info.resizeVectors(indexIntoFile()->runOrLumiEntries());
1796 
1797  // fill firstIndexOfLumi, firstIndexOfRun, runsWithNoEvents
1798  info.gatherNeededInfo(indexIntoFile()->runOrLumiEntries());
1799 
1800  info.fillIndexesSortedByEventEntry(indexIntoFile()->runOrLumiEntries());
1801  info.fillIndexesToLastContiguousEvents(indexIntoFile()->runOrLumiEntries());
1802 
1804 
1805  // The main iterator created here (iEventSequence) is incremented
1806  // in the function handleToEndOfContiguousEventsInRun and
1807  // the functions it calls. The iterator is stored in "info",
1808  // which also holds other information related to the iteration.
1809  // The information is passed to these functions inside the "info"
1810  // object.
1811  for (info.iEventSequence_ = info.indexesSortedByEventEntry_.cbegin(),
1812  info.iEventSequenceEnd_ = info.indexesSortedByEventEntry_.cend();
1813  info.iEventSequence_ < info.iEventSequenceEnd_;) {
1814  info.eventSequenceIndex_ = info.iEventSequence_->runOrLumiIndex_;
1815  info.eventSequenceRunOrLumiEntry_ = &indexIntoFile()->runOrLumiEntries()[info.eventSequenceIndex_];
1816 
1817  assert(info.eventSequenceRunOrLumiEntry_->orderPHIDRun() != currentRun);
1818  currentRun = info.eventSequenceRunOrLumiEntry_->orderPHIDRun();
1819 
1820  // Handles the set of events contiguous in the Events TTree from
1821  // a single run and all the entries (Run or Lumi) associated with
1822  // those events and possibly some runs with no events that precede
1823  // the run in the runs TTree.
1825  }
1826  // This takes care of only Runs with no Events at the end of
1827  // the Runs TTree that were not already added.
1830  }
void handleToEndOfContiguousEventsInRun(EntryOrderInitializationInfo &info, EntryNumber_t currentRun)
static const TGPicture * info(bool iBackgroundIsBlack)
void addRunsWithNoEvents(EntryOrderInitializationInfo &, EntryNumber_t maxRunTTreeEntry=invalidEntry)
RunNumber_t & currentRun() const
assert(be >=bs)
long long EntryNumber_t
void reserveSpaceInVectors(std::vector< EntryNumber_t >::size_type)
IndexIntoFileItrImpl(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.

Member Function Documentation

◆ addRunsWithNoEvents()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::addRunsWithNoEvents ( EntryOrderInitializationInfo info,
EntryNumber_t  maxRunTTreeEntry = invalidEntry 
)
private

Definition at line 2196 of file IndexIntoFile.cc.

References info(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

Referenced by IndexIntoFileItrEntryOrder().

2197  {
2198  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2199 
2200  for (auto& nextRunWithNoEvents = info.nextRunWithNoEvents_;
2201  nextRunWithNoEvents != info.endRunsWithNoEvents_ &&
2202  (maxRunTTreeEntry == invalidEntry || nextRunWithNoEvents->ttreeEntry_ < maxRunTTreeEntry);
2203  ++nextRunWithNoEvents) {
2204  int index = nextRunWithNoEvents->runOrLumiIndex_;
2205  EntryNumber_t runToAdd = runOrLumiEntries[index].orderPHIDRun();
2206  for (int iEnd = static_cast<int>(runOrLumiEntries.size());
2207  index < iEnd && runOrLumiEntries[index].orderPHIDRun() == runToAdd;
2208  ++index) {
2209  // This will add in Run entries and the entries of Lumis in those Runs
2210  addToFileOrder(index, true, false);
2211  }
2212  }
2213  }
static const TGPicture * info(bool iBackgroundIsBlack)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
long long EntryNumber_t
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.

◆ addToFileOrder()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::addToFileOrder ( int  index,
bool  processRunOrLumi,
bool  processEvents 
)
private

Definition at line 2269 of file IndexIntoFile.cc.

2269  {
2270  fileOrderRunOrLumiEntry_.push_back(index);
2271  shouldProcessRunOrLumi_.push_back(processRunOrLumi);
2272  shouldProcessEvents_.push_back(processEvents);
2273  }
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_

◆ clone()

IndexIntoFile::IndexIntoFileItrImpl * edm::IndexIntoFile::IndexIntoFileItrEntryOrder::clone ( void  ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1832 of file IndexIntoFile.cc.

1832  {
1833  return new IndexIntoFileItrEntryOrder(*this);
1834  }
IndexIntoFileItrEntryOrder(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)

◆ entry()

IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::entry ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1854 of file IndexIntoFile.cc.

References mps_splice::entry, Exception, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, and edm::errors::LogicError.

1854  {
1855  if (type() == kEnd)
1856  return invalidEntry;
1857  if (type() == kRun)
1858  return runOrLumisEntry(indexToRun()).entry();
1859  if (type() == kLumi) {
1860  auto entry = runOrLumisEntry(indexToLumi()).entry();
1861  if (entry == invalidEntry) {
1862  auto const& runLumiEntry = runOrLumisEntry(indexToLumi());
1863  for (int index = indexToLumi() + 1; index < indexedSize(); ++index) {
1864  auto const& laterRunOrLumiEntry = runOrLumisEntry(index);
1865  if (runLumiEntry.lumi() == laterRunOrLumiEntry.lumi() and runLumiEntry.run() == laterRunOrLumiEntry.run() and
1866  runLumiEntry.processHistoryIDIndex() == laterRunOrLumiEntry.processHistoryIDIndex() &&
1867  laterRunOrLumiEntry.entry() != invalidEntry) {
1868  return laterRunOrLumiEntry.entry();
1869  }
1870  }
1871  // We should always find one and never get here!
1872  throw Exception(errors::LogicError) << "In IndexIntoFile::IndexIntoFileItrEntryOrder::entry. Could not\n"
1873  << "find valid TTree entry number for lumi. This means the IndexIntoFile\n"
1874  << "product in the output file will be corrupted.\n"
1875  << "The output file will be unusable for most purposes.\n"
1876  << "If this occurs after an unrelated exception was thrown,\n"
1877  << "then ignore this exception and fix the primary exception.\n"
1878  << "This is an expected side effect.\n"
1879  << "Otherwise, please report this to the core framework developers\n";
1880  }
1881  return entry;
1882  }
1884  }
EntryNumber_t beginEvents() const
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ fillLumisWithNoRemainingEvents()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::fillLumisWithNoRemainingEvents ( std::vector< TTreeEntryAndIndex > &  lumisWithNoRemainingEvents,
int  startingIndex,
EntryNumber_t  currentRun,
RunOrLumiEntry const *  eventSequenceRunOrLumiEntry 
) const
private

Definition at line 2215 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::RunOrLumiEntry::beginEvents(), edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::currentLumi(), edm::IndexIntoFile::currentRun(), edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::runOrLumiEntries(), jetUpdater_cfi::sort, and edm::IndexIntoFile::IndexIntoFileItrEntryOrder::TTreeEntryAndIndex::ttreeEntry_.

2219  {
2220  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2221  int iEnd = static_cast<int>(runOrLumiEntries.size());
2222 
2223  // start at the first entry after the Run entries
2224  // iterate over all the lumi entries in this Run
2225  // The outer loop iterates over lumis and inner loop iterates over entries in each lumi
2226  for (int indexOfLumiEntry = startingIndex;
2227  indexOfLumiEntry < iEnd && runOrLumiEntries[indexOfLumiEntry].orderPHIDRun() == currentRun;) {
2228  auto currentLumiIndex = indexOfLumiEntry;
2229  auto const& currentLumiEntry = runOrLumiEntries[currentLumiIndex];
2230  assert(!currentLumiEntry.isRun());
2231  auto currentLumi = currentLumiEntry.orderPHIDRunLumi();
2232 
2233  bool foundUnprocessedEvents = false;
2234  EntryNumber_t minLumiTTreeEntry = invalidEntry;
2235  // iterate over the lumi entries associated with a single lumi
2236  for (; indexOfLumiEntry < iEnd && runOrLumiEntries[indexOfLumiEntry].orderPHIDRunLumi() == currentLumi;
2237  ++indexOfLumiEntry) {
2238  if (runOrLumiEntries[indexOfLumiEntry].beginEvents() >= eventSequenceRunOrLumiEntry->beginEvents()) {
2239  foundUnprocessedEvents = true;
2240  }
2241  // Find the smallest valid Lumi TTree entry for this lumi
2242  auto lumiTTreeEntry = runOrLumiEntries[indexOfLumiEntry].entry();
2243  if (lumiTTreeEntry != invalidEntry &&
2244  (minLumiTTreeEntry == invalidEntry || lumiTTreeEntry < minLumiTTreeEntry)) {
2245  minLumiTTreeEntry = lumiTTreeEntry;
2246  }
2247  }
2248  // No event sequences left to process and at least one valid lumi TTree entry.
2249  if (!foundUnprocessedEvents && minLumiTTreeEntry != invalidEntry) {
2250  lumisWithNoRemainingEvents.push_back({minLumiTTreeEntry, currentLumiIndex});
2251  }
2252  }
2253 
2254  std::sort(lumisWithNoRemainingEvents.begin(),
2255  lumisWithNoRemainingEvents.end(),
2256  [](TTreeEntryAndIndex const& left, TTreeEntryAndIndex const& right) -> bool {
2257  return left.ttreeEntry_ < right.ttreeEntry_;
2258  });
2259  }
RunNumber_t & currentRun() const
assert(be >=bs)
long long EntryNumber_t
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t & currentLumi() const
EntryNumber_t & beginEvents() const

◆ getRunOrLumiEntryType()

IndexIntoFile::EntryType edm::IndexIntoFile::IndexIntoFileItrEntryOrder::getRunOrLumiEntryType ( int  index) const
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 2029 of file IndexIntoFile.cc.

References edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kLumi, and edm::IndexIntoFile::kRun.

2029  {
2030  if (index < 0 || index >= indexedSize()) {
2031  return kEnd;
2032  } else if (runOrLumisEntry(index).isRun()) {
2033  return kRun;
2034  }
2035  return kLumi;
2036  }
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ handleLumiEntriesNoRemainingEvents()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::handleLumiEntriesNoRemainingEvents ( EntryOrderInitializationInfo info,
int &  iLumiIndex,
int  currentLumi,
EntryNumber_t  firstBeginEventsContiguousLumi,
bool  completeAll = false 
)
private

Definition at line 2421 of file IndexIntoFile.cc.

References edm::IndexIntoFile::currentLumi(), mps_splice::entry, info(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

2426  {
2427  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2428  int iEnd = static_cast<int>(runOrLumiEntries.size());
2429 
2430  for (; iLumiIndex < iEnd && runOrLumiEntries[iLumiIndex].orderPHIDRunLumi() == currentLumi &&
2431  (completeAll || runOrLumiEntries[iLumiIndex].entry() < info.eventSequenceRunOrLumiEntry_->entry());
2432  ++iLumiIndex) {
2433  if (runOrLumiEntries[iLumiIndex].entry() == invalidEntry ||
2434  runOrLumiEntries[iLumiIndex].beginEvents() >= firstBeginEventsContiguousLumi) {
2435  continue;
2436  }
2437  addToFileOrder(iLumiIndex, true, false);
2438  }
2439  }
static const TGPicture * info(bool iBackgroundIsBlack)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t & currentLumi() const

◆ handleLumisWithNoEvents()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::handleLumisWithNoEvents ( std::vector< TTreeEntryAndIndex >::const_iterator &  nextLumiWithNoEvents,
std::vector< TTreeEntryAndIndex >::const_iterator &  endLumisWithNoEvents,
EntryNumber_t  lumiTTreeEntryNumber,
bool  completeAll = false 
)
private

Definition at line 2380 of file IndexIntoFile.cc.

References mps_splice::entry, edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

2384  {
2385  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2386  int iEnd = static_cast<int>(runOrLumiEntries.size());
2387 
2388  for (; nextLumiWithNoEvents < endLumisWithNoEvents &&
2389  (completeAll || nextLumiWithNoEvents->ttreeEntry_ < lumiTTreeEntryNumber);
2390  ++nextLumiWithNoEvents) {
2391  int iLumiIndex = nextLumiWithNoEvents->runOrLumiIndex_;
2392  auto orderPHIDRunLumi = runOrLumiEntries[iLumiIndex].orderPHIDRunLumi();
2393  for (; iLumiIndex < iEnd && runOrLumiEntries[iLumiIndex].orderPHIDRunLumi() == orderPHIDRunLumi; ++iLumiIndex) {
2394  if (runOrLumiEntries[iLumiIndex].entry() != invalidEntry) {
2395  addToFileOrder(iLumiIndex, true, false);
2396  }
2397  }
2398  }
2399  }
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.

◆ handleLumiWithEvents()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::handleLumiWithEvents ( EntryOrderInitializationInfo info,
int  currentLumi,
EntryNumber_t  firstBeginEventsContiguousLumi 
)
private

Definition at line 2401 of file IndexIntoFile.cc.

References edm::IndexIntoFile::currentLumi(), info(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

2403  {
2404  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2405  int iLumiIndex = info.firstIndexOfLumi_[currentLumi];
2406  while (info.iEventSequence_ < info.iEventSequenceEnd_ &&
2407  info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi() == currentLumi) {
2408  // lumi entries for the currentLumi with no remaining Events to process and
2409  // with Lumi TTree entry numbers less than the Lumi TTree entry for the next
2410  // sequence of Events.
2411  handleLumiEntriesNoRemainingEvents(info, iLumiIndex, currentLumi, firstBeginEventsContiguousLumi);
2412 
2413  // Add entry with the next event sequence
2414  bool shouldProcessLumi = runOrLumiEntries[info.eventSequenceIndex_].entry() != invalidEntry;
2415  addToFileOrder(info.eventSequenceIndex_, shouldProcessLumi, true);
2416  info.nextEventSequence(runOrLumiEntries);
2417  }
2418  handleLumiEntriesNoRemainingEvents(info, iLumiIndex, currentLumi, firstBeginEventsContiguousLumi, true);
2419  }
static const TGPicture * info(bool iBackgroundIsBlack)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
void handleLumiEntriesNoRemainingEvents(EntryOrderInitializationInfo &info, int &iLumiIndex, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi, bool completeAll=false)
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t & currentLumi() const

◆ handleToEndOfContiguousEventsInLumis()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::handleToEndOfContiguousEventsInLumis ( EntryOrderInitializationInfo info,
EntryNumber_t  currentRun,
int  endOfRunEntries 
)
private

Definition at line 2320 of file IndexIntoFile.cc.

References edm::IndexIntoFile::currentLumi(), edm::IndexIntoFile::currentRun(), info(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

2321  {
2322  // Form a list of lumis that have no more events left to be processed and are in the current
2323  // run and have at least one valid Lumi TTree entry. Contains the index to the first
2324  // lumi entry and its TTree entry number, sorted by earliest lumi TTree entry number.
2325  std::vector<TTreeEntryAndIndex> lumisWithNoRemainingEvents;
2327  lumisWithNoRemainingEvents, endOfRunEntries, currentRun, info.eventSequenceRunOrLumiEntry_);
2328  auto nextLumiWithNoEvents = lumisWithNoRemainingEvents.cbegin();
2329  auto endLumisWithNoEvents = lumisWithNoRemainingEvents.cend();
2330 
2331  // On each step of this iteration we process all the events in a contiguous sequence of events
2332  // from a single lumi (these are events that haven't already been processed and are contained
2333  // within the last contiguous sequence of events from the containing run).
2334  while (info.iEventSequence_ < info.iEventSequenceEnd_ &&
2335  info.eventSequenceRunOrLumiEntry_->orderPHIDRun() == currentRun) {
2336  auto currentLumi = info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi();
2337 
2338  // Last contiguous sequence of events in lumi
2339  if (info.startOfLastContiguousEventsInLumi_[currentLumi] == info.eventSequenceIndex_) {
2340  auto firstBeginEventsContiguousLumi = info.eventSequenceRunOrLumiEntry_->beginEvents();
2341  // Find the first Lumi TTree entry number for this Lumi
2342  EntryNumber_t lumiTTreeEntryNumber = lowestInLumi(info, currentLumi);
2343 
2344  // In addition, we want lumis before this in the lumi tree if they have no events
2345  // left to be processed
2346  handleLumisWithNoEvents(nextLumiWithNoEvents, endLumisWithNoEvents, lumiTTreeEntryNumber);
2347 
2348  // Handle the lumi with the next sequence of events to process
2349  handleLumiWithEvents(info, currentLumi, firstBeginEventsContiguousLumi);
2350 
2351  } else {
2352  // not last contiguous event sequence for lumi
2353  while (info.iEventSequence_ < info.iEventSequenceEnd_ &&
2354  info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi() == currentLumi) {
2355  addToFileOrder(info.eventSequenceIndex_, false, true);
2356  info.nextEventSequence(indexIntoFile()->runOrLumiEntries());
2357  }
2358  }
2359  }
2360  handleLumisWithNoEvents(nextLumiWithNoEvents, endLumisWithNoEvents, invalidEntry, true);
2361  }
static const TGPicture * info(bool iBackgroundIsBlack)
void fillLumisWithNoRemainingEvents(std::vector< TTreeEntryAndIndex > &lumisWithNoRemainingEvents, int startingIndex, EntryNumber_t currentRun, RunOrLumiEntry const *eventSequenceRunOrLumiEntry) const
void handleLumisWithNoEvents(std::vector< TTreeEntryAndIndex >::const_iterator &nextLumiWithNoEvents, std::vector< TTreeEntryAndIndex >::const_iterator &endLumisWithNoEvents, EntryNumber_t lumiTTreeEntryNumber, bool completeAll=false)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
RunNumber_t & currentRun() const
EntryNumber_t lowestInLumi(EntryOrderInitializationInfo &info, int currentLumi) const
long long EntryNumber_t
void handleLumiWithEvents(EntryOrderInitializationInfo &info, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi)
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t & currentLumi() const

◆ handleToEndOfContiguousEventsInRun()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::handleToEndOfContiguousEventsInRun ( EntryOrderInitializationInfo info,
EntryNumber_t  currentRun 
)
private

Definition at line 2275 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::currentRun(), mps_splice::entry, info(), and edm::IndexIntoFile::runOrLumiEntries().

Referenced by IndexIntoFileItrEntryOrder().

2276  {
2277  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2278  int iEnd = static_cast<int>(runOrLumiEntries.size());
2279 
2280  int indexOfRunEntry = info.firstIndexOfRun_[currentRun];
2281 
2282  // Event entries are put in the exact same order as in the Events TTree.
2283  // We make some effort to make the Runs and Lumis come out in Run TTree
2284  // order and Lumi TTree order, but that is often not possible.
2285 
2286  // If it is the last contiguous sequence of events for the Run, also
2287  // add ALL entries corresponding to valid Run or Lumi TTree entries for
2288  // this Run. This is the place where the Run and Lumi products will get
2289  // processed and merged, ALL of them for this run whether or not they have
2290  // events in this particular subsequence of events. This forces all the Run
2291  // and Lumi product merging to occur the first time a file is read.
2292  if (info.startOfLastContiguousEventsInRun_[currentRun] == info.eventSequenceIndex_) {
2293  // Add runs with no events that have an earlier Run TTree entry number
2294  addRunsWithNoEvents(info, runOrLumiEntries[indexOfRunEntry].entry());
2295 
2296  // Add all valid run entries associated with the event sequence
2297  for (; indexOfRunEntry < iEnd && runOrLumiEntries[indexOfRunEntry].isRun(); ++indexOfRunEntry) {
2298  assert(runOrLumiEntries[indexOfRunEntry].orderPHIDRun() == currentRun);
2299  addToFileOrder(indexOfRunEntry, true, false);
2300  }
2301 
2302  // Add all lumi entries associated with this run
2304 
2305  } else {
2306  // Add only the first run entry and flag it to be not processed yet.
2307  addToFileOrder(indexOfRunEntry, false, false);
2308 
2309  // Add the minimum number of lumi entries so that the events they reference
2310  // will be processed in the correct order, lumis are not to be processed.
2311  // The lumis will be added again later to be processed.
2312  while (info.iEventSequence_ != info.iEventSequenceEnd_ &&
2313  info.eventSequenceRunOrLumiEntry_->orderPHIDRun() == currentRun) {
2314  addToFileOrder(info.eventSequenceIndex_, false, true);
2315  info.nextEventSequence(runOrLumiEntries);
2316  }
2317  }
2318  }
static const TGPicture * info(bool iBackgroundIsBlack)
void handleToEndOfContiguousEventsInLumis(EntryOrderInitializationInfo &info, EntryNumber_t currentRun, int endOfRunEntries)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
void addRunsWithNoEvents(EntryOrderInitializationInfo &, EntryNumber_t maxRunTTreeEntry=invalidEntry)
RunNumber_t & currentRun() const
assert(be >=bs)
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.

◆ indexedSize()

int edm::IndexIntoFile::IndexIntoFileItrEntryOrder::indexedSize ( ) const
inlineoverridevirtual

Reimplemented from edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 786 of file IndexIntoFile.h.

References indexedSize_.

◆ initializeLumi_()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::initializeLumi_ ( )
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1912 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::invalidIndex.

1912  {
1914 
1916  setIndexToEvent(0);
1917  setNEvents(0);
1918 
1919  for (int index = indexToLumi(); index < indexedSize(); ++index) {
1920  if (runOrLumisEntry(index).isRun()) {
1921  break;
1922  } else if (runOrLumisEntry(index).lumi() == runOrLumisEntry(indexToLumi()).lumi()) {
1924  continue;
1925  }
1927  setIndexToEvent(0);
1930  break;
1931  } else {
1932  break;
1933  }
1934  }
1935  }
bool shouldProcessEvents(EntryNumber_t iEntry) const
static constexpr int invalidIndex
EntryNumber_t & endEvents() const
assert(be >=bs)
LuminosityBlockNumber_t lumi() const
EntryNumber_t beginEvents() const
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const
EntryNumber_t & beginEvents() const

◆ isSameLumi()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::isSameLumi ( int  index1,
int  index2 
) const
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 2038 of file IndexIntoFile.cc.

2038  {
2039  if (index1 < 0 || index1 >= indexedSize() || index2 < 0 || index2 >= indexedSize()) {
2040  return false;
2041  }
2042  return runOrLumisEntry(index1).lumi() == runOrLumisEntry(index2).lumi();
2043  }
LuminosityBlockNumber_t lumi() const
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ isSameRun()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::isSameRun ( int  index1,
int  index2 
) const
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 2045 of file IndexIntoFile.cc.

2045  {
2046  if (index1 < 0 || index1 >= indexedSize() || index2 < 0 || index2 >= indexedSize()) {
2047  return false;
2048  }
2049  return runOrLumisEntry(index1).run() == runOrLumisEntry(index2).run() &&
2051  }
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ lowestInLumi()

IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::lowestInLumi ( EntryOrderInitializationInfo info,
int  currentLumi 
) const
private

Definition at line 2363 of file IndexIntoFile.cc.

References edm::IndexIntoFile::currentLumi(), info(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::runOrLumiEntries().

2364  {
2365  auto const& runOrLumiEntries = indexIntoFile()->runOrLumiEntries();
2366  int iEnd = static_cast<int>(runOrLumiEntries.size());
2367 
2368  for (int iLumiIndex = info.firstIndexOfLumi_[currentLumi];
2369  iLumiIndex < iEnd && runOrLumiEntries[iLumiIndex].orderPHIDRunLumi() == currentLumi;
2370  ++iLumiIndex) {
2371  EntryNumber_t lumiTTreeEntryNumber = runOrLumiEntries[iLumiIndex].entry();
2372  if (lumiTTreeEntryNumber != invalidEntry) {
2373  // First valid one is the lowest because of the sort order of the container
2374  return lumiTTreeEntryNumber;
2375  }
2376  }
2377  return invalidEntry;
2378  }
static const TGPicture * info(bool iBackgroundIsBlack)
long long EntryNumber_t
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t & currentLumi() const

◆ lumi() [1/2]

LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::lumi ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1848 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kRun.

1848  {
1849  if (type() == kEnd || type() == kRun)
1850  return invalidLumi;
1851  return runOrLumisEntry(indexToLumi()).lumi();
1852  }
LuminosityBlockNumber_t lumi() const
static constexpr LuminosityBlockNumber_t invalidLumi
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ lumi() [2/2]

LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::lumi ( int  index) const
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 2053 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidLumi.

2053  {
2054  if (index < 0 || index >= indexedSize()) {
2055  return invalidLumi;
2056  }
2057  return runOrLumisEntry(index).lumi();
2058  }
LuminosityBlockNumber_t lumi() const
static constexpr LuminosityBlockNumber_t invalidLumi
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ lumiIterationStartingIndex()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::lumiIterationStartingIndex ( int  index) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 2012 of file IndexIntoFile.cc.

References cms::cuda::assert(), mps_splice::entry, edm::IndexIntoFile::invalidEntry, and BXlumiParameters_cfi::lumi.

2012  {
2013  assert(index >= 0 && index < indexedSize());
2014  auto entry = runOrLumisEntry(index).entry();
2015  if (entry == invalidEntry) {
2016  // Usually the starting index is just the first one with a valid lumi TTree entry
2017  // number. If there aren't any that are valid, then use the last one.
2018  if (index + 1 < indexedSize()) {
2019  if (runOrLumisEntry(index).lumi() != runOrLumisEntry(index + 1).lumi()) {
2020  return true;
2021  }
2022  } else if (index + 1 == indexedSize()) {
2023  return true;
2024  }
2025  }
2026  return entry != invalidEntry;
2027  }
assert(be >=bs)
LuminosityBlockNumber_t lumi() const override
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ nextEventRange()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::nextEventRange ( )
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1937 of file IndexIntoFile.cc.

References edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), edm::IndexIntoFile::invalidEntry, and edm::IndexIntoFile::invalidIndex.

1937  {
1939  return false;
1940 
1941  // Look for the next event range, same lumi but different entry
1942  for (int index = indexToEventRange() + 1; index < indexedSize(); ++index) {
1943  if (runOrLumisEntry(index).isRun()) {
1944  return false; // hit next run
1947  continue; // same lumi but has no events, keep looking
1948  }
1950  setIndexToEvent(0);
1953  return true; // found more events in this lumi
1954  }
1955  return false; // hit next lumi
1956  }
1957  return false; // hit the end of the IndexIntoFile
1958  }
bool shouldProcessEvents(EntryNumber_t iEntry) const
static constexpr int invalidIndex
EntryNumber_t & endEvents() const
LuminosityBlockNumber_t lumi() const
EntryNumber_t beginEvents() const
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const
EntryNumber_t & beginEvents() const

◆ peekAheadAtEventEntry()

IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::peekAheadAtEventEntry ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1904 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, and createIOVlist::nEvents.

1904  {
1905  if (indexToLumi() == invalidIndex)
1906  return invalidEntry;
1907  if (indexToEvent() >= nEvents())
1908  return invalidEntry;
1910  }
static constexpr int invalidIndex
EntryNumber_t beginEvents() const
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ peekAheadAtLumi()

LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::peekAheadAtLumi ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1898 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidIndex, and edm::IndexIntoFile::invalidLumi.

1898  {
1899  if (indexToLumi() == invalidIndex)
1900  return invalidLumi;
1901  return runOrLumisEntry(indexToLumi()).lumi();
1902  }
static constexpr int invalidIndex
LuminosityBlockNumber_t lumi() const
static constexpr LuminosityBlockNumber_t invalidLumi
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ previousEventRange()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::previousEventRange ( )
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1960 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, and createIOVlist::nEvents.

1960  {
1962  return false;
1964 
1965  // Look backward for a previous event range with events, same lumi but different entry
1966  for (int newRange = indexToEventRange() - 1; newRange > 0; --newRange) {
1967  if (runOrLumisEntry(newRange).isRun()) {
1968  return false; // hit run
1969  } else if (isSameLumi(newRange, indexToEventRange())) {
1970  if (runOrLumisEntry(newRange).beginEvents() == invalidEntry || !shouldProcessEvents(newRange)) {
1971  continue; // same lumi but has no events, keep looking
1972  }
1973  setIndexToEventRange(newRange);
1976  setIndexToEvent(nEvents() - 1);
1977  return true; // found previous event in this lumi
1978  }
1979  return false; // hit previous lumi
1980  }
1981  return false; // hit the beginning of the IndexIntoFile, 0th entry has to be a run
1982  }
bool shouldProcessEvents(EntryNumber_t iEntry) const
static constexpr int invalidIndex
EntryNumber_t & endEvents() const
assert(be >=bs)
static constexpr EntryNumber_t invalidEntry
bool isSameLumi(int index1, int index2) const override
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const
EntryNumber_t & beginEvents() const

◆ processHistoryIDIndex()

int edm::IndexIntoFile::IndexIntoFileItrEntryOrder::processHistoryIDIndex ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1836 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidIndex, and edm::IndexIntoFile::kEnd.

1836  {
1837  if (type() == kEnd)
1838  return invalidIndex;
1840  }
static constexpr int invalidIndex
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ reserveSpaceInVectors()

void edm::IndexIntoFile::IndexIntoFileItrEntryOrder::reserveSpaceInVectors ( std::vector< EntryNumber_t >::size_type  sizeToReserve)
private

Definition at line 2261 of file IndexIntoFile.cc.

Referenced by IndexIntoFileItrEntryOrder().

2262  {
2263  // Reserve some space. Most likely this is not big enough, but better than reserving nothing.
2264  fileOrderRunOrLumiEntry_.reserve(sizeToReserve);
2265  shouldProcessRunOrLumi_.reserve(sizeToReserve);
2266  shouldProcessEvents_.reserve(sizeToReserve);
2267  }
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_

◆ run()

RunNumber_t edm::IndexIntoFile::IndexIntoFileItrEntryOrder::run ( ) const
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1842 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidRun, and edm::IndexIntoFile::kEnd.

Referenced by Types.EventID::cppID(), and Types.LuminosityBlockID::cppID().

1842  {
1843  if (type() == kEnd)
1844  return invalidRun;
1845  return runOrLumisEntry(indexToRun()).run();
1846  }
static constexpr RunNumber_t invalidRun
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

◆ runOrLumisEntry()

RunOrLumiEntry const& edm::IndexIntoFile::IndexIntoFileItrEntryOrder::runOrLumisEntry ( EntryNumber_t  iEntry) const
inlineprivate

Definition at line 797 of file IndexIntoFile.h.

References fileOrderRunOrLumiEntry_, edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile(), and edm::IndexIntoFile::runOrLumiEntries().

797  {
799  }
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.

◆ setToLastEventInRange()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::setToLastEventInRange ( int  index)
overrideprivatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1984 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), edm::IndexIntoFile::invalidEntry, and createIOVlist::nEvents.

1984  {
1986  return false;
1987  }
1990  assert(nEvents() > 0);
1991  setIndexToEvent(nEvents() - 1);
1992  return true;
1993  }
bool shouldProcessEvents(EntryNumber_t iEntry) const
EntryNumber_t & endEvents() const
assert(be >=bs)
static constexpr EntryNumber_t invalidEntry
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const
EntryNumber_t & beginEvents() const

◆ shouldProcessEvents()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessEvents ( EntryNumber_t  iEntry) const
inlineprivate

Definition at line 801 of file IndexIntoFile.h.

References shouldProcessEvents_.

801 { return shouldProcessEvents_[iEntry]; }

◆ shouldProcessLumi()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessLumi ( ) const
finalvirtual

◆ shouldProcessRun()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessRun ( ) const
finalvirtual

◆ shouldProcessRunOrLumi()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessRunOrLumi ( EntryNumber_t  iEntry) const
inlineprivate

Definition at line 800 of file IndexIntoFile.h.

References shouldProcessRunOrLumi_.

800 { return shouldProcessRunOrLumi_[iEntry]; }

◆ skipLumiInRun()

bool edm::IndexIntoFile::IndexIntoFileItrEntryOrder::skipLumiInRun ( )
overridevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1995 of file IndexIntoFile.cc.

References mps_fire::i, edm::IndexIntoFile::invalidIndex, and BXlumiParameters_cfi::lumi.

1995  {
1996  if (indexToLumi() == invalidIndex)
1997  return false;
1998  for (int i = 1; indexToLumi() + i < indexedSize(); ++i) {
1999  int newLumi = indexToLumi() + i;
2000  if (runOrLumisEntry(newLumi).isRun()) {
2001  return false; // hit next run
2002  } else if (runOrLumisEntry(newLumi).lumi() == runOrLumisEntry(indexToLumi()).lumi()) {
2003  continue;
2004  }
2005  setIndexToLumi(newLumi);
2006  initializeLumi();
2007  return true; // hit next lumi
2008  }
2009  return false; // hit the end of the IndexIntoFile
2010  }
static constexpr int invalidIndex
LuminosityBlockNumber_t lumi() const override
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const

Member Data Documentation

◆ fileOrderRunOrLumiEntry_

std::vector<EntryNumber_t> edm::IndexIntoFile::IndexIntoFileItrEntryOrder::fileOrderRunOrLumiEntry_
private

Definition at line 878 of file IndexIntoFile.h.

Referenced by IndexIntoFileItrEntryOrder(), and runOrLumisEntry().

◆ indexedSize_

int edm::IndexIntoFile::IndexIntoFileItrEntryOrder::indexedSize_ = 0
private

Definition at line 877 of file IndexIntoFile.h.

Referenced by indexedSize(), and IndexIntoFileItrEntryOrder().

◆ shouldProcessEvents_

std::vector<bool> edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessEvents_
private

Definition at line 880 of file IndexIntoFile.h.

Referenced by shouldProcessEvents().

◆ shouldProcessRunOrLumi_

std::vector<bool> edm::IndexIntoFile::IndexIntoFileItrEntryOrder::shouldProcessRunOrLumi_
private

Definition at line 879 of file IndexIntoFile.h.

Referenced by shouldProcessRunOrLumi().