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

Constructor & Destructor Documentation

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

Definition at line 1021 of file IndexIntoFile.cc.

1027  :
1029  size_(static_cast<int>(indexIntoFile_->runOrLumiEntries_.size())),
1030  type_(entryType),
1035  nEvents_(nEvents) {
1036  }
IndexIntoFile const * indexIntoFile() const
std::vector< RunOrLumiEntry > runOrLumiEntries_
edm::IndexIntoFile::IndexIntoFileItrImpl::~IndexIntoFileItrImpl ( )
virtual

Definition at line 1038 of file IndexIntoFile.cc.

1038 {}

Member Function Documentation

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

Definition at line 1320 of file IndexIntoFile.cc.

References getRunOrLumiEntryType(), mps_fire::i, indexToLumi_, indexToRun_, initializeLumi(), initializeRun(), edm::IndexIntoFile::invalidIndex, isSameLumi(), isSameRun(), edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, setInvalid(), size_, and type_.

1320  {
1321  if(type_ == kEnd) return;
1322  assert(indexToRun_ != invalidIndex);
1323 
1324  // A preliminary step is to advance to the last run entry for
1325  // this run (actually this step is not needed in the
1326  // context I expect this to be called in, just being careful)
1327  int startSearch = indexToRun_;
1328  for(int i = 1; startSearch + i < size_; ++i) {
1329  if(getRunOrLumiEntryType(startSearch + i) == kRun &&
1330  isSameRun(indexToRun_, startSearch + i)) {
1331  indexToRun_ = startSearch + i;
1332  } else {
1333  break;
1334  }
1335  }
1336 
1337  if(type_ == kRun && indexToLumi_ != invalidIndex) {
1338  type_ = kLumi;
1339  return;
1340  }
1341 
1342  startSearch = indexToLumi_;
1343  if(startSearch == invalidIndex) startSearch = indexToRun_;
1344  for(int i = 1; startSearch + i < size_; ++i) {
1345  if(getRunOrLumiEntryType(startSearch + i) == kRun) {
1346  if(!isSameRun(indexToRun_, startSearch + i)) {
1347  type_ = kRun;
1348  indexToRun_ = startSearch + i;
1349  initializeRun();
1350  return;
1351  }
1352  } else if(indexToLumi_ != invalidIndex) {
1353  if(!isSameLumi(indexToLumi_, startSearch + i)) {
1354  type_ = kLumi;
1355  indexToLumi_ = startSearch + i;
1356  initializeLumi();
1357  return;
1358  }
1359  }
1360  }
1361  setInvalid();
1362  }
virtual bool isSameLumi(int index1, int index2) const =0
static constexpr int invalidIndex
virtual bool isSameRun(int index1, int index2) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
void edm::IndexIntoFile::IndexIntoFileItrImpl::advanceToNextRun ( )
virtual IndexIntoFileItrImpl* edm::IndexIntoFile::IndexIntoFileItrImpl::clone ( ) const
pure virtual
void edm::IndexIntoFile::IndexIntoFileItrImpl::copyPosition ( IndexIntoFileItrImpl const &  position)

Definition at line 1421 of file IndexIntoFile.cc.

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

1421  {
1422  type_ = position.type_;
1423  indexToRun_ = position.indexToRun_;
1424  indexToLumi_ = position.indexToLumi_;
1425  indexToEventRange_ = position.indexToEventRange_;
1426  indexToEvent_ = position.indexToEvent_;
1427  nEvents_ = position.nEvents_;
1428  }
static int position[264][3]
Definition: ReadPGInfo.cc:509
virtual EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::entry ( ) const
pure virtual
IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::firstEventEntryThisLumi ( )

Definition at line 1276 of file IndexIntoFile.cc.

References getRunOrLumiEntryType(), mps_fire::i, indexToEvent(), indexToEventRange(), indexToLumi(), indexToLumi_, initializeLumi(), edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, isSameLumi(), edm::IndexIntoFile::kRun, nEvents(), peekAheadAtEventEntry(), setIndexToEvent(), setIndexToEventRange(), setIndexToLumi(), and setNEvents().

