test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IndexIntoFile.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_IndexIntoFile_h
2 #define DataFormats_Provenance_IndexIntoFile_h
3 
171 
172 #include <memory>
173 
174 #include <cassert>
175 #include <iosfwd>
176 #include <map>
177 #include <set>
178 #include <vector>
179 
180 class TestIndexIntoFile;
181 class TestIndexIntoFile1;
182 class TestIndexIntoFile2;
183 class TestIndexIntoFile3;
184 class TestIndexIntoFile4;
185 class TestIndexIntoFile5;
186 
187 namespace edm {
188 
189  class ProcessHistoryRegistry;
190  class RootFile;
191 
193  public:
194  class IndexIntoFileItr;
195  class SortedRunOrLumiItr;
197 
198  typedef long long EntryNumber_t;
199  static int const invalidIndex = -1;
200  static RunNumber_t const invalidRun = 0U;
202  static EventNumber_t const invalidEvent = 0U;
203  static EntryNumber_t const invalidEntry = -1LL;
204 
206 
207  IndexIntoFile();
208  ~IndexIntoFile();
209 
210  ProcessHistoryID const& processHistoryID(int i) const;
211  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
212 
234 
237  IndexIntoFileItr begin(SortOrder sortOrder) const;
238 
240  IndexIntoFileItr end(SortOrder sortOrder) const;
241 
243  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
244 
246  bool empty() const;
247 
269  IndexIntoFileItr
271 
272  IndexIntoFileItr
274 
277  IndexIntoFileItr
279 
282  IndexIntoFileItr
284 
286  IndexIntoFileItr
288 
292  bool containsRun(RunNumber_t run) const;
293 
294  SortedRunOrLumiItr beginRunOrLumi() const;
295  SortedRunOrLumiItr endRunOrLumi() const;
296 
299  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
300 
302  bool containsDuplicateEvents() const;
303 
304  //*****************************************************************************
305  //*****************************************************************************
306 
308  public:
309 
310  RunOrLumiEntry();
311 
320 
323  EntryNumber_t entry() const {return entry_;}
325  RunNumber_t run() const {return run_;}
329 
330  bool isRun() const {return lumi() == invalidLumi;}
331 
335 
336  bool operator<(RunOrLumiEntry const& right) const {
337  if (orderPHIDRun_ == right.orderPHIDRun()) {
338  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
339  return entry_ < right.entry();
340  }
341  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
342  }
343  return orderPHIDRun_ < right.orderPHIDRun();
344  }
345 
346  private:
347 
348  // All Runs, Lumis, and Events associated with the same
349  // ProcessHistory and Run in the same input file are processed
350  // contiguously. This parameter establishes the default order
351  // of processing of these contiguous subsets of data.
353 
354  // All Lumis and Events associated with the same
355  // ProcessHistory, Run, and Lumi in the same input file are
356  // processed contiguously. This parameter establishes the
357  // default order of processing of these contiguous subsets
358  // of data which have the same ProcessHistory and Run.
360 
361  // TTree entry number of Run or Lumi
363 
366  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
367 
368  // These are entry numbers in the Events TTree
369  // Each RunOrLumiEntry is associated with one contiguous range of events.
370  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
371  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
372  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
373  };
374 
375  //*****************************************************************************
376  //*****************************************************************************
377 
379  public:
381 
383  RunNumber_t run() const {return run_;}
385  int indexToGetEntry() const {return indexToGetEntry_;}
386  long long beginEventNumbers() const {return beginEventNumbers_;}
387  long long endEventNumbers() const {return endEventNumbers_;}
388 
389  bool isRun() const {return lumi() == invalidLumi;}
390 
392  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
393 
394  bool operator<(RunOrLumiIndexes const& right) const {
396  if (run_ == right.run()) {
397  return lumi_ < right.lumi();
398  }
399  return run_ < right.run();
400  }
402  }
403 
404  private:
405 
408  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
410 
411  // The next two data members are indexes into the vectors eventNumbers_ and
412  // eventEntries_ (which both have the same number of entries in the same order,
413  // the only difference being that one contains only events numbers and is
414  // smaller in memory).
415 
416  // If there are no events, then the next two are equal (and the value is the
417  // index where the first event would have gone if there had been one)
418 
419  // Note that there can be many RunOrLumiIndexes objects where these two values are
420  // the same if there are many noncontiguous ranges of events associated with the same
421  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
422  // all the noncontiguous ranges in the Events TTree).
423  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
424  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
425  };
426 
427  //*****************************************************************************
428  //*****************************************************************************
429 
430  class EventEntry {
431  public:
434 
435  EventNumber_t event() const {return event_;}
436  EntryNumber_t entry() const {return entry_;}
437 
438  bool operator<(EventEntry const& right) const {
439  return event() < right.event();
440  }
441 
442  bool operator==(EventEntry const& right) const {
443  return event() == right.event();
444  }
445 
446  private:
449  };
450 
451 
452  //*****************************************************************************
453  //*****************************************************************************
454 
456 
457  public:
459 
460  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
461  unsigned runOrLumi() const {return runOrLumi_;}
462 
463  bool operator==(SortedRunOrLumiItr const& right) const;
464  bool operator!=(SortedRunOrLumiItr const& right) const;
466 
467  bool isRun();
468 
469  void getRange(long long& beginEventNumbers,
470  long long& endEventNumbers,
471  EntryNumber_t& beginEventEntry,
472  EntryNumber_t& endEventEntry);
473 
474  RunOrLumiIndexes const& runOrLumiIndexes() const;
475 
476  private:
477 
479 
480  // This is an index into runOrLumiIndexes_
481  // which gives the current position of the iteration
482  unsigned runOrLumi_;
483  };
484 
485 
486  //*****************************************************************************
487  //*****************************************************************************
488 
490 
491  public:
493  EntryType entryType,
494  int indexToRun,
495  int indexToLumi,
496  int indexToEventRange,
497  long long indexToEvent,
498  long long nEvents);
499  virtual ~IndexIntoFileItrImpl();
500 
501  virtual IndexIntoFileItrImpl* clone() const = 0;
502 
503  EntryType getEntryType() const {return type_;}
504 
505  void next ();
506 
507  void skipEventForward(int& phIndexOfSkippedEvent,
508  RunNumber_t& runOfSkippedEvent,
509  LuminosityBlockNumber_t& lumiOfSkippedEvent,
510  EntryNumber_t& skippedEventEntry);
511 
512  void skipEventBackward(int& phIndexOfEvent,
513  RunNumber_t& runOfEvent,
514  LuminosityBlockNumber_t& lumiOfEvent,
515  EntryNumber_t& eventEntry);
516 
517  virtual int processHistoryIDIndex() const = 0;
518  virtual RunNumber_t run() const = 0;
519  virtual LuminosityBlockNumber_t lumi() const = 0;
520  virtual EntryNumber_t entry() const = 0;
521  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
522  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
525  virtual bool skipLumiInRun() = 0;
526 
527  void advanceToNextRun();
528  void advanceToNextLumiOrRun();
529  bool skipToNextEventInLumi();
530  void initializeRun();
531 
533 
534  bool operator==(IndexIntoFileItrImpl const& right) const;
535 
536  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
537  int size() const { return size_; }
538 
539  EntryType type() const { return type_; }
540  int indexToRun() const { return indexToRun_; }
541 
542  int indexToLumi() const { return indexToLumi_; }
543  int indexToEventRange() const { return indexToEventRange_; }
544  long long indexToEvent() const { return indexToEvent_; }
545  long long nEvents() const { return nEvents_; }
546 
548 
549  protected:
550 
551  void setInvalid();
552 
555  void setIndexToEvent(long long value) { indexToEvent_ = value; }
556  void setNEvents(long long value) { nEvents_ = value; }
557 
558  private:
559 
560  virtual void initializeLumi_() = 0;
561  virtual bool nextEventRange() = 0;
562  virtual bool previousEventRange() = 0;
563  bool previousLumiWithEvents();
564  virtual bool setToLastEventInRange(int index) = 0;
565  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
566  virtual bool isSameLumi(int index1, int index2) const = 0;
567  virtual bool isSameRun(int index1, int index2) const = 0;
568 
570  int size_;
571 
576  long long indexToEvent_;
577  long long nEvents_;
578  };
579 
580  //*****************************************************************************
581  //*****************************************************************************
582 
584  public:
586  EntryType entryType,
587  int indexToRun,
588  int indexToLumi,
589  int indexToEventRange,
590  long long indexToEvent,
591  long long nEvents);
592 
593  virtual IndexIntoFileItrImpl* clone() const;
594 
595  virtual int processHistoryIDIndex() const;
596  virtual RunNumber_t run() const;
597  virtual LuminosityBlockNumber_t lumi() const;
598  virtual EntryNumber_t entry() const;
600  virtual EntryNumber_t peekAheadAtEventEntry() const;
601  virtual bool skipLumiInRun();
602 
603  private:
604 
605  virtual void initializeLumi_();
606  virtual bool nextEventRange();
607  virtual bool previousEventRange();
608  virtual bool setToLastEventInRange(int index);
609  virtual EntryType getRunOrLumiEntryType(int index) const;
610  virtual bool isSameLumi(int index1, int index2) const;
611  virtual bool isSameRun(int index1, int index2) const;
612  };
613 
614  //*****************************************************************************
615  //*****************************************************************************
616 
618  public:
620  EntryType entryType,
621  int indexToRun,
622  int indexToLumi,
623  int indexToEventRange,
624  long long indexToEvent,
625  long long nEvents);
626 
627  virtual IndexIntoFileItrImpl* clone() const;
628  virtual int processHistoryIDIndex() const;
629  virtual RunNumber_t run() const;
630  virtual LuminosityBlockNumber_t lumi() const;
631  virtual EntryNumber_t entry() const;
633  virtual EntryNumber_t peekAheadAtEventEntry() const;
634  virtual bool skipLumiInRun();
635 
636  private:
637 
638  virtual void initializeLumi_();
639  virtual bool nextEventRange();
640  virtual bool previousEventRange();
641  virtual bool setToLastEventInRange(int index);
642  virtual EntryType getRunOrLumiEntryType(int index) const;
643  virtual bool isSameLumi(int index1, int index2) const;
644  virtual bool isSameRun(int index1, int index2) const;
645  };
646 
647  //*****************************************************************************
648  //*****************************************************************************
649 
651  public:
661  SortOrder sortOrder,
662  EntryType entryType,
663  int indexToRun,
664  int indexToLumi,
665  int indexToEventRange,
666  long long indexToEvent,
667  long long nEvents);
668 
669 
670  EntryType getEntryType() const {return impl_->getEntryType();}
671  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
672  RunNumber_t run() const {return impl_->run();}
673  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
674  EntryNumber_t entry() const {return impl_->entry();}
675 
678  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
679 
684  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
685 
689  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
690  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
691 
692  // This is intentionally not implemented.
693  // It would be difficult to implement for the no sort mode,
694  // either slow or using extra memory.
695  // It would be easy to implement for the sorted iteration,
696  // but I did not implement it so both cases would offer a
697  // consistent interface.
698  // It looks like in all cases where this would be needed
699  // it would not be difficult to get the event number
700  // directly from the event auxiliary.
701  // We may need to revisit this decision in the future.
702  // EventNumber_t event() const;
703 
704 
707  impl_->next();
708  return *this;
709  }
710 
716  void skipEventForward(int& phIndexOfSkippedEvent,
717  RunNumber_t& runOfSkippedEvent,
718  LuminosityBlockNumber_t& lumiOfSkippedEvent,
719  EntryNumber_t& skippedEventEntry) {
720  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
721  }
722 
730  void skipEventBackward(int& phIndexOfEvent,
731  RunNumber_t& runOfEvent,
732  LuminosityBlockNumber_t& lumiOfEvent,
733  EntryNumber_t& eventEntry) {
734  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
735  }
736 
739  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
740 
743  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
744 
745  void advanceToNextRun() {impl_->advanceToNextRun();}
746  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
747 
748  void advanceToEvent();
749  void advanceToLumi();
750 
751  bool operator==(IndexIntoFileItr const& right) const {
752  return *impl_ == *right.impl_;
753  }
754 
755  bool operator!=(IndexIntoFileItr const& right) const {
756  return !(*this == right);
757  }
758 
760  void initializeRun() {impl_->initializeRun();}
761 
763  void initializeLumi() {impl_->initializeLumi();}
764 
767 
768  private:
769  //for testing
770  friend class ::TestIndexIntoFile;
771  friend class ::TestIndexIntoFile3;
772  friend class ::TestIndexIntoFile4;
773  friend class ::TestIndexIntoFile5;
774 
775  // The rest of these are intended to be used only by code which tests
776  // this class.
777  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
778  int size() const { return impl_->size(); }
779  EntryType type() const { return impl_->type(); }
780  int indexToRun() const { return impl_->indexToRun(); }
781  int indexToLumi() const { return impl_->indexToLumi(); }
782  int indexToEventRange() const { return impl_->indexToEventRange(); }
783  long long indexToEvent() const { return impl_->indexToEvent(); }
784  long long nEvents() const { return impl_->nEvents(); }
785 
787  };
788 
789  //*****************************************************************************
790  //*****************************************************************************
791 
792  class IndexRunKey {
793  public:
795  processHistoryIDIndex_(index),
796  run_(run) {
797  }
798 
800  RunNumber_t run() const {return run_;}
801 
802  bool operator<(IndexRunKey const& right) const {
804  return run_ < right.run();
805  }
807  }
808 
809  private:
812  };
813 
814  //*****************************************************************************
815  //*****************************************************************************
816 
818  public:
820  processHistoryIDIndex_(index),
821  run_(run),
822  lumi_(lumi) {
823  }
824 
826  RunNumber_t run() const {return run_;}
828 
829  bool operator<(IndexRunLumiKey const& right) const {
831  if (run_ == right.run()) {
832  return lumi_ < right.lumi();
833  }
834  return run_ < right.run();
835  }
837  }
838 
839  private:
843  };
844 
845  //*****************************************************************************
846  //*****************************************************************************
847 
849  public:
851  processHistoryIDIndex_(index),
852  run_(run),
853  lumi_(lumi),
854  event_(event) {
855  }
856 
858  RunNumber_t run() const {return run_;}
860  EventNumber_t event() const {return event_;}
861 
862  bool operator<(IndexRunLumiEventKey const& right) const {
864  if (run_ == right.run()) {
865  if (lumi_ == right.lumi()) {
866  return event_ < right.event();
867  }
868  return lumi_ < right.lumi();
869  }
870  return run_ < right.run();
871  }
873  }
874 
875  private:
880  };
881 
882  //*****************************************************************************
883  //*****************************************************************************
884 
885  class EventFinder {
886  public:
887  virtual ~EventFinder() {}
889  };
890 
891  //*****************************************************************************
892  //*****************************************************************************
893 
894  // The next two functions are used by the output module to fill the
895  // persistent data members.
896 
904 
910 
911  //*****************************************************************************
912  //*****************************************************************************
913 
914  // The next group of functions is used by the PoolSource (or other
915  // input related code) to fill the IndexIntoFile.
916 
922  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
923 
928  }
929 
935  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
936 
950  void fillEventNumbers() const;
951 
965  void fillEventEntries() const;
966 
972  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
973 
977  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
978 
981  void inputFileClosed() const;
982 
984  void doneFileInitialization() const;
985 
989  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
990 
994  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
995 
999  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
1000 
1001  //*****************************************************************************
1002  //*****************************************************************************
1003 
1005  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
1006 
1007  //*****************************************************************************
1008  //*****************************************************************************
1009 
1011 
1012  struct Transients {
1013  Transients();
1014  void reset();
1016  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1017  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1025  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1026  std::vector<EventNumber_t> eventNumbers_;
1027  std::vector<EventEntry> eventEntries_;
1028  std::vector<EventNumber_t> unsortedEventNumbers_;
1029  };
1030 
1031  private:
1032 
1033  //for testing
1034  friend class ::TestIndexIntoFile;
1035  friend class ::TestIndexIntoFile1;
1036  friend class ::TestIndexIntoFile2;
1037  friend class ::TestIndexIntoFile3;
1038  friend class ::TestIndexIntoFile4;
1039  friend class ::TestIndexIntoFile5;
1040 
1043  void fillRunOrLumiIndexes() const;
1044 
1045  void fillUnsortedEventNumbers() const;
1046  void resetEventFinder() const {transient_.eventFinder_ = nullptr;} // propagate_const<T> has no reset() function
1047  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1048  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1049  void sortEvents() const;
1050  void sortEventEntries() const;
1052  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1053  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1056  int& currentIndex() const {return transient_.currentIndex_;}
1059  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1060  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1062  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1063  }
1064 
1066 
1067  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1068  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1069  };
1070 
1071  template <>
1072  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1074  };
1075 
1076 
1078  public:
1080  };
1081 
1083  public:
1085  };
1086 }
1087 
1088 #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
virtual bool isSameLumi(int index1, int index2) const
virtual EntryNumber_t entry() const
void setEventFinder(std::shared_ptr< EventFinder > ptr) const
int i
Definition: DBlmapReader.cc:9
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 int const invalidIndex
virtual LuminosityBlockNumber_t lumi() const
virtual EntryNumber_t peekAheadAtEventEntry() const
virtual EntryNumber_t entry() const
IndexIntoFile const * indexIntoFile() const
virtual bool isSameRun(int index1, int index2) const
LuminosityBlockNumber_t currentLumi_
std::vector< EventEntry > & eventEntries() const
EntryNumber_t beginEvents() const
std::vector< EventNumber_t > eventNumbers_
virtual int processHistoryIDIndex() const =0
tuple lumi
Definition: fjr2json.py:35
virtual EntryType getRunOrLumiEntryType(int index) const
virtual bool setToLastEventInRange(int index)=0
EntryNumber_t firstEventEntryThisRun() const
SortedRunOrLumiItr beginRunOrLumi() const
bool empty() const
True if no runs, lumis, or events are in the file.
LuminosityBlockNumber_t & currentLumi() const
virtual LuminosityBlockNumber_t peekAheadAtLumi() const
EventEntry(EventNumber_t event, EntryNumber_t entry)
static IndexIntoFile::IndexIntoFileItrImpl * clone(IndexIntoFile::IndexIntoFileItrImpl const *p)
bool operator<(IndexRunLumiKey const &right) const
bool operator==(SortedRunOrLumiItr const &right) const
unsigned long long EventNumber_t
std::vector< RunOrLumiIndexes > & runOrLumiIndexes() const
void sortEvents() const
virtual LuminosityBlockNumber_t peekAheadAtLumi() const =0
void fillUnsortedEventNumbers() const
IndexIntoFileItr begin(SortOrder sortOrder) const
bool operator==(EventEntry const &right) const
LuminosityBlockNumber_t lumi() 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_
virtual bool isSameLumi(int index1, int index2) const =0
LuminosityBlockNumber_t lumi() const
virtual IndexIntoFileItrImpl * clone() 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
long long EntryNumber_t
static EventNumber_t const invalidEvent
virtual EntryNumber_t peekAheadAtEventEntry() const =0
std::map< IndexRunLumiKey, EntryNumber_t > lumiToFirstEntry_
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
virtual LuminosityBlockNumber_t lumi() const =0
RunOrLumiIndexes(int processHistoryIDIndex, RunNumber_t run, LuminosityBlockNumber_t lumi, int indexToGetEntry)
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
void setOrderPHIDRun(EntryNumber_t v)
virtual EntryType getRunOrLumiEntryType(int index) const =0
static RunNumber_t const invalidRun
virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const =0
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
EntryNumber_t orderPHIDRunLumi() const
virtual IndexIntoFileItrImpl * clone() const =0
std::vector< RunOrLumiEntry > runOrLumiEntries_
EventNumber_t event() const
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
std::vector< ProcessHistoryID > processHistoryIDs_
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
LuminosityBlockNumber_t lumi_
virtual bool isSameRun(int index1, int index2) const =0
void fillEventEntries() const
void setOrderPHIDRunLumi(EntryNumber_t v)
IndexIntoFileItrImpl(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
virtual EntryNumber_t peekAheadAtEventEntry() const
void fillRunOrLumiIndexes() const
std::map< IndexRunKey, EntryNumber_t > runToFirstEntry_
virtual bool isSameRun(int index1, int index2) const
bool operator==(IndexIntoFileItrImpl const &right) const
void set_intersection(IndexIntoFile const &indexIntoFile, std::set< IndexRunLumiEventKey > &intersection) const
virtual EntryNumber_t entry() const =0
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
virtual IndexIntoFileItrImpl * clone() const
IndexIntoFileItr & operator++()
Move to next event to be processed.
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
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
bool operator!=(SortedRunOrLumiItr const &right) const
void addEntry(ProcessHistoryID const &processHistoryID, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
SortedRunOrLumiItr(IndexIntoFile const *indexIntoFile, unsigned runOrLumi)
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::map< IndexRunKey, EntryNumber_t > & runToFirstEntry() const
std::vector< EventNumber_t > & unsortedEventNumbers() const
static EntryNumber_t const invalidEntry
virtual bool isSameLumi(int index1, int index2) const
virtual EntryType getRunOrLumiEntryType(int index) const
IndexIntoFileItrSorted(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
virtual LuminosityBlockNumber_t peekAheadAtLumi() const
static LuminosityBlockNumber_t const 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
bool operator<(IndexRunKey const &right) const
void copyPosition(IndexIntoFileItrImpl const &position)
std::vector< EventEntry > eventEntries_
EntryNumber_t firstEventEntryThisLumi() const
EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const
virtual LuminosityBlockNumber_t lumi() const
void fillEventNumbers() const
static int position[264][3]
Definition: ReadPGInfo.cc:509
bool operator==(IndexIntoFileItr const &right) const
void setNumberOfEvents(EntryNumber_t nevents) const
list entry
Definition: mps_splice.py:62
bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::vector< EventNumber_t > & eventNumbers() const
std::vector< RunOrLumiIndexes > runOrLumiIndexes_
IndexIntoFileItr(IndexIntoFile const *indexIntoFile, SortOrder sortOrder, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
IndexIntoFile const * indexIntoFile() const
unsigned int RunNumber_t
bool operator<(IndexRunLumiEventKey const &right) const
SortedRunOrLumiItr endRunOrLumi() const
bool operator()(IndexIntoFile::RunOrLumiIndexes const &lh, IndexIntoFile::RunOrLumiIndexes const &rh)
std::map< IndexRunLumiKey, EntryNumber_t > & lumiToFirstEntry() const
bool containsRun(RunNumber_t run) const
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
EntryNumber_t entry() const
LuminosityBlockNumber_t lumi_
void getRange(long long &beginEventNumbers, long long &endEventNumbers, EntryNumber_t &beginEventEntry, EntryNumber_t &endEventEntry)
EntryNumber_t & endEvents() const
virtual RunNumber_t run() const =0
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)
IndexIntoFileItrNoSort(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
edm::propagate_const< std::shared_ptr< EventFinder > > eventFinder_
RunOrLumiIndexes const & runOrLumiIndexes() const