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::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
 
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 lumiEntryValid (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
 
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 517 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 932 of file IndexIntoFile.cc.

◆ ~IndexIntoFileItrImpl()

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

Definition at line 948 of file IndexIntoFile.cc.

948 {}

Member Function Documentation

◆ advanceToNextLumiOrRun()

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

Definition at line 1229 of file IndexIntoFile.cc.

1229  {
1230  if (type_ == kEnd)
1231  return;
1233 
1234  // A preliminary step is to advance to the last run entry for
1235  // this run (actually this step is not needed in the
1236  // context I expect this to be called in, just being careful)
1237  int startSearch = indexToRun_;
1238  for (int i = 1; startSearch + i < size_; ++i) {
1239  if (getRunOrLumiEntryType(startSearch + i) == kRun && isSameRun(indexToRun_, startSearch + i)) {
1240  indexToRun_ = startSearch + i;
1241  } else {
1242  break;
1243  }
1244  }
1245 
1246  if (type_ == kRun && indexToLumi_ != invalidIndex) {
1247  type_ = kLumi;
1248  return;
1249  }
1250 
1251  startSearch = indexToLumi_;
1252  if (startSearch == invalidIndex)
1253  startSearch = indexToRun_;
1254  for (int i = 1; startSearch + i < size_; ++i) {
1255  if (getRunOrLumiEntryType(startSearch + i) == kRun) {
1256  if (!isSameRun(indexToRun_, startSearch + i)) {
1257  type_ = kRun;
1258  indexToRun_ = startSearch + i;
1259  initializeRun();
1260  return;
1261  }
1262  } else if (indexToLumi_ != invalidIndex) {
1263  if (!isSameLumi(indexToLumi_, startSearch + i)) {
1264  type_ = kLumi;
1265  indexToLumi_ = startSearch + i;
1266  initializeLumi();
1267  return;
1268  }
1269  }
1270  }
1271  setInvalid();
1272  }

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

◆ advanceToNextRun()

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

Definition at line 1213 of file IndexIntoFile.cc.

1213  {
1214  if (type_ == kEnd)
1215  return;
1216  for (int i = 1; indexToRun_ + i < size_; ++i) {
1218  if (!isSameRun(indexToRun_, indexToRun_ + i)) {
1219  type_ = kRun;
1220  indexToRun_ += i;
1221  initializeRun();
1222  return;
1223  }
1224  }
1225  }
1226  setInvalid();
1227  }

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

◆ clone()

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

◆ copyPosition()

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

Definition at line 1326 of file IndexIntoFile.cc.

1326  {
1327  type_ = position.type_;
1328  indexToRun_ = position.indexToRun_;
1329  indexToLumi_ = position.indexToLumi_;
1330  indexToEventRange_ = position.indexToEventRange_;
1331  indexToEvent_ = position.indexToEvent_;
1332  nEvents_ = position.nEvents_;
1333  }

References position.

◆ entry()

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

◆ firstEventEntryThisLumi()

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

Definition at line 1181 of file IndexIntoFile.cc.

1181  {
1182  if (indexToLumi() == invalidIndex)
1183  return invalidEntry;
1184 
1185  int saveIndexToLumi = indexToLumi();
1186  int saveIndexToEventRange = indexToEventRange();
1187  long long saveIndexToEvent = indexToEvent();
1188  long long saveNEvents = nEvents();
1189 
1190  while (indexToLumi() - 1 > 0) {
1191  if (getRunOrLumiEntryType(indexToLumi() - 1) == kRun)
1192  break;
1193  if (!isSameLumi(indexToLumi(), indexToLumi() - 1))
1194  break;
1195  --indexToLumi_;
1196  }
1197  initializeLumi();
1198 
1200 
1201  if (indexToEvent() < nEvents()) {
1202  returnValue = peekAheadAtEventEntry();
1203  }
1204 
1205  setIndexToLumi(saveIndexToLumi);
1206  setIndexToEventRange(saveIndexToEventRange);
1207  setIndexToEvent(saveIndexToEvent);
1208  setNEvents(saveNEvents);
1209 
1210  return returnValue;
1211  }

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

