CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::IndexIntoFile::IndexIntoFileItrImpl Class Referenceabstract

#include <IndexIntoFile.h>

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

Public Member Functions

void advanceToNextLumiOrRun ()
 
void advanceToNextRun ()
 
virtual IndexIntoFileItrImplclone () const =0
 
void copyPosition (IndexIntoFileItrImpl const &position)
 
virtual EntryNumber_t entry () const =0
 
EntryNumber_t firstEventEntryThisLumi ()
 
EntryNumber_t firstEventEntryThisRun ()
 
EntryType getEntryType () const
 
void getLumisInRun (std::vector< LuminosityBlockNumber_t > &lumis) const
 
virtual int indexedSize () 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 ()
 
virtual LuminosityBlockNumber_t lumi () const =0
 
virtual bool lumiIterationStartingIndex (int index) const =0
 
long long nEvents () const
 
void next ()
 
bool operator== (IndexIntoFileItrImpl const &right) const
 
virtual EntryNumber_t peekAheadAtEventEntry () const =0
 
virtual LuminosityBlockNumber_t peekAheadAtLumi () const =0
 
virtual int processHistoryIDIndex () const =0
 
virtual RunNumber_t run () const =0
 
virtual bool shouldProcessLumi () const =0
 
virtual bool shouldProcessRun () const =0
 
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)
 
virtual bool skipLumiInRun ()=0
 
bool skipToNextEventInLumi ()
 
EntryType type () const
 
virtual ~IndexIntoFileItrImpl ()
 

Protected Member Functions

void setIndexToEvent (long long value)
 
void setIndexToEventRange (int value)
 
void setIndexToLumi (int value)
 
void setInvalid ()
 
void setNEvents (long long value)
 

Private Member Functions

virtual EntryType getRunOrLumiEntryType (int index) const =0
 
virtual void initializeLumi_ ()=0
 
virtual bool isSameLumi (int index1, int index2) const =0
 
virtual bool isSameRun (int index1, int index2) const =0
 
virtual LuminosityBlockNumber_t lumi (int index) const =0
 
virtual bool nextEventRange ()=0
 
virtual bool previousEventRange ()=0
 
bool previousLumiWithEvents ()
 
virtual bool setToLastEventInRange (int index)=0
 

Private Attributes

IndexIntoFile const * indexIntoFile_
 
long long indexToEvent_
 
int indexToEventRange_
 
int indexToLumi_
 
int indexToRun_
 
long long nEvents_
 
int size_
 
EntryType type_
 

Detailed Description

Definition at line 584 of file IndexIntoFile.h.

Constructor & Destructor Documentation

◆ IndexIntoFileItrImpl()

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

Definition at line 977 of file IndexIntoFile.cc.

985  size_(static_cast<int>(indexIntoFile_->runOrLumiEntries_.size())),
986  type_(entryType),
991  nEvents_(nEvents) {}
std::vector< RunOrLumiEntry > runOrLumiEntries_
IndexIntoFile const * indexIntoFile() const

◆ ~IndexIntoFileItrImpl()

edm::IndexIntoFile::IndexIntoFileItrImpl::~IndexIntoFileItrImpl ( )
virtual

Definition at line 993 of file IndexIntoFile.cc.

993 {}

Member Function Documentation

◆ advanceToNextLumiOrRun()

void edm::IndexIntoFile::IndexIntoFileItrImpl::advanceToNextLumiOrRun ( )

Definition at line 1280 of file IndexIntoFile.cc.

References cms::cuda::assert(), mps_fire::i, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kLumi, and edm::IndexIntoFile::kRun.