1276  {
1277  if(indexToLumi() == invalidIndex) return invalidEntry;
1278 
1279  int saveIndexToLumi = indexToLumi();
1280  int saveIndexToEventRange = indexToEventRange();
1281  long long saveIndexToEvent = indexToEvent();
1282  long long saveNEvents = nEvents();
1283 
1284  for(int i = 1; indexToLumi() - i > 0; ++i) {
1285  if(getRunOrLumiEntryType(indexToLumi_ - i) == kRun) break;
1286  if(!isSameLumi(indexToLumi(), indexToLumi() - i)) break;
1288  }
1289  initializeLumi();
1290 
1292 
1293  if(indexToEvent() < nEvents()) {
1294  returnValue = peekAheadAtEventEntry();
1295  }
1296 
1297  setIndexToLumi(saveIndexToLumi);
1298  setIndexToEventRange(saveIndexToEventRange);
1299  setIndexToEvent(saveIndexToEvent);
1300  setNEvents(saveNEvents);
1301 
1302  return returnValue;
1303  }
virtual bool isSameLumi(int index1, int index2) const =0
static constexpr int invalidIndex
long long EntryNumber_t
virtual EntryType getRunOrLumiEntryType(int index) const =0
static constexpr EntryNumber_t invalidEntry
virtual EntryNumber_t peekAheadAtEventEntry() const =0
IndexIntoFile::EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::firstEventEntryThisRun ( )

Definition at line 1249 of file IndexIntoFile.cc.

References indexToEvent(), indexToEventRange(), indexToLumi(), initializeRun(), edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, nEvents(), peekAheadAtEventEntry(), setIndexToEvent(), setIndexToEventRange(), setIndexToLumi(), setNEvents(), and skipLumiInRun().

1249  {
1250  if(indexToLumi() == invalidIndex) return invalidEntry;
1251 
1252  int saveIndexToLumi = indexToLumi();
1253  int saveIndexToEventRange = indexToEventRange();
1254  long long saveIndexToEvent = indexToEvent();
1255  long long saveNEvents = nEvents();
1256 
1257  initializeRun();
1258 
1260 
1261  do {
1262  if(indexToEvent() < nEvents()) {
1263  returnValue = peekAheadAtEventEntry();
1264  break;
1265  }
1266  } while(skipLumiInRun());
1267 
1268  setIndexToLumi(saveIndexToLumi);
1269  setIndexToEventRange(saveIndexToEventRange);
1270  setIndexToEvent(saveIndexToEvent);
1271  setNEvents(saveNEvents);
1272 
1273  return returnValue;
1274  }
static constexpr int invalidIndex
long long EntryNumber_t
static constexpr EntryNumber_t invalidEntry
virtual EntryNumber_t peekAheadAtEventEntry() const =0
EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::getEntryType ( ) const
inline
virtual EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::getRunOrLumiEntryType ( int  index) const
privatepure virtual
IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItrImpl::indexIntoFile ( ) const
inline

Definition at line 576 of file IndexIntoFile.h.

Referenced by edm::IndexIntoFile::IndexIntoFileItrNoSort::entry(), edm::IndexIntoFile::IndexIntoFileItrSorted::entry(), edm::IndexIntoFile::IndexIntoFileItrNoSort::getRunOrLumiEntryType(), edm::IndexIntoFile::IndexIntoFileItrSorted::getRunOrLumiEntryType(), edm::IndexIntoFile::IndexIntoFileItrNoSort::initializeLumi_(), edm::IndexIntoFile::IndexIntoFileItrSorted::initializeLumi_(), edm::IndexIntoFile::IndexIntoFileItrNoSort::isSameLumi(), edm::IndexIntoFile::IndexIntoFileItrSorted::isSameLumi(), edm::IndexIntoFile::IndexIntoFileItrNoSort::isSameRun(), edm::IndexIntoFile::IndexIntoFileItrSorted::isSameRun(), edm::IndexIntoFile::IndexIntoFileItrNoSort::lumi(), edm::IndexIntoFile::IndexIntoFileItrSorted::lumi(), edm::IndexIntoFile::IndexIntoFileItrNoSort::lumiEntryValid(), edm::IndexIntoFile::IndexIntoFileItrSorted::lumiEntryValid(), edm::IndexIntoFile::IndexIntoFileItrNoSort::nextEventRange(), edm::IndexIntoFile::IndexIntoFileItrNoSort::peekAheadAtEventEntry(), edm::IndexIntoFile::IndexIntoFileItrSorted::peekAheadAtEventEntry(), edm::IndexIntoFile::IndexIntoFileItrNoSort::peekAheadAtLumi(), edm::IndexIntoFile::IndexIntoFileItrSorted::peekAheadAtLumi(), edm::IndexIntoFile::IndexIntoFileItrNoSort::previousEventRange(), edm::IndexIntoFile::IndexIntoFileItrNoSort::processHistoryIDIndex(), edm::IndexIntoFile::IndexIntoFileItrSorted::processHistoryIDIndex(), edm::IndexIntoFile::IndexIntoFileItrNoSort::run(), edm::IndexIntoFile::IndexIntoFileItrSorted::run(), edm::IndexIntoFile::IndexIntoFileItrNoSort::setToLastEventInRange(), edm::IndexIntoFile::IndexIntoFileItrSorted::setToLastEventInRange(), edm::IndexIntoFile::IndexIntoFileItrNoSort::skipLumiInRun(), and edm::IndexIntoFile::IndexIntoFileItrSorted::skipLumiInRun().

