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();
157 long long beginEventNumbers = 0;
159 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
160 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
163 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
166 if (beginOfLumi == iEnd)
169 endOfLumi = beginOfLumi + 1;
170 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
171 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
175 for (std::vector<RunOrLumiIndexes>::iterator iter = beginOfLumi; iter != endOfLumi; ++iter) {
181 for (std::vector<RunOrLumiIndexes>::iterator iter = beginOfLumi; iter != endOfLumi; ++iter) {
182 iter->setBeginEventNumbers(beginEventNumbers);
183 iter->setEndEventNumbers(beginEventNumbers +
nEvents);
186 beginOfLumi = endOfLumi;
201 needEventNumbers =
false;
205 needEventEntries =
false;
217 if (!needEventNumbers && !needEventEntries) {
223 if (needEventNumbers) {
226 if (needEventEntries) {
231 long long previousBeginEventNumbers = -1
LL;
235 if (runOrLumi.isRun())
238 long long beginEventNumbers = 0;
239 long long endEventNumbers = 0;
242 runOrLumi.getRange(beginEventNumbers, endEventNumbers, beginEventEntry, endEventEntry);
246 if (beginEventNumbers != previousBeginEventNumbers)
250 if (needEventNumbers) {
253 if (needEventEntries) {
259 previousBeginEventNumbers = beginEventNumbers;
260 offset += endEventEntry - beginEventEntry;
262 if (needEventNumbers) {
266 if (needEventEntries) {
302 std::vector<ProcessHistoryID> reducedPHIDs;
304 std::map<ProcessHistoryID, int> reducedPHIDToIndex;
306 std::pair<std::map<ProcessHistoryID, int>::iterator,
bool> insertResult;
308 std::vector<int> phidIndexConverter;
311 mapEntry.first = reducedPHID;
312 insertResult = reducedPHIDToIndex.insert(mapEntry);
314 if (insertResult.second) {
315 insertResult.first->second = reducedPHIDs.size();
316 reducedPHIDs.push_back(reducedPHID);
318 phidIndexConverter.push_back(insertResult.first->second);
329 std::map<IndexIntoFile::IndexRunKey, int> runOrderMap;
330 std::pair<std::map<IndexIntoFile::IndexRunKey, int>::iterator,
bool> runInsertResult;
332 std::map<IndexIntoFile::IndexRunLumiKey, int> lumiOrderMap;
333 std::pair<std::map<IndexIntoFile::IndexRunLumiKey, int>::iterator,
bool> lumiInsertResult;
338 item.setProcessHistoryIDIndex(phidIndexConverter.at(
item.processHistoryIDIndex()));
342 runInsertResult = runOrderMap.insert(std::pair<IndexIntoFile::IndexRunKey, int>(runKey, 0));
343 if (runInsertResult.second) {
344 runInsertResult.first->second =
item.orderPHIDRun();
346 item.setOrderPHIDRun(runInsertResult.first->second);
350 if (
item.lumi() != 0) {
352 lumiInsertResult = lumiOrderMap.insert(std::pair<IndexIntoFile::IndexRunLumiKey, int>(lumiKey, 0));
353 if (lumiInsertResult.second) {
354 lumiInsertResult.first->second =
item.orderPHIDRunLumi();
356 item.setOrderPHIDRunLumi(lumiInsertResult.first->second);
364 std::map<int, int> oldToNewIndex;
369 std::vector<ProcessHistoryID>::const_iterator iterExisting =
381 item.setProcessHistoryIDIndex(oldToNewIndex[
item.processHistoryIDIndex()]);
387 std::map<IndexRunKey, EntryNumber_t>::const_iterator keyAndOrder =
391 <<
"In IndexIntoFile::sortVector_Run_Or_Lumi_Entries. A run entry is missing.\n" 392 <<
"This means the IndexIntoFile product in the output file will be corrupted.\n" 393 <<
"The output file will be unusable for most purposes.\n" 394 <<
"If this occurs after an unrelated exception was thrown in\n" 395 <<
"endLuminosityBlock or endRun then ignore this exception and fix\n" 396 <<
"the primary exception. This is an expected side effect.\n" 397 <<
"Otherwise please report this to the core framework developers\n";
399 item.setOrderPHIDRun(keyAndOrder->second);
406 bool shouldThrow =
false;
407 bool foundValidLumiEntry =
true;
419 <<
"In IndexIntoFile::sortVector_Run_Or_Lumi_Entries. Missing Run entry.\n" 420 <<
"If this occurs after an unrelated exception occurs, please ignore this\n" 421 <<
"exception and fix the primary exception. This is a possible and expected\n" 422 <<
"side effect. Otherwise, please report to Framework developers.\n" 423 <<
"This could indicate a bug in the source or Framework\n" 424 <<
"Run: " <<
item.run() <<
" Lumi: " <<
item.lumi() <<
" Entry: " <<
item.entry() <<
"\n";
428 if (!foundValidLumiEntry) {
432 foundValidLumiEntry =
false;
436 foundValidLumiEntry =
true;
441 if (!foundValidLumiEntry) {
447 <<
"In IndexIntoFile::sortVector_Run_Or_Lumi_Entries. Missing valid Lumi entry.\n" 448 <<
"If this occurs after an unrelated exception occurs, please ignore this\n" 449 <<
"exception and fix the primary exception. This is a possible and expected\n" 450 <<
"side effect. Otherwise, please report to Framework developers.\n" 451 <<
"This could indicate a bug in the source or Framework\n" 452 <<
"Run: " << lastEntry->
run() <<
" Lumi: " << lastEntry->
lumi() <<
" Entry: " << lastEntry->
entry() <<
"\n";
458 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
459 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
462 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
465 if (beginOfLumi == iEnd)
468 endOfLumi = beginOfLumi + 1;
469 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
470 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
473 assert(beginOfLumi->endEventNumbers() >= 0);
474 assert(beginOfLumi->endEventNumbers() <=
static_cast<long long>(
eventNumbers().size()));
476 eventNumbers().begin() + beginOfLumi->endEventNumbers());
477 beginOfLumi = endOfLumi;
483 std::vector<RunOrLumiIndexes>::iterator beginOfLumi =
runOrLumiIndexes().begin();
484 std::vector<RunOrLumiIndexes>::iterator endOfLumi = beginOfLumi;
487 while (beginOfLumi != iEnd && beginOfLumi->isRun()) {
490 if (beginOfLumi == iEnd)
493 endOfLumi = beginOfLumi + 1;
494 while (endOfLumi != iEnd && beginOfLumi->processHistoryIDIndex() == endOfLumi->processHistoryIDIndex() &&
495 beginOfLumi->run() == endOfLumi->run() && beginOfLumi->lumi() == endOfLumi->lumi()) {
498 assert(beginOfLumi->endEventNumbers() >= 0);
499 assert(beginOfLumi->endEventNumbers() <=
static_cast<long long>(
eventEntries().size()));
501 eventEntries().begin() + beginOfLumi->endEventNumbers());
502 beginOfLumi = endOfLumi;
508 return end(sortOrder);
523 if (
it.entry() < maxEntry) {
526 maxEntry =
it.entry();
539 bool lumiMissing = (
lumi == 0 &&
event != 0);
541 std::vector<RunOrLumiIndexes>::const_iterator iEnd =
runOrLumiIndexes().end();
542 std::vector<RunOrLumiIndexes>::const_iterator phEnd;
545 for (std::vector<RunOrLumiIndexes>::const_iterator phBegin =
runOrLumiIndexes().
begin(); phBegin != iEnd;
552 if (iRun == phEnd || iRun->run() !=
run)
564 std::vector<RunOrLumiIndexes>::const_iterator iLumi =
std::lower_bound(iRun, iRunEnd, el);
565 if (iLumi == iRunEnd || iLumi->lumi() !=
lumi)
581 long long beginEventNumbers = iLumi->beginEventNumbers();
582 long long endEventNumbers = iLumi->endEventNumbers();
583 if (beginEventNumbers >= endEventNumbers)
586 long long indexToEvent = 0;
588 std::vector<EventEntry>::const_iterator eventIter =
595 indexToEvent = eventIter -
eventEntries().begin() - beginEventNumbers;
603 indexToEvent = eventIter -
eventNumbers().begin() - beginEventNumbers;
620 endEventNumbers - beginEventNumbers);
623 std::vector<RunOrLumiIndexes>::const_iterator iLumi = iRun;
624 while (iLumi != iRunEnd && iLumi->lumi() ==
invalidLumi) {
627 if (iLumi == iRunEnd)
630 std::vector<RunOrLumiIndexes>::const_iterator lumiEnd;
631 for (; iLumi != iRunEnd; iLumi = lumiEnd) {
635 long long beginEventNumbers = iLumi->beginEventNumbers();
636 long long endEventNumbers = iLumi->endEventNumbers();
637 if (beginEventNumbers >= endEventNumbers)
640 long long indexToEvent = 0;
642 std::vector<EventEntry>::const_iterator eventIter =
648 indexToEvent = eventIter -
eventEntries().begin() - beginEventNumbers;
655 indexToEvent = eventIter -
eventNumbers().begin() - beginEventNumbers;
672 endEventNumbers - beginEventNumbers);
690 while (itr != itrEnd) {
705 if (eventNumber ==
event) {
783 while (iter1 != iEnd1 && iter1.
isRun())
790 while (iter2 != iEnd2 && iter2.
isRun())
800 while (iter1 != iEnd1 && iter2 != iEnd2) {
803 if (indexes1 < indexes2) {
805 }
else if (indexes2 < indexes1) {
810 if (indexes1.
isRun() || (previousIndexes && !(*previousIndexes < indexes1))) {
814 previousIndexes = &indexes1;
825 if ((beginEventNumbers1 >= endEventNumbers1) || (beginEventNumbers2 >= endEventNumbers2)) {
832 std::vector<EventEntry> matchingEvents;
833 std::insert_iterator<std::vector<EventEntry> > insertIter(matchingEvents, matchingEvents.begin());
836 indexIntoFile.
eventEntries().begin() + beginEventNumbers2,
837 indexIntoFile.
eventEntries().begin() + endEventNumbers2,
846 std::vector<EventNumber_t> matchingEvents;
847 std::insert_iterator<std::vector<EventNumber_t> > insertIter(matchingEvents, matchingEvents.begin());
850 indexIntoFile.
eventNumbers().begin() + beginEventNumbers2,
851 indexIntoFile.
eventNumbers().begin() + endEventNumbers2,
870 if (indexes.
isRun() || (previousIndexes && !(*previousIndexes < indexes))) {
873 previousIndexes = &indexes;
879 if (beginEventNumbers + 1 >= endEventNumbers)
883 std::vector<EventEntry>::iterator
last =
eventEntries().begin() + endEventNumbers;
889 std::vector<EventNumber_t>::iterator
last =
eventNumbers().begin() + endEventNumbers;
899 : orderPHIDRun_(invalidEntry),
900 orderPHIDRunLumi_(invalidEntry),
901 entry_(invalidEntry),
902 processHistoryIDIndex_(invalidIndex),
905 beginEvents_(invalidEntry),
906 endEvents_(invalidEntry) {}
911 int processHistoryIDIndex,
916 : orderPHIDRun_(orderPHIDRun),
917 orderPHIDRunLumi_(orderPHIDRunLumi),
919 processHistoryIDIndex_(processHistoryIDIndex),
929 : processHistoryIDIndex_(processHistoryIDIndex),
932 indexToGetEntry_(indexToGetEntry),
933 beginEventNumbers_(-1),
934 endEventNumbers_(-1) {}
937 : indexIntoFile_(indexIntoFile), runOrLumi_(runOrLumi) {
951 if (runOrLumi_ != indexIntoFile_->runOrLumiEntries().size()) {
958 return indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).lumi() ==
invalidLumi;
962 long long& endEventNumbers,
965 beginEventNumbers = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).beginEventNumbers();
966 endEventNumbers = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).endEventNumbers();
968 int indexToGetEntry = indexIntoFile_->runOrLumiIndexes().at(runOrLumi_).indexToGetEntry();
969 beginEventEntry = indexIntoFile_->runOrLumiEntries_.at(indexToGetEntry).beginEvents();
970 endEventEntry = indexIntoFile_->runOrLumiEntries_.at(indexToGetEntry).endEvents();
974 return indexIntoFile_->runOrLumiIndexes().at(runOrLumi_);
981 int indexToEventRange,
982 long long indexToEvent,
984 : indexIntoFile_(indexIntoFile),
987 indexToRun_(indexToRun),
988 indexToLumi_(indexToLumi),
989 indexToEventRange_(indexToEventRange),
990 indexToEvent_(indexToEvent),
997 if ((indexToEvent_ + 1) < nEvents_) {
1000 bool found = nextEventRange();
1003 type_ = getRunOrLumiEntryType(indexToLumi_ + 1);
1005 if (type_ ==
kLumi) {
1008 }
else if (type_ ==
kRun) {
1009 indexToRun_ = indexToLumi_ + 1;
1016 }
else if (type_ ==
kLumi) {
1017 if (indexToLumi_ + 1 == indexedSize()) {
1018 if (indexToEvent_ < nEvents_) {
1024 EntryType nextType = getRunOrLumiEntryType(indexToLumi_ + 1);
1026 if (nextType ==
kLumi && isSameLumi(indexToLumi_, indexToLumi_ + 1)) {
1028 }
else if (indexToEvent_ < nEvents_) {
1030 }
else if (nextType ==
kRun) {
1032 indexToRun_ = indexToLumi_ + 1;
1039 }
else if (type_ ==
kRun) {
1040 EntryType nextType = getRunOrLumiEntryType(indexToRun_ + 1);
1041 bool sameRun = isSameRun(indexToRun_, indexToRun_ + 1);
1042 if (nextType ==
kRun && sameRun) {
1044 }
else if (nextType ==
kRun && !sameRun) {
1047 }
else if (nextType ==
kLumi) {
1059 if (indexToEvent_ < nEvents_) {
1060 phIndexOfSkippedEvent = processHistoryIDIndex();
1061 runOfSkippedEvent =
run();
1062 lumiOfSkippedEvent = peekAheadAtLumi();
1063 skippedEventEntry = peekAheadAtEventEntry();
1065 if ((indexToEvent_ + 1) < nEvents_) {
1068 }
else if (nextEventRange()) {
1070 }
else if (type_ ==
kRun || type_ ==
kLumi) {
1071 if (skipLumiInRun()) {
1074 }
else if (type_ ==
kEvent) {
1082 if (type_ ==
kRun) {
1083 while (skipLumiInRun()) {
1084 if (indexToEvent_ < nEvents_) {
1085 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1091 while (indexToEvent_ >= nEvents_ && type_ !=
kEnd) {
1092 while (skipLumiInRun()) {
1093 if (indexToEvent_ < nEvents_) {
1094 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1100 if (type_ ==
kEnd) {
1107 skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1116 if (indexToEvent_ > 0) {
1118 }
else if (!previousEventRange()) {
1120 if (!previousLumiWithEvents()) {
1123 if (!indexIntoFile_->empty()) {
1140 phIndexOfEvent = processHistoryIDIndex();
1142 lumiOfEvent = peekAheadAtLumi();
1143 eventEntry = peekAheadAtEventEntry();
1148 int newLumi = indexToLumi();
1150 newLumi = indexToRun() ==
invalidIndex ? indexedSize() - 1 : indexToRun();
1152 while (getRunOrLumiEntryType(newLumi - 1) ==
kLumi && isSameLumi(newLumi, newLumi - 1)) {
1161 for (; newLumi > 0; --newLumi) {
1162 if (getRunOrLumiEntryType(newLumi) ==
kRun) {
1165 if (setToLastEventInRange(newLumi)) {
1174 while (getRunOrLumiEntryType(newLumi - 1) ==
kLumi && isSameLumi(newLumi, newLumi - 1)) {
1179 while (not lumiIterationStartingIndex(newLumi)) {
1183 setIndexToLumi(newLumi);
1185 if (
type() !=
kEnd && isSameRun(newLumi, indexToRun())) {
1190 int newRun = newLumi;
1191 while (newRun > 0 && getRunOrLumiEntryType(newRun - 1) ==
kLumi) {
1195 assert(getRunOrLumiEntryType(newRun) ==
kRun);
1196 while (getRunOrLumiEntryType(newRun - 1) ==
kRun && isSameRun(newRun - 1, newLumi)) {
1199 indexToRun_ = newRun;
1208 int saveIndexToLumi = indexToLumi();
1209 int saveIndexToEventRange = indexToEventRange();
1210 long long saveIndexToEvent = indexToEvent();
1211 long long saveNEvents =
nEvents();
1218 if (indexToEvent() <
nEvents()) {
1219 returnValue = peekAheadAtEventEntry();
1222 }
while (skipLumiInRun());
1224 setIndexToLumi(saveIndexToLumi);
1225 setIndexToEventRange(saveIndexToEventRange);
1226 setIndexToEvent(saveIndexToEvent);
1227 setNEvents(saveNEvents);
1236 int saveIndexToLumi = indexToLumi();
1237 int saveIndexToEventRange = indexToEventRange();
1238 long long saveIndexToEvent = indexToEvent();
1239 long long saveNEvents =
nEvents();
1241 while (indexToLumi() - 1 > 0) {
1242 if (getRunOrLumiEntryType(indexToLumi() - 1) ==
kRun)
1244 if (!isSameLumi(indexToLumi(), indexToLumi() - 1))
1252 if (indexToEvent() <
nEvents()) {
1253 returnValue = peekAheadAtEventEntry();
1256 setIndexToLumi(saveIndexToLumi);
1257 setIndexToEventRange(saveIndexToEventRange);
1258 setIndexToEvent(saveIndexToEvent);
1259 setNEvents(saveNEvents);
1267 for (
int i = 1; indexToRun_ +
i < indexedSize(); ++
i) {
1268 if (getRunOrLumiEntryType(indexToRun_ +
i) ==
kRun) {
1269 if (!isSameRun(indexToRun_, indexToRun_ +
i)) {
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;
1302 startSearch = indexToLumi_;
1304 startSearch = indexToRun_;
1305 for (
int i = 1; startSearch +
i < indexedSize(); ++
i) {
1306 if (getRunOrLumiEntryType(startSearch +
i) ==
kRun) {
1307 if (!isSameRun(indexToRun_, startSearch +
i)) {
1309 indexToRun_ = startSearch +
i;
1314 if (!isSameLumi(indexToLumi_, startSearch +
i)) {
1316 indexToLumi_ = startSearch +
i;
1326 if (indexToEvent_ >= nEvents_)
1328 if ((indexToEvent_ + 1) < nEvents_) {
1332 return nextEventRange();
1341 for (
int i = indexToRun_ + 1, iEnd = indexedSize();
i < iEnd; ++
i) {
1342 EntryType entryType = getRunOrLumiEntryType(
i);
1343 bool sameRun = isSameRun(indexToRun_,
i);
1345 if (entryType ==
kRun) {
1361 auto oldLumi =
lumi();
1364 while (not lumiIterationStartingIndex(indexToLumi_)) {
1381 indexToRun_ =
position.indexToRun_;
1382 indexToLumi_ =
position.indexToLumi_;
1383 indexToEventRange_ =
position.indexToEventRange_;
1384 indexToEvent_ =
position.indexToEvent_;
1389 assert(shouldProcessRun());
1397 for (
int i = 1; (
i + indexToRun_) < indexedSize(); ++
i) {
1398 int index =
i + indexToRun_;
1401 if (entryType ==
kRun) {
1402 if (isSameRun(indexToRun_,
index)) {
1409 if (luminosityBlock !=
invalidLumi && luminosityBlock != previousLumi) {
1410 lumis.push_back(luminosityBlock);
1411 previousLumi = luminosityBlock;
1432 int indexToEventRange,
1433 long long indexToEvent,
1436 indexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent,
nEvents) {}
1445 return indexIntoFile()->runOrLumiEntries()[indexToRun()].processHistoryIDIndex();
1451 return indexIntoFile()->runOrLumiEntries()[indexToRun()].run();
1457 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1464 return indexIntoFile()->runOrLumiEntries()[indexToRun()].entry();
1466 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].entry();
1467 return indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() + indexToEvent();
1473 return indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi();
1479 if (indexToEvent() >=
nEvents())
1481 return indexIntoFile()->runOrLumiEntries()[indexToEventRange()].beginEvents() + indexToEvent();
1491 for (
int i = 0; indexToLumi() +
i < size(); ++
i) {
1492 if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].isRun()) {
1494 }
else if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].lumi() ==
1495 indexIntoFile()->runOrLumiEntries()[indexToLumi()].lumi()) {
1496 if (indexIntoFile()->runOrLumiEntries()[indexToLumi() +
i].beginEvents() ==
invalidEntry) {
1499 setIndexToEventRange(indexToLumi() +
i);
1515 for (
int i = 1; indexToEventRange() +
i < size(); ++
i) {
1516 if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].isRun()) {
1518 }
else if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].lumi() ==
1519 indexIntoFile()->runOrLumiEntries()[indexToEventRange()].lumi()) {
1520 if (indexIntoFile()->runOrLumiEntries()[indexToEventRange() +
i].beginEvents() ==
invalidEntry) {
1523 setIndexToEventRange(indexToEventRange() +
i);
1537 assert(indexToEventRange() < size());
1540 for (
int i = 1; indexToEventRange() -
i > 0; ++
i) {
1541 int newRange = indexToEventRange() -
i;
1544 }
else if (isSameLumi(newRange, indexToEventRange())) {
1548 setIndexToEventRange(newRange);
1551 setIndexToEvent(
nEvents() - 1);
1563 setIndexToEventRange(
index);
1567 setIndexToEvent(
nEvents() - 1);
1574 for (
int i = 1; indexToLumi() +
i < size(); ++
i) {
1575 int newLumi = indexToLumi() +
i;
1582 setIndexToLumi(newLumi);
1594 if (index < 0 || index >= size()) {
1603 if (index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1606 return indexIntoFile()->runOrLumiEntries()[index1].lumi() == indexIntoFile()->runOrLumiEntries()[index2].lumi();
1610 if (index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1613 return indexIntoFile()->runOrLumiEntries()[index1].run() == indexIntoFile()->runOrLumiEntries()[index2].run() &&
1614 indexIntoFile()->runOrLumiEntries()[index1].processHistoryIDIndex() ==
1615 indexIntoFile()->runOrLumiEntries()[index2].processHistoryIDIndex();
1619 if (index < 0 || index >= size()) {
1622 return indexIntoFile()->runOrLumiEntries()[
index].lumi();
1629 int indexToEventRange,
1630 long long indexToEvent,
1633 indexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent,
nEvents) {
1644 return indexIntoFile()->runOrLumiIndexes()[indexToRun()].processHistoryIDIndex();
1650 return indexIntoFile()->runOrLumiIndexes()[indexToRun()].run();
1656 return indexIntoFile()->runOrLumiIndexes()[indexToLumi()].lumi();
1663 int i = indexIntoFile()->runOrLumiIndexes()[indexToRun()].indexToGetEntry();
1664 return indexIntoFile()->runOrLumiEntries()[
i].entry();
1667 int i = indexIntoFile()->runOrLumiIndexes()[indexToLumi()].indexToGetEntry();
1668 return indexIntoFile()->runOrLumiEntries()[
i].entry();
1670 long long eventNumberIndex =
1671 indexIntoFile()->runOrLumiIndexes()[indexToEventRange()].beginEventNumbers() + indexToEvent();
1672 indexIntoFile()->fillEventEntries();
1673 return indexIntoFile()->eventEntries().at(eventNumberIndex).entry();
1679 return indexIntoFile()->runOrLumiIndexes()[indexToLumi()].lumi();
1685 if (indexToEvent() >=
nEvents())
1687 long long eventNumberIndex =
1688 indexIntoFile()->runOrLumiIndexes()[indexToEventRange()].beginEventNumbers() + indexToEvent();
1689 indexIntoFile()->fillEventEntries();
1690 return indexIntoFile()->eventEntries().at(eventNumberIndex).entry();
1695 setIndexToEventRange(indexToLumi());
1697 setNEvents(indexIntoFile()->
runOrLumiIndexes()[indexToLumi()].endEventNumbers() -
1709 long long nEventsInRange = indexIntoFile()->runOrLumiIndexes()[
index].endEventNumbers() -
1710 indexIntoFile()->runOrLumiIndexes()[
index].beginEventNumbers();
1711 if (nEventsInRange == 0) {
1720 setIndexToEventRange(
index);
1721 setNEvents(nEventsInRange);
1723 setIndexToEvent(nEventsInRange - 1);
1730 for (
int i = 1; indexToLumi() +
i < size(); ++
i) {
1731 int newLumi = indexToLumi() +
i;
1738 setIndexToLumi(newLumi);
1746 return indexIntoFile()->runOrLumiEntries()[indexIntoFile()->runOrLumiIndexes()[
index].indexToGetEntry()].entry() !=
1751 if (index < 0 || index >= size()) {
1760 if (index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1763 return indexIntoFile()->runOrLumiIndexes()[index1].lumi() == indexIntoFile()->runOrLumiIndexes()[index2].lumi();
1767 if (index1 < 0 || index1 >= size() || index2 < 0 || index2 >= size()) {
1770 return indexIntoFile()->runOrLumiIndexes()[index1].run() == indexIntoFile()->runOrLumiIndexes()[index2].run() &&
1771 indexIntoFile()->runOrLumiIndexes()[index1].processHistoryIDIndex() ==
1772 indexIntoFile()->runOrLumiIndexes()[index2].processHistoryIDIndex();
1776 if (index < 0 || index >= size()) {
1779 return indexIntoFile()->runOrLumiIndexes()[
index].lumi();
1788 int indexToEventRange,
1789 long long indexToEvent,
1792 iIndexIntoFile, entryType, indexToRun, indexToLumi, indexToEventRange, indexToEvent,
nEvents) {
1811 for (
info.iEventSequence_ =
info.indexesSortedByEventEntry_.cbegin(),
1812 info.iEventSequenceEnd_ =
info.indexesSortedByEventEntry_.cend();
1813 info.iEventSequence_ <
info.iEventSequenceEnd_;) {
1814 info.eventSequenceIndex_ =
info.iEventSequence_->runOrLumiIndex_;
1839 return runOrLumisEntry(indexToRun()).processHistoryIDIndex();
1845 return runOrLumisEntry(indexToRun()).run();
1851 return runOrLumisEntry(indexToLumi()).lumi();
1858 return runOrLumisEntry(indexToRun()).entry();
1860 auto entry = runOrLumisEntry(indexToLumi()).entry();
1862 auto const& runLumiEntry = runOrLumisEntry(indexToLumi());
1864 auto const& laterRunOrLumiEntry = runOrLumisEntry(
index);
1865 if (runLumiEntry.lumi() == laterRunOrLumiEntry.lumi() and runLumiEntry.run() == laterRunOrLumiEntry.run() and
1866 runLumiEntry.processHistoryIDIndex() == laterRunOrLumiEntry.processHistoryIDIndex() &&
1868 return laterRunOrLumiEntry.entry();
1873 <<
"find valid TTree entry number for lumi. This means the IndexIntoFile\n" 1874 <<
"product in the output file will be corrupted.\n" 1875 <<
"The output file will be unusable for most purposes.\n" 1876 <<
"If this occurs after an unrelated exception was thrown,\n" 1877 <<
"then ignore this exception and fix the primary exception.\n" 1878 <<
"This is an expected side effect.\n" 1879 <<
"Otherwise, please report this to the core framework developers\n";
1883 return runOrLumisEntry(indexToEventRange()).beginEvents() + indexToEvent();
1889 return shouldProcessRunOrLumi_[indexToLumi()];
1895 return shouldProcessRunOrLumi_[indexToRun()];
1901 return runOrLumisEntry(indexToLumi()).lumi();
1907 if (indexToEvent() >=
nEvents())
1909 return runOrLumisEntry(indexToEventRange()).beginEvents() + indexToEvent();
1920 if (runOrLumisEntry(
index).isRun()) {
1922 }
else if (runOrLumisEntry(
index).lumi() == runOrLumisEntry(indexToLumi()).lumi()) {
1926 setIndexToEventRange(
index);
1928 setNEvents(runOrLumisEntry(indexToEventRange()).
endEvents() -
1929 runOrLumisEntry(indexToEventRange()).
beginEvents());
1942 for (
int index = indexToEventRange() + 1;
index < indexedSize(); ++
index) {
1943 if (runOrLumisEntry(
index).isRun()) {
1945 }
else if (runOrLumisEntry(
index).lumi() == runOrLumisEntry(indexToEventRange()).lumi()) {
1949 setIndexToEventRange(
index);
1951 setNEvents(runOrLumisEntry(indexToEventRange()).
endEvents() -
1952 runOrLumisEntry(indexToEventRange()).
beginEvents());
1963 assert(indexToEventRange() < indexedSize());
1966 for (
int newRange = indexToEventRange() - 1; newRange > 0; --newRange) {
1967 if (runOrLumisEntry(newRange).isRun()) {
1969 }
else if (isSameLumi(newRange, indexToEventRange())) {
1973 setIndexToEventRange(newRange);
1974 setNEvents(runOrLumisEntry(indexToEventRange()).
endEvents() -
1975 runOrLumisEntry(indexToEventRange()).
beginEvents());
1976 setIndexToEvent(
nEvents() - 1);
1988 setIndexToEventRange(
index);
1989 setNEvents(runOrLumisEntry(indexToEventRange()).
endEvents() - runOrLumisEntry(indexToEventRange()).
beginEvents());
1991 setIndexToEvent(
nEvents() - 1);
1998 for (
int i = 1; indexToLumi() +
i < indexedSize(); ++
i) {
1999 int newLumi = indexToLumi() +
i;
2000 if (runOrLumisEntry(newLumi).isRun()) {
2002 }
else if (runOrLumisEntry(newLumi).
lumi() == runOrLumisEntry(indexToLumi()).
lumi()) {
2005 setIndexToLumi(newLumi);
2018 if (
index + 1 < indexedSize()) {
2022 }
else if (
index + 1 == indexedSize()) {
2030 if (index < 0 || index >= indexedSize()) {
2032 }
else if (runOrLumisEntry(
index).isRun()) {
2039 if (index1 < 0 || index1 >= indexedSize() || index2 < 0 || index2 >= indexedSize()) {
2042 return runOrLumisEntry(index1).lumi() == runOrLumisEntry(index2).lumi();
2046 if (index1 < 0 || index1 >= indexedSize() || index2 < 0 || index2 >= indexedSize()) {
2049 return runOrLumisEntry(index1).run() == runOrLumisEntry(index2).run() &&
2050 runOrLumisEntry(index1).processHistoryIDIndex() == runOrLumisEntry(index2).processHistoryIDIndex();
2054 if (index < 0 || index >= indexedSize()) {
2057 return runOrLumisEntry(
index).lumi();
2075 unsigned int nSize = 0;
2078 assert(runOrLumiEntry.orderPHIDRun() >= 0);
2079 if (runOrLumiEntry.orderPHIDRun() > maxOrderPHIDRun) {
2080 maxOrderPHIDRun = runOrLumiEntry.orderPHIDRun();
2082 if (!runOrLumiEntry.isRun()) {
2083 assert(runOrLumiEntry.orderPHIDRunLumi() >= 0);
2084 if (runOrLumiEntry.orderPHIDRunLumi() > maxOrderPHIDRunLumi) {
2085 maxOrderPHIDRunLumi = runOrLumiEntry.orderPHIDRunLumi();
2093 firstIndexOfRun_.resize(maxOrderPHIDRun + 1,
invalidIndex);
2094 firstIndexOfLumi_.resize(maxOrderPHIDRunLumi + 1,
invalidIndex);
2095 startOfLastContiguousEventsInRun_.resize(maxOrderPHIDRun + 1,
invalidIndex);
2096 startOfLastContiguousEventsInLumi_.resize(maxOrderPHIDRunLumi + 1,
invalidIndex);
2097 indexesSortedByEventEntry_.reserve(nSize);
2110 if (!runOrLumiEntry.isRun() && runOrLumiEntry.orderPHIDRunLumi() != previousLumi) {
2111 previousLumi = runOrLumiEntry.orderPHIDRunLumi();
2114 firstIndexOfLumi_[runOrLumiEntry.orderPHIDRunLumi()] =
index;
2118 if (runOrLumiEntry.orderPHIDRun() != previousRun) {
2119 previousRun = runOrLumiEntry.orderPHIDRun();
2122 firstIndexOfRun_[runOrLumiEntry.orderPHIDRun()] =
index;
2125 bool runHasEvents =
false;
2126 for (
int indexWithinRun =
index + 1;
2127 indexWithinRun < iEnd &&
runOrLumiEntries[indexWithinRun].orderPHIDRun() == runOrLumiEntry.orderPHIDRun();
2130 runHasEvents =
true;
2134 if (!runHasEvents) {
2135 runsWithNoEvents_.push_back({runOrLumiEntry.entry(),
index});
2142 runsWithNoEvents_.end(),
2147 nextRunWithNoEvents_ = runsWithNoEvents_.cbegin();
2148 endRunsWithNoEvents_ = runsWithNoEvents_.cend();
2156 indexesSortedByEventEntry_.push_back({runOrLumiEntry.beginEvents(),
index});
2161 std::sort(indexesSortedByEventEntry_.begin(),
2162 indexesSortedByEventEntry_.end(),
2169 for (
auto const& eventSequence : indexesSortedByEventEntry_) {
2182 for (
auto const& iter : indexesSortedByEventEntry_) {
2185 startOfLastContiguousEventsInRun_[
currentRun] = iter.runOrLumiIndex_;
2190 startOfLastContiguousEventsInLumi_[
currentLumi] = iter.runOrLumiIndex_;
2200 for (
auto& nextRunWithNoEvents =
info.nextRunWithNoEvents_;
2201 nextRunWithNoEvents !=
info.endRunsWithNoEvents_ &&
2202 (maxRunTTreeEntry ==
invalidEntry || nextRunWithNoEvents->ttreeEntry_ < maxRunTTreeEntry);
2203 ++nextRunWithNoEvents) {
2204 int index = nextRunWithNoEvents->runOrLumiIndex_;
2210 addToFileOrder(
index,
true,
false);
2216 std::vector<TTreeEntryAndIndex>& lumisWithNoRemainingEvents,
2226 for (
int indexOfLumiEntry = startingIndex;
2228 auto currentLumiIndex = indexOfLumiEntry;
2230 assert(!currentLumiEntry.isRun());
2231 auto currentLumi = currentLumiEntry.orderPHIDRunLumi();
2233 bool foundUnprocessedEvents =
false;
2237 ++indexOfLumiEntry) {
2239 foundUnprocessedEvents =
true;
2244 (minLumiTTreeEntry ==
invalidEntry || lumiTTreeEntry < minLumiTTreeEntry)) {
2245 minLumiTTreeEntry = lumiTTreeEntry;
2249 if (!foundUnprocessedEvents && minLumiTTreeEntry !=
invalidEntry) {
2250 lumisWithNoRemainingEvents.push_back({minLumiTTreeEntry, currentLumiIndex});
2254 std::sort(lumisWithNoRemainingEvents.begin(),
2255 lumisWithNoRemainingEvents.end(),
2264 fileOrderRunOrLumiEntry_.reserve(sizeToReserve);
2265 shouldProcessRunOrLumi_.reserve(sizeToReserve);
2266 shouldProcessEvents_.reserve(sizeToReserve);
2270 fileOrderRunOrLumiEntry_.push_back(
index);
2271 shouldProcessRunOrLumi_.push_back(processRunOrLumi);
2272 shouldProcessEvents_.push_back(processEvents);
2292 if (
info.startOfLastContiguousEventsInRun_[
currentRun] ==
info.eventSequenceIndex_) {
2297 for (; indexOfRunEntry < iEnd &&
runOrLumiEntries[indexOfRunEntry].isRun(); ++indexOfRunEntry) {
2299 addToFileOrder(indexOfRunEntry,
true,
false);
2303 handleToEndOfContiguousEventsInLumis(
info,
currentRun, indexOfRunEntry);
2307 addToFileOrder(indexOfRunEntry,
false,
false);
2312 while (
info.iEventSequence_ !=
info.iEventSequenceEnd_ &&
2313 info.eventSequenceRunOrLumiEntry_->orderPHIDRun() ==
currentRun) {
2314 addToFileOrder(
info.eventSequenceIndex_,
false,
true);
2325 std::vector<TTreeEntryAndIndex> lumisWithNoRemainingEvents;
2326 fillLumisWithNoRemainingEvents(
2327 lumisWithNoRemainingEvents, endOfRunEntries,
currentRun,
info.eventSequenceRunOrLumiEntry_);
2328 auto nextLumiWithNoEvents = lumisWithNoRemainingEvents.cbegin();
2329 auto endLumisWithNoEvents = lumisWithNoRemainingEvents.cend();
2334 while (
info.iEventSequence_ <
info.iEventSequenceEnd_ &&
2335 info.eventSequenceRunOrLumiEntry_->orderPHIDRun() ==
currentRun) {
2336 auto currentLumi =
info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi();
2340 auto firstBeginEventsContiguousLumi =
info.eventSequenceRunOrLumiEntry_->beginEvents();
2346 handleLumisWithNoEvents(nextLumiWithNoEvents, endLumisWithNoEvents, lumiTTreeEntryNumber);
2349 handleLumiWithEvents(
info,
currentLumi, firstBeginEventsContiguousLumi);
2353 while (
info.iEventSequence_ <
info.iEventSequenceEnd_ &&
2354 info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi() ==
currentLumi) {
2355 addToFileOrder(
info.eventSequenceIndex_,
false,
true);
2360 handleLumisWithNoEvents(nextLumiWithNoEvents, endLumisWithNoEvents,
invalidEntry,
true);
2374 return lumiTTreeEntryNumber;
2381 std::vector<TTreeEntryAndIndex>::const_iterator& nextLumiWithNoEvents,
2382 std::vector<TTreeEntryAndIndex>::const_iterator& endLumisWithNoEvents,
2388 for (; nextLumiWithNoEvents < endLumisWithNoEvents &&
2389 (completeAll || nextLumiWithNoEvents->ttreeEntry_ < lumiTTreeEntryNumber);
2390 ++nextLumiWithNoEvents) {
2391 int iLumiIndex = nextLumiWithNoEvents->runOrLumiIndex_;
2393 for (; iLumiIndex < iEnd &&
runOrLumiEntries[iLumiIndex].orderPHIDRunLumi() == orderPHIDRunLumi; ++iLumiIndex) {
2395 addToFileOrder(iLumiIndex,
true,
false);
2406 while (
info.iEventSequence_ <
info.iEventSequenceEnd_ &&
2407 info.eventSequenceRunOrLumiEntry_->orderPHIDRunLumi() ==
currentLumi) {
2411 handleLumiEntriesNoRemainingEvents(
info, iLumiIndex,
currentLumi, firstBeginEventsContiguousLumi);
2415 addToFileOrder(
info.eventSequenceIndex_, shouldProcessLumi,
true);
2418 handleLumiEntriesNoRemainingEvents(
info, iLumiIndex,
currentLumi, firstBeginEventsContiguousLumi,
true);
2431 (completeAll ||
runOrLumiEntries[iLumiIndex].entry() <
info.eventSequenceRunOrLumiEntry_->entry());
2434 runOrLumiEntries[iLumiIndex].beginEvents() >= firstBeginEventsContiguousLumi) {
2437 addToFileOrder(iLumiIndex,
true,
false);
2448 int indexToEventRange,
2449 long long indexToEvent,
2468 for (
EntryType entryType = getEntryType(); entryType !=
kEnd && entryType !=
kEvent; entryType = getEntryType()) {
2474 for (
EntryType entryType = getEntryType(); entryType !=
kEnd && entryType !=
kLumi; entryType = getEntryType()) {
2480 impl_->copyPosition(*
position.impl_);
2486 return lh.run() < rh.
run();
void initializeRun()
Should only be used internally and for tests.
void initializeLumi_() override
bool setToLastEventInRange(int index) override
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
LuminosityBlockNumber_t peekAheadAtLumi() const override
IndexIntoFileItr begin(SortOrder sortOrder) const
void fillIndexesSortedByEventEntry(std::vector< RunOrLumiEntry > const &)
EntryType getRunOrLumiEntryType(int index) const override
bool lumiIterationStartingIndex(int index) const override
void handleToEndOfContiguousEventsInRun(EntryOrderInitializationInfo &info, EntryNumber_t currentRun)
IndexIntoFile::EntryNumber_t ttreeEntry_
std::vector< RunOrLumiIndexes > & runOrLumiIndexes() const
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::map< IndexRunLumiKey, EntryNumber_t > & lumiToOrder() const
void fillLumisWithNoRemainingEvents(std::vector< TTreeEntryAndIndex > &lumisWithNoRemainingEvents, int startingIndex, EntryNumber_t currentRun, RunOrLumiEntry const *eventSequenceRunOrLumiEntry) const
static constexpr int invalidIndex
EntryNumber_t entry() const override
bool skipLumiInRun() override
int & previousAddedIndex() const
bool isSameLumi(int index1, int index2) const override
bool operator==(SortedRunOrLumiItr const &right) const
void handleToEndOfContiguousEventsInLumis(EntryOrderInitializationInfo &info, EntryNumber_t currentRun, int endOfRunEntries)
IndexIntoFileItrEntryOrder(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
bool skipToNextEventInLumi()
void fillEventNumbers() const
void handleLumisWithNoEvents(std::vector< TTreeEntryAndIndex >::const_iterator &nextLumiWithNoEvents, std::vector< TTreeEntryAndIndex >::const_iterator &endLumisWithNoEvents, EntryNumber_t lumiTTreeEntryNumber, bool completeAll=false)
void addToFileOrder(int index, bool processRunOrLumi, bool processEvents)
void addLumi(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EntryNumber_t entry)
void addRunsWithNoEvents(EntryOrderInitializationInfo &, EntryNumber_t maxRunTTreeEntry=invalidEntry)
int processHistoryIDIndex() const override
bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
IndexIntoFileItrImpl * clone() const override
void advanceToNextLumiOrRun()
int processHistoryIDIndex() const override
bool operator!=(SortedRunOrLumiItr const &right) const
EntryNumber_t entry() const
EntryType getEntryType() const
void sortEventEntries() const
IndexIntoFile const * indexIntoFile() const
bool nextEventRange() override
IndexIntoFile const * indexIntoFile_
unsigned long long EventNumber_t
EntryNumber_t & endEvents() const
void resizeVectors(std::vector< RunOrLumiEntry > const &)
EntryType getRunOrLumiEntryType(int index) const override
void fillEventEntries() const
void initializeLumi_() override
bool previousEventRange() override
IndexIntoFile const * indexIntoFile_
RunNumber_t & currentRun() const
std::vector< EventEntry > & eventEntries() const
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
LuminosityBlockNumber_t lumi() const
virtual ~IndexIntoFileItrImpl()
EntryNumber_t entry() const override
unsigned int LuminosityBlockNumber_t
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
static constexpr EventNumber_t invalidEvent
void swap(Association< C > &lhs, Association< C > &rhs)
EntryNumber_t peekAheadAtEventEntry() const
EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const
bool operator==(IndexIntoFileItrImpl const &right) const
RunNumber_t run() const override
void sortVector_Run_Or_Lumi_Entries()
IndexIntoFileItrImpl * clone() const override
void fillUnsortedEventNumbers() const
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
LuminosityBlockNumber_t lumi() const override
EntryNumber_t lowestInLumi(EntryOrderInitializationInfo &info, int currentLumi) const
void setNumberOfEvents(EntryNumber_t nevents)
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
int & currentIndex() const
bool skipLumiInRun() override
bool setToLastEventInRange(int index) override
IndexIntoFileItrImpl * clone() const override
void checkForMissingRunOrLumiEntry() const
Run this check just after sorting.
RunOrLumiIndexes(int processHistoryIDIndex, RunNumber_t run, LuminosityBlockNumber_t lumi, int indexToGetEntry)
void reserveSpaceInVectors(std::vector< EntryNumber_t >::size_type)
double intersection(double r12)
virtual int indexedSize() const
static constexpr RunNumber_t invalidRun
LuminosityBlockNumber_t peekAheadAtLumi() const override
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RunNumber_t run() const override
std::vector< RunOrLumiEntry > runOrLumiEntries_
LuminosityBlockNumber_t lumi() const override
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
void handleLumiWithEvents(EntryOrderInitializationInfo &info, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi)
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
std::vector< ProcessHistoryID > processHistoryIDs_
long long endEventNumbers() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
def unique(seq, keepstr=True)
SortedRunOrLumiItr endRunOrLumi() const
IndexIntoFileItrImpl(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
LuminosityBlockNumber_t peekAheadAtLumi() const override
bool previousLumiWithEvents()
bool empty() const
True if no runs, lumis, or events are in the file.
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
unsigned runOrLumi() const
SortedRunOrLumiItr & operator++()
bool isSameRun(int index1, int index2) const override
ProcessHistoryID const & processHistoryID(int i) const
EntryNumber_t peekAheadAtEventEntry() const override
std::vector< EventNumber_t > & unsortedEventNumbersMutable() const
bool isSameRun(int index1, int index2) const override
std::vector< EntryNumber_t > fileOrderRunOrLumiEntry_
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
void handleLumiEntriesNoRemainingEvents(EntryOrderInitializationInfo &info, int &iLumiIndex, int currentLumi, EntryNumber_t firstBeginEventsContiguousLumi, bool completeAll=false)
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
EntryNumber_t beginEvents() const
SortedRunOrLumiItr(IndexIntoFile const *indexIntoFile, unsigned runOrLumi)
EntryNumber_t firstEventEntryThisLumi()
Hash< ProcessHistoryType > ProcessHistoryID
long long nEvents() const
bool lumiIterationStartingIndex(int index) const override
bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const
long long beginEventNumbers() const
bool lumiIterationStartingIndex(int index) const override
IndexIntoFile const * indexIntoFile() const
bool previousEventRange() override
void fillIndexesToLastContiguousEvents(std::vector< RunOrLumiEntry > const &)
LuminosityBlockNumber_t lumi() const
size_t numberOfEvents() const
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
EntryNumber_t peekAheadAtEventEntry() const override
std::vector< EventNumber_t > & eventNumbers() const
bool setToLastEventInRange(int index) override
bool nextEventRange() override
IndexIntoFile const * indexIntoFile() const
static constexpr EntryNumber_t invalidEntry
LuminosityBlockNumber_t peekAheadAtLumi() const
int processHistoryIDIndex() const override
IndexIntoFileItrSorted(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
std::vector< EventNumber_t > & unsortedEventNumbers()
static constexpr LuminosityBlockNumber_t invalidLumi
RunNumber_t run() const override
void initializeLumi()
Should only be used internally and for tests.
void fillRunOrLumiIndexes() const
std::vector< ProcessHistoryID > const & processHistoryIDs() const
EntryNumber_t firstEventEntryThisRun()
void copyPosition(IndexIntoFileItrImpl const &position)
void getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
int processHistoryIDIndex() const
LuminosityBlockNumber_t lumi() const override
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
void doneFileInitialization()
Clears the temporary vector of event numbers to reduce memory usage.
LuminosityBlockNumber_t & currentLumi() const
EntryType getRunOrLumiEntryType(int index) const override
bool containsRun(RunNumber_t run) const
bool containsDuplicateEvents() const
Returns true if the IndexIntoFile contains 2 events with the same ProcessHistoryID index...
static int position[264][3]
bool isSameLumi(int index1, int index2) const override
bool isSameRun(int index1, int index2) const override
long long indexToEvent() const
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
bool isSameLumi(int index1, int index2) const override
void gatherNeededInfo(std::vector< RunOrLumiEntry > const &)
bool nextEventRange() override
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
SortedRunOrLumiItr beginRunOrLumi() const
IndexIntoFileItr(IndexIntoFile const *indexIntoFile, SortOrder sortOrder, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
bool previousEventRange() override
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
EntryNumber_t entry() const override
bool shouldProcessRun() const final
bool skipToNextEventInLumi()
bool shouldProcessLumi() const final
void getRange(long long &beginEventNumbers, long long &endEventNumbers, EntryNumber_t &beginEventEntry, EntryNumber_t &endEventEntry)
RunOrLumiIndexes const & runOrLumiIndexes() const
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
void set_intersection(IndexIntoFile const &indexIntoFile, std::set< IndexRunLumiEventKey > &intersection) const
EntryNumber_t & beginEvents() const
value_ptr< IndexIntoFileItrImpl > impl_
std::map< IndexRunKey, EntryNumber_t > & runToOrder() const
bool skipLumiInRun() override
IndexIntoFileItrNoSort(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
void resetEventFinder() const
void initializeLumi_() override
EntryNumber_t peekAheadAtEventEntry() const override
int indexToEventRange() const