1280  {
1281  if (type_ == kEnd)
1282  return;
1284 
1285  // A preliminary step is to advance to the last run entry for
1286  // this run (actually this step is not needed in the
1287  // context I expect this to be called in, just being careful)
1288  int startSearch = indexToRun_;
1289  for (int i = 1; startSearch + i < indexedSize(); ++i) {
1290  if (getRunOrLumiEntryType(startSearch + i) == kRun && isSameRun(indexToRun_, startSearch + i)) {
1291  indexToRun_ = startSearch + i;
1292  } else {
1293  break;
1294  }
1295  }
1296 
1297  if (type_ == kRun && indexToLumi_ != invalidIndex) {
1298  type_ = kLumi;
1299  return;
1300  }
1301 
1302  startSearch = indexToLumi_;
1303  if (startSearch == invalidIndex)
1304  startSearch = indexToRun_;
1305  for (int i = 1; startSearch + i < indexedSize(); ++i) {
1306  if (getRunOrLumiEntryType(startSearch + i) == kRun) {
1307  if (!isSameRun(indexToRun_, startSearch + i)) {
1308  type_ = kRun;
1309  indexToRun_ = startSearch + i;
1310  initializeRun();
1311  return;
1312  }
1313  } else if (indexToLumi_ != invalidIndex) {
1314  if (!isSameLumi(indexToLumi_, startSearch + i)) {
1315  type_ = kLumi;
1316  indexToLumi_ = startSearch + i;
1317  initializeLumi();
1318  return;
1319  }
1320  }
1321  }
1322  setInvalid();
1323  }
static constexpr int invalidIndex
virtual bool isSameLumi(int index1, int index2) const =0
assert(be >=bs)
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0

◆ advanceToNextRun()

void edm::IndexIntoFile::IndexIntoFileItrImpl::advanceToNextRun ( )

Definition at line 1264 of file IndexIntoFile.cc.

References mps_fire::i, edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kRun.

1264  {
1265  if (type_ == kEnd)
1266  return;
1267  for (int i = 1; indexToRun_ + i < indexedSize(); ++i) {
1269  if (!isSameRun(indexToRun_, indexToRun_ + i)) {
1270  type_ = kRun;
1271  indexToRun_ += i;
1272  initializeRun();
1273  return;
1274  }
1275  }
1276  }
1277  setInvalid();
1278  }
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0

◆ clone()

virtual IndexIntoFileItrImpl* edm::IndexIntoFile::IndexIntoFileItrImpl::clone ( ) const
pure virtual

◆ copyPosition()

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

Definition at line 1379 of file IndexIntoFile.cc.

References position.

1379  {
1380  type_ = position.type_;
1381  indexToRun_ = position.indexToRun_;
1382  indexToLumi_ = position.indexToLumi_;
1383  indexToEventRange_ = position.indexToEventRange_;
1384  indexToEvent_ = position.indexToEvent_;
1385  nEvents_ = position.nEvents_;
1386  }
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ entry()

virtual EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::entry ( ) const
pure virtual

◆ firstEventEntryThisLumi()

IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::firstEventEntryThisLumi ( )

Definition at line 1232 of file IndexIntoFile.cc.

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

1232  {
1233  if (indexToLumi() == invalidIndex)
1234  return invalidEntry;
1235 
1236  int saveIndexToLumi = indexToLumi();
1237  int saveIndexToEventRange = indexToEventRange();
1238  long long saveIndexToEvent = indexToEvent();
1239  long long saveNEvents = nEvents();
1240 
1241  while (indexToLumi() - 1 > 0) {
1242  if (getRunOrLumiEntryType(indexToLumi() - 1) == kRun)
1243  break;
1244  if (!isSameLumi(indexToLumi(), indexToLumi() - 1))
1245  break;
1246  --indexToLumi_;
1247  }
1248  initializeLumi();
1249 
1251 
1252  if (indexToEvent() < nEvents()) {
1253  returnValue = peekAheadAtEventEntry();
1254  }
1255 
1256  setIndexToLumi(saveIndexToLumi);
1257  setIndexToEventRange(saveIndexToEventRange);
1258  setIndexToEvent(saveIndexToEvent);
1259  setNEvents(saveNEvents);
1260 
1261  return returnValue;
1262  }
static constexpr int invalidIndex
virtual bool isSameLumi(int index1, int index2) const =0
virtual EntryNumber_t peekAheadAtEventEntry() const =0
long long EntryNumber_t
virtual EntryType getRunOrLumiEntryType(int index) const =0
static constexpr EntryNumber_t invalidEntry