576 { return indexIntoFile_; }
long long edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent ( ) const
inline
int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange ( ) const
inline
int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi ( ) const
inline
int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun ( ) const
inline
void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi ( )

Definition at line 1398 of file IndexIntoFile.cc.

References indexToLumi_, initializeLumi_(), lumi(), and lumiEntryValid().

Referenced by advanceToNextLumiOrRun(), firstEventEntryThisLumi(), initializeRun(), next(), edm::IndexIntoFile::IndexIntoFileItrNoSort::skipLumiInRun(), and edm::IndexIntoFile::IndexIntoFileItrSorted::skipLumiInRun().

1398  {
1399  initializeLumi_();
1400  //See if entry number is invalid, this can happen if events from
1401  // different lumis overlap when doing concurrent lumi processing
1402  auto oldLumi = lumi();
1403  while( not lumiEntryValid(indexToLumi_) ) {
1404  ++indexToLumi_;
1405  }
1406  assert(oldLumi == lumi());
1407  }
virtual LuminosityBlockNumber_t lumi() const =0
virtual bool lumiEntryValid(int index) const =0
virtual void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeLumi_ ( )
privatepure virtual
void edm::IndexIntoFile::IndexIntoFileItrImpl::initializeRun ( )

Definition at line 1373 of file IndexIntoFile.cc.

References getRunOrLumiEntryType(), mps_fire::i, indexToEvent_, indexToEventRange_, indexToLumi_, indexToRun_, initializeLumi(), edm::IndexIntoFile::invalidIndex, isSameRun(), edm::IndexIntoFile::kRun, nEvents_, and size_.

Referenced by advanceToNextLumiOrRun(), advanceToNextRun(), firstEventEntryThisRun(), next(), and skipEventBackward().

1373  {
1374 
1377  indexToEvent_ = 0;
1378  nEvents_ = 0;
1379 
1380  for(int i = 1; (i + indexToRun_) < size_; ++i) {
1382  bool sameRun = isSameRun(indexToRun_, indexToRun_ + i);
1383 
1384  if(entryType == kRun) {
1385  if(sameRun) {
1386  continue;
1387  } else {
1388  break;
1389  }
1390  } else {
1392  initializeLumi();
1393  return;
1394  }
1395  }
1396  }
static constexpr int invalidIndex
virtual bool isSameRun(int index1, int index2) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::isSameLumi ( int  index1,
int  index2 
) const
privatepure virtual
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::isSameRun ( int  index1,
int  index2 
) const
privatepure virtual
virtual LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::lumi ( ) const
pure virtual
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::lumiEntryValid ( int  index) const
pure virtual
long long edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents ( ) const
inline
void edm::IndexIntoFile::IndexIntoFileItrImpl::next ( void  )

Definition at line 1040 of file IndexIntoFile.cc.

References runEdmFileComparison::found, getRunOrLumiEntryType(), indexToEvent_, indexToLumi_, indexToRun_, initializeLumi(), initializeRun(), isSameLumi(), isSameRun(), edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, nEvents_, nextEventRange(), setInvalid(), size_, and type_.

