CMS 3D CMS Logo

IndexIntoFile.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_IndexIntoFile_h
2 #define DataFormats_Provenance_IndexIntoFile_h
3 
202 
203 #include <memory>
204 
205 #include <cassert>
206 #include <iosfwd>
207 #include <map>
208 #include <set>
209 #include <vector>
210 
211 class TestIndexIntoFile;
212 class TestIndexIntoFile1;
213 class TestIndexIntoFile2;
214 class TestIndexIntoFile3;
215 class TestIndexIntoFile4;
216 class TestIndexIntoFile5;
217 
218 namespace edm {
219 
220  class ProcessHistoryRegistry;
221  class RootFile;
222 
224  public:
225  class IndexIntoFileItr;
226  class SortedRunOrLumiItr;
227  class IndexRunLumiEventKey;
228 
229  using EntryNumber_t = long long ;
230  static constexpr int invalidIndex = -1;
235 
237 
238  IndexIntoFile();
239  ~IndexIntoFile();
240 
241  ProcessHistoryID const& processHistoryID(int i) const;
242  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
243 
265 
268  IndexIntoFileItr begin(SortOrder sortOrder) const;
269 
271  IndexIntoFileItr end(SortOrder sortOrder) const;
272 
274  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
275 
277  bool empty() const;
278 
302 
305 
310 
315 
318  findRunPosition(RunNumber_t run) const;
319 
320  bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const;
321  bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const;
322  bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const;
323  bool containsRun(RunNumber_t run) const;
324 
327 
330  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
331 
333  bool containsDuplicateEvents() const;
334 
335  //*****************************************************************************
336  //*****************************************************************************
337 
339  public:
340 
341  RunOrLumiEntry();
342 
347  RunNumber_t run,
351 
354  EntryNumber_t entry() const {return entry_;}
356  RunNumber_t run() const {return run_;}
360 
361  bool isRun() const {return lumi() == invalidLumi;}
362 
366 
367  bool operator<(RunOrLumiEntry const& right) const {
368  if (orderPHIDRun_ == right.orderPHIDRun()) {
369  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
370  return entry_ < right.entry();
371  }
372  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
373  }
374  return orderPHIDRun_ < right.orderPHIDRun();
375  }
376 
377  private:
378 
379  // All Runs, Lumis, and Events associated with the same
380  // ProcessHistory and Run in the same input file are processed
381  // contiguously. This parameter establishes the default order
382  // of processing of these contiguous subsets of data.
384 
385  // All Lumis and Events associated with the same
386  // ProcessHistory, Run, and Lumi in the same input file are
387  // processed contiguously. This parameter establishes the
388  // default order of processing of these contiguous subsets
389  // of data.
391 
392  // TTree entry number of Run or Lumi
393  // Always will be valid except when the IndexIntoFile was
394  // created while processing more than 1 luminosity block
395  // at a time (multiple concurrent lumis). In that case
396  // there can be multiple contiguous event ranges associated
397  // with the same lumi TTree entry. Exactly one of those will
398  // have a valid entry_ number and the rest will be set
399  // to the invalid value (-1). For a particular lumi, the
400  // invalid ones sort before the valid ones.
402 
405  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
406 
407  // These are entry numbers in the Events TTree
408  // Each RunOrLumiEntry is associated with one contiguous range of events.
409  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
410  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
411  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
412  };
413 
414  //*****************************************************************************
415  //*****************************************************************************
416 
418  public:
419  RunOrLumiIndexes(int processHistoryIDIndex, RunNumber_t run, LuminosityBlockNumber_t lumi, int indexToGetEntry);
420 
422  RunNumber_t run() const {return run_;}
424  int indexToGetEntry() const {return indexToGetEntry_;}
425  long long beginEventNumbers() const {return beginEventNumbers_;}
426  long long endEventNumbers() const {return endEventNumbers_;}
427 
428  bool isRun() const {return lumi() == invalidLumi;}
429 
430  void setBeginEventNumbers(long long v) {beginEventNumbers_ = v;}
431  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
432 
433  bool operator<(RunOrLumiIndexes const& right) const {
435  if (run_ == right.run()) {
436  return lumi_ < right.lumi();
437  }
438  return run_ < right.run();
439  }
441  }
442 
443  private:
444 
447  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
449 
450  // The next two data members are indexes into the vectors eventNumbers_ and
451  // eventEntries_ (which both have the same number of entries in the same order,
452  // the only difference being that one contains only events numbers and is
453  // smaller in memory).
454 
455  // If there are no events, then the next two are equal (and the value is the
456  // index where the first event would have gone if there had been one)
457 
458  // Note that there can be many RunOrLumiIndexes objects where these two values are
459  // the same if there are many noncontiguous ranges of events associated with the same
460  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
461  // all the noncontiguous ranges in the Events TTree).
462  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
463  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
464  };
465 
466  //*****************************************************************************
467  //*****************************************************************************
468 
469  class EventEntry {
470  public:
471  EventEntry() : event_(invalidEvent), entry_(invalidEntry) {}
473 
474  EventNumber_t event() const {return event_;}
475  EntryNumber_t entry() const {return entry_;}
476 
477  bool operator<(EventEntry const& right) const {
478  return event() < right.event();
479  }
480 
481  bool operator==(EventEntry const& right) const {
482  return event() == right.event();
483  }
484 
485  private:
488  };
489 
490 
491  //*****************************************************************************
492  //*****************************************************************************
493 
495 
496  public:
497  SortedRunOrLumiItr(IndexIntoFile const* indexIntoFile, unsigned runOrLumi);
498 
499  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
500  unsigned runOrLumi() const {return runOrLumi_;}
501 
502  bool operator==(SortedRunOrLumiItr const& right) const;
503  bool operator!=(SortedRunOrLumiItr const& right) const;
504  SortedRunOrLumiItr& operator++();
505 
506  bool isRun();
507 
508  void getRange(long long& beginEventNumbers,
509  long long& endEventNumbers,
510  EntryNumber_t& beginEventEntry,
511  EntryNumber_t& endEventEntry);
512 
513  RunOrLumiIndexes const& runOrLumiIndexes() const;
514 
515  private:
516 
518 
519  // This is an index into runOrLumiIndexes_
520  // which gives the current position of the iteration
521  unsigned runOrLumi_;
522  };
523 
524 
525  //*****************************************************************************
526  //*****************************************************************************
527 
529 
530  public:
531  IndexIntoFileItrImpl(IndexIntoFile const* indexIntoFile,
532  EntryType entryType,
533  int indexToRun,
534  int indexToLumi,
535  int indexToEventRange,
536  long long indexToEvent,
537  long long nEvents);
538  virtual ~IndexIntoFileItrImpl();
539 
540  virtual IndexIntoFileItrImpl* clone() const = 0;
541 
542  EntryType getEntryType() const {return type_;}
543 
544  void next ();
545 
546  void skipEventForward(int& phIndexOfSkippedEvent,
547  RunNumber_t& runOfSkippedEvent,
548  LuminosityBlockNumber_t& lumiOfSkippedEvent,
549  EntryNumber_t& skippedEventEntry);
550 
551  void skipEventBackward(int& phIndexOfEvent,
552  RunNumber_t& runOfEvent,
553  LuminosityBlockNumber_t& lumiOfEvent,
554  EntryNumber_t& eventEntry);
555 
556  virtual int processHistoryIDIndex() const = 0;
557  virtual RunNumber_t run() const = 0;
558  virtual LuminosityBlockNumber_t lumi() const = 0;
559  virtual EntryNumber_t entry() const = 0;
560  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
561  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
562  EntryNumber_t firstEventEntryThisRun();
563  EntryNumber_t firstEventEntryThisLumi();
564  virtual bool skipLumiInRun() = 0;
565  virtual bool lumiEntryValid(int index) const = 0;
566 
567  void advanceToNextRun();
568  void advanceToNextLumiOrRun();
569  bool skipToNextEventInLumi();
570  void initializeRun();
571 
572  void initializeLumi() ;
573 
574  bool operator==(IndexIntoFileItrImpl const& right) const;
575 
576  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
577  int size() const { return size_; }
578 
579  EntryType type() const { return type_; }
580  int indexToRun() const { return indexToRun_; }
581 
582  int indexToLumi() const { return indexToLumi_; }
583  int indexToEventRange() const { return indexToEventRange_; }
584  long long indexToEvent() const { return indexToEvent_; }
585  long long nEvents() const { return nEvents_; }
586 
587  void copyPosition(IndexIntoFileItrImpl const& position);
588 
589  protected:
590 
591  void setInvalid();
592 
593  void setIndexToLumi(int value) { indexToLumi_ = value; }
594  void setIndexToEventRange(int value) { indexToEventRange_ = value; }
595  void setIndexToEvent(long long value) { indexToEvent_ = value; }
596  void setNEvents(long long value) { nEvents_ = value; }
597 
598  private:
599 
600  virtual void initializeLumi_() = 0;
601  virtual bool nextEventRange() = 0;
602  virtual bool previousEventRange() = 0;
603  bool previousLumiWithEvents();
604  virtual bool setToLastEventInRange(int index) = 0;
605  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
606  virtual bool isSameLumi(int index1, int index2) const = 0;
607  virtual bool isSameRun(int index1, int index2) const = 0;
608 
610  int size_;
611 
616  long long indexToEvent_;
617  long long nEvents_;
618  };
619 
620  //*****************************************************************************
621  //*****************************************************************************
622 
624  public:
625  IndexIntoFileItrNoSort(IndexIntoFile const* indexIntoFile,
626  EntryType entryType,
627  int indexToRun,
628  int indexToLumi,
629  int indexToEventRange,
630  long long indexToEvent,
631  long long nEvents);
632 
633  IndexIntoFileItrImpl* clone() const override;
634 
635  int processHistoryIDIndex() const override;
636  RunNumber_t run() const override;
637  LuminosityBlockNumber_t lumi() const override;
638  EntryNumber_t entry() const override;
639  LuminosityBlockNumber_t peekAheadAtLumi() const override;
640  EntryNumber_t peekAheadAtEventEntry() const override;
641  bool skipLumiInRun() override;
642  bool lumiEntryValid(int index) const override;
643 
644  private:
645 
646  void initializeLumi_() override;
647  bool nextEventRange() override;
648  bool previousEventRange() override;
649  bool setToLastEventInRange(int index) override;
650  EntryType getRunOrLumiEntryType(int index) const override;
651  bool isSameLumi(int index1, int index2) const override;
652  bool isSameRun(int index1, int index2) const override;
653  };
654 
655  //*****************************************************************************
656  //*****************************************************************************
657 
659  public:
660  IndexIntoFileItrSorted(IndexIntoFile const* indexIntoFile,
661  EntryType entryType,
662  int indexToRun,
663  int indexToLumi,
664  int indexToEventRange,
665  long long indexToEvent,
666  long long nEvents);
667 
668  IndexIntoFileItrImpl* clone() const override;
669  int processHistoryIDIndex() const override;
670  RunNumber_t run() const override;
671  LuminosityBlockNumber_t lumi() const override;
672  EntryNumber_t entry() const override;
673  LuminosityBlockNumber_t peekAheadAtLumi() const override;
674  EntryNumber_t peekAheadAtEventEntry() const override;
675  bool skipLumiInRun() override;
676  bool lumiEntryValid(int index) const override;
677 
678  private:
679 
680  void initializeLumi_() override;
681  bool nextEventRange() override;
682  bool previousEventRange() override;
683  bool setToLastEventInRange(int index) override;
684  EntryType getRunOrLumiEntryType(int index) const override;
685  bool isSameLumi(int index1, int index2) const override;
686  bool isSameRun(int index1, int index2) const override;
687  };
688 
689  //*****************************************************************************
690  //*****************************************************************************
691 
693  public:
702  IndexIntoFileItr(IndexIntoFile const* indexIntoFile,
703  SortOrder sortOrder,
704  EntryType entryType,
705  int indexToRun,
706  int indexToLumi,
707  int indexToEventRange,
708  long long indexToEvent,
709  long long nEvents);
710 
711 
712  EntryType getEntryType() const {return impl_->getEntryType();}
713  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
714  RunNumber_t run() const {return impl_->run();}
715  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
716  EntryNumber_t entry() const {return impl_->entry();}
717 
720  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
721 
726  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
727 
731  EntryNumber_t firstEventEntryThisRun() { return impl_->firstEventEntryThisRun(); }
732  EntryNumber_t firstEventEntryThisLumi() { return impl_->firstEventEntryThisLumi(); }
733 
734  // This is intentionally not implemented.
735  // It would be difficult to implement for the no sort mode,
736  // either slow or using extra memory.
737  // It would be easy to implement for the sorted iteration,
738  // but I did not implement it so both cases would offer a
739  // consistent interface.
740  // It looks like in all cases where this would be needed
741  // it would not be difficult to get the event number
742  // directly from the event auxiliary.
743  // We may need to revisit this decision in the future.
744  // EventNumber_t event() const;
745 
746 
749  impl_->next();
750  return *this;
751  }
752 
758  void skipEventForward(int& phIndexOfSkippedEvent,
759  RunNumber_t& runOfSkippedEvent,
760  LuminosityBlockNumber_t& lumiOfSkippedEvent,
761  EntryNumber_t& skippedEventEntry) {
762  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
763  }
764 
772  void skipEventBackward(int& phIndexOfEvent,
773  RunNumber_t& runOfEvent,
774  LuminosityBlockNumber_t& lumiOfEvent,
775  EntryNumber_t& eventEntry) {
776  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
777  }
778 
781  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
782 
785  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
786 
787  void advanceToNextRun() {impl_->advanceToNextRun();}
788  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
789 
790  void advanceToEvent();
791  void advanceToLumi();
792 
793  bool operator==(IndexIntoFileItr const& right) const {
794  return *impl_ == *right.impl_;
795  }
796 
797  bool operator!=(IndexIntoFileItr const& right) const {
798  return !(*this == right);
799  }
800 
802  void initializeRun() {impl_->initializeRun();}
803 
805  void initializeLumi() {impl_->initializeLumi();}
806 
808  void copyPosition(IndexIntoFileItr const& position);
809 
810  private:
811  //for testing
812  friend class ::TestIndexIntoFile;
813  friend class ::TestIndexIntoFile3;
814  friend class ::TestIndexIntoFile4;
815  friend class ::TestIndexIntoFile5;
816 
817  // The rest of these are intended to be used only by code which tests
818  // this class.
819  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
820  int size() const { return impl_->size(); }
821  EntryType type() const { return impl_->type(); }
822  int indexToRun() const { return impl_->indexToRun(); }
823  int indexToLumi() const { return impl_->indexToLumi(); }
824  int indexToEventRange() const { return impl_->indexToEventRange(); }
825  long long indexToEvent() const { return impl_->indexToEvent(); }
826  long long nEvents() const { return impl_->nEvents(); }
827 
829  };
830 
831  //*****************************************************************************
832  //*****************************************************************************
833 
834  class IndexRunKey {
835  public:
837  processHistoryIDIndex_(index),
838  run_(run) {
839  }
840 
842  RunNumber_t run() const {return run_;}
843 
844  bool operator<(IndexRunKey const& right) const {
846  return run_ < right.run();
847  }
849  }
850 
851  private:
854  };
855 
856  //*****************************************************************************
857  //*****************************************************************************
858 
860  public:
862  processHistoryIDIndex_(index),
863  run_(run),
864  lumi_(lumi) {
865  }
866 
868  RunNumber_t run() const {return run_;}
870 
871  bool operator<(IndexRunLumiKey const& right) const {
873  if (run_ == right.run()) {
874  return lumi_ < right.lumi();
875  }
876  return run_ < right.run();
877  }
879  }
880 
881  private:
885  };
886 
887  //*****************************************************************************
888  //*****************************************************************************
889 
891  public:
893  processHistoryIDIndex_(index),
894  run_(run),
895  lumi_(lumi),
896  event_(event) {
897  }
898 
900  RunNumber_t run() const {return run_;}
902  EventNumber_t event() const {return event_;}
903 
904  bool operator<(IndexRunLumiEventKey const& right) const {
906  if (run_ == right.run()) {
907  if (lumi_ == right.lumi()) {
908  return event_ < right.event();
909  }
910  return lumi_ < right.lumi();
911  }
912  return run_ < right.run();
913  }
915  }
916 
917  private:
922  };
923 
924  //*****************************************************************************
925  //*****************************************************************************
926 
927  class EventFinder {
928  public:
929  virtual ~EventFinder() {}
931  };
932 
933  //*****************************************************************************
934  //*****************************************************************************
935 
936  // The next two functions are used by the output module to fill the
937  // persistent data members.
938 
941  void addEntry(ProcessHistoryID const& processHistoryID,
942  RunNumber_t run,
944  EventNumber_t event,
946 
952 
953  //used internally by addEntry
954  void addLumi(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EntryNumber_t entry);
955  //*****************************************************************************
956  //*****************************************************************************
957 
958  // The next group of functions is used by the PoolSource (or other
959  // input related code) to fill the IndexIntoFile.
960 
966  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
967 
970  void setNumberOfEvents(EntryNumber_t nevents) const {
971  transient_.numberOfEvents_ = nevents;
972  }
973 
979  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
980 
994  void fillEventNumbers() const;
995 
1009  void fillEventEntries() const;
1010 
1016  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
1017 
1021  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
1022 
1025  void inputFileClosed() const;
1026 
1028  void doneFileInitialization() const;
1029 
1033  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
1034 
1038  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
1039 
1043  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
1044 
1045  //*****************************************************************************
1046  //*****************************************************************************
1047 
1049  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
1050 
1051  //*****************************************************************************
1052  //*****************************************************************************
1053 
1055 
1056  struct Transients {
1057  Transients();
1058  void reset();
1060  std::map<IndexRunKey, EntryNumber_t> runToOrder_;
1061  std::map<IndexRunLumiKey, EntryNumber_t> lumiToOrder_;
1069  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1070  std::vector<EventNumber_t> eventNumbers_;
1071  std::vector<EventEntry> eventEntries_;
1072  std::vector<EventNumber_t> unsortedEventNumbers_;
1073  };
1074 
1075  private:
1076 
1077  //for testing
1078  friend class ::TestIndexIntoFile;
1079  friend class ::TestIndexIntoFile1;
1080  friend class ::TestIndexIntoFile2;
1081  friend class ::TestIndexIntoFile3;
1082  friend class ::TestIndexIntoFile4;
1083  friend class ::TestIndexIntoFile5;
1084 
1087  void fillRunOrLumiIndexes() const;
1088 
1089  void fillUnsortedEventNumbers() const;
1090  void resetEventFinder() const {transient_.eventFinder_ = nullptr;} // propagate_const<T> has no reset() function
1091  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1092  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1093  void sortEvents() const;
1094  void sortEventEntries() const;
1096  std::map<IndexRunKey, EntryNumber_t>& runToOrder() const {return transient_.runToOrder_;}
1097  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToOrder() const {return transient_.lumiToOrder_;}
1100  int& currentIndex() const {return transient_.currentIndex_;}
1103  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1104  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1106  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1107  }
1108 
1110 
1111  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1112  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1113  };
1114 
1115  template <>
1116  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1118  };
1119 
1120 
1122  public:
1123  bool operator()(IndexIntoFile::RunOrLumiIndexes const& lh, IndexIntoFile::RunOrLumiIndexes const& rh);
1124  };
1125 
1127  public:
1128  bool operator()(IndexIntoFile::RunOrLumiIndexes const& lh, IndexIntoFile::RunOrLumiIndexes const& rh);
1129  };
1130 }
1131 
1132 #endif
void initializeRun()
Should only be used internally and for tests.
bool operator<(EventEntry const &right) const
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
RunNumber_t & currentRun() const
LuminosityBlockNumber_t lumi() const
void setEventFinder(std::shared_ptr< EventFinder > ptr) const
EntryNumber_t peekAheadAtEventEntry() const
EntryNumber_t entry() const
LuminosityBlockNumber_t lumi() const
EntryNumber_t endEvents() const
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
IndexRunLumiKey(int index, RunNumber_t run, LuminosityBlockNumber_t lumi)
static constexpr int invalidIndex
IndexIntoFile const * indexIntoFile() const
LuminosityBlockNumber_t currentLumi_
void addLumi(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EntryNumber_t entry)
std::vector< EventEntry > & eventEntries() const
Definition: Hash.h:43
EntryNumber_t beginEvents() const
std::vector< EventNumber_t > eventNumbers_
SortedRunOrLumiItr beginRunOrLumi() const
bool empty() const
True if no runs, lumis, or events are in the file.
LuminosityBlockNumber_t & currentLumi() const
EventEntry(EventNumber_t event, EntryNumber_t entry)
static IndexIntoFile::IndexIntoFileItrImpl * clone(IndexIntoFile::IndexIntoFileItrImpl const *p)
bool operator<(IndexRunLumiKey const &right) const
unsigned long long EventNumber_t
std::vector< RunOrLumiIndexes > & runOrLumiIndexes() const
void sortEvents() const
void fillUnsortedEventNumbers() const
IndexIntoFileItr begin(SortOrder sortOrder) const
bool operator==(EventEntry const &right) const
LuminosityBlockNumber_t lumi() const
std::map< IndexRunLumiKey, EntryNumber_t > & lumiToOrder() const
bool int lh
Definition: SIMDVec.h:21
std::vector< RunOrLumiEntry > const & runOrLumiEntries() const
Used internally and for test purposes.
EntryNumber_t orderPHIDRun() const
std::vector< EventNumber_t > unsortedEventNumbers_
LuminosityBlockNumber_t lumi() const
IndexRunLumiEventKey(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
unsigned int LuminosityBlockNumber_t
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
std::vector< ProcessHistoryID > const & processHistoryIDs() const
#define constexpr
static constexpr EventNumber_t invalidEvent
std::map< IndexRunLumiKey, EntryNumber_t > lumiToOrder_
bool operator<(RunOrLumiIndexes const &right) const
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
int & previousAddedIndex() const
void sortVector_Run_Or_Lumi_Entries()
size_t numberOfEvents() const
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
IndexIntoFile const * indexIntoFile() const
bool operator<(RunOrLumiEntry const &right) const
int & currentIndex() const
long long EntryNumber_t
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
void setOrderPHIDRun(EntryNumber_t v)
static constexpr RunNumber_t invalidRun
EntryNumber_t orderPHIDRunLumi() const
std::vector< RunOrLumiEntry > runOrLumiEntries_
std::map< IndexRunKey, EntryNumber_t > runToOrder_
EventNumber_t event() const
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
std::vector< ProcessHistoryID > processHistoryIDs_
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
LuminosityBlockNumber_t lumi_
void fillEventEntries() const
void setOrderPHIDRunLumi(EntryNumber_t v)
void fillRunOrLumiIndexes() const
void set_intersection(IndexIntoFile const &indexIntoFile, std::set< IndexRunLumiEventKey > &intersection) const
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFileItr & operator++()
Move to next event to be processed.
Definition: value.py:1
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
bool operator!=(IndexIntoFileItr const &right) const
void sortEventEntries() const
IndexRunKey(int index, RunNumber_t run)
bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const
bool containsDuplicateEvents() const
Returns true if the IndexIntoFile contains 2 events with the same ProcessHistoryID index...
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void inputFileClosed() const
void initializeTransients() const
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
void resetEventFinder() const
std::vector< EventNumber_t > & unsortedEventNumbers() const
static constexpr EntryNumber_t invalidEntry
static constexpr LuminosityBlockNumber_t invalidLumi
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
LuminosityBlockNumber_t lumi() const
void initializeLumi()
Should only be used internally and for tests.
ProcessHistoryID const & processHistoryID(int i) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
std::map< IndexRunKey, EntryNumber_t > & runToOrder() const
virtual IndexIntoFileItrImpl * clone() const =0
bool operator<(IndexRunKey const &right) const
std::vector< EventEntry > eventEntries_
EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const
HLT enums.
void fillEventNumbers() const
static int position[264][3]
Definition: ReadPGInfo.cc:509
void event_()
bool operator==(IndexIntoFileItr const &right) const
void setNumberOfEvents(EntryNumber_t nevents) const
bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::vector< EventNumber_t > & eventNumbers() const
std::vector< RunOrLumiIndexes > runOrLumiIndexes_
IndexIntoFile const * indexIntoFile() const
unsigned int RunNumber_t
bool operator<(IndexRunLumiEventKey const &right) const
SortedRunOrLumiItr endRunOrLumi() const
UInt_t nEvents
Definition: hcalCalib.cc:42
bool containsRun(RunNumber_t run) const
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
EntryNumber_t entry() const
void reset(double vett[256])
Definition: TPedValues.cc:11
LuminosityBlockNumber_t lumi_
EntryNumber_t & endEvents() const
LuminosityBlockNumber_t peekAheadAtLumi() const
EntryNumber_t & beginEvents() const
value_ptr< IndexIntoFileItrImpl > impl_
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
Definition: event.py:1
edm::propagate_const< std::shared_ptr< EventFinder > > eventFinder_