◆ firstEventEntryThisRun()

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

Definition at line 1153 of file IndexIntoFile.cc.

1153  {
1154  if (indexToLumi() == invalidIndex)
1155  return invalidEntry;
1156 
1157  int saveIndexToLumi = indexToLumi();
1158  int saveIndexToEventRange = indexToEventRange();
1159  long long saveIndexToEvent = indexToEvent();
1160  long long saveNEvents = nEvents();
1161 
1162  initializeRun();
1163 
1165 
1166  do {
1167  if (indexToEvent() < nEvents()) {
1168  returnValue = peekAheadAtEventEntry();
1169  break;
1170  }
1171  } while (skipLumiInRun());
1172 
1173  setIndexToLumi(saveIndexToLumi);
1174  setIndexToEventRange(saveIndexToEventRange);
1175  setIndexToEvent(saveIndexToEvent);
1176  setNEvents(saveNEvents);
1177 
1178  return returnValue;
1179  }

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

◆ getEntryType()

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

Definition at line 530 of file IndexIntoFile.h.

530 { return type_; }

References type_.

◆ getLumisInRun()

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

Definition at line 1335 of file IndexIntoFile.cc.

1335  {
1336  lumis.clear();
1337 
1338  if (type_ == kEnd)
1339  return;
1340 
1341  LuminosityBlockNumber_t previousLumi = invalidLumi;
1342 
1343  for (int i = 1; (i + indexToRun_) < size_; ++i) {
1344  int index = i + indexToRun_;
1345  EntryType entryType = getRunOrLumiEntryType(index);
1346 
1347  if (entryType == kRun) {
1348  if (isSameRun(indexToRun_, index)) {
1349  continue;
1350  } else {
1351  break;
1352  }
1353  } else {
1354  LuminosityBlockNumber_t luminosityBlock = lumi(index);
1355  if (luminosityBlock != invalidLumi && luminosityBlock != previousLumi) {
1356  lumis.push_back(luminosityBlock);
1357  previousLumi = luminosityBlock;
1358  }
1359  }
1360  }
1361  std::sort(lumis.begin(), lumis.end());
1362  lumis.erase(std::unique(lumis.begin(), lumis.end()), lumis.end());
1363  }

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

◆ getRunOrLumiEntryType()

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

◆ indexIntoFile()

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

Definition at line 564 of file IndexIntoFile.h.

564 { return indexIntoFile_; }

References indexIntoFile_.

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

◆ indexToEvent()

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

Definition at line 572 of file IndexIntoFile.h.

572 { return indexToEvent_; }

References indexToEvent_.

◆ indexToEventRange()

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

Definition at line 571 of file IndexIntoFile.h.

571 { return indexToEventRange_; }

References indexToEventRange_.

◆ indexToLumi()

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

Definition at line 570 of file IndexIntoFile.h.

570 { return indexToLumi_; }

References indexToLumi_.

◆ indexToRun()

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

Definition at line 568 of file IndexIntoFile.h.

568 { return indexToRun_; }

References indexToRun_.

◆ initializeLumi()

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

Definition at line 1308 of file IndexIntoFile.cc.

1308  {
1309  initializeLumi_();
1310  //See if entry number is invalid, this can happen if events from
1311  // different lumis overlap when doing concurrent lumi processing
1312  auto oldLumi = lumi();
1313  while (not lumiEntryValid(indexToLumi_)) {
1314  ++indexToLumi_;
1315  }
1316  assert(oldLumi == lumi());
1317  }

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

◆ initializeLumi_()

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

◆ initializeRun()

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

Definition at line 1284 of file IndexIntoFile.cc.

1284  {
1287  indexToEvent_ = 0;
1288  nEvents_ = 0;
1289 
1290  for (int i = 1; (i + indexToRun_) < size_; ++i) {
1292  bool sameRun = isSameRun(indexToRun_, indexToRun_ + i);
1293 
1294  if (entryType == kRun) {
1295  if (sameRun) {
1296  continue;
1297  } else {
1298  break;
1299  }
1300  } else {
1302  initializeLumi();
1303  return;
1304  }
1305  }
1306  }

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

