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 
203 
204 #include <memory>
205 
206 #include <cassert>
207 #include <iosfwd>
208 #include <map>
209 #include <set>
210 #include <vector>
211 
212 class TestIndexIntoFile;
213 class TestIndexIntoFile1;
214 class TestIndexIntoFile2;
215 class TestIndexIntoFile3;
216 class TestIndexIntoFile4;
217 class TestIndexIntoFile5;
218 
219 namespace edm {
220 
221  class ProcessHistoryRegistry;
222  class RootFile;
223 
225  public:
226  class IndexIntoFileItr;
227  class SortedRunOrLumiItr;
228  class IndexRunLumiEventKey;
229 
230  using EntryNumber_t = long long ;
231  static constexpr int invalidIndex = -1;
236 
238 
239  IndexIntoFile();
240  ~IndexIntoFile();
241 
242  ProcessHistoryID const& processHistoryID(int i) const;
243  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
244 
266 
269  IndexIntoFileItr begin(SortOrder sortOrder) const;
270 
272  IndexIntoFileItr end(SortOrder sortOrder) const;
273 
275  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
276 
278  bool empty() const;
279 
303 
306 
311 
316 
319  findRunPosition(RunNumber_t run) const;
320 
321  bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const;
322  bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const;
323  bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const;
324  bool containsRun(RunNumber_t run) const;
325 
328 
331  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
332 
334  bool containsDuplicateEvents() const;
335 
336  //*****************************************************************************
337  //*****************************************************************************
338 
340  public:
341 
342  RunOrLumiEntry();
343 
348  RunNumber_t run,
352 
355  EntryNumber_t entry() const {return entry_;}
357  RunNumber_t run() const {return run_;}
361 
362  bool isRun() const {return lumi() == invalidLumi;}
363 
367 
368  bool operator<(RunOrLumiEntry const& right) const {
369  if (orderPHIDRun_ == right.orderPHIDRun()) {
370  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
371  return entry_ < right.entry();
372  }
373  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
374  }
375  return orderPHIDRun_ < right.orderPHIDRun();
376  }
377 
378  private:
379 
380  // All Runs, Lumis, and Events associated with the same
381  // ProcessHistory and Run in the same input file are processed
382  // contiguously. This parameter establishes the default order
383  // of processing of these contiguous subsets of data.
385 
386  // All Lumis and Events associated with the same
387  // ProcessHistory, Run, and Lumi in the same input file are
388  // processed contiguously. This parameter establishes the
389  // default order of processing of these contiguous subsets
390  // of data.
392 
393  // TTree entry number of Run or Lumi
394  // Always will be valid except when the IndexIntoFile was
395  // created while processing more than 1 luminosity block
396  // at a time (multiple concurrent lumis). In that case
397  // there can be multiple contiguous event ranges associated
398  // with the same lumi TTree entry. Exactly one of those will
399  // have a valid entry_ number and the rest will be set
400  // to the invalid value (-1). For a particular lumi, the
401  // invalid ones sort before the valid ones.
403 
406  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
407 
408  // These are entry numbers in the Events TTree
409  // Each RunOrLumiEntry is associated with one contiguous range of events.
410  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
411  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
412  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
413  };
414 
415  //*****************************************************************************
416  //*****************************************************************************
417 
419  public:
420  RunOrLumiIndexes(int processHistoryIDIndex, RunNumber_t run, LuminosityBlockNumber_t lumi, int indexToGetEntry);
421 
423  RunNumber_t run() const {return run_;}
425  int indexToGetEntry() const {return indexToGetEntry_;}
426  long long beginEventNumbers() const {return beginEventNumbers_;}
427  long long endEventNumbers() const {return endEventNumbers_;}
428 
429  bool isRun() const {return lumi() == invalidLumi;}
430 
431  void setBeginEventNumbers(long long v) {beginEventNumbers_ = v;}
432  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
433 
434  bool operator<(RunOrLumiIndexes const& right) const {
436  if (run_ == right.run()) {
437  return lumi_ < right.lumi();
438  }
439  return run_ < right.run();
440  }
442  }
443 
444  private:
445 
448  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
450 
451  // The next two data members are indexes into the vectors eventNumbers_ and
452  // eventEntries_ (which both have the same number of entries in the same order,
453  // the only difference being that one contains only events numbers and is
454  // smaller in memory).
455 
456  // If there are no events, then the next two are equal (and the value is the
457  // index where the first event would have gone if there had been one)
458 
459  // Note that there can be many RunOrLumiIndexes objects where these two values are
460  // the same if there are many noncontiguous ranges of events associated with the same
461  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
462  // all the noncontiguous ranges in the Events TTree).
463  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
464  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
465  };
466 
467  //*****************************************************************************
468  //*****************************************************************************
469 
470  class EventEntry {
471  public:
472  EventEntry() : event_(invalidEvent), entry_(invalidEntry) {}
474 
475  EventNumber_t event() const {return event_;}
476  EntryNumber_t entry() const {return entry_;}
477 
478  bool operator<(EventEntry const& right) const {
479  return event() < right.event();
480  }
481 
482  bool operator==(EventEntry const& right) const {
483  return event() == right.event();
484  }
485 
486  private:
489  };
490 
491 
492  //*****************************************************************************
493  //*****************************************************************************
494 
496 
497  public:
498  SortedRunOrLumiItr(IndexIntoFile const* indexIntoFile, unsigned runOrLumi);
499 
500  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
501  unsigned runOrLumi() const {return runOrLumi_;}
502 
503  bool operator==(SortedRunOrLumiItr const& right) const;
504  bool operator!=(SortedRunOrLumiItr const& right) const;
505  SortedRunOrLumiItr& operator++();
506 
507  bool isRun();
508 
509  void getRange(long long& beginEventNumbers,
510  long long& endEventNumbers,
511  EntryNumber_t& beginEventEntry,
512  EntryNumber_t& endEventEntry);
513 
514  RunOrLumiIndexes const& runOrLumiIndexes() const;
515 
516  private:
517 
519 
520  // This is an index into runOrLumiIndexes_
521  // which gives the current position of the iteration
522  unsigned runOrLumi_;
523  };
524 
525 
526  //*****************************************************************************
527  //*****************************************************************************
528 
530 
531  public:
532  IndexIntoFileItrImpl(IndexIntoFile const* indexIntoFile,
533  EntryType entryType,
534  int indexToRun,
535  int indexToLumi,
536  int indexToEventRange,
537  long long indexToEvent,
538  long long nEvents);
539  virtual ~IndexIntoFileItrImpl();
540 
541  virtual IndexIntoFileItrImpl* clone() const = 0;
542 
543  EntryType getEntryType() const {return type_;}
544 
545  void next ();
546 
547  void skipEventForward(int& phIndexOfSkippedEvent,
548  RunNumber_t& runOfSkippedEvent,
549  LuminosityBlockNumber_t& lumiOfSkippedEvent,
550  EntryNumber_t& skippedEventEntry);
551 
552  void skipEventBackward(int& phIndexOfEvent,
553  RunNumber_t& runOfEvent,
554  LuminosityBlockNumber_t& lumiOfEvent,
555  EntryNumber_t& eventEntry);
556 
557  virtual int processHistoryIDIndex() const = 0;
558  virtual RunNumber_t run() const = 0;
559  virtual LuminosityBlockNumber_t lumi() const = 0;
560  virtual EntryNumber_t entry() const = 0;
561  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
562  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
563  EntryNumber_t firstEventEntryThisRun();
564  EntryNumber_t firstEventEntryThisLumi();
565  virtual bool skipLumiInRun() = 0;
566  virtual bool lumiEntryValid(int index) const = 0;
567 
568  void advanceToNextRun();
569  void advanceToNextLumiOrRun();
570  bool skipToNextEventInLumi();
571  void initializeRun();
572 
573  void initializeLumi() ;
574 
575  bool operator==(IndexIntoFileItrImpl const& right) const;
576 
577  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
578  int size() const { return size_; }
579 
580  EntryType type() const { return type_; }
581  int indexToRun() const { return indexToRun_; }
582 
583  int indexToLumi() const { return indexToLumi_; }
584  int indexToEventRange() const { return indexToEventRange_; }
585  long long indexToEvent() const { return indexToEvent_; }
586  long long nEvents() const { return nEvents_; }
587 
588  void copyPosition(IndexIntoFileItrImpl const& position);
589 
590  void getLumisInRun(std::vector<LuminosityBlockNumber_t> & lumis) const;
591 
592  protected:
593 
594  void setInvalid();
595 
596  void setIndexToLumi(int value) { indexToLumi_ = value; }
597  void setIndexToEventRange(int value) { indexToEventRange_ = value; }
598  void setIndexToEvent(long long value) { indexToEvent_ = value; }
599  void setNEvents(long long value) { nEvents_ = value; }
600 
601  private:
602 
603  virtual void initializeLumi_() = 0;
604  virtual bool nextEventRange() = 0;
605  virtual bool previousEventRange() = 0;
606  bool previousLumiWithEvents();
607  virtual bool setToLastEventInRange(int index) = 0;
608  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
609  virtual bool isSameLumi(int index1, int index2) const = 0;
610  virtual bool isSameRun(int index1, int index2) const = 0;
611  virtual LuminosityBlockNumber_t lumi(int index) const = 0;
612 
614  int size_;
615 
620  long long indexToEvent_;
621  long long nEvents_;
622  };
623 
624  //*****************************************************************************
625  //*****************************************************************************
626 
628  public:
629  IndexIntoFileItrNoSort(IndexIntoFile const* indexIntoFile,
630  EntryType entryType,
631  int indexToRun,
632  int indexToLumi,
633  int indexToEventRange,
634  long long indexToEvent,
635  long long nEvents);
636 
637  IndexIntoFileItrImpl* clone() const override;
638 
639  int processHistoryIDIndex() const override;
640  RunNumber_t run() const override;
641  LuminosityBlockNumber_t lumi() const override;
642  EntryNumber_t entry() const override;
643  LuminosityBlockNumber_t peekAheadAtLumi() const override;
644  EntryNumber_t peekAheadAtEventEntry() const override;
645  bool skipLumiInRun() override;
646  bool lumiEntryValid(int index) const override;
647 
648  private:
649 
650  void initializeLumi_() override;
651  bool nextEventRange() override;
652  bool previousEventRange() override;
653  bool setToLastEventInRange(int index) override;
654  EntryType getRunOrLumiEntryType(int index) const override;
655  bool isSameLumi(int index1, int index2) const override;
656  bool isSameRun(int index1, int index2) const override;
657  LuminosityBlockNumber_t lumi(int index) const override;
658  };
659 
660  //*****************************************************************************
661  //*****************************************************************************
662 
664  public:
665  IndexIntoFileItrSorted(IndexIntoFile const* indexIntoFile,
666  EntryType entryType,
667  int indexToRun,
668  int indexToLumi,
669  int indexToEventRange,
670  long long indexToEvent,
671  long long nEvents);
672 
673  IndexIntoFileItrImpl* clone() const override;
674  int processHistoryIDIndex() const override;
675  RunNumber_t run() const override;
676  LuminosityBlockNumber_t lumi() const override;
677  EntryNumber_t entry() const override;
678  LuminosityBlockNumber_t peekAheadAtLumi() const override;
679  EntryNumber_t peekAheadAtEventEntry() const override;
680  bool skipLumiInRun() override;
681  bool lumiEntryValid(int index) const override;
682 
683  private:
684 
685  void initializeLumi_() override;
686  bool nextEventRange() override;
687  bool previousEventRange() override;
688  bool setToLastEventInRange(int index) override;
689  EntryType getRunOrLumiEntryType(int index) const override;
690  bool isSameLumi(int index1, int index2) const override;
691  bool isSameRun(int index1, int index2) const override;
692  LuminosityBlockNumber_t lumi(int index) const override;
693  };
694 
695  //*****************************************************************************
696  //*****************************************************************************
697 
699  public:
708  IndexIntoFileItr(IndexIntoFile const* indexIntoFile,
709  SortOrder sortOrder,
710  EntryType entryType,
711  int indexToRun,
712  int indexToLumi,
713  int indexToEventRange,
714  long long indexToEvent,
715  long long nEvents);
716 
717 
718  EntryType getEntryType() const {return impl_->getEntryType();}
719  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
720  RunNumber_t run() const {return impl_->run();}
721  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
722  EntryNumber_t entry() const {return impl_->entry();}
723 
726  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
727 
732  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
733 
737  EntryNumber_t firstEventEntryThisRun() { return impl_->firstEventEntryThisRun(); }
738  EntryNumber_t firstEventEntryThisLumi() { return impl_->firstEventEntryThisLumi(); }
739 
740  // This is intentionally not implemented.
741  // It would be difficult to implement for the no sort mode,
742  // either slow or using extra memory.
743  // It would be easy to implement for the sorted iteration,
744  // but I did not implement it so both cases would offer a
745  // consistent interface.
746  // It looks like in all cases where this would be needed
747  // it would not be difficult to get the event number
748  // directly from the event auxiliary.
749  // We may need to revisit this decision in the future.
750  // EventNumber_t event() const;
751 
752 
755  impl_->next();
756  return *this;
757  }
758 
764  void skipEventForward(int& phIndexOfSkippedEvent,
765  RunNumber_t& runOfSkippedEvent,
766  LuminosityBlockNumber_t& lumiOfSkippedEvent,
767  EntryNumber_t& skippedEventEntry) {
768  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
769  }
770 
778  void skipEventBackward(int& phIndexOfEvent,
779  RunNumber_t& runOfEvent,
780  LuminosityBlockNumber_t& lumiOfEvent,
781  EntryNumber_t& eventEntry) {
782  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
783  }
784 
787  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
788 
791  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
792 
793  void advanceToNextRun() {impl_->advanceToNextRun();}
794  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
795 
796  void advanceToEvent();
797  void advanceToLumi();
798 
799  bool operator==(IndexIntoFileItr const& right) const {
800  return *impl_ == *right.impl_;
801  }
802 
803  bool operator!=(IndexIntoFileItr const& right) const {
804  return !(*this == right);
805  }
806 
808  void initializeRun() {impl_->initializeRun();}
809 
811  void initializeLumi() {impl_->initializeLumi();}
812 
814  void copyPosition(IndexIntoFileItr const& position);
815 
816  void getLumisInRun(std::vector<LuminosityBlockNumber_t> & lumis) const {impl_->getLumisInRun(lumis);}
817 
818  private:
819  //for testing
820  friend class ::TestIndexIntoFile;
821  friend class ::TestIndexIntoFile3;
822  friend class ::TestIndexIntoFile4;
823  friend class ::TestIndexIntoFile5;
824 
825  // The rest of these are intended to be used only by code which tests
826  // this class.
827  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
828  int size() const { return impl_->size(); }
829  EntryType type() const { return impl_->type(); }
830  int indexToRun() const { return impl_->indexToRun(); }
831  int indexToLumi() const { return impl_->indexToLumi(); }
832  int indexToEventRange() const { return impl_->indexToEventRange(); }
833  long long indexToEvent() const { return impl_->indexToEvent(); }
834  long long nEvents() const { return impl_->nEvents(); }
835 
837  };
838 
839  //*****************************************************************************
840  //*****************************************************************************
841 
842  class IndexRunKey {
843  public:
845  processHistoryIDIndex_(index),
846  run_(run) {
847  }
848 
850  RunNumber_t run() const {return run_;}
851 
852  bool operator<(IndexRunKey const& right) const {
854  return run_ < right.run();
855  }
857  }
858 
859  private:
862  };
863 
864  //*****************************************************************************
865  //*****************************************************************************
866 
868  public:
870  processHistoryIDIndex_(index),
871  run_(run),
872  lumi_(lumi) {
873  }
874 
876  RunNumber_t run() const {return run_;}
878 
879  bool operator<(IndexRunLumiKey const& right) const {
881  if (run_ == right.run()) {
882  return lumi_ < right.lumi();
883  }
884  return run_ < right.run();
885  }
887  }
888 
889  private:
893  };
894 
895  //*****************************************************************************
896  //*****************************************************************************
897 
899  public:
901  processHistoryIDIndex_(index),
902  run_(run),
903  lumi_(lumi),
904  event_(event) {
905  }
906 
908  RunNumber_t run() const {return run_;}
910  EventNumber_t event() const {return event_;}
911 
912  bool operator<(IndexRunLumiEventKey const& right) const {
914  if (run_ == right.run()) {
915  if (lumi_ == right.lumi()) {
916  return event_ < right.event();
917  }
918  return lumi_ < right.lumi();
919  }
920  return run_ < right.run();
921  }
923  }
924 
925  private:
930  };
931 
932  //*****************************************************************************
933  //*****************************************************************************
934 
935  class EventFinder {
936  public:
937  virtual ~EventFinder() {}
939  };
940 
941  //*****************************************************************************
942  //*****************************************************************************
943 
944  // The next two functions are used by the output module to fill the
945  // persistent data members.
946 
949  void addEntry(ProcessHistoryID const& processHistoryID,
950  RunNumber_t run,
952  EventNumber_t event,
954 
960 
961  //used internally by addEntry
962  void addLumi(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EntryNumber_t entry);
963  //*****************************************************************************
964  //*****************************************************************************
965 
966  // The next group of functions is used by the PoolSource (or other
967  // input related code) to fill the IndexIntoFile.
968 
974  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
975 
978  void setNumberOfEvents(EntryNumber_t nevents) const {
979  transient_.numberOfEvents_ = nevents;
980  }
981 
987  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
988 
1002  void fillEventNumbers() const;
1003 
1017  void fillEventEntries() const;
1018 
1024  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
1025 
1029  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
1030 
1033  void inputFileClosed() const;
1034 
1036  void doneFileInitialization() const;
1037 
1041  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
1042 
1046  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
1047 
1051  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
1052 
1053  //*****************************************************************************
1054  //*****************************************************************************
1055 
1057  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
1058 
1059  //*****************************************************************************
1060  //*****************************************************************************
1061 
1063 
1064  struct Transients {
1065  Transients();
1066  void reset();
1068  std::map<IndexRunKey, EntryNumber_t> runToOrder_;
1069  std::map<IndexRunLumiKey, EntryNumber_t> lumiToOrder_;
1077  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1078  std::vector<EventNumber_t> eventNumbers_;
1079  std::vector<EventEntry> eventEntries_;
1080  std::vector<EventNumber_t> unsortedEventNumbers_;
1081  };
1082 
1083  private:
1084 
1085  //for testing
1086  friend class ::TestIndexIntoFile;
1087  friend class ::TestIndexIntoFile1;
1088  friend class ::TestIndexIntoFile2;
1089  friend class ::TestIndexIntoFile3;
1090  friend class ::TestIndexIntoFile4;
1091  friend class ::TestIndexIntoFile5;
1092 
1095  void fillRunOrLumiIndexes() const;
1096 
1097  void fillUnsortedEventNumbers() const;
1098  void resetEventFinder() const {transient_.eventFinder_ = nullptr;} // propagate_const<T> has no reset() function
1099  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1100  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1101  void sortEvents() const;
1102  void sortEventEntries() const;
1104  std::map<IndexRunKey, EntryNumber_t>& runToOrder() const {return transient_.runToOrder_;}
1105  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToOrder() const {return transient_.lumiToOrder_;}
1108  int& currentIndex() const {return transient_.currentIndex_;}
1111  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1112  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1114  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1115  }
1116 
1118 
1119  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1120  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1121  };
1122 
1123  template <>
1124  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1127  };
1128 
1129 
1131  public:
1132  bool operator()(IndexIntoFile::RunOrLumiIndexes const& lh, IndexIntoFile::RunOrLumiIndexes const& rh);
1133  };
1134 
1136  public:
1137  bool operator()(IndexIntoFile::RunOrLumiIndexes const& lh, IndexIntoFile::RunOrLumiIndexes const& rh);
1138  };
1139 
1140  // This class exists only to allow forward declarations of IndexIntoFile::IndexIntoFileItr
1142  public:
1144  void getLumisInRun(std::vector<LuminosityBlockNumber_t> & lumis) const {
1145  iter_.getLumisInRun(lumis);
1146  }
1147  private:
1149  };
1150 }
1151 
1152 #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_
static void destroy(IndexIntoFile::IndexIntoFileItrImpl *p)
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
IndexIntoFile::IndexIntoFileItr const & iter_
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.
IndexIntoFileItrHolder(IndexIntoFile::IndexIntoFileItr const &iIter)
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
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 getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
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
void getLumisInRun(std::vector< LuminosityBlockNumber_t > &lumis) const
unsigned int RunNumber_t
bool operator<(IndexRunLumiEventKey const &right) const
SortedRunOrLumiItr endRunOrLumi() const
UInt_t nEvents
Definition: hcalCalib.cc:41
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)
#define constexpr
Definition: event.py:1
edm::propagate_const< std::shared_ptr< EventFinder > > eventFinder_