Referenced by skipEventForward().

1040  {
1041 
1042  if(type_ == kEvent) {
1043  if((indexToEvent_ + 1) < nEvents_) {
1044  ++indexToEvent_;
1045  } else {
1046  bool found = nextEventRange();
1047 
1048  if(!found) {
1050 
1051  if(type_ == kLumi) {
1052  ++indexToLumi_;
1053  initializeLumi();
1054  } else if(type_ == kRun) {
1055  indexToRun_ = indexToLumi_ + 1;
1056  initializeRun();
1057  } else {
1058  setInvalid(); // type_ is kEnd
1059  }
1060  }
1061  }
1062  } else if(type_ == kLumi) {
1063 
1064  if(indexToLumi_ + 1 == size_) {
1065  if(indexToEvent_ < nEvents_) {
1066  type_ = kEvent;
1067  } else {
1068  setInvalid();
1069  }
1070  } else {
1071 
1073 
1074  if(nextType == kLumi && isSameLumi(indexToLumi_, indexToLumi_ + 1)) {
1075  ++indexToLumi_;
1076  } else if(indexToEvent_ < nEvents_) {
1077  type_ = kEvent;
1078  } else if(nextType == kRun) {
1079  type_ = kRun;
1080  indexToRun_ = indexToLumi_ + 1;
1081  initializeRun();
1082  } else {
1083  ++indexToLumi_;
1084  initializeLumi();
1085  }
1086  }
1087  } else if(type_ == kRun) {
1089  bool sameRun = isSameRun(indexToRun_, indexToRun_ + 1);
1090  if(nextType == kRun && sameRun) {
1091  ++indexToRun_;
1092  } else if(nextType == kRun && !sameRun) {
1093  ++indexToRun_;
1094  initializeRun();
1095  } else if(nextType == kLumi) {
1096  type_ = kLumi;
1097  } else {
1098  setInvalid();
1099  }
1100  }
1101  }
virtual bool isSameLumi(int index1, int index2) const =0
virtual bool isSameRun(int index1, int index2) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::nextEventRange ( )
privatepure virtual
bool edm::IndexIntoFile::IndexIntoFileItrImpl::operator== ( IndexIntoFileItrImpl const &  right) const

Definition at line 1409 of file IndexIntoFile.cc.

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

1409  {
1410  return (indexIntoFile_ == right.indexIntoFile_ &&
1411  size_ == right.size_ &&
1412  type_ == right.type_ &&
1413  indexToRun_ == right.indexToRun_ &&
1414  indexToLumi_ == right.indexToLumi_ &&
1415  indexToEventRange_ == right.indexToEventRange_ &&
1416  indexToEvent_ == right.indexToEvent_ &&
1417  nEvents_ == right.nEvents_);
1418  }
virtual EntryNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtEventEntry ( ) const
pure virtual
virtual LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::peekAheadAtLumi ( ) const
pure virtual
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::previousEventRange ( )
privatepure virtual
bool edm::IndexIntoFile::IndexIntoFileItrImpl::previousLumiWithEvents ( )
private

Definition at line 1196 of file IndexIntoFile.cc.

References getRunOrLumiEntryType(), indexToLumi(), indexToRun(), indexToRun_, edm::IndexIntoFile::invalidIndex, isSameLumi(), isSameRun(), edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, lumiEntryValid(), setIndexToLumi(), setToLastEventInRange(), size(), type(), and type_.

Referenced by skipEventBackward().