◆ firstEventEntryThisRun()

IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::firstEventEntryThisRun ( )

Definition at line 1204 of file IndexIntoFile.cc.

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

1204  {
1205  if (indexToLumi() == invalidIndex)
1206  return invalidEntry;
1207 
1208  int saveIndexToLumi = indexToLumi();
1209  int saveIndexToEventRange = indexToEventRange();
1210  long long saveIndexToEvent = indexToEvent();
1211  long long saveNEvents = nEvents();
1212 
1213  initializeRun();
1214 
1216 
1217  do {
1218  if (indexToEvent() < nEvents()) {
1219  returnValue = peekAheadAtEventEntry();
1220  break;
1221  }
1222  } while (skipLumiInRun());
1223 
1224  setIndexToLumi(saveIndexToLumi);
1225  setIndexToEventRange(saveIndexToEventRange);
1226  setIndexToEvent(saveIndexToEvent);
1227  setNEvents(saveNEvents);
1228 
1229  return returnValue;
1230  }
static constexpr int invalidIndex
virtual EntryNumber_t peekAheadAtEventEntry() const =0
long long EntryNumber_t
static constexpr EntryNumber_t invalidEntry

◆ getEntryType()

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

Definition at line 597 of file IndexIntoFile.h.

References type_.

◆ getLumisInRun()

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

Definition at line 1388 of file IndexIntoFile.cc.

References cms::cuda::assert(), mps_fire::i, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kRun, BXlumiParameters_cfi::lumi, edmLumisInFiles::lumis, jetUpdater_cfi::sort, and tier0::unique().

1388  {
1390  lumis.clear();
1391 
1392  if (type_ == kEnd)
1393  return;
1394 
1395  LuminosityBlockNumber_t previousLumi = invalidLumi;
1396 
1397  for (int i = 1; (i + indexToRun_) < indexedSize(); ++i) {
1398  int index = i + indexToRun_;
1399  EntryType entryType = getRunOrLumiEntryType(index);
1400 
1401  if (entryType == kRun) {
1402  if (isSameRun(indexToRun_, index)) {
1403  continue;
1404  } else {
1405  break;
1406  }
1407  } else {
1408  LuminosityBlockNumber_t luminosityBlock = lumi(index);
1409  if (luminosityBlock != invalidLumi && luminosityBlock != previousLumi) {
1410  lumis.push_back(luminosityBlock);
1411  previousLumi = luminosityBlock;
1412  }
1413  }
1414  }
1415  std::sort(lumis.begin(), lumis.end());
1416  lumis.erase(std::unique(lumis.begin(), lumis.end()), lumis.end());
1417  }
assert(be >=bs)
unsigned int LuminosityBlockNumber_t
virtual LuminosityBlockNumber_t lumi() const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
def unique(seq, keepstr=True)
Definition: tier0.py:24
virtual bool isSameRun(int index1, int index2) const =0
virtual bool shouldProcessRun() const =0
static constexpr LuminosityBlockNumber_t invalidLumi

◆ getRunOrLumiEntryType()

virtual EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::getRunOrLumiEntryType ( int  index) const
privatepure virtual

◆ indexedSize()

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexedSize ( ) const
virtual

Reimplemented in edm::IndexIntoFile::IndexIntoFileItrEntryOrder.

Definition at line 1377 of file IndexIntoFile.cc.

1377 { return size(); }

◆ indexIntoFile()

IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile ( ) const
inline

◆ indexToEvent()

long long edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent ( ) const
inline

Definition at line 652 of file IndexIntoFile.h.

