CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::IndexIntoFile::IndexIntoFileItr Class Reference

#include <IndexIntoFile.h>

Public Member Functions

void advanceToEvent ()
 
void advanceToLumi ()
 
void advanceToNextLumiOrRun ()
 
void advanceToNextRun ()
 
void copyPosition (IndexIntoFileItr const &position)
 Copy the position without modifying the pointer to the IndexIntoFile or size. More...
 
EntryNumber_t entry () const
 
EntryNumber_t firstEventEntryThisLumi ()
 
EntryNumber_t firstEventEntryThisRun ()
 
EntryType getEntryType () const
 
void getLumisInRun (std::vector< LuminosityBlockNumber_t > &lumis) const
 
 IndexIntoFileItr (IndexIntoFile const *indexIntoFile, SortOrder sortOrder, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
 
void initializeLumi ()
 Should only be used internally and for tests. More...
 
void initializeRun ()
 Should only be used internally and for tests. More...
 
LuminosityBlockNumber_t lumi () const
 
bool lumiIterationStartingIndex (int index) const
 
bool operator!= (IndexIntoFileItr const &right) const
 
IndexIntoFileItroperator++ ()
 Move to next event to be processed. More...
 
bool operator== (IndexIntoFileItr const &right) const
 
EntryNumber_t peekAheadAtEventEntry () const
 
LuminosityBlockNumber_t peekAheadAtLumi () const
 
int processHistoryIDIndex () const
 
RunNumber_t run () const
 
bool shouldProcessLumi () const
 
bool shouldProcessRun () 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 skipLumiInRun ()
 
bool skipToNextEventInLumi ()
 

Private Member Functions

int indexedSize () const
 
IndexIntoFile const * indexIntoFile () const
 
long long indexToEvent () const
 
int indexToEventRange () const
 
int indexToLumi () const
 
int indexToRun () const
 
long long nEvents () const
 
int size () const
 
EntryType type () const
 

Private Attributes

value_ptr< IndexIntoFileItrImplimpl_
 

Friends

class ::TestIndexIntoFile
 
class ::TestIndexIntoFile2
 
class ::TestIndexIntoFile3
 
class ::TestIndexIntoFile4
 
class ::TestIndexIntoFile5
 

Detailed Description

Definition at line 886 of file IndexIntoFile.h.

Constructor & Destructor Documentation

◆ IndexIntoFileItr()

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

This itended to be used only internally and by IndexIntoFile. One thing that is needed for the future, is to add some checks to make sure the iterator is in a valid state inside this constructor. It is currently possible to create an iterator with this constructor in an invalid state and the behavior would then be undefined. In the existing internal usages the iterator will always be valid. (for example IndexIntoFile::begin and IndexIntoFile::findPosition will always return a valid iterator).

Definition at line 2443 of file IndexIntoFile.cc.

References edm::IndexIntoFile::firstAppearanceOrder, impl_, indexIntoFile(), indexToEvent(), indexToEventRange(), indexToLumi(), indexToRun(), nEvents(), edm::IndexIntoFile::numericalOrder, edm::swap(), and groupFilesInBlocks::temp.

2451  : impl_() {
2452  if (sortOrder == numericalOrder) {
2453  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrSorted(
2455  swap(temp, impl_);
2456  } else if (sortOrder == firstAppearanceOrder) {
2457  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrNoSort(
2459  swap(temp, impl_);
2460  } else {
2461  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrEntryOrder(
2463  swap(temp, impl_);
2464  }
2465  }
IndexIntoFile const * indexIntoFile() const
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
value_ptr< IndexIntoFileItrImpl > impl_

Member Function Documentation

◆ advanceToEvent()

void edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent ( )

Definition at line 2467 of file IndexIntoFile.cc.

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

Referenced by edm::IndexIntoFile::findEventPosition(), edm::RootFile::setEntryAtNextEventInLumi(), and edm::RootFile::wasLastEventJustRead().

2467  {
2468  for (EntryType entryType = getEntryType(); entryType != kEnd && entryType != kEvent; entryType = getEntryType()) {
2469  impl_->next();
2470  }
2471  }
value_ptr< IndexIntoFileItrImpl > impl_

◆ advanceToLumi()

void edm::IndexIntoFile::IndexIntoFileItr::advanceToLumi ( )

Definition at line 2473 of file IndexIntoFile.cc.

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

Referenced by edm::IndexIntoFile::findLumiPosition().

2473  {
2474  for (EntryType entryType = getEntryType(); entryType != kEnd && entryType != kLumi; entryType = getEntryType()) {
2475  impl_->next();
2476  }
2477  }
value_ptr< IndexIntoFileItrImpl > impl_

◆ advanceToNextLumiOrRun()

void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun ( )
inline

Definition at line 983 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::getNextItemType().

983 { impl_->advanceToNextLumiOrRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ advanceToNextRun()

void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun ( )
inline

Definition at line 982 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition(), and edm::RootFile::getNextItemType().

982 { impl_->advanceToNextRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ copyPosition()

void edm::IndexIntoFile::IndexIntoFileItr::copyPosition ( IndexIntoFileItr const &  position)

Copy the position without modifying the pointer to the IndexIntoFile or size.

Definition at line 2479 of file IndexIntoFile.cc.

References position.

Referenced by edm::RootFile::setPosition().

2479  {
2480  impl_->copyPosition(*position.impl_);
2481  }
static int position[264][3]
Definition: ReadPGInfo.cc:289
value_ptr< IndexIntoFileItrImpl > impl_

◆ entry()

EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::entry ( ) const
inline

◆ firstEventEntryThisLumi()

EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisLumi ( )
inline

Definition at line 928 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readLuminosityBlockAuxiliary_().

928 { return impl_->firstEventEntryThisLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ firstEventEntryThisRun()

EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun ( )
inline

Returns the TTree entry of the first event which would be processed in the current run/lumi if all the events in the run/lumi were processed in the current processing order. If there are none it returns -1 (invalid).

Definition at line 927 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readRunAuxiliary_().

927 { return impl_->firstEventEntryThisRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ getEntryType()

EntryType edm::IndexIntoFile::IndexIntoFileItr::getEntryType ( ) const
inline

◆ getLumisInRun()

void edm::IndexIntoFile::IndexIntoFileItr::getLumisInRun ( std::vector< LuminosityBlockNumber_t > &  lumis) const
inline

Definition at line 1001 of file IndexIntoFile.h.

References impl_, and edmLumisInFiles::lumis.

Referenced by edm::IndexIntoFileItrHolder::getLumisInRun().

1001 { impl_->getLumisInRun(lumis); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexedSize()

int edm::IndexIntoFile::IndexIntoFileItr::indexedSize ( ) const
inlineprivate

Definition at line 1015 of file IndexIntoFile.h.

References impl_.

1015 { return impl_->indexedSize(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexIntoFile()

IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItr::indexIntoFile ( ) const
inlineprivate

Definition at line 1013 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1013 { return impl_->indexIntoFile(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexToEvent()

long long edm::IndexIntoFile::IndexIntoFileItr::indexToEvent ( ) const
inlineprivate

Definition at line 1020 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1020 { return impl_->indexToEvent(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexToEventRange()

int edm::IndexIntoFile::IndexIntoFileItr::indexToEventRange ( ) const
inlineprivate

Definition at line 1019 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1019 { return impl_->indexToEventRange(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexToLumi()

int edm::IndexIntoFile::IndexIntoFileItr::indexToLumi ( ) const
inlineprivate

Definition at line 1018 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1018 { return impl_->indexToLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ indexToRun()

int edm::IndexIntoFile::IndexIntoFileItr::indexToRun ( ) const
inlineprivate

Definition at line 1017 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1017 { return impl_->indexToRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ initializeLumi()

void edm::IndexIntoFile::IndexIntoFileItr::initializeLumi ( )
inline

Should only be used internally and for tests.

Definition at line 996 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

996 { impl_->initializeLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ initializeRun()

void edm::IndexIntoFile::IndexIntoFileItr::initializeRun ( )
inline

Should only be used internally and for tests.

Definition at line 993 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::begin(), and edm::IndexIntoFile::findPosition().

993 { impl_->initializeRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ lumi()

LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItr::lumi ( ) const
inline

◆ lumiIterationStartingIndex()

bool edm::IndexIntoFile::IndexIntoFileItr::lumiIterationStartingIndex ( int  index) const
inline

Definition at line 912 of file IndexIntoFile.h.

References impl_.

912 { return impl_->lumiIterationStartingIndex(index); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ nEvents()

long long edm::IndexIntoFile::IndexIntoFileItr::nEvents ( ) const
inlineprivate

Definition at line 1021 of file IndexIntoFile.h.

References impl_.

Referenced by IndexIntoFileItr().

1021 { return impl_->nEvents(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ operator!=()

bool edm::IndexIntoFile::IndexIntoFileItr::operator!= ( IndexIntoFileItr const &  right) const
inline

Definition at line 990 of file IndexIntoFile.h.

990 { return !(*this == right); }

◆ operator++()

IndexIntoFileItr& edm::IndexIntoFile::IndexIntoFileItr::operator++ ( void  )
inline

Move to next event to be processed.

Definition at line 943 of file IndexIntoFile.h.

References impl_.

943  {
944  impl_->next();
945  return *this;
946  }
value_ptr< IndexIntoFileItrImpl > impl_

◆ operator==()

bool edm::IndexIntoFile::IndexIntoFileItr::operator== ( IndexIntoFileItr const &  right) const
inline

Definition at line 988 of file IndexIntoFile.h.

References impl_.

988 { return *impl_ == *right.impl_; }
value_ptr< IndexIntoFileItrImpl > impl_

◆ peekAheadAtEventEntry()

EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtEventEntry ( ) const
inline

Same as entry() except when the the current type is kRun or kLumi. In that case instead of always returning -1 (invalid), it will return the event entry that will be processed next and which is in the current run and lumi. If there is none it still returns -1 (invalid).

Definition at line 922 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

922 { return impl_->peekAheadAtEventEntry(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ peekAheadAtLumi()

LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtLumi ( ) const
inline

Same as lumi() except when the the current type is kRun. In that case instead of always returning 0 (invalid), it will return the lumi that will be processed next

Definition at line 916 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition(), edm::RootFile::getNextItemType(), and edm::RootFile::skipThisEntry().

916 { return impl_->peekAheadAtLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ processHistoryIDIndex()

int edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex ( ) const
inline

Definition at line 906 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::isDuplicateEvent(), and edm::RootFile::readCurrentEvent().

906 { return impl_->processHistoryIDIndex(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ run()

RunNumber_t edm::IndexIntoFile::IndexIntoFileItr::run ( ) const
inline

◆ shouldProcessLumi()

bool edm::IndexIntoFile::IndexIntoFileItr::shouldProcessLumi ( ) const
inline

Definition at line 910 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readLuminosityBlock_().

910 { return impl_->shouldProcessLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ shouldProcessRun()

bool edm::IndexIntoFile::IndexIntoFileItr::shouldProcessRun ( ) const
inline

Definition at line 911 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readRun_().

911 { return impl_->shouldProcessRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ size()

int edm::IndexIntoFile::IndexIntoFileItr::size ( void  ) const
inlineprivate

Definition at line 1014 of file IndexIntoFile.h.

References impl_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

1014 { return impl_->size(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ skipEventBackward()

void edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward ( int &  phIndexOfEvent,
RunNumber_t runOfEvent,
LuminosityBlockNumber_t lumiOfEvent,
EntryNumber_t eventEntry 
)
inline

Move so that the event immediately preceding the the current position is the next event processed. If the type is kEvent or kLumi, then change the type to kRun if and only if the preceding event is in a different run. If the type is kEvent, change the type to kLumi if the lumi is different but the run is the same. Otherwise leave the type unchanged.

Definition at line 967 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::skipEvents(), and edm::RootFile::wasFirstEventJustRead().

970  {
971  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
972  }
value_ptr< IndexIntoFileItrImpl > impl_

◆ skipEventForward()

void edm::IndexIntoFile::IndexIntoFileItr::skipEventForward ( int &  phIndexOfSkippedEvent,
RunNumber_t runOfSkippedEvent,
LuminosityBlockNumber_t lumiOfSkippedEvent,
EntryNumber_t skippedEventEntry 
)
inline

Move to whatever is immediately after the current event or after the next event if there is not a current event, but do not modify the type or run/lumi indexes unless it is necessary because there are no more events in the current run or lumi.

Definition at line 953 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::skipEvents().

956  {
957  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
958  }
value_ptr< IndexIntoFileItrImpl > impl_

◆ skipLumiInRun()

bool edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun ( )
inline

Move to the next lumi in the current run. Returns false if there is not one.

Definition at line 976 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition(), and edm::RootFile::skipThisEntry().

976 { return impl_->skipLumiInRun(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ skipToNextEventInLumi()

bool edm::IndexIntoFile::IndexIntoFileItr::skipToNextEventInLumi ( )
inline

Move to the next event in the current lumi. Returns false if there is not one.

Definition at line 980 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

980 { return impl_->skipToNextEventInLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_

◆ type()

EntryType edm::IndexIntoFile::IndexIntoFileItr::type ( ) const
inlineprivate

Definition at line 1016 of file IndexIntoFile.h.

References impl_.

1016 { return impl_->type(); }
value_ptr< IndexIntoFileItrImpl > impl_

Friends And Related Function Documentation

◆ ::TestIndexIntoFile

friend class ::TestIndexIntoFile
friend

Definition at line 1005 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile2

friend class ::TestIndexIntoFile2
friend

Definition at line 1006 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile3

friend class ::TestIndexIntoFile3
friend

Definition at line 1007 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile4

friend class ::TestIndexIntoFile4
friend

Definition at line 1008 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile5

friend class ::TestIndexIntoFile5
friend

Definition at line 1009 of file IndexIntoFile.h.

Member Data Documentation

◆ impl_

value_ptr<IndexIntoFileItrImpl> edm::IndexIntoFile::IndexIntoFileItr::impl_
private