1196  {
1197  // Find the correct place to start the search
1198  int newLumi = indexToLumi();
1199  if(newLumi == invalidIndex) {
1200  newLumi = indexToRun() == invalidIndex ? size() - 1 : indexToRun();
1201  } else {
1202  while(getRunOrLumiEntryType(newLumi - 1) == kLumi &&
1203  isSameLumi(newLumi, newLumi - 1)) {
1204  --newLumi;
1205  }
1206  --newLumi;
1207  }
1208  if(newLumi <= 0) return false;
1209 
1210  // Look backwards for a lumi with events
1211  for( ; newLumi > 0; --newLumi) {
1212  if(getRunOrLumiEntryType(newLumi) == kRun) {
1213  continue;
1214  }
1215  if(setToLastEventInRange(newLumi)) {
1216  break; // found it
1217  }
1218  }
1219  if(newLumi == 0) return false;
1220 
1221  // Finish initializing the iterator
1222  while(getRunOrLumiEntryType(newLumi - 1) == kLumi &&
1223  isSameLumi(newLumi, newLumi - 1) &&
1224  lumiEntryValid(newLumi - 1)) {
1225  --newLumi;
1226  }
1227  setIndexToLumi(newLumi);
1228 
1229  if(type() != kEnd &&
1230  isSameRun(newLumi, indexToRun())) {
1231  if(type() == kEvent) type_ = kLumi;
1232  return true;
1233  }
1234  int newRun = newLumi;
1235  while(newRun > 0 && getRunOrLumiEntryType(newRun - 1) == kLumi) {
1236  --newRun;
1237  }
1238  --newRun;
1239  assert(getRunOrLumiEntryType(newRun) == kRun);
1240  while(getRunOrLumiEntryType(newRun - 1) == kRun &&
1241  isSameRun(newRun - 1, newLumi)) {
1242  --newRun;
1243  }
1244  indexToRun_ = newRun;
1245  type_ = kRun;
1246  return true;
1247  }
virtual bool isSameLumi(int index1, int index2) const =0
static constexpr int invalidIndex
virtual bool setToLastEventInRange(int index)=0
virtual bool lumiEntryValid(int index) const =0
virtual bool isSameRun(int index1, int index2) const =0
virtual EntryType getRunOrLumiEntryType(int index) const =0
virtual int edm::IndexIntoFile::IndexIntoFileItrImpl::processHistoryIDIndex ( ) const
pure virtual
virtual RunNumber_t edm::IndexIntoFile::IndexIntoFileItrImpl::run ( ) const
pure virtual
void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEvent ( long long  value)
inlineprotected
void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToEventRange ( int  value)
inlineprotected
void edm::IndexIntoFile::IndexIntoFileItrImpl::setIndexToLumi ( int  value)
inlineprotected
void edm::IndexIntoFile::IndexIntoFileItrImpl::setInvalid ( void  )
protected
void edm::IndexIntoFile::IndexIntoFileItrImpl::setNEvents ( long long  value)
inlineprotected
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::setToLastEventInRange ( int  index)
privatepure virtual
int edm::IndexIntoFile::IndexIntoFileItrImpl::size ( void  ) const
inline
void edm::IndexIntoFile::IndexIntoFileItrImpl::skipEventBackward ( int &  phIndexOfEvent,
RunNumber_t runOfEvent,
LuminosityBlockNumber_t lumiOfEvent,
EntryNumber_t eventEntry 
)

Definition at line 1159 of file IndexIntoFile.cc.

References edm::IndexIntoFile::empty(), indexIntoFile_, indexToEvent_, indexToRun_, initializeRun(), edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, edm::IndexIntoFile::kRun, peekAheadAtEventEntry(), peekAheadAtLumi(), previousEventRange(), previousLumiWithEvents(), processHistoryIDIndex(), run(), and type_.

1162  {
1163  // Look for previous events in the current lumi
1164  if(indexToEvent_ > 0) {
1165  --indexToEvent_;
1166  } else if(!previousEventRange()) {
1167 
1168  // Look for previous events in previous lumis
1169  if(!previousLumiWithEvents()) {
1170 
1171  // If we get here there are no previous events in the file
1172 
1173  if(!indexIntoFile_->empty()) {
1174  // Set the iterator to the beginning of the file
1175  type_ = kRun;
1176  indexToRun_ = 0;
1177  initializeRun();
1178  }
1179  phIndexOfEvent = invalidIndex;
1180  runOfEvent = invalidRun;
1181  lumiOfEvent = invalidLumi;
1182  eventEntry = invalidEntry;
1183  return;
1184  }
1185  }
1186  // Found a previous event and we have set the iterator so that this event
1187  // will be the next event process. (There may or may not be a run and/or
1188  // a lumi processed first).
1189  // Return information about this event
1190  phIndexOfEvent = processHistoryIDIndex();
1191  runOfEvent = run();
1192  lumiOfEvent = peekAheadAtLumi();
1193  eventEntry = peekAheadAtEventEntry();
1194  }
static constexpr int invalidIndex
bool empty() const
True if no runs, lumis, or events are in the file.
static constexpr RunNumber_t invalidRun
static constexpr EntryNumber_t invalidEntry
virtual RunNumber_t run() const =0
static constexpr LuminosityBlockNumber_t invalidLumi
virtual int processHistoryIDIndex() const =0
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
virtual EntryNumber_t peekAheadAtEventEntry() const =0
void edm::IndexIntoFile::IndexIntoFileItrImpl::skipEventForward ( int &  phIndexOfSkippedEvent,
RunNumber_t runOfSkippedEvent,
LuminosityBlockNumber_t lumiOfSkippedEvent,
EntryNumber_t skippedEventEntry 
)