References indexToEvent_.

◆ indexToEventRange()

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange ( ) const
inline

Definition at line 651 of file IndexIntoFile.h.

References indexToEventRange_.

◆ indexToLumi()

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi ( ) const
inline

Definition at line 650 of file IndexIntoFile.h.

References indexToLumi_.

◆ indexToRun()

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun ( ) const
inline

Definition at line 648 of file IndexIntoFile.h.

References indexToRun_.

◆ initializeLumi()

void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi ( )

Definition at line 1359 of file IndexIntoFile.cc.

References cms::cuda::assert(), and BXlumiParameters_cfi::lumi.

1359  {
1360  initializeLumi_();
1361  auto oldLumi = lumi();
1362  // Then go forward to the first valid one (or if there are not any valid ones
1363  // to the last one, only possible in the entryOrder case)
1365  ++indexToLumi_;
1366  }
1367  assert(oldLumi == lumi());
1368  }
assert(be >=bs)
virtual LuminosityBlockNumber_t lumi() const =0
virtual bool lumiIterationStartingIndex(int index) const =0

◆ initializeLumi_()

virtual void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi_ ( )
privatepure virtual

◆ initializeRun()

void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeRun ( )

Definition at line 1335 of file IndexIntoFile.cc.

References mps_fire::i, edm::IndexIntoFile::invalidIndex, and edm::IndexIntoFile::kRun.

1335  {
1338  indexToEvent_ = 0;
1339  nEvents_ = 0;
1340 
1341  for (int i = indexToRun_ + 1, iEnd = indexedSize(); i < iEnd; ++i) {
1342  EntryType entryType = getRunOrLumiEntryType(i);
1343  bool sameRun = isSameRun(indexToRun_, i);
1344 
1345  if (entryType == kRun) {
1346  if (sameRun) {
1347  continue;
1348  } else {
1349  break;
1350  }
1351  } else {
1352  indexToLumi_ = i;
1353  initializeLumi();
1354  return;
1355  }
1356  }
1357  }
static constexpr int invalidIndex
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0

◆ isSameLumi()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::isSameLumi ( int  index1,
int  index2 
) const
privatepure virtual

◆ isSameRun()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::isSameRun ( int  index1,
int  index2 
) const
privatepure virtual

◆ lumi() [1/2]

virtual LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::lumi ( ) const
pure virtual

◆ lumi() [2/2]

virtual LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::lumi ( int  index) const
privatepure virtual

◆ lumiIterationStartingIndex()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::lumiIterationStartingIndex ( int  index) const
pure virtual

◆ nEvents()

long long edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents ( ) const
inline

Definition at line 653 of file IndexIntoFile.h.

References nEvents_.

◆ next()

void edm::IndexIntoFile::IndexIntoFileItrImpl::next ( void  )

Definition at line 995 of file IndexIntoFile.cc.

References newFWLiteAna::found, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, and edm::IndexIntoFile::kRun.

995  {
996  if (type_ == kEvent) {
997  if ((indexToEvent_ + 1) < nEvents_) {
998  ++indexToEvent_;
999  } else {
1000  bool found = nextEventRange();
1001 
1002  if (!found) {
1004 
1005  if (type_ == kLumi) {
1006  ++indexToLumi_;
1007  initializeLumi();
1008  } else if (type_ == kRun) {
1009  indexToRun_ = indexToLumi_ + 1;
1010  initializeRun();
1011  } else {
1012  setInvalid(); // type_ is kEnd
1013  }
1014  }
1015  }
1016  } else if (type_ == kLumi) {
1017  if (indexToLumi_ + 1 == indexedSize()) {
1018  if (indexToEvent_ < nEvents_) {
1019  type_ = kEvent;
1020  } else {
1021  setInvalid();
1022  }
1023  } else {
1025 
1026  if (nextType == kLumi && isSameLumi(indexToLumi_, indexToLumi_ + 1)) {
1027  ++indexToLumi_;
1028  } else if (indexToEvent_ < nEvents_) {
1029  type_ = kEvent;
1030  } else if (nextType == kRun) {
1031  type_ = kRun;
1032  indexToRun_ = indexToLumi_ + 1;
1033  initializeRun();
1034  } else {
1035  ++indexToLumi_;
1036  initializeLumi();
1037  }
1038  }
1039  } else if (type_ == kRun) {
1041  bool sameRun = isSameRun(indexToRun_, indexToRun_ + 1);
1042  if (nextType == kRun && sameRun) {
1043  ++indexToRun_;
1044  } else if (nextType == kRun && !sameRun) {
1045  ++indexToRun_;
1046  initializeRun();
1047  } else if (nextType == kLumi) {
1048  type_ = kLumi;
1049  } else {
1050  setInvalid();
1051  }
1052  }
1053  }
virtual bool isSameLumi(int index1, int index2) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0