◆ 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

◆ lumiEntryValid()

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

◆ nEvents()

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

Definition at line 573 of file IndexIntoFile.h.

573 { return nEvents_; }

References nEvents_.

◆ next()

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

Definition at line 950 of file IndexIntoFile.cc.

950  {
951  if (type_ == kEvent) {
952  if ((indexToEvent_ + 1) < nEvents_) {
953  ++indexToEvent_;
954  } else {
955  bool found = nextEventRange();
956 
957  if (!found) {
959 
960  if (type_ == kLumi) {
961  ++indexToLumi_;
962  initializeLumi();
963  } else if (type_ == kRun) {
965  initializeRun();
966  } else {
967  setInvalid(); // type_ is kEnd
968  }
969  }
970  }
971  } else if (type_ == kLumi) {
972  if (indexToLumi_ + 1 == size_) {
973  if (indexToEvent_ < nEvents_) {
974  type_ = kEvent;
975  } else {
976  setInvalid();
977  }
978  } else {
980 
981  if (nextType == kLumi && isSameLumi(indexToLumi_, indexToLumi_ + 1)) {
982  ++indexToLumi_;
983  } else if (indexToEvent_ < nEvents_) {
984  type_ = kEvent;
985  } else if (nextType == kRun) {
986  type_ = kRun;
988  initializeRun();
989  } else {
990  ++indexToLumi_;
991  initializeLumi();
992  }
993  }
994  } else if (type_ == kRun) {
996  bool sameRun = isSameRun(indexToRun_, indexToRun_ + 1);
997  if (nextType == kRun && sameRun) {
998  ++indexToRun_;
999  } else if (nextType == kRun && !sameRun) {
1000  ++indexToRun_;
1001  initializeRun();
1002  } else if (nextType == kLumi) {
1003  type_ = kLumi;
1004  } else {
1005  setInvalid();
1006  }
1007  }
1008  }

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

◆ nextEventRange()

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

◆ operator==()

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

Definition at line 1319 of file IndexIntoFile.cc.

1319  {
1320  return (indexIntoFile_ == right.indexIntoFile_ && size_ == right.size_ && type_ == right.type_ &&
1321  indexToRun_ == right.indexToRun_ && indexToLumi_ == right.indexToLumi_ &&
1322  indexToEventRange_ == right.indexToEventRange_ && indexToEvent_ == right.indexToEvent_ &&
1323  nEvents_ == right.nEvents_);
1324  }

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

◆ 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 1101 of file IndexIntoFile.cc.

1101  {
1102  // Find the correct place to start the search
1103  int newLumi = indexToLumi();
1104  if (newLumi == invalidIndex) {
1105  newLumi = indexToRun() == invalidIndex ? size() - 1 : indexToRun();
1106  } else {
1107  while (getRunOrLumiEntryType(newLumi - 1) == kLumi && isSameLumi(newLumi, newLumi - 1)) {
1108  --newLumi;
1109  }
1110  --newLumi;
1111  }
1112  if (newLumi <= 0)
1113  return false;
1114 
1115  // Look backwards for a lumi with events
1116  for (; newLumi > 0; --newLumi) {
1117  if (getRunOrLumiEntryType(newLumi) == kRun) {
1118  continue;
1119  }
1120  if (setToLastEventInRange(newLumi)) {
1121  break; // found it
1122  }
1123  }
1124  if (newLumi == 0)
1125  return false;
1126 
1127  // Finish initializing the iterator
1128  while (getRunOrLumiEntryType(newLumi - 1) == kLumi && isSameLumi(newLumi, newLumi - 1) &&
1129  lumiEntryValid(newLumi - 1)) {
1130  --newLumi;
1131  }
1132  setIndexToLumi(newLumi);
1133 
1134  if (type() != kEnd && isSameRun(newLumi, indexToRun())) {
1135  if (type() == kEvent)
1136  type_ = kLumi;
1137  return true;
1138  }
1139  int newRun = newLumi;
1140  while (newRun > 0 && getRunOrLumiEntryType(newRun - 1) == kLumi) {
1141  --newRun;
1142  }
1143  --newRun;
1144  assert(getRunOrLumiEntryType(newRun) == kRun);
1145  while (getRunOrLumiEntryType(newRun - 1) == kRun && isSameRun(newRun - 1, newLumi)) {
1146  --newRun;
1147  }
1148  indexToRun_ = newRun;
1149  type_ = kRun;
1150  return true;
1151  }

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