Definition at line 1103 of file IndexIntoFile.cc.

References advanceToNextRun(), indexToEvent_, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, nEvents_, next(), nextEventRange(), peekAheadAtEventEntry(), peekAheadAtLumi(), processHistoryIDIndex(), run(), skipLumiInRun(), and type_.

1106  {
1107  if(indexToEvent_ < nEvents_) {
1108  phIndexOfSkippedEvent = processHistoryIDIndex();
1109  runOfSkippedEvent = run();
1110  lumiOfSkippedEvent = peekAheadAtLumi();
1111  skippedEventEntry = peekAheadAtEventEntry();
1112 
1113  if((indexToEvent_ + 1) < nEvents_) {
1114  ++indexToEvent_;
1115  return;
1116  } else if(nextEventRange()) {
1117  return;
1118  } else if(type_ == kRun || type_ == kLumi) {
1119  if(skipLumiInRun()) {
1120  return;
1121  }
1122  } else if(type_ == kEvent) {
1123  next();
1124  return;
1125  }
1126  advanceToNextRun();
1127  return;
1128  }
1129 
1130  if(type_ == kRun) {
1131  while(skipLumiInRun()) {
1132  if(indexToEvent_ < nEvents_) {
1133  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1134  return;
1135  }
1136  }
1137  }
1138 
1139  while(indexToEvent_ >= nEvents_ && type_ != kEnd) {
1140  while(skipLumiInRun()) {
1141  if(indexToEvent_ < nEvents_) {
1142  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1143  return;
1144  }
1145  }
1146  advanceToNextRun();
1147  }
1148  if(type_ == kEnd) {
1149  phIndexOfSkippedEvent = invalidIndex;
1150  runOfSkippedEvent = invalidRun;
1151  lumiOfSkippedEvent = invalidLumi;
1152  skippedEventEntry = invalidEntry;
1153  return;
1154  }
1155  skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1156  return;
1157  }
static constexpr int invalidIndex
static constexpr RunNumber_t invalidRun
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
static constexpr EntryNumber_t invalidEntry
virtual RunNumber_t run() const =0
static constexpr LuminosityBlockNumber_t invalidLumi
virtual int processHistoryIDIndex() const =0
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
virtual EntryNumber_t peekAheadAtEventEntry() const =0
virtual bool edm::IndexIntoFile::IndexIntoFileItrImpl::skipLumiInRun ( )
pure virtual
bool edm::IndexIntoFile::IndexIntoFileItrImpl::skipToNextEventInLumi ( )

Definition at line 1364 of file IndexIntoFile.cc.

References indexToEvent_, nEvents_, and nextEventRange().

1364  {
1365  if(indexToEvent_ >= nEvents_) return false;
1366  if((indexToEvent_ + 1) < nEvents_) {
1367  ++indexToEvent_;
1368  return true;
1369  }
1370  return nextEventRange();
1371  }
EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::type ( ) const
inline

Member Data Documentation

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

Definition at line 609 of file IndexIntoFile.h.

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

long long edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEvent_
private
int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToEventRange_
private

Definition at line 615 of file IndexIntoFile.h.

Referenced by copyPosition(), initializeRun(), operator==(), and setInvalid().

int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToLumi_
private
int edm::IndexIntoFile::IndexIntoFileItrImpl::indexToRun_
private
long long edm::IndexIntoFile::IndexIntoFileItrImpl::nEvents_
private
int edm::IndexIntoFile::IndexIntoFileItrImpl::size_
private
EntryType edm::IndexIntoFile::IndexIntoFileItrImpl::type_
private