◆ nextEventRange()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::nextEventRange ( )
privatepure virtual

◆ operator==()

bool edm::IndexIntoFile::IndexIntoFileItrImpl::operator== ( IndexIntoFileItrImpl const &  right) const

Definition at line 1370 of file IndexIntoFile.cc.

References indexIntoFile_, indexToEvent_, indexToEventRange_, indexToLumi_, indexToRun_, nEvents_, size_, and type_.

1370  {
1371  return (indexIntoFile_ == right.indexIntoFile_ && size_ == right.size_ && type_ == right.type_ &&
1372  indexToRun_ == right.indexToRun_ && indexToLumi_ == right.indexToLumi_ &&
1373  indexToEventRange_ == right.indexToEventRange_ && indexToEvent_ == right.indexToEvent_ &&
1374  nEvents_ == right.nEvents_);
1375  }

◆ peekAheadAtEventEntry()

virtual EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtEventEntry ( ) const
pure virtual

◆ peekAheadAtLumi()

virtual LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtLumi ( ) const
pure virtual

◆ previousEventRange()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::previousEventRange ( )
privatepure virtual

◆ previousLumiWithEvents()

bool edm::IndexIntoFile::IndexIntoFileItrImpl::previousLumiWithEvents ( )
private

Definition at line 1146 of file IndexIntoFile.cc.

References cms::cuda::assert(), edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, and edm::IndexIntoFile::kRun.

1146  {
1147  // Find the correct place to start the search
1148  int newLumi = indexToLumi();
1149  if (newLumi == invalidIndex) {
1150  newLumi = indexToRun() == invalidIndex ? indexedSize() - 1 : indexToRun();
1151  } else {
1152  while (getRunOrLumiEntryType(newLumi - 1) == kLumi && isSameLumi(newLumi, newLumi - 1)) {
1153  --newLumi;
1154  }
1155  --newLumi;
1156  }
1157  if (newLumi <= 0)
1158  return false;
1159 
1160  // Look backwards for a lumi with events
1161  for (; newLumi > 0; --newLumi) {
1162  if (getRunOrLumiEntryType(newLumi) == kRun) {
1163  continue;
1164  }
1165  if (setToLastEventInRange(newLumi)) {
1166  break; // found it
1167  }
1168  }
1169  if (newLumi == 0)
1170  return false;
1171 
1172  // Finish initializing the iterator
1173  // Go back to the first lumi entry for this lumi
1174  while (getRunOrLumiEntryType(newLumi - 1) == kLumi && isSameLumi(newLumi, newLumi - 1)) {
1175  --newLumi;
1176  }
1177  // Then go forward to the first valid one (or if there are not any valid ones
1178  // to the last one, only possible in the entryOrder case)
1179  while (not lumiIterationStartingIndex(newLumi)) {
1180  ++newLumi;
1181  }
1182 
1183  setIndexToLumi(newLumi);
1184 
1185  if (type() != kEnd && isSameRun(newLumi, indexToRun())) {
1186  if (type() == kEvent)
1187  type_ = kLumi;
1188  return true;
1189  }
1190  int newRun = newLumi;
1191  while (newRun > 0 && getRunOrLumiEntryType(newRun - 1) == kLumi) {
1192  --newRun;
1193  }
1194  --newRun;
1195  assert(getRunOrLumiEntryType(newRun) == kRun);
1196  while (getRunOrLumiEntryType(newRun - 1) == kRun && isSameRun(newRun - 1, newLumi)) {
1197  --newRun;
1198  }
1199  indexToRun_ = newRun;
1200  type_ = kRun;
1201  return true;
1202  }
static constexpr int invalidIndex
virtual bool setToLastEventInRange(int index)=0
virtual bool isSameLumi(int index1, int index2) const =0
assert(be >=bs)
virtual bool lumiIterationStartingIndex(int index) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0

