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 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
 
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

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 ::TestIndexIntoFile3
 
class ::TestIndexIntoFile4
 
class ::TestIndexIntoFile5
 

Detailed Description

Definition at line 681 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 1728 of file IndexIntoFile.cc.

1736  : impl_() {
1737  if (sortOrder == numericalOrder) {
1738  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrSorted(
1740  swap(temp, impl_);
1741  } else {
1742  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrNoSort(
1744  swap(temp, impl_);
1745  }
1746  }

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

Member Function Documentation

◆ advanceToEvent()

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

Definition at line 1748 of file IndexIntoFile.cc.

1748  {
1749  for (EntryType entryType = getEntryType(); entryType != kEnd && entryType != kEvent; entryType = getEntryType()) {
1750  impl_->next();
1751  }
1752  }

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

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

◆ advanceToLumi()

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

Definition at line 1754 of file IndexIntoFile.cc.

1754  {
1755  for (EntryType entryType = getEntryType(); entryType != kEnd && entryType != kLumi; entryType = getEntryType()) {
1756  impl_->next();
1757  }
1758  }

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

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

◆ advanceToNextLumiOrRun()

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

Definition at line 775 of file IndexIntoFile.h.

775 { impl_->advanceToNextLumiOrRun(); }

References impl_.

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

◆ advanceToNextRun()

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

Definition at line 774 of file IndexIntoFile.h.

774 { impl_->advanceToNextRun(); }

References impl_.

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

◆ copyPosition()

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

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

Definition at line 1760 of file IndexIntoFile.cc.

1760  {
1761  impl_->copyPosition(*position.impl_);
1762  }

References position.

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

◆ entry()

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

◆ firstEventEntryThisLumi()

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

Definition at line 720 of file IndexIntoFile.h.

720 { return impl_->firstEventEntryThisLumi(); }

References impl_.

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

◆ 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 719 of file IndexIntoFile.h.

719 { return impl_->firstEventEntryThisRun(); }

References impl_.

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

◆ getEntryType()

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

◆ getLumisInRun()

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

Definition at line 793 of file IndexIntoFile.h.

793 { impl_->getLumisInRun(lumis); }

References impl_, and edmLumisInFiles::lumis.

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

◆ indexIntoFile()

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

Definition at line 804 of file IndexIntoFile.h.

804 { return impl_->indexIntoFile(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ indexToEvent()

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

Definition at line 810 of file IndexIntoFile.h.

810 { return impl_->indexToEvent(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ indexToEventRange()

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

Definition at line 809 of file IndexIntoFile.h.

809 { return impl_->indexToEventRange(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ indexToLumi()

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

Definition at line 808 of file IndexIntoFile.h.

808 { return impl_->indexToLumi(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ indexToRun()

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

Definition at line 807 of file IndexIntoFile.h.

807 { return impl_->indexToRun(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ initializeLumi()

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

Should only be used internally and for tests.

Definition at line 788 of file IndexIntoFile.h.

788 { impl_->initializeLumi(); }

References impl_.

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

◆ initializeRun()

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

Should only be used internally and for tests.

Definition at line 785 of file IndexIntoFile.h.

785 { impl_->initializeRun(); }

References impl_.

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

◆ lumi()

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

◆ nEvents()

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

Definition at line 811 of file IndexIntoFile.h.

811 { return impl_->nEvents(); }

References impl_.

Referenced by IndexIntoFileItr().

◆ operator!=()

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

Definition at line 782 of file IndexIntoFile.h.

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

◆ operator++()

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

Move to next event to be processed.

Definition at line 735 of file IndexIntoFile.h.

735  {
736  impl_->next();
737  return *this;
738  }

References impl_.

◆ operator==()

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

Definition at line 780 of file IndexIntoFile.h.

780 { return *impl_ == *right.impl_; }

References 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 714 of file IndexIntoFile.h.

714 { return impl_->peekAheadAtEventEntry(); }

References 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 708 of file IndexIntoFile.h.

708 { return impl_->peekAheadAtLumi(); }

References impl_.

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

◆ processHistoryIDIndex()

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

Definition at line 701 of file IndexIntoFile.h.

701 { return impl_->processHistoryIDIndex(); }

References impl_.

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

◆ run()

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

◆ size()

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

Definition at line 805 of file IndexIntoFile.h.

805 { return impl_->size(); }

References impl_.

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

◆ 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 759 of file IndexIntoFile.h.

762  {
763  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
764  }

References impl_.

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

◆ 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 745 of file IndexIntoFile.h.

748  {
749  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
750  }

References impl_.

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

◆ 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 768 of file IndexIntoFile.h.

768 { return impl_->skipLumiInRun(); }

References impl_.

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

◆ 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 772 of file IndexIntoFile.h.

772 { return impl_->skipToNextEventInLumi(); }

References impl_.

◆ type()

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

Definition at line 806 of file IndexIntoFile.h.

806 { return impl_->type(); }

References impl_.

Friends And Related Function Documentation

◆ ::TestIndexIntoFile

friend class ::TestIndexIntoFile
friend

Definition at line 797 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile3

friend class ::TestIndexIntoFile3
friend

Definition at line 798 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile4

friend class ::TestIndexIntoFile4
friend

Definition at line 799 of file IndexIntoFile.h.

◆ ::TestIndexIntoFile5

friend class ::TestIndexIntoFile5
friend

Definition at line 800 of file IndexIntoFile.h.

Member Data Documentation

◆ impl_

value_ptr<IndexIntoFileItrImpl> edm::IndexIntoFile::IndexIntoFileItr::impl_
private
edm::IndexIntoFile::kLumi
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::IndexIntoFileItr::nEvents
long long nEvents() const
Definition: IndexIntoFile.h:811
edm::IndexIntoFile::IndexIntoFileItr::indexToLumi
int indexToLumi() const
Definition: IndexIntoFile.h:808
edm::IndexIntoFile::kEvent
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::numericalOrder
Definition: IndexIntoFile.h:266
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::IndexIntoFile::IndexIntoFileItr::indexToEvent
long long indexToEvent() const
Definition: IndexIntoFile.h:810
edm::IndexIntoFile::IndexIntoFileItr::indexToRun
int indexToRun() const
Definition: IndexIntoFile.h:807
edmLumisInFiles.lumis
lumis
Definition: edmLumisInFiles.py:31
edm::IndexIntoFile::IndexIntoFileItr::indexToEventRange
int indexToEventRange() const
Definition: IndexIntoFile.h:809
edm::IndexIntoFile::IndexIntoFileItr::impl_
value_ptr< IndexIntoFileItrImpl > impl_
Definition: IndexIntoFile.h:813
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::IndexIntoFile::IndexIntoFileItr::getEntryType
EntryType getEntryType() const
Definition: IndexIntoFile.h:700
edm::IndexIntoFile::IndexIntoFileItr::indexIntoFile
IndexIntoFile const * indexIntoFile() const
Definition: IndexIntoFile.h:804
edm::IndexIntoFile::kEnd
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::EntryType
EntryType
Definition: IndexIntoFile.h:238