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 
172 
173 #include <memory>
174 
175 #include <cassert>
176 #include <iosfwd>
177 #include <map>
178 #include <set>
179 #include <vector>
180 
182 
183 namespace edm {
184 
185  class ProcessHistoryRegistry;
186  class RootFile;
187 
189  public:
190  class IndexIntoFileItr;
191  class SortedRunOrLumiItr;
193 
194  typedef long long EntryNumber_t;
195  static int const invalidIndex = -1;
196  static RunNumber_t const invalidRun = 0U;
198  static EventNumber_t const invalidEvent = 0U;
199  static EntryNumber_t const invalidEntry = -1LL;
200 
202 
203  IndexIntoFile();
204  ~IndexIntoFile();
205 
206  ProcessHistoryID const& processHistoryID(int i) const;
207  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
208 
230 
233  IndexIntoFileItr begin(SortOrder sortOrder) const;
234 
236  IndexIntoFileItr end(SortOrder sortOrder) const;
237 
239  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
240 
242  bool empty() const;
243 
265  IndexIntoFileItr
267 
268  IndexIntoFileItr
270 
273  IndexIntoFileItr
275 
278  IndexIntoFileItr
280 
282  IndexIntoFileItr
284 
288  bool containsRun(RunNumber_t run) const;
289 
290  SortedRunOrLumiItr beginRunOrLumi() const;
291  SortedRunOrLumiItr endRunOrLumi() const;
292 
295  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
296 
298  bool containsDuplicateEvents() const;
299 
300  //*****************************************************************************
301  //*****************************************************************************
302 
304  public:
305 
306  RunOrLumiEntry();
307 
316 
319  EntryNumber_t entry() const {return entry_;}
321  RunNumber_t run() const {return run_;}
325 
326  bool isRun() const {return lumi() == invalidLumi;}
327 
331 
332  bool operator<(RunOrLumiEntry const& right) const {
333  if (orderPHIDRun_ == right.orderPHIDRun()) {
334  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
335  return entry_ < right.entry();
336  }
337  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
338  }
339  return orderPHIDRun_ < right.orderPHIDRun();
340  }
341 
342  private:
343  // All Runs, Lumis, and Events associated with the same
344  // ProcessHistory and Run in the same input file are processed
345  // contiguously. This parameter establishes the default order
346  // of processing of these contiguous subsets of data.
348 
349  // All Lumis and Events associated with the same
350  // ProcessHistory, Run, and Lumi in the same input file are
351  // processed contiguously. This parameter establishes the
352  // default order of processing of these contiguous subsets
353  // of data which have the same ProcessHistory and Run.
355 
356  // TTree entry number of Run or Lumi
358 
361  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
362 
363  // These are entry numbers in the Events TTree
364  // Each RunOrLumiEntry is associated with one contiguous range of events.
365  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
366  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
367  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
368  };
369 
370  //*****************************************************************************
371  //*****************************************************************************
372 
374  public:
376 
378  RunNumber_t run() const {return run_;}
380  int indexToGetEntry() const {return indexToGetEntry_;}
381  long long beginEventNumbers() const {return beginEventNumbers_;}
382  long long endEventNumbers() const {return endEventNumbers_;}
383 
384  bool isRun() const {return lumi() == invalidLumi;}
385 
387  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
388 
389  bool operator<(RunOrLumiIndexes const& right) const {
391  if (run_ == right.run()) {
392  return lumi_ < right.lumi();
393  }
394  return run_ < right.run();
395  }
397  }
398 
399  private:
400 
403  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
405 
406  // The next two data members are indexes into the vectors eventNumbers_ and
407  // eventEntries_ (which both have the same number of entries in the same order,
408  // the only difference being that one contains only events numbers and is
409  // smaller in memory).
410 
411  // If there are no events, then the next two are equal (and the value is the
412  // index where the first event would have gone if there had been one)
413 
414  // Note that there can be many RunOrLumiIndexes objects where these two values are
415  // the same if there are many noncontiguous ranges of events associated with the same
416  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
417  // all the noncontiguous ranges in the Events TTree).
418  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
419  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
420  };
421 
422  //*****************************************************************************
423  //*****************************************************************************
424 
425  class EventEntry {
426  public:
429 
430  EventNumber_t event() const {return event_;}
431  EntryNumber_t entry() const {return entry_;}
432 
433  bool operator<(EventEntry const& right) const {
434  return event() < right.event();
435  }
436 
437  bool operator==(EventEntry const& right) const {
438  return event() == right.event();
439  }
440 
441  private:
444  };
445 
446 
447  //*****************************************************************************
448  //*****************************************************************************
449 
451 
452  public:
454 
455  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
456  unsigned runOrLumi() const {return runOrLumi_;}
457 
458  bool operator==(SortedRunOrLumiItr const& right) const;
459  bool operator!=(SortedRunOrLumiItr const& right) const;
461 
462  bool isRun();
463 
464  void getRange(long long& beginEventNumbers,
465  long long& endEventNumbers,
466  EntryNumber_t& beginEventEntry,
467  EntryNumber_t& endEventEntry);
468 
469  RunOrLumiIndexes const& runOrLumiIndexes() const;
470 
471  private:
472 
474 
475  // This is an index into runOrLumiIndexes_
476  // which gives the current position of the iteration
477  unsigned runOrLumi_;
478  };
479 
480 
481  //*****************************************************************************
482  //*****************************************************************************
483 
485 
486  public:
488  EntryType entryType,
489  int indexToRun,
490  int indexToLumi,
491  int indexToEventRange,
492  long long indexToEvent,
493  long long nEvents);
494  virtual ~IndexIntoFileItrImpl();
495 
496  virtual IndexIntoFileItrImpl* clone() const = 0;
497 
498  EntryType getEntryType() const {return type_;}
499 
500  void next ();
501 
502  void skipEventForward(int& phIndexOfSkippedEvent,
503  RunNumber_t& runOfSkippedEvent,
504  LuminosityBlockNumber_t& lumiOfSkippedEvent,
505  EntryNumber_t& skippedEventEntry);
506 
507  void skipEventBackward(int& phIndexOfEvent,
508  RunNumber_t& runOfEvent,
509  LuminosityBlockNumber_t& lumiOfEvent,
510  EntryNumber_t& eventEntry);
511 
512  virtual int processHistoryIDIndex() const = 0;
513  virtual RunNumber_t run() const = 0;
514  virtual LuminosityBlockNumber_t lumi() const = 0;
515  virtual EntryNumber_t entry() const = 0;
516  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
517  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
520  virtual bool skipLumiInRun() = 0;
521 
522  void advanceToNextRun();
523  void advanceToNextLumiOrRun();
524  bool skipToNextEventInLumi();
525  void initializeRun();
526 
528 
529  bool operator==(IndexIntoFileItrImpl const& right) const;
530 
531  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
532  int size() const { return size_; }
533 
534  EntryType type() const { return type_; }
535  int indexToRun() const { return indexToRun_; }
536 
537  int indexToLumi() const { return indexToLumi_; }
538  int indexToEventRange() const { return indexToEventRange_; }
539  long long indexToEvent() const { return indexToEvent_; }
540  long long nEvents() const { return nEvents_; }
541 
543 
544  protected:
545 
546  void setInvalid();
547 
550  void setIndexToEvent(long long value) { indexToEvent_ = value; }
551  void setNEvents(long long value) { nEvents_ = value; }
552 
553  private:
554 
555  virtual void initializeLumi_() = 0;
556  virtual bool nextEventRange() = 0;
557  virtual bool previousEventRange() = 0;
558  bool previousLumiWithEvents();
559  virtual bool setToLastEventInRange(int index) = 0;
560  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
561  virtual bool isSameLumi(int index1, int index2) const = 0;
562  virtual bool isSameRun(int index1, int index2) const = 0;
563 
565  int size_;
566 
571  long long indexToEvent_;
572  long long nEvents_;
573  };
574 
575  //*****************************************************************************
576  //*****************************************************************************
577 
579  public:
581  EntryType entryType,
582  int indexToRun,
583  int indexToLumi,
584  int indexToEventRange,
585  long long indexToEvent,
586  long long nEvents);
587 
588  virtual IndexIntoFileItrImpl* clone() const;
589 
590  virtual int processHistoryIDIndex() const;
591  virtual RunNumber_t run() const;
592  virtual LuminosityBlockNumber_t lumi() const;
593  virtual EntryNumber_t entry() const;
595  virtual EntryNumber_t peekAheadAtEventEntry() const;
596  virtual bool skipLumiInRun();
597 
598  private:
599 
600  virtual void initializeLumi_();
601  virtual bool nextEventRange();
602  virtual bool previousEventRange();
603  virtual bool setToLastEventInRange(int index);
604  virtual EntryType getRunOrLumiEntryType(int index) const;
605  virtual bool isSameLumi(int index1, int index2) const;
606  virtual bool isSameRun(int index1, int index2) const;
607  };
608 
609  //*****************************************************************************
610  //*****************************************************************************
611 
613  public:
615  EntryType entryType,
616  int indexToRun,
617  int indexToLumi,
618  int indexToEventRange,
619  long long indexToEvent,
620  long long nEvents);
621 
622  virtual IndexIntoFileItrImpl* clone() const;
623  virtual int processHistoryIDIndex() const;
624  virtual RunNumber_t run() const;
625  virtual LuminosityBlockNumber_t lumi() const;
626  virtual EntryNumber_t entry() const;
628  virtual EntryNumber_t peekAheadAtEventEntry() const;
629  virtual bool skipLumiInRun();
630 
631  private:
632 
633  virtual void initializeLumi_();
634  virtual bool nextEventRange();
635  virtual bool previousEventRange();
636  virtual bool setToLastEventInRange(int index);
637  virtual EntryType getRunOrLumiEntryType(int index) const;
638  virtual bool isSameLumi(int index1, int index2) const;
639  virtual bool isSameRun(int index1, int index2) const;
640  };
641 
642  //*****************************************************************************
643  //*****************************************************************************
644 
646  public:
656  SortOrder sortOrder,
657  EntryType entryType,
658  int indexToRun,
659  int indexToLumi,
660  int indexToEventRange,
661  long long indexToEvent,
662  long long nEvents);
663 
664 
665  EntryType getEntryType() const {return impl_->getEntryType();}
666  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
667  RunNumber_t run() const {return impl_->run();}
668  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
669  EntryNumber_t entry() const {return impl_->entry();}
670 
673  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
674 
679  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
680 
684  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
685  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
686 
687  // This is intentionally not implemented.
688  // It would be difficult to implement for the no sort mode,
689  // either slow or using extra memory.
690  // It would be easy to implement for the sorted iteration,
691  // but I did not implement it so both cases would offer a
692  // consistent interface.
693  // It looks like in all cases where this would be needed
694  // it would not be difficult to get the event number
695  // directly from the event auxiliary.
696  // We may need to revisit this decision in the future.
697  // EventNumber_t event() const;
698 
699 
702  impl_->next();
703  return *this;
704  }
705 
711  void skipEventForward(int& phIndexOfSkippedEvent,
712  RunNumber_t& runOfSkippedEvent,
713  LuminosityBlockNumber_t& lumiOfSkippedEvent,
714  EntryNumber_t& skippedEventEntry) {
715  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
716  }
717 
725  void skipEventBackward(int& phIndexOfEvent,
726  RunNumber_t& runOfEvent,
727  LuminosityBlockNumber_t& lumiOfEvent,
728  EntryNumber_t& eventEntry) {
729  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
730  }
731 
734  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
735 
738  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
739 
740  void advanceToNextRun() {impl_->advanceToNextRun();}
741  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
742 
743  void advanceToEvent();
744  void advanceToLumi();
745 
746  bool operator==(IndexIntoFileItr const& right) const {
747  return *impl_ == *right.impl_;
748  }
749 
750  bool operator!=(IndexIntoFileItr const& right) const {
751  return !(*this == right);
752  }
753 
755  void initializeRun() {impl_->initializeRun();}
756 
758  void initializeLumi() {impl_->initializeLumi();}
759 
762 
763  private:
764 
765  // The rest of these are intended to be used only by code which tests
766  // this class.
767  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
768  int size() const { return impl_->size(); }
769  EntryType type() const { return impl_->type(); }
770  int indexToRun() const { return impl_->indexToRun(); }
771  int indexToLumi() const { return impl_->indexToLumi(); }
772  int indexToEventRange() const { return impl_->indexToEventRange(); }
773  long long indexToEvent() const { return impl_->indexToEvent(); }
774  long long nEvents() const { return impl_->nEvents(); }
775 
777  };
778 
779  //*****************************************************************************
780  //*****************************************************************************
781 
782  class IndexRunKey {
783  public:
785  processHistoryIDIndex_(index),
786  run_(run) {
787  }
788 
790  RunNumber_t run() const {return run_;}
791 
792  bool operator<(IndexRunKey const& right) const {
794  return run_ < right.run();
795  }
797  }
798 
799  private:
802  };
803 
804  //*****************************************************************************
805  //*****************************************************************************
806 
808  public:
810  processHistoryIDIndex_(index),
811  run_(run),
812  lumi_(lumi) {
813  }
814 
816  RunNumber_t run() const {return run_;}
818 
819  bool operator<(IndexRunLumiKey const& right) const {
821  if (run_ == right.run()) {
822  return lumi_ < right.lumi();
823  }
824  return run_ < right.run();
825  }
827  }
828 
829  private:
833  };
834 
835  //*****************************************************************************
836  //*****************************************************************************
837 
839  public:
841  processHistoryIDIndex_(index),
842  run_(run),
843  lumi_(lumi),
844  event_(event) {
845  }
846 
848  RunNumber_t run() const {return run_;}
850  EventNumber_t event() const {return event_;}
851 
852  bool operator<(IndexRunLumiEventKey const& right) const {
854  if (run_ == right.run()) {
855  if (lumi_ == right.lumi()) {
856  return event_ < right.event();
857  }
858  return lumi_ < right.lumi();
859  }
860  return run_ < right.run();
861  }
863  }
864 
865  private:
870  };
871 
872  //*****************************************************************************
873  //*****************************************************************************
874 
875  class EventFinder {
876  public:
877  virtual ~EventFinder() {}
878  virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const = 0;
879  };
880 
881  //*****************************************************************************
882  //*****************************************************************************
883 
884  // The next two functions are used by the output module to fill the
885  // persistent data members.
886 
893  EntryNumber_t entry);
894 
900 
901  //*****************************************************************************
902  //*****************************************************************************
903 
904  // The next group of functions is used by the PoolSource (or other
905  // input related code) to fill the IndexIntoFile.
906 
912  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
913 
918  }
919 
925  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
926 
940  void fillEventNumbers() const;
941 
955  void fillEventEntries() const;
956 
962  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
963 
967  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
968 
971  void inputFileClosed() const;
972 
974  void doneFileInitialization() const;
975 
979  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
980 
984  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
985 
989  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
990 
991  //*****************************************************************************
992  //*****************************************************************************
993 
995  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
996 
997  //*****************************************************************************
998  //*****************************************************************************
999 
1001 
1002  struct Transients {
1003  Transients();
1004  void reset();
1006  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1007  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1014  std::shared_ptr<EventFinder> eventFinder_;
1015  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1016  std::vector<EventNumber_t> eventNumbers_;
1017  std::vector<EventEntry> eventEntries_;
1018  std::vector<EventNumber_t> unsortedEventNumbers_;
1019  };
1020 
1021  private:
1022 
1025  void fillRunOrLumiIndexes() const;
1026 
1027  void fillUnsortedEventNumbers() const;
1028  void resetEventFinder() const {transient_.eventFinder_.reset();}
1029  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1030  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1031  void sortEvents() const;
1032  void sortEventEntries() const;
1034  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1035  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1038  int& currentIndex() const {return transient_.currentIndex_;}
1041  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1042  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1044  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1045  }
1046 
1048 
1049  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1050  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1051  };
1052 
1053  template <>
1054  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1056  };
1057 
1058 
1060  public:
1062  };
1063 
1065  public:
1067  };
1068 }
1069 
1070 #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_
unsigned int EventNumber_t
Definition: EventRange.h:30
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
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:19
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
std::shared_ptr< EventFinder > eventFinder_
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 int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
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.
int nevents
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
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_
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
Definition: EventRange.h:32
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)
RunOrLumiIndexes const & runOrLumiIndexes() const