1 #ifndef DataFormats_Provenance_IndexIntoFile_h
2 #define DataFormats_Provenance_IndexIntoFile_h
213 class TestIndexIntoFile;
214 class TestIndexIntoFile1;
215 class TestIndexIntoFile2;
216 class TestIndexIntoFile3;
217 class TestIndexIntoFile4;
218 class TestIndexIntoFile5;
222 class ProcessHistoryRegistry;
500 void getRange(
long long& beginEventNumbers,
501 long long& endEventNumbers,
596 virtual bool isSameLumi(
int index1,
int index2)
const = 0;
597 virtual bool isSameRun(
int index1,
int index2)
const = 0;
642 bool isSameLumi(
int index1,
int index2)
const override;
643 bool isSameRun(
int index1,
int index2)
const override;
677 bool isSameLumi(
int index1,
int index2)
const override;
678 bool isSameRun(
int index1,
int index2)
const override;
715 bool isSameLumi(
int index1,
int index2)
const override;
716 bool isSameRun(
int index1,
int index2)
const override;
793 impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
807 impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
841 friend class ::TestIndexIntoFile;
842 friend class ::TestIndexIntoFile3;
843 friend class ::TestIndexIntoFile4;
844 friend class ::TestIndexIntoFile5;
1095 friend class ::TestIndexIntoFile;
1096 friend class ::TestIndexIntoFile1;
1097 friend class ::TestIndexIntoFile2;
1098 friend class ::TestIndexIntoFile3;
1099 friend class ::TestIndexIntoFile4;
1100 friend class ::TestIndexIntoFile5;
void initializeRun()
Should only be used internally and for tests.
void initializeLumi_() override
bool setToLastEventInRange(int index) override
bool operator<(EventEntry const &right) const
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
RunNumber_t & currentRun() const
LuminosityBlockNumber_t lumi() const
LuminosityBlockNumber_t peekAheadAtLumi() const override
int processHistoryIDIndex() const
int processHistoryIDIndex() const
EntryType getRunOrLumiEntryType(int index) const override
EntryNumber_t peekAheadAtEventEntry() const
int processHistoryIDIndex() const
void setIndexToLumi(int value)
virtual void initializeLumi_()=0
EntryNumber_t entry() const
LuminosityBlockNumber_t lumi() const
EntryNumber_t firstEventEntryThisRun()
EntryNumber_t endEvents() const
IndexRunLumiKey(int index, RunNumber_t run, LuminosityBlockNumber_t lumi)
static constexpr int invalidIndex
EntryNumber_t entry() const override
bool skipLumiInRun() override
IndexIntoFile const * indexIntoFile() const
bool isSameLumi(int index1, int index2) const override
LuminosityBlockNumber_t currentLumi_
static void destroy(IndexIntoFile::IndexIntoFileItrImpl *p)
IndexIntoFileItrEntryOrder(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
bool skipToNextEventInLumi()
void addLumi(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EntryNumber_t entry)
virtual bool previousEventRange()=0
std::vector< EventEntry > & eventEntries() const
virtual bool nextEventRange()=0
int processHistoryIDIndex() const override
EntryNumber_t beginEvents() const
bool lumiEntryValid(int index) const override
IndexIntoFileItrImpl * clone() const override
void advanceToNextLumiOrRun()
void setBeginEventNumbers(long long v)
std::vector< EventNumber_t > eventNumbers_
virtual int processHistoryIDIndex() const =0
int processHistoryIDIndex() const override
virtual bool setToLastEventInRange(int index)=0
SortedRunOrLumiItr beginRunOrLumi() const
LuminosityBlockNumber_t lumi_
EntryNumber_t orderPHIDRun_
int processHistoryIDIndex_
bool empty() const
True if no runs, lumis, or events are in the file.
LuminosityBlockNumber_t & currentLumi() const
long long beginEventNumbers_
EntryType getEntryType() const
EntryNumber_t beginEvents_
EventEntry(EventNumber_t event, EntryNumber_t entry)
static IndexIntoFile::IndexIntoFileItrImpl * clone(IndexIntoFile::IndexIntoFileItrImpl const *p)
bool operator<(IndexRunLumiKey const &right) const
std::vector< EventNumber_t > const & unsortedEventNumbers() const
bool nextEventRange() override
IndexIntoFile const * indexIntoFile_
bool entryContinues() const override
bool operator==(SortedRunOrLumiItr const &right) const
bool lumiEntryValid(int index) const override
int processHistoryIDIndex_
unsigned long long EventNumber_t
std::vector< RunOrLumiIndexes > & runOrLumiIndexes() const
int indexToGetEntry() const
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
EntryNumber_t beginEvents_
void fillUnsortedEventNumbers() const
EntryType getRunOrLumiEntryType(int index) const override
IndexIntoFileItr begin(SortOrder sortOrder) const
IndexIntoFile::IndexIntoFileItr const & iter_
void initializeLumi_() override
long long indexToEvent() const
bool previousEventRange() override
IndexIntoFile const * indexIntoFile_
bool operator==(EventEntry const &right) const
LuminosityBlockNumber_t lumi() const
int indexToEventRange() const
std::map< IndexRunLumiKey, EntryNumber_t > & lumiToOrder() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
IndexIntoFileItrHolder(IndexIntoFile::IndexIntoFileItr const &iIter)
EntryNumber_t orderPHIDRun() const
std::vector< EventNumber_t > unsortedEventNumbers_
virtual bool isSameLumi(int index1, int index2) const =0
LuminosityBlockNumber_t lumi() const
void setIndexToEventRange(int value)
IndexRunLumiEventKey(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
virtual ~IndexIntoFileItrImpl()
EntryNumber_t entry() const override
unsigned int LuminosityBlockNumber_t
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
constexpr Matriplex::idx_t LL
std::vector< ProcessHistoryID > const & processHistoryIDs() const
static constexpr EventNumber_t invalidEvent
virtual EntryNumber_t peekAheadAtEventEntry() const =0
long long beginEventNumbers() const
void advanceToNextLumiOrRun()
std::map< IndexRunLumiKey, EntryNumber_t > lumiToOrder_
RunNumber_t run() const override
bool operator<(RunOrLumiIndexes const &right) const
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
int & previousAddedIndex() const
void sortVector_Run_Or_Lumi_Entries()
IndexIntoFileItrImpl * clone() const override
LuminosityBlockNumber_t lumi() const override
void setNEvents(long long value)
void setNumberOfEvents(EntryNumber_t nevents)
size_t numberOfEvents() const
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
IndexIntoFile const * indexIntoFile() const
bool entryContinues() const final
int processHistoryIDIndex() const
bool operator<(RunOrLumiEntry const &right) const
bool skipLumiInRun() override
int & currentIndex() const
bool setToLastEventInRange(int index) override
IndexIntoFileItrImpl * clone() const override
virtual LuminosityBlockNumber_t lumi() const =0
RunOrLumiIndexes(int processHistoryIDIndex, RunNumber_t run, LuminosityBlockNumber_t lumi, int indexToGetEntry)
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
long long indexToEvent() const
double intersection(double r12)
void setOrderPHIDRun(EntryNumber_t v)
virtual EntryType getRunOrLumiEntryType(int index) const =0
static constexpr EntryNumber_t continuedLumi
static constexpr RunNumber_t invalidRun
void setIndexToEvent(long long value)
LuminosityBlockNumber_t peekAheadAtLumi() const override
virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const =0
int processHistoryIDIndex_
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RunNumber_t run() const override
EntryNumber_t orderPHIDRunLumi() const
int indexToEventRange() const
virtual IndexIntoFileItrImpl * clone() const =0
std::vector< RunOrLumiEntry > runOrLumiEntries_
std::map< IndexRunKey, EntryNumber_t > runToOrder_
EventNumber_t event() const
LuminosityBlockNumber_t lumi() const override
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
EntryNumber_t numberOfEvents_
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
std::vector< ProcessHistoryID > processHistoryIDs_
void initializeTransients()
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
LuminosityBlockNumber_t lumi_
EntryNumber_t firstEventEntryThisLumi()
virtual bool isSameRun(int index1, int index2) const =0
EventNumber_t event() const
int processHistoryIDIndex() const
virtual bool lumiEntryValid(int index) const =0
void fillEventEntries() const
void setOrderPHIDRunLumi(EntryNumber_t v)
IndexIntoFileItrImpl(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
LuminosityBlockNumber_t peekAheadAtLumi() const override
virtual bool skipLumiInRun()=0
void fillRunOrLumiIndexes() const
bool operator==(IndexIntoFileItrImpl const &right) const
bool previousLumiWithEvents()
RunOrLumiEntry const & runOrLumisEntry(EntryNumber_t iEntry) const
void set_intersection(IndexIntoFile const &indexIntoFile, std::set< IndexRunLumiEventKey > &intersection) const
virtual EntryNumber_t entry() const =0
int processHistoryIDIndex() const
SortedRunOrLumiItr & operator++()
bool isSameRun(int index1, int index2) const override
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
void setProcessHistoryIDIndex(int v)
void getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
IndexIntoFileItr & operator++()
Move to next event to be processed.
void setEndEventNumbers(long long v)
EntryNumber_t peekAheadAtEventEntry() const override
bool isSameRun(int index1, int index2) const override
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
bool operator!=(SortedRunOrLumiItr const &right) const
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
bool entryContinues() const
long long endEventNumbers() const
SortedRunOrLumiItr(IndexIntoFile const *indexIntoFile, unsigned runOrLumi)
EntryNumber_t firstEventEntryThisLumi()
bool operator!=(IndexIntoFileItr const &right) const
void sortEventEntries() const
IndexRunKey(int index, RunNumber_t run)
bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const
bool containsDuplicateEvents() const
Returns true if the IndexIntoFile contains 2 events with the same ProcessHistoryID index...
bool previousEventRange() override
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
long long nEvents() const
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
EntryNumber_t peekAheadAtEventEntry() const override
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
bool setToLastEventInRange(int index) override
void resetEventFinder() const
bool nextEventRange() override
long long endEventNumbers_
EntryType getEntryType() const
static constexpr EntryNumber_t invalidEntry
int processHistoryIDIndex() const override
IndexIntoFileItrSorted(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
std::vector< EventNumber_t > & unsortedEventNumbers()
static constexpr LuminosityBlockNumber_t invalidLumi
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
LuminosityBlockNumber_t lumi() const
unsigned runOrLumi() const
RunNumber_t run() const override
void initializeLumi()
Should only be used internally and for tests.
ProcessHistoryID const & processHistoryID(int i) const
std::map< IndexRunKey, EntryNumber_t > & runToOrder() const
virtual bool entryContinues() const =0
bool operator<(IndexRunKey const &right) const
EntryNumber_t firstEventEntryThisRun()
void copyPosition(IndexIntoFileItrImpl const &position)
LuminosityBlockNumber_t lumi() const override
std::vector< EventEntry > eventEntries_
void doneFileInitialization()
Clears the temporary vector of event numbers to reduce memory usage.
EntryType getRunOrLumiEntryType(int index) const override
EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const
void fillEventNumbers() const
LuminosityBlockNumber_t lumi_
static int position[264][3]
bool isSameLumi(int index1, int index2) const override
void getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
bool isSameRun(int index1, int index2) const override
long long nEvents() const
bool operator==(IndexIntoFileItr const &right) const
bool isSameLumi(int index1, int index2) const override
bool lumiEntryValid(int index) const override
bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::vector< EventNumber_t > & eventNumbers() const
bool nextEventRange() override
std::vector< RunOrLumiIndexes > runOrLumiIndexes_
IndexIntoFileItr(IndexIntoFile const *indexIntoFile, SortOrder sortOrder, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
IndexIntoFile const * indexIntoFile() const
void getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
bool previousEventRange() override
bool operator<(IndexRunLumiEventKey const &right) const
SortedRunOrLumiItr endRunOrLumi() const
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
EntryNumber_t entry() const override
std::vector< EventNumber_t > & unsortedEventNumbersMutable() const
bool skipToNextEventInLumi()
bool containsRun(RunNumber_t run) const
EntryNumber_t orderPHIDRunLumi_
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEventFinder(std::shared_ptr< EventFinder > ptr)
EntryNumber_t entry() const
EntryNumber_t entry() const
LuminosityBlockNumber_t lumi_
void getRange(long long &beginEventNumbers, long long &endEventNumbers, EntryNumber_t &beginEventEntry, EntryNumber_t &endEventEntry)
EntryNumber_t & endEvents() const
virtual RunNumber_t run() const =0
LuminosityBlockNumber_t peekAheadAtLumi() const
EntryNumber_t & beginEvents() const
bool entryContinues() const final
value_ptr< IndexIntoFileItrImpl > impl_
bool skipLumiInRun() override
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
IndexIntoFileItrNoSort(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
void initializeLumi_() override
int processHistoryIDIndex_
EntryNumber_t peekAheadAtEventEntry() const override
int processHistoryIDIndex_
edm::propagate_const< std::shared_ptr< EventFinder > > eventFinder_
RunOrLumiIndexes const & runOrLumiIndexes() const