CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
edm::IndexIntoFile::IndexIntoFileItrNoSort Class Reference

#include <IndexIntoFile.h>

Inheritance diagram for edm::IndexIntoFile::IndexIntoFileItrNoSort:
edm::IndexIntoFile::IndexIntoFileItrImpl

Public Member Functions

virtual IndexIntoFileItrImplclone () const
 
virtual EntryNumber_t entry () const
 
 IndexIntoFileItrNoSort (IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
 
virtual LuminosityBlockNumber_t lumi () const
 
virtual EntryNumber_t peekAheadAtEventEntry () const
 
virtual LuminosityBlockNumber_t peekAheadAtLumi () const
 
virtual int processHistoryIDIndex () const
 
virtual RunNumber_t run () const
 
virtual bool skipLumiInRun ()
 
- 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
 
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

virtual EntryType getRunOrLumiEntryType (int index) const
 
virtual void initializeLumi_ ()
 
virtual bool isSameLumi (int index1, int index2) const
 
virtual bool isSameRun (int index1, int index2) const
 
virtual bool nextEventRange ()
 
virtual bool previousEventRange ()
 
virtual bool setToLastEventInRange (int index)
 

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

Constructor & Destructor Documentation

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

Definition at line 1413 of file IndexIntoFile.cc.

1419  :
1421  entryType,
1422  indexToRun,
1423  indexToLumi,
1425  indexToEvent,
1426  nEvents)
1427  {
1428  }
IndexIntoFile const * indexIntoFile() const
IndexIntoFileItrImpl(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)

Member Function Documentation