◆ 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

Definition at line 584 of file IndexIntoFile.h.

584 { indexToEvent_ = value; }

References indexToEvent_, and relativeConstraints::value.

◆ setIndexToEventRange()

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

Definition at line 583 of file IndexIntoFile.h.

References indexToEventRange_, and relativeConstraints::value.

◆ setIndexToLumi()

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

Definition at line 582 of file IndexIntoFile.h.

582 { indexToLumi_ = value; }

References indexToLumi_, and relativeConstraints::value.

◆ setInvalid()

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

Definition at line 1365 of file IndexIntoFile.cc.

1365  {
1366  type_ = kEnd;
1370  indexToEvent_ = 0;
1371  nEvents_ = 0;
1372  }

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

◆ setNEvents()

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

Definition at line 585 of file IndexIntoFile.h.

585 { nEvents_ = value; }

References nEvents_, and relativeConstraints::value.

◆ setToLastEventInRange()

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

◆ size()

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

Definition at line 565 of file IndexIntoFile.h.

565 { return size_; }

References size_.

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

◆ skipEventBackward()

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

Definition at line 1066 of file IndexIntoFile.cc.

1069  {
1070  // Look for previous events in the current lumi
1071  if (indexToEvent_ > 0) {
1072  --indexToEvent_;
1073  } else if (!previousEventRange()) {
1074  // Look for previous events in previous lumis
1075  if (!previousLumiWithEvents()) {
1076  // If we get here there are no previous events in the file
1077 
1078  if (!indexIntoFile_->empty()) {
1079  // Set the iterator to the beginning of the file
1080  type_ = kRun;
1081  indexToRun_ = 0;
1082  initializeRun();
1083  }
1084  phIndexOfEvent = invalidIndex;
1085  runOfEvent = invalidRun;
1086  lumiOfEvent = invalidLumi;
1087  eventEntry = invalidEntry;
1088  return;
1089  }
1090  }
1091  // Found a previous event and we have set the iterator so that this event
1092  // will be the next event process. (There may or may not be a run and/or
1093  // a lumi processed first).
1094  // Return information about this event
1095  phIndexOfEvent = processHistoryIDIndex();
1096  runOfEvent = run();
1097  lumiOfEvent = peekAheadAtLumi();
1098  eventEntry = peekAheadAtEventEntry();
1099  }

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

◆ skipEventForward()

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

Definition at line 1010 of file IndexIntoFile.cc.

1013  {
1014  if (indexToEvent_ < nEvents_) {
1015  phIndexOfSkippedEvent = processHistoryIDIndex();
1016  runOfSkippedEvent = run();
1017  lumiOfSkippedEvent = peekAheadAtLumi();
1018  skippedEventEntry = peekAheadAtEventEntry();
1019 
1020  if ((indexToEvent_ + 1) < nEvents_) {
1021  ++indexToEvent_;
1022  return;
1023  } else if (nextEventRange()) {
1024  return;
1025  } else if (type_ == kRun || type_ == kLumi) {
1026  if (skipLumiInRun()) {
1027  return;
1028  }
1029  } else if (type_ == kEvent) {
1030  next();
1031  return;
1032  }
1033  advanceToNextRun();
1034  return;
1035  }
1036 
1037  if (type_ == kRun) {
1038  while (skipLumiInRun()) {
1039  if (indexToEvent_ < nEvents_) {
1040  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1041  return;
1042  }
1043  }
1044  }
1045 
1046  while (indexToEvent_ >= nEvents_ && type_ != kEnd) {
1047  while (skipLumiInRun()) {
1048  if (indexToEvent_ < nEvents_) {
1049  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1050  return;
1051  }
1052  }
1053  advanceToNextRun();
1054  }
1055  if (type_ == kEnd) {
1056  phIndexOfSkippedEvent = invalidIndex;
1057  runOfSkippedEvent = invalidRun;
1058  lumiOfSkippedEvent = invalidLumi;
1059  skippedEventEntry = invalidEntry;
1060  return;
1061  }
1062  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1063  return;
1064  }

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.