◆ processHistoryIDIndex()

virtual int edm::IndexIntoFile::IndexIntoFileItrImpl::processHistoryIDIndex ( ) const
pure virtual

◆ run()

virtual RunNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::run ( ) const
pure virtual

◆ setIndexToEvent()

void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEvent ( long long  value)
inlineprotected

◆ setIndexToEventRange()

void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEventRange ( int  value)
inlineprotected

◆ setIndexToLumi()

void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToLumi ( int  value)
inlineprotected

◆ setInvalid()

void edm::IndexIntoFile::IndexIntoFileItrImpl::setInvalid ( void  )
protected

◆ setNEvents()

void edm::IndexIntoFile::IndexIntoFileItrImpl::setNEvents ( long long  value)
inlineprotected

◆ setToLastEventInRange()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::setToLastEventInRange ( int  index)
privatepure virtual

◆ shouldProcessLumi()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::shouldProcessLumi ( ) const
pure virtual

◆ shouldProcessRun()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::shouldProcessRun ( ) const
pure virtual

◆ size()

int edm::IndexIntoFile::IndexIntoFileItrImpl::size ( void  ) const
inline

◆ skipEventBackward()

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

Definition at line 1111 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, edm::IndexIntoFile::kRun, and writedatasetfile::run.

1114  {
1115  // Look for previous events in the current lumi
1116  if (indexToEvent_ > 0) {
1117  --indexToEvent_;
1118  } else if (!previousEventRange()) {
1119  // Look for previous events in previous lumis
1120  if (!previousLumiWithEvents()) {
1121  // If we get here there are no previous events in the file
1122 
1123  if (!indexIntoFile_->empty()) {
1124  // Set the iterator to the beginning of the file
1125  type_ = kRun;
1126  indexToRun_ = 0;
1127  initializeRun();
1128  }
1129  phIndexOfEvent = invalidIndex;
1130  runOfEvent = invalidRun;
1131  lumiOfEvent = invalidLumi;
1132  eventEntry = invalidEntry;
1133  return;
1134  }
1135  }
1136  // Found a previous event and we have set the iterator so that this event
1137  // will be the next event process. (There may or may not be a run and/or
1138  // a lumi processed first).
1139  // Return information about this event
1140  phIndexOfEvent = processHistoryIDIndex();
1141  runOfEvent = run();
1142  lumiOfEvent = peekAheadAtLumi();
1143  eventEntry = peekAheadAtEventEntry();
1144  }
static constexpr int invalidIndex
virtual int processHistoryIDIndex() const =0
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
virtual EntryNumber_t peekAheadAtEventEntry() const =0
static constexpr RunNumber_t invalidRun
bool empty() const
True if no runs, lumis, or events are in the file.
static constexpr EntryNumber_t invalidEntry
static constexpr LuminosityBlockNumber_t invalidLumi
virtual RunNumber_t run() const =0

◆ skipEventForward()

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

Definition at line 1055 of file IndexIntoFile.cc.

References edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, GetRecoTauVFromDQM_MC_cff::next, and writedatasetfile::run.