IndexIntoFile::IndexIntoFileItrImpl * edm::IndexIntoFile::IndexIntoFileItrNoSort::clone ( void  ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1431 of file IndexIntoFile.cc.

1431  {
1432  return new IndexIntoFileItrNoSort(*this);
1433  }
IndexIntoFileItrNoSort(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrNoSort::entry ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1451 of file IndexIntoFile.cc.

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

1451  {
1452  if(type() == kEnd) return invalidEntry;
1453  if(type() == kRun) return indexIntoFile()->runOrLumiEntries()[indexToRun()].entry();
1454  if(type() == kLumi) return indexIntoFile()->runOrLumiEntries()[indexToLumi()].entry();
1455  return
1456  indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() +
1457  indexToEvent();
1458  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
IndexIntoFile::EntryType edm::IndexIntoFile::IndexIntoFileItrNoSort::getRunOrLumiEntryType ( int  index) const
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1575 of file IndexIntoFile.cc.

References edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, edm::IndexIntoFile::runOrLumiEntries(), and findQualityFiles::size.

1575  {
1576  if(index < 0 || index >= size()) {
1577  return kEnd;
1578  } else if(indexIntoFile()->runOrLumiEntries()[index].isRun()) {
1579  return kRun;
1580  }
1581  return kLumi;
1582  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
void edm::IndexIntoFile::IndexIntoFileItrNoSort::initializeLumi_ ( )
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1473 of file IndexIntoFile.cc.

References edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), i, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::runOrLumiEntries(), and findQualityFiles::size.

1473  {
1474  assert(indexToLumi() != invalidIndex);
1475 
1477  setIndexToEvent(0);
1478  setNEvents(0);
1479 
1480  for(int i = 0; indexToLumi() + i < size(); ++i) {
1481  if(indexIntoFile()->runOrLumiEntries()[indexToLumi() + i].isRun()) {
1482  break;
1483  } else if(indexIntoFile()->runOrLumiEntries()[indexToLumi() + i].lumi() ==
1484  indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi()) {
1485  if(indexIntoFile()->runOrLumiEntries()[indexToLumi() + i].beginEvents() == invalidEntry) {
1486  continue;
1487  }
1489  setIndexToEvent(0);
1492  break;
1493  } else {
1494  break;
1495  }
1496  }
1497  }
int i
Definition: DBlmapReader.cc:9
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
EntryNumber_t & endEvents() const
EntryNumber_t & beginEvents() const
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::isSameLumi ( int  index1,
int  index2 
) const
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1584 of file IndexIntoFile.cc.

References findQualityFiles::size.

1584  {
1585  if(index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1586  return false;
1587  }
1588  return indexIntoFile()->runOrLumiEntries()[index1].lumi() ==
1589  indexIntoFile()->runOrLumiEntries()[index2].lumi();
1590  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::isSameRun ( int  index1,
int  index2 
) const
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1592 of file IndexIntoFile.cc.

References findQualityFiles::size.

1592  {
1593  if(index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1594  return false;
1595  }
1596  return indexIntoFile()->runOrLumiEntries()[index1].run() ==
1597  indexIntoFile()->runOrLumiEntries()[index2].run() &&
1598  indexIntoFile()->runOrLumiEntries()[index1].processHistoryIDIndex() ==
1599  indexIntoFile()->runOrLumiEntries()[index2].processHistoryIDIndex();
1600  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrNoSort::lumi ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1446 of file IndexIntoFile.cc.

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

1446  {
1447  if(type() == kEnd || type() == kRun) return invalidLumi;
1448  return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1449  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static LuminosityBlockNumber_t const invalidLumi
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::nextEventRange ( )
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1499 of file IndexIntoFile.cc.

References edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), i, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::runOrLumiEntries(), and findQualityFiles::size.

1499  {
1500  if(indexToEventRange() == invalidIndex) return false;
1501 
1502  // Look for the next event range, same lumi but different entry
1503  for(int i = 1; indexToEventRange() + i < size(); ++i) {
1504  if(indexIntoFile()->runOrLumiEntries()[indexToEventRange() + i ].isRun()) {
1505  return false; // hit next run
1506  } else if(indexIntoFile()->runOrLumiEntries()[indexToEventRange() + i].lumi() ==
1508  if(indexIntoFile()->runOrLumiEntries()[indexToEventRange() + i].beginEvents() == invalidEntry) {
1509  continue; // same lumi but has no events, keep looking
1510  }
1512  setIndexToEvent(0);
1515  return true; // found more events in this lumi
1516  }
1517  return false; // hit next lumi
1518  }
1519  return false; // hit the end of the IndexIntoFile
1520  }
int i
Definition: DBlmapReader.cc:9
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
EntryNumber_t & endEvents() const
EntryNumber_t & beginEvents() const
IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrNoSort::peekAheadAtEventEntry ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1465 of file IndexIntoFile.cc.

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

1465  {
1466  if(indexToLumi() == invalidIndex) return invalidEntry;
1467  if(indexToEvent() >= nEvents()) return invalidEntry;
1468  return
1469  indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() +
1470  indexToEvent();
1471  }
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrNoSort::peekAheadAtLumi ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1460 of file IndexIntoFile.cc.

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

1460  {
1461  if(indexToLumi() == invalidIndex) return invalidLumi;
1462  return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1463  }
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static LuminosityBlockNumber_t const invalidLumi
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::previousEventRange ( )
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1522 of file IndexIntoFile.cc.

References edm::IndexIntoFile::beginEvents(), edm::IndexIntoFile::endEvents(), i, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, nEvents, edm::IndexIntoFile::runOrLumiEntries(), and findQualityFiles::size.

1522  {
1523  if(indexToEventRange() == invalidIndex) return false;
1524  assert(indexToEventRange() < size());
1525 
1526  // Look backward for a previous event range with events, same lumi but different entry
1527  for(int i = 1; indexToEventRange() - i > 0; ++i) {
1528  int newRange = indexToEventRange() - i;
1529  if(indexIntoFile()->runOrLumiEntries()[newRange].isRun()) {
1530  return false; // hit run
1531  } else if(isSameLumi(newRange, indexToEventRange())) {
1532  if(indexIntoFile()->runOrLumiEntries()[newRange].beginEvents() == invalidEntry) {
1533  continue; // same lumi but has no events, keep looking
1534  }
1535  setIndexToEventRange(newRange);
1538  setIndexToEvent(nEvents() - 1);
1539  return true; // found previous event in this lumi
1540  }
1541  return false; // hit previous lumi
1542  }
1543  return false; // hit the beginning of the IndexIntoFile, 0th entry has to be a run
1544  }
int i
Definition: DBlmapReader.cc:9
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
virtual bool isSameLumi(int index1, int index2) const
EntryNumber_t & endEvents() const
EntryNumber_t & beginEvents() const
int edm::IndexIntoFile::IndexIntoFileItrNoSort::processHistoryIDIndex ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1436 of file IndexIntoFile.cc.

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

1436  {
1437  if(type() == kEnd) return invalidIndex;
1438  return indexIntoFile()->runOrLumiEntries()[indexToRun()].processHistoryIDIndex();
1439  }
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
RunNumber_t edm::IndexIntoFile::IndexIntoFileItrNoSort::run ( ) const
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1441 of file IndexIntoFile.cc.

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

Referenced by Types.LuminosityBlockID::cppID().

1441  {
1442  if(type() == kEnd) return invalidRun;
1443  return indexIntoFile()->runOrLumiEntries()[indexToRun()].run();
1444  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static RunNumber_t const invalidRun
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::setToLastEventInRange ( int  index)
privatevirtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1546 of file IndexIntoFile.cc.

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

1546  {
1548  return false;
1549  }
1553  assert(nEvents() > 0);
1554  setIndexToEvent(nEvents() - 1);
1555  return true;
1556  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
static EntryNumber_t const invalidEntry
EntryNumber_t & endEvents() const
EntryNumber_t & beginEvents() const
bool edm::IndexIntoFile::IndexIntoFileItrNoSort::skipLumiInRun ( )
virtual

Implements edm::IndexIntoFile::IndexIntoFileItrImpl.

Definition at line 1558 of file IndexIntoFile.cc.

References i, edm::IndexIntoFile::invalidIndex, fjr2json::lumi, edm::IndexIntoFile::runOrLumiEntries(), and findQualityFiles::size.

1558  {
1559  if(indexToLumi() == invalidIndex) return false;
1560  for(int i = 1; indexToLumi() + i < size(); ++i) {
1561  int newLumi = indexToLumi() + i;
1562  if(indexIntoFile()->runOrLumiEntries()[newLumi].isRun()) {
1563  return false; // hit next run
1564  } else if(indexIntoFile()->runOrLumiEntries()[newLumi].lumi() ==
1566  continue;
1567  }
1568  setIndexToLumi(newLumi);
1569  initializeLumi();
1570  return true; // hit next lumi
1571  }
1572  return false; // hit the end of the IndexIntoFile
1573  }
int i
Definition: DBlmapReader.cc:9
static int const invalidIndex
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
virtual LuminosityBlockNumber_t lumi() const