◆ skipLumiInRun()

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

◆ skipToNextEventInLumi()

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

Definition at line 1274 of file IndexIntoFile.cc.

1274  {
1275  if (indexToEvent_ >= nEvents_)
1276  return false;
1277  if ((indexToEvent_ + 1) < nEvents_) {
1278  ++indexToEvent_;
1279  return true;
1280  }
1281  return nextEventRange();
1282  }

◆ type()

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

Definition at line 567 of file IndexIntoFile.h.

567 { return type_; }

References type_.

Member Data Documentation

◆ indexIntoFile_

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

Definition at line 598 of file IndexIntoFile.h.

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

◆ indexToEvent_

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

Definition at line 605 of file IndexIntoFile.h.

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

◆ indexToEventRange_

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

Definition at line 604 of file IndexIntoFile.h.

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

◆ indexToLumi_

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

Definition at line 603 of file IndexIntoFile.h.

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

◆ indexToRun_

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

Definition at line 602 of file IndexIntoFile.h.

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

◆ nEvents_

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

Definition at line 606 of file IndexIntoFile.h.

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

◆ size_

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

Definition at line 599 of file IndexIntoFile.h.

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

◆ type_

EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::type_
private
edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtEventEntry
virtual EntryNumber_t peekAheadAtEventEntry() const =0
edm::IndexIntoFile::kLumi
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::runOrLumiEntries_
std::vector< RunOrLumiEntry > runOrLumiEntries_
Definition: IndexIntoFile.h:1087
mps_fire.i
i
Definition: mps_fire.py:355
edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEvent
void setIndexToEvent(long long value)
Definition: IndexIntoFile.h:584
edm::IndexIntoFile::IndexIntoFileItrImpl::setNEvents
void setNEvents(long long value)
Definition: IndexIntoFile.h:585
edm::IndexIntoFile::IndexIntoFileItrImpl::previousLumiWithEvents
bool previousLumiWithEvents()
Definition: IndexIntoFile.cc:1101
edm::IndexIntoFile::kEvent
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::invalidEntry
static constexpr EntryNumber_t invalidEntry
Definition: IndexIntoFile.h:236
edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile
IndexIntoFile const * indexIntoFile() const
Definition: IndexIntoFile.h:564
cms::cuda::assert
assert(be >=bs)
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent_
long long indexToEvent_
Definition: IndexIntoFile.h:605
edm::IndexIntoFile::IndexIntoFileItrImpl::lumiEntryValid
virtual bool lumiEntryValid(int index) const =0
edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtLumi
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::IndexIntoFile::IndexIntoFileItrImpl::lumi
virtual LuminosityBlockNumber_t lumi() const =0
edm::IndexIntoFile::empty
bool empty() const
True if no runs, lumis, or events are in the file.
Definition: IndexIntoFile.cc:487
edm::IndexIntoFile::IndexIntoFileItrImpl::size
int size() const
Definition: IndexIntoFile.h:565
edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile_
IndexIntoFile const * indexIntoFile_
Definition: IndexIntoFile.h:598
edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEventRange
void setIndexToEventRange(int value)
Definition: IndexIntoFile.h:583
edm::IndexIntoFile::invalidIndex
static constexpr int invalidIndex
Definition: IndexIntoFile.h:232
edm::IndexIntoFile::kRun
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi
int indexToLumi() const
Definition: IndexIntoFile.h:570
edmLumisInFiles.lumis
lumis
Definition: edmLumisInFiles.py:31
edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi
void initializeLumi()
Definition: IndexIntoFile.cc:1308
edm::IndexIntoFile::IndexIntoFileItrImpl::previousEventRange
virtual bool previousEventRange()=0
edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToLumi
void setIndexToLumi(int value)
Definition: IndexIntoFile.h:582
edm::IndexIntoFile::IndexIntoFileItrImpl::next
void next()
Definition: IndexIntoFile.cc:950
edm::IndexIntoFile::invalidLumi
static constexpr LuminosityBlockNumber_t invalidLumi
Definition: IndexIntoFile.h:234
edm::IndexIntoFile::IndexIntoFileItrImpl::type_
EntryType type_
Definition: IndexIntoFile.h:601
edm::IndexIntoFile::IndexIntoFileItrImpl::isSameRun
virtual bool isSameRun(int index1, int index2) const =0
edm::IndexIntoFile::IndexIntoFileItrImpl::size_
int size_
Definition: IndexIntoFile.h:599
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::IndexIntoFile::IndexIntoFileItrImpl::processHistoryIDIndex
virtual int processHistoryIDIndex() const =0
edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents
long long nEvents() const
Definition: IndexIntoFile.h:573
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange
int indexToEventRange() const
Definition: IndexIntoFile.h:571
edm::IndexIntoFile::IndexIntoFileItrImpl::run
virtual RunNumber_t run() const =0
edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi_
virtual void initializeLumi_()=0
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun_
int indexToRun_
Definition: IndexIntoFile.h:602
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent
long long indexToEvent() const
Definition: IndexIntoFile.h:572
edm::IndexIntoFile::IndexIntoFileItrImpl::advanceToNextRun
void advanceToNextRun()
Definition: IndexIntoFile.cc:1213
edm::IndexIntoFile::IndexIntoFileItrImpl::initializeRun
void initializeRun()
Definition: IndexIntoFile.cc:1284
tier0.unique
def unique(seq, keepstr=True)
Definition: tier0.py:24
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun
int indexToRun() const
Definition: IndexIntoFile.h:568
relativeConstraints.value
value
Definition: relativeConstraints.py:53
edm::IndexIntoFile::IndexIntoFileItrImpl::getRunOrLumiEntryType
virtual EntryType getRunOrLumiEntryType(int index) const =0
edm::IndexIntoFile::IndexIntoFileItrImpl::skipEventForward
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
Definition: IndexIntoFile.cc:1010
edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents_
long long nEvents_
Definition: IndexIntoFile.h:606
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi_
int indexToLumi_
Definition: IndexIntoFile.h:603
edm::IndexIntoFile::EntryNumber_t
long long EntryNumber_t
Definition: IndexIntoFile.h:231
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::IndexIntoFile::IndexIntoFileItrImpl::skipLumiInRun
virtual bool skipLumiInRun()=0
edm::IndexIntoFile::IndexIntoFileItrImpl::isSameLumi
virtual bool isSameLumi(int index1, int index2) const =0
edm::IndexIntoFile::kEnd
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::IndexIntoFileItrImpl::type
EntryType type() const
Definition: IndexIntoFile.h:567
edm::IndexIntoFile::IndexIntoFileItrImpl::setToLastEventInRange
virtual bool setToLastEventInRange(int index)=0
edm::IndexIntoFile::IndexIntoFileItrImpl::setInvalid
void setInvalid()
Definition: IndexIntoFile.cc:1365
edm::IndexIntoFile::invalidRun
static constexpr RunNumber_t invalidRun
Definition: IndexIntoFile.h:233
edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange_
int indexToEventRange_
Definition: IndexIntoFile.h:604
edm::IndexIntoFile::IndexIntoFileItrImpl::nextEventRange
virtual bool nextEventRange()=0
edm::IndexIntoFile::EntryType
EntryType
Definition: IndexIntoFile.h:238