19 : previousAddedIndex_(invalidIndex),
22 beginEvents_(invalidEntry),
23 endEvents_(invalidEntry),
24 currentIndex_(invalidIndex),
25 currentRun_(invalidRun),
26 currentLumi_(invalidLumi),
32 unsortedEventNumbers_() {}
44 eventFinder_ =
nullptr;
45 runOrLumiIndexes_.clear();
46 eventNumbers_.clear();
47 eventEntries_.clear();
48 unsortedEventNumbers_.clear();
104 <<
"In IndexIntoFile::addEntry. Entries were added in illegal order.\n"
105 <<
"This means the IndexIntoFile product in the output file will be corrupted.\n"
106 <<
"The output file will be unusable for most purposes.\n"
107 <<
"If this occurs after an unrelated exception was thrown in\n"
108 <<
"endLuminosityBlock or endRun then ignore this exception and fix\n"
109 <<
"the primary exception. This is an expected side effect.\n"
110 <<
"Otherwise please report this to the core framework developers\n";
164 long long beginEventNumbers = 0;
166 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
167 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
170 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
173 if (beginOfLumi == iEnd)
176 endOfLumi = beginOfLumi + 1;
177 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
178 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
182 for (std::vector<RunOrLumiIndexes>::iterator iter = beginOfLumi; iter != endOfLumi; ++iter) {
188 for (std::vector<RunOrLumiIndexes>::iterator iter = beginOfLumi; iter != endOfLumi; ++iter) {
189 iter->setBeginEventNumbers(beginEventNumbers);
190 iter->setEndEventNumbers(beginEventNumbers +
nEvents);
193 beginOfLumi = endOfLumi;
208 needEventNumbers =
false;
212 needEventEntries =
false;
224 if (!needEventNumbers && !needEventEntries) {
230 if (needEventNumbers) {
233 if (needEventEntries) {
238 long long previousBeginEventNumbers = -1
LL;
242 if (runOrLumi.isRun())
245 long long beginEventNumbers = 0;
246 long long endEventNumbers = 0;
249 runOrLumi.getRange(beginEventNumbers, endEventNumbers, beginEventEntry, endEventEntry);
253 if (beginEventNumbers != previousBeginEventNumbers)
257 if (needEventNumbers) {
260 if (needEventEntries) {
266 previousBeginEventNumbers = beginEventNumbers;
267 offset += endEventEntry - beginEventEntry;
269 if (needEventNumbers) {
273 if (needEventEntries) {
309 std::vector<ProcessHistoryID> reducedPHIDs;
311 std::map<ProcessHistoryID, int> reducedPHIDToIndex;
313 std::pair<std::map<ProcessHistoryID, int>::iterator,
bool> insertResult;
315 std::vector<int> phidIndexConverter;
318 mapEntry.first = reducedPHID;
319 insertResult = reducedPHIDToIndex.insert(mapEntry);
321 if (insertResult.second) {
322 insertResult.first->second = reducedPHIDs.size();
323 reducedPHIDs.push_back(reducedPHID);
325 phidIndexConverter.push_back(insertResult.first->second);
336 std::map<IndexIntoFile::IndexRunKey, int> runOrderMap;
337 std::pair<std::map<IndexIntoFile::IndexRunKey, int>::iterator,
bool> runInsertResult;
339 std::map<IndexIntoFile::IndexRunLumiKey, int> lumiOrderMap;
340 std::pair<std::map<IndexIntoFile::IndexRunLumiKey, int>::iterator,
bool> lumiInsertResult;
345 item.setProcessHistoryIDIndex(phidIndexConverter.at(
item.processHistoryIDIndex()));
349 runInsertResult = runOrderMap.insert(std::pair<IndexIntoFile::IndexRunKey, int>(runKey, 0));
350 if (runInsertResult.second) {
351 runInsertResult.first->second =
item.orderPHIDRun();
353 item.setOrderPHIDRun(runInsertResult.first->second);
357 if (
item.lumi() != 0) {
359 lumiInsertResult = lumiOrderMap.insert(std::pair<IndexIntoFile::IndexRunLumiKey, int>(lumiKey, 0));
360 if (lumiInsertResult.second) {
361 lumiInsertResult.first->second =
item.orderPHIDRunLumi();
363 item.setOrderPHIDRunLumi(lumiInsertResult.first->second);
371 std::map<int, int> oldToNewIndex;
376 std::vector<ProcessHistoryID>::const_iterator iterExisting =
388 item.setProcessHistoryIDIndex(oldToNewIndex[
item.processHistoryIDIndex()]);
394 std::map<IndexRunKey, EntryNumber_t>::const_iterator keyAndOrder =
398 <<
"In IndexIntoFile::sortVector_Run_Or_Lumi_Entries. A run entry is missing.\n"
399 <<
"This means the IndexIntoFile product in the output file will be corrupted.\n"
400 <<
"The output file will be unusable for most purposes.\n"
401 <<
"If this occurs after an unrelated exception was thrown in\n"
402 <<
"endLuminosityBlock or endRun then ignore this exception and fix\n"
403 <<
"the primary exception. This is an expected side effect.\n"
404 <<
"Otherwise please report this to the core framework developers\n";
406 item.setOrderPHIDRun(keyAndOrder->second);
413 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
414 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
417 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
420 if (beginOfLumi == iEnd)
423 endOfLumi = beginOfLumi + 1;
424 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
425 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
428 assert(beginOfLumi->endEventNumbers() >= 0);
431 eventNumbers().begin() + beginOfLumi->endEventNumbers());
432 beginOfLumi = endOfLumi;
438 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
439 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
442 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
445 if (beginOfLumi == iEnd)
448 endOfLumi = beginOfLumi + 1;
449 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
450 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
453 assert(beginOfLumi->endEventNumbers() >= 0);
456 eventEntries().begin() + beginOfLumi->endEventNumbers());
457 beginOfLumi = endOfLumi;
463 return end(sortOrder);
477 if (it.getEntryType() ==
kEvent) {
478 if (it.entry() < maxEntry) {
481 maxEntry = it.entry();
494 bool lumiMissing = (
lumi == 0 &&
event != 0);
496 std::vector<RunOrLumiIndexes>::const_iterator iEnd =
runOrLumiIndexes().end();
497 std::vector<RunOrLumiIndexes>::const_iterator phEnd;
500 for (std::vector<RunOrLumiIndexes>::const_iterator phBegin =
runOrLumiIndexes().
begin(); phBegin != iEnd;
507 if (iRun == phEnd || iRun->run() !=
run)
519 std::vector<RunOrLumiIndexes>::const_iterator iLumi =
std::lower_bound(iRun, iRunEnd, el);
520 if (iLumi == iRunEnd || iLumi->lumi() !=
lumi)
536 long long beginEventNumbers = iLumi->beginEventNumbers();
537 long long endEventNumbers = iLumi->endEventNumbers();
538 if (beginEventNumbers >= endEventNumbers)
541 long long indexToEvent = 0;
543 std::vector<EventEntry>::const_iterator eventIter =
550 indexToEvent = eventIter -
eventEntries().begin() - beginEventNumbers;
558 indexToEvent = eventIter -
eventNumbers().begin() - beginEventNumbers;
575 endEventNumbers - beginEventNumbers);
578 std::vector<RunOrLumiIndexes>::const_iterator iLumi = iRun;
579 while (iLumi != iRunEnd && iLumi->lumi() ==
invalidLumi) {
582 if (iLumi == iRunEnd)
585 std::vector<RunOrLumiIndexes>::const_iterator lumiEnd;
586 for (; iLumi != iRunEnd; iLumi = lumiEnd) {
590 long long beginEventNumbers = iLumi->beginEventNumbers();
591 long long endEventNumbers = iLumi->endEventNumbers();
592 if (beginEventNumbers >= endEventNumbers)
595 long long indexToEvent = 0;
597 std::vector<EventEntry>::const_iterator eventIter =
603 indexToEvent = eventIter -
eventEntries().begin() - beginEventNumbers;
610 indexToEvent = eventIter -
eventNumbers().begin() - beginEventNumbers;
627 endEventNumbers - beginEventNumbers);
645 while (itr != itrEnd) {
660 if (eventNumber ==
event) {
738 while (iter1 != iEnd1 && iter1.
isRun())
745 while (iter2 != iEnd2 && iter2.
isRun())
755 while (iter1 != iEnd1 && iter2 != iEnd2) {
758 if (indexes1 < indexes2) {
760 }
else if (indexes2 < indexes1) {
765 if (indexes1.
isRun() || (previousIndexes && !(*previousIndexes < indexes1))) {
769 previousIndexes = &indexes1;
780 if ((beginEventNumbers1 >= endEventNumbers1) || (beginEventNumbers2 >= endEventNumbers2)) {
787 std::vector<EventEntry> matchingEvents;
788 std::insert_iterator<std::vector<EventEntry> > insertIter(matchingEvents, matchingEvents.begin());
791 indexIntoFile.
eventEntries().begin() + beginEventNumbers2,
792 indexIntoFile.
eventEntries().begin() + endEventNumbers2,
801 std::vector<EventNumber_t> matchingEvents;
802 std::insert_iterator<std::vector<EventNumber_t> > insertIter(matchingEvents, matchingEvents.begin());
805 indexIntoFile.
eventNumbers().begin() + beginEventNumbers2,
806 indexIntoFile.
eventNumbers().begin() + endEventNumbers2,
825 if (indexes.
isRun() || (previousIndexes && !(*previousIndexes < indexes))) {
828 previousIndexes = &indexes;
834 if (beginEventNumbers + 1 >= endEventNumbers)
838 std::vector<EventEntry>::iterator
last =
eventEntries().begin() + endEventNumbers;
844 std::vector<EventNumber_t>::iterator
last =
eventNumbers().begin() + endEventNumbers;
854 : orderPHIDRun_(invalidEntry),
855 orderPHIDRunLumi_(invalidEntry),
856 entry_(invalidEntry),
857 processHistoryIDIndex_(invalidIndex),
860 beginEvents_(invalidEntry),
861 endEvents_(invalidEntry) {}
866 int processHistoryIDIndex,
871 : orderPHIDRun_(orderPHIDRun),
872 orderPHIDRunLumi_(orderPHIDRunLumi),
874 processHistoryIDIndex_(processHistoryIDIndex),
884 : processHistoryIDIndex_(processHistoryIDIndex),
887 indexToGetEntry_(indexToGetEntry),
888 beginEventNumbers_(-1),
889 endEventNumbers_(-1) {}
892 : indexIntoFile_(indexIntoFile), runOrLumi_(runOrLumi) {
906 if (runOrLumi_ != indexIntoFile_->runOrLumiEntries().size()) {
913 return indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).lumi() ==
invalidLumi;
917 long long& endEventNumbers,
920 beginEventNumbers = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).beginEventNumbers();
921 endEventNumbers = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).endEventNumbers();
923 int indexToGetEntry = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).indexToGetEntry();
924 beginEventEntry = indexIntoFile_->runOrLumiEntries_.at(indexToGetEntry).beginEvents();
925 endEventEntry = indexIntoFile_->runOrLumiEntries_.at(indexToGetEntry).endEvents();
929 return indexIntoFile_->runOrLumiIndexes().at(runOrLumi_);
936 int indexToEventRange,
937 long long indexToEvent,
939 : indexIntoFile_(indexIntoFile),
942 indexToRun_(indexToRun),
943 indexToLumi_(indexToLumi),
944 indexToEventRange_(indexToEventRange),
945 indexToEvent_(indexToEvent),
952 if ((indexToEvent_ + 1) < nEvents_) {
955 bool found = nextEventRange();
958 type_ = getRunOrLumiEntryType(indexToLumi_ + 1);
960 if (type_ ==
kLumi) {
963 }
else if (type_ ==
kRun) {
964 indexToRun_ = indexToLumi_ + 1;
971 }
else if (type_ ==
kLumi) {
972 if (indexToLumi_ + 1 == size_) {
973 if (indexToEvent_ < nEvents_) {
979 EntryType nextType = getRunOrLumiEntryType(indexToLumi_ + 1);
981 if (nextType ==
kLumi && isSameLumi(indexToLumi_, indexToLumi_ + 1)) {
983 }
else if (indexToEvent_ < nEvents_) {
985 }
else if (nextType ==
kRun) {
987 indexToRun_ = indexToLumi_ + 1;
994 }
else if (type_ ==
kRun) {
995 EntryType nextType = getRunOrLumiEntryType(indexToRun_ + 1);
996 bool sameRun = isSameRun(indexToRun_, indexToRun_ + 1);
997 if (nextType ==
kRun && sameRun) {
999 }
else if (nextType ==
kRun && !sameRun) {
1002 }
else if (nextType ==
kLumi) {
1014 if (indexToEvent_ < nEvents_) {
1015 phIndexOfSkippedEvent = processHistoryIDIndex();
1016 runOfSkippedEvent =
run();
1017 lumiOfSkippedEvent = peekAheadAtLumi();
1018 skippedEventEntry = peekAheadAtEventEntry();
1020 if ((indexToEvent_ + 1) < nEvents_) {
1023 }
else if (nextEventRange()) {
1025 }
else if (type_ ==
kRun || type_ ==
kLumi) {
1026 if (skipLumiInRun()) {
1029 }
else if (type_ ==
kEvent) {
1037 if (type_ ==
kRun) {
1038 while (skipLumiInRun()) {
1039 if (indexToEvent_ < nEvents_) {
1040 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1046 while (indexToEvent_ >= nEvents_ && type_ !=
kEnd) {
1047 while (skipLumiInRun()) {
1048 if (indexToEvent_ < nEvents_) {
1049 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1055 if (type_ ==
kEnd) {
1062 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1071 if (indexToEvent_ > 0) {
1073 }
else if (!previousEventRange()) {
1075 if (!previousLumiWithEvents()) {
1078 if (!indexIntoFile_->empty()) {
1095 phIndexOfEvent = processHistoryIDIndex();
1097 lumiOfEvent = peekAheadAtLumi();
1098 eventEntry = peekAheadAtEventEntry();
1103 int newLumi = indexToLumi();
1107 while (getRunOrLumiEntryType(newLumi - 1) ==
kLumi && isSameLumi(newLumi, newLumi - 1)) {
1116 for (; newLumi > 0; --newLumi) {
1117 if (getRunOrLumiEntryType(newLumi) ==
kRun) {
1120 if (setToLastEventInRange(newLumi)) {
1128 while (getRunOrLumiEntryType(newLumi - 1) ==
kLumi && isSameLumi(newLumi, newLumi - 1) &&
1129 lumiEntryValid(newLumi - 1)) {
1132 setIndexToLumi(newLumi);
1134 if (
type() !=
kEnd && isSameRun(newLumi, indexToRun())) {
1139 int newRun = newLumi;
1140 while (newRun > 0 && getRunOrLumiEntryType(newRun - 1) ==
kLumi) {
1144 assert(getRunOrLumiEntryType(newRun) ==
kRun);
1145 while (getRunOrLumiEntryType(newRun - 1) ==
kRun && isSameRun(newRun - 1, newLumi)) {
1148 indexToRun_ = newRun;
1157 int saveIndexToLumi = indexToLumi();
1158 int saveIndexToEventRange = indexToEventRange();
1159 long long saveIndexToEvent = indexToEvent();
1160 long long saveNEvents =
nEvents();
1167 if (indexToEvent() <
nEvents()) {
1168 returnValue = peekAheadAtEventEntry();
1171 }
while (skipLumiInRun());
1173 setIndexToLumi(saveIndexToLumi);
1174 setIndexToEventRange(saveIndexToEventRange);
1175 setIndexToEvent(saveIndexToEvent);
1176 setNEvents(saveNEvents);
1185 int saveIndexToLumi = indexToLumi();
1186 int saveIndexToEventRange = indexToEventRange();
1187 long long saveIndexToEvent = indexToEvent();
1188 long long saveNEvents =
nEvents();
1190 while (indexToLumi() - 1 > 0) {
1191 if (getRunOrLumiEntryType(indexToLumi() - 1) ==
kRun)
1193 if (!isSameLumi(indexToLumi(), indexToLumi() - 1))
1201 if (indexToEvent() <
nEvents()) {
1202 returnValue = peekAheadAtEventEntry();
1205 setIndexToLumi(saveIndexToLumi);
1206 setIndexToEventRange(saveIndexToEventRange);
1207 setIndexToEvent(saveIndexToEvent);
1208 setNEvents(saveNEvents);
1216 for (
int i = 1; indexToRun_ +
i < size_; ++
i) {
1217 if (getRunOrLumiEntryType(indexToRun_ +
i) ==
kRun) {
1218 if (!isSameRun(indexToRun_, indexToRun_ +
i)) {
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;
1251 startSearch = indexToLumi_;
1253 startSearch = indexToRun_;
1254 for (
int i = 1; startSearch +
i < size_; ++
i) {
1255 if (getRunOrLumiEntryType(startSearch +
i) ==
kRun) {
1256 if (!isSameRun(indexToRun_, startSearch +
i)) {
1258 indexToRun_ = startSearch +
i;
1263 if (!isSameLumi(indexToLumi_, startSearch +
i)) {
1265 indexToLumi_ = startSearch +
i;
1275 if (indexToEvent_ >= nEvents_)
1277 if ((indexToEvent_ + 1) < nEvents_) {
1281 return nextEventRange();
1290 for (
int i = 1; (
i + indexToRun_) < size_; ++
i) {
1291 EntryType entryType = getRunOrLumiEntryType(indexToRun_ +
i);
1292 bool sameRun = isSameRun(indexToRun_, indexToRun_ +
i);
1294 if (entryType ==
kRun) {
1301 indexToLumi_ = indexToRun_ +
i;
1312 auto oldLumi =
lumi();
1313 while (not lumiEntryValid(indexToLumi_)) {
1328 indexToRun_ =
position.indexToRun_;
1329 indexToLumi_ =
position.indexToLumi_;
1330 indexToEventRange_ =
position.indexToEventRange_;
1331 indexToEvent_ =
position.indexToEvent_;
1343 for (
int i = 1; (
i + indexToRun_) < size_; ++
i) {
1344 int index =
i + indexToRun_;
1347 if (entryType ==
kRun) {
1348 if (isSameRun(indexToRun_,
index)) {
1355 if (luminosityBlock !=
invalidLumi && luminosityBlock != previousLumi) {
1356 lumis.push_back(luminosityBlock);
1357 previousLumi = luminosityBlock;
1378 int indexToEventRange,
1379 long long indexToEvent,
1382 indexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent,
nEvents) {}
1391 return indexIntoFile()->runOrLumiEntries()[indexToRun()].processHistoryIDIndex();
1397 return indexIntoFile()->runOrLumiEntries()[indexToRun()].run();
1403 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1410 return indexIntoFile()->runOrLumiEntries()[indexToRun()].entry();
1412 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].entry();
1413 return indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() + indexToEvent();
1419 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1425 if (indexToEvent() >=
nEvents())
1427 return indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() + indexToEvent();
1437 for (
int i = 0; indexToLumi() +
i <
size(); ++
i) {
1438 if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].isRun()) {
1440 }
else if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].lumi() ==
1441 indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi()) {
1442 if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].beginEvents() ==
invalidEntry) {
1445 setIndexToEventRange(indexToLumi() +
i);
1461 for (
int i = 1; indexToEventRange() +
i <
size(); ++
i) {
1462 if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].isRun()) {
1464 }
else if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].lumi() ==
1465 indexIntoFile()->runOrLumiEntries()[indexToEventRange()].lumi()) {
1466 if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].beginEvents() ==
invalidEntry) {
1469 setIndexToEventRange(indexToEventRange() +
i);
1486 for (
int i = 1; indexToEventRange() -
i > 0; ++
i) {
1487 int newRange = indexToEventRange() -
i;
1490 }
else if (isSameLumi(newRange, indexToEventRange())) {
1494 setIndexToEventRange(newRange);
1497 setIndexToEvent(
nEvents() - 1);
1509 setIndexToEventRange(
index);
1513 setIndexToEvent(
nEvents() - 1);
1520 for (
int i = 1; indexToLumi() +
i <
size(); ++
i) {
1521 int newLumi = indexToLumi() +
i;
1528 setIndexToLumi(newLumi);
1540 if (index < 0 || index >=
size()) {
1549 if (index1 < 0 || index1 >=
size() || index2 < 0 || index2 >=
size()) {
1552 return indexIntoFile()->runOrLumiEntries()[index1].lumi() == indexIntoFile()->runOrLumiEntries()[index2].lumi();
1556 if (index1 < 0 || index1 >=
size() || index2 < 0 || index2 >=
size()) {
1559 return indexIntoFile()->runOrLumiEntries()[index1].run() == indexIntoFile()->runOrLumiEntries()[index2].run() &&
1560 indexIntoFile()->runOrLumiEntries()[index1].processHistoryIDIndex() ==
1561 indexIntoFile()->runOrLumiEntries()[index2].processHistoryIDIndex();
1565 if (index < 0 || index >=
size()) {
1568 return indexIntoFile()->runOrLumiEntries()[
index].lumi();
1575 int indexToEventRange,
1576 long long indexToEvent,
1579 indexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent,
nEvents) {
1590 return indexIntoFile()->runOrLumiIndexes()[indexToRun()].processHistoryIDIndex();
1596 return indexIntoFile()->runOrLumiIndexes()[indexToRun()].run();
1602 return indexIntoFile()->runOrLumiIndexes()[indexToLumi()].lumi();
1609 int i = indexIntoFile()->runOrLumiIndexes()[indexToRun()].indexToGetEntry();
1610 return indexIntoFile()->runOrLumiEntries()[
i].entry();
1613 int i = indexIntoFile()->runOrLumiIndexes()[indexToLumi()].indexToGetEntry();
1614 return indexIntoFile()->runOrLumiEntries()[
i].entry();
1616 long long eventNumberIndex =
1617 indexIntoFile()->runOrLumiIndexes()[indexToEventRange()].beginEventNumbers() + indexToEvent();
1618 indexIntoFile()->fillEventEntries();
1619 return indexIntoFile()->eventEntries().at(eventNumberIndex).entry();
1625 return indexIntoFile()->runOrLumiIndexes()[indexToLumi()].lumi();
1631 if (indexToEvent() >=
nEvents())
1633 long long eventNumberIndex =
1634 indexIntoFile()->runOrLumiIndexes()[indexToEventRange()].beginEventNumbers() + indexToEvent();
1635 indexIntoFile()->fillEventEntries();
1636 return indexIntoFile()->eventEntries().at(eventNumberIndex).entry();
1641 setIndexToEventRange(indexToLumi());
1643 setNEvents(indexIntoFile()->
runOrLumiIndexes()[indexToLumi()].endEventNumbers() -
1655 long long nEventsInRange = indexIntoFile()->runOrLumiIndexes()[
index].endEventNumbers() -
1656 indexIntoFile()->runOrLumiIndexes()[
index].beginEventNumbers();
1657 if (nEventsInRange == 0) {
1666 setIndexToEventRange(
index);
1667 setNEvents(nEventsInRange);
1669 setIndexToEvent(nEventsInRange - 1);
1676 for (
int i = 1; indexToLumi() +
i <
size(); ++
i) {
1677 int newLumi = indexToLumi() +
i;
1684 setIndexToLumi(newLumi);
1692 return indexIntoFile()->runOrLumiEntries()[indexIntoFile()->runOrLumiIndexes()[
index].indexToGetEntry()].entry() !=
1697 if (index < 0 || index >=
size()) {
1706 if (index1 < 0 || index1 >=
size() || index2 < 0 || index2 >=
size()) {
1709 return indexIntoFile()->runOrLumiIndexes()[index1].lumi() == indexIntoFile()->runOrLumiIndexes()[index2].lumi();
1713 if (index1 < 0 || index1 >=
size() || index2 < 0 || index2 >=
size()) {
1716 return indexIntoFile()->runOrLumiIndexes()[index1].run() == indexIntoFile()->runOrLumiIndexes()[index2].run() &&
1717 indexIntoFile()->runOrLumiIndexes()[index1].processHistoryIDIndex() ==
1718 indexIntoFile()->runOrLumiIndexes()[index2].processHistoryIDIndex();
1722 if (index < 0 || index >=
size()) {
1725 return indexIntoFile()->runOrLumiIndexes()[
index].lumi();
1733 int indexToEventRange,
1734 long long indexToEvent,
1749 for (
EntryType entryType = getEntryType(); entryType !=
kEnd && entryType !=
kEvent; entryType = getEntryType()) {
1755 for (
EntryType entryType = getEntryType(); entryType !=
kEnd && entryType !=
kLumi; entryType = getEntryType()) {
1761 impl_->copyPosition(*
position.impl_);
1767 return lh.run() < rh.
run();