1058  {
1059  if (indexToEvent_ < nEvents_) {
1060  phIndexOfSkippedEvent = processHistoryIDIndex();
1061  runOfSkippedEvent = run();
1062  lumiOfSkippedEvent = peekAheadAtLumi();
1063  skippedEventEntry = peekAheadAtEventEntry();
1064 
1065  if ((indexToEvent_ + 1) < nEvents_) {
1066  ++indexToEvent_;
1067  return;
1068  } else if (nextEventRange()) {
1069  return;
1070  } else if (type_ == kRun || type_ == kLumi) {
1071  if (skipLumiInRun()) {
1072  return;
1073  }
1074  } else if (type_ == kEvent) {
1075  next();
1076  return;
1077  }
1078  advanceToNextRun();
1079  return;
1080  }
1081 
1082  if (type_ == kRun) {
1083  while (skipLumiInRun()) {
1084  if (indexToEvent_ < nEvents_) {
1085  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1086  return;
1087  }
1088  }
1089  }
1090 
1091  while (indexToEvent_ >= nEvents_ && type_ != kEnd) {
1092  while (skipLumiInRun()) {
1093  if (indexToEvent_ < nEvents_) {
1094  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1095  return;
1096  }
1097  }
1098  advanceToNextRun();
1099  }
1100  if (type_ == kEnd) {
1101  phIndexOfSkippedEvent = invalidIndex;
1102  runOfSkippedEvent = invalidRun;
1103  lumiOfSkippedEvent = invalidLumi;
1104  skippedEventEntry = invalidEntry;
1105  return;
1106  }
1107  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1108  return;
1109  }
static constexpr int invalidIndex
virtual int processHistoryIDIndex() const =0
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
virtual EntryNumber_t peekAheadAtEventEntry() const =0
static constexpr RunNumber_t invalidRun
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
static constexpr EntryNumber_t invalidEntry
static constexpr LuminosityBlockNumber_t invalidLumi
virtual RunNumber_t run() const =0

◆ skipLumiInRun()

virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::skipLumiInRun ( )
pure virtual

◆ skipToNextEventInLumi()

bool edm::IndexIntoFile::IndexIntoFileItrImpl::skipToNextEventInLumi ( )

Definition at line 1325 of file IndexIntoFile.cc.

1325  {
1326  if (indexToEvent_ >= nEvents_)
1327  return false;
1328  if ((indexToEvent_ + 1) < nEvents_) {
1329  ++indexToEvent_;
1330  return true;
1331  }
1332  return nextEventRange();
1333  }

◆ type()

EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::type ( ) const
inline

Definition at line 647 of file IndexIntoFile.h.

References type_.

Member Data Documentation

◆ indexIntoFile_

IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile_
private

Definition at line 678 of file IndexIntoFile.h.

Referenced by indexIntoFile(), and operator==().

◆ indexToEvent_

long long edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent_
private

Definition at line 685 of file IndexIntoFile.h.

Referenced by indexToEvent(), operator==(), and setIndexToEvent().

◆ indexToEventRange_

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange_
private

Definition at line 684 of file IndexIntoFile.h.

Referenced by indexToEventRange(), operator==(), and setIndexToEventRange().

◆ indexToLumi_

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi_
private

Definition at line 683 of file IndexIntoFile.h.

Referenced by indexToLumi(), operator==(), and setIndexToLumi().

◆ indexToRun_

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun_
private

Definition at line 682 of file IndexIntoFile.h.

Referenced by indexToRun(), and operator==().

◆ nEvents_

long long edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents_
private

Definition at line 686 of file IndexIntoFile.h.

Referenced by nEvents(), operator==(), and setNEvents().

◆ size_

int edm::IndexIntoFile::IndexIntoFileItrImpl::size_
private

Definition at line 679 of file IndexIntoFile.h.

Referenced by operator==(), and size().

◆ type_

EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::type_
private