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 
170 
171 #include <memory>
172 
173 #include <cassert>
174 #include <iosfwd>
175 #include <map>
176 #include <set>
177 #include <vector>
178 
179 class TestIndexIntoFile;
180 class TestIndexIntoFile1;
181 class TestIndexIntoFile2;
182 class TestIndexIntoFile3;
183 class TestIndexIntoFile4;
184 class TestIndexIntoFile5;
185 
186 namespace edm {
187 
188  class ProcessHistoryRegistry;
189  class RootFile;
190 
192  public:
193  class IndexIntoFileItr;
194  class SortedRunOrLumiItr;
196 
197  typedef long long EntryNumber_t;
198  static int const invalidIndex = -1;
199  static RunNumber_t const invalidRun = 0U;
201  static EventNumber_t const invalidEvent = 0U;
202  static EntryNumber_t const invalidEntry = -1LL;
203 
205 
206  IndexIntoFile();
207  ~IndexIntoFile();
208 
209  ProcessHistoryID const& processHistoryID(int i) const;
210  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
211 
233 
236  IndexIntoFileItr begin(SortOrder sortOrder) const;
237 
239  IndexIntoFileItr end(SortOrder sortOrder) const;
240 
242  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
243 
245  bool empty() const;
246 
268  IndexIntoFileItr
270 
271  IndexIntoFileItr
273 
276  IndexIntoFileItr
278 
281  IndexIntoFileItr
283 
285  IndexIntoFileItr
287 
291  bool containsRun(RunNumber_t run) const;
292 
293  SortedRunOrLumiItr beginRunOrLumi() const;
294  SortedRunOrLumiItr endRunOrLumi() const;
295 
298  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
299 
301  bool containsDuplicateEvents() const;
302 
303  //*****************************************************************************
304  //*****************************************************************************
305 
307  public:
308 
309  RunOrLumiEntry();
310 
319 
322  EntryNumber_t entry() const {return entry_;}
324  RunNumber_t run() const {return run_;}
328 
329  bool isRun() const {return lumi() == invalidLumi;}
330 
334 
335  bool operator<(RunOrLumiEntry const& right) const {
336  if (orderPHIDRun_ == right.orderPHIDRun()) {
337  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
338  return entry_ < right.entry();
339  }
340  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
341  }
342  return orderPHIDRun_ < right.orderPHIDRun();
343  }
344 
345  private:
346 
347  // All Runs, Lumis, and Events associated with the same
348  // ProcessHistory and Run in the same input file are processed
349  // contiguously. This parameter establishes the default order
350  // of processing of these contiguous subsets of data.
352 
353  // All Lumis and Events associated with the same
354  // ProcessHistory, Run, and Lumi in the same input file are
355  // processed contiguously. This parameter establishes the
356  // default order of processing of these contiguous subsets
357  // of data which have the same ProcessHistory and Run.
359 
360  // TTree entry number of Run or Lumi
362 
365  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
366 
367  // These are entry numbers in the Events TTree
368  // Each RunOrLumiEntry is associated with one contiguous range of events.
369  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
370  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
371  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
372  };
373 
374  //*****************************************************************************
375  //*****************************************************************************
376 
378  public:
380 
382  RunNumber_t run() const {return run_;}
384  int indexToGetEntry() const {return indexToGetEntry_;}
385  long long beginEventNumbers() const {return beginEventNumbers_;}
386  long long endEventNumbers() const {return endEventNumbers_;}
387 
388  bool isRun() const {return lumi() == invalidLumi;}
389 
391  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
392 
393  bool operator<(RunOrLumiIndexes const& right) const {
395  if (run_ == right.run()) {
396  return lumi_ < right.lumi();
397  }
398  return run_ < right.run();
399  }
401  }
402 
403  private:
404 
407  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
409 
410  // The next two data members are indexes into the vectors eventNumbers_ and
411  // eventEntries_ (which both have the same number of entries in the same order,
412  // the only difference being that one contains only events numbers and is
413  // smaller in memory).
414 
415  // If there are no events, then the next two are equal (and the value is the
416  // index where the first event would have gone if there had been one)
417 
418  // Note that there can be many RunOrLumiIndexes objects where these two values are
419  // the same if there are many noncontiguous ranges of events associated with the same
420  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
421  // all the noncontiguous ranges in the Events TTree).
422  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
423  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
424  };
425 
426  //*****************************************************************************
427  //*****************************************************************************
428 
429  class EventEntry {
430  public:
433 
434  EventNumber_t event() const {return event_;}
435  EntryNumber_t entry() const {return entry_;}
436 
437  bool operator<(EventEntry const& right) const {
438  return event() < right.event();
439  }
440 
441  bool operator==(EventEntry const& right) const {
442  return event() == right.event();
443  }
444 
445  private:
448  };
449 
450 
451  //*****************************************************************************
452  //*****************************************************************************
453 
455 
456  public:
458 
459  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
460  unsigned runOrLumi() const {return runOrLumi_;}
461 
462  bool operator==(SortedRunOrLumiItr const& right) const;
463  bool operator!=(SortedRunOrLumiItr const& right) const;
465 
466  bool isRun();
467 
468  void getRange(long long& beginEventNumbers,
469  long long& endEventNumbers,
470  EntryNumber_t& beginEventEntry,
471  EntryNumber_t& endEventEntry);
472 
473  RunOrLumiIndexes const& runOrLumiIndexes() const;
474 
475  private:
476 
478 
479  // This is an index into runOrLumiIndexes_
480  // which gives the current position of the iteration
481  unsigned runOrLumi_;
482  };
483 
484 
485  //*****************************************************************************
486  //*****************************************************************************
487 
489 
490  public:
492  EntryType entryType,
493  int indexToRun,
494  int indexToLumi,
495  int indexToEventRange,
496  long long indexToEvent,
497  long long nEvents);
498  virtual ~IndexIntoFileItrImpl();
499 
500  virtual IndexIntoFileItrImpl* clone() const = 0;
501 
502  EntryType getEntryType() const {return type_;}
503 
504  void next ();
505 
506  void skipEventForward(int& phIndexOfSkippedEvent,
507  RunNumber_t& runOfSkippedEvent,
508  LuminosityBlockNumber_t& lumiOfSkippedEvent,
509  EntryNumber_t& skippedEventEntry);
510 
511  void skipEventBackward(int& phIndexOfEvent,
512  RunNumber_t& runOfEvent,
513  LuminosityBlockNumber_t& lumiOfEvent,
514  EntryNumber_t& eventEntry);
515 
516  virtual int processHistoryIDIndex() const = 0;
517  virtual RunNumber_t run() const = 0;
518  virtual LuminosityBlockNumber_t lumi() const = 0;
519  virtual EntryNumber_t entry() const = 0;
520  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
521  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
524  virtual bool skipLumiInRun() = 0;
525 
526  void advanceToNextRun();
527  void advanceToNextLumiOrRun();
528  bool skipToNextEventInLumi();
529  void initializeRun();
530 
532 
533  bool operator==(IndexIntoFileItrImpl const& right) const;
534 
535  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
536  int size() const { return size_; }
537 
538  EntryType type() const { return type_; }
539  int indexToRun() const { return indexToRun_; }
540 
541  int indexToLumi() const { return indexToLumi_; }
542  int indexToEventRange() const { return indexToEventRange_; }
543  long long indexToEvent() const { return indexToEvent_; }
544  long long nEvents() const { return nEvents_; }
545 
547 
548  protected:
549 
550  void setInvalid();
551 
554  void setIndexToEvent(long long value) { indexToEvent_ = value; }
555  void setNEvents(long long value) { nEvents_ = value; }
556 
557  private:
558 
559  virtual void initializeLumi_() = 0;
560  virtual bool nextEventRange() = 0;
561  virtual bool previousEventRange() = 0;
562  bool previousLumiWithEvents();
563  virtual bool setToLastEventInRange(int index) = 0;
564  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
565  virtual bool isSameLumi(int index1, int index2) const = 0;
566  virtual bool isSameRun(int index1, int index2) const = 0;
567 
569  int size_;
570 
575  long long indexToEvent_;
576  long long nEvents_;
577  };
578 
579  //*****************************************************************************
580  //*****************************************************************************
581 
583  public:
585  EntryType entryType,
586  int indexToRun,
587  int indexToLumi,
588  int indexToEventRange,
589  long long indexToEvent,
590  long long nEvents);
591 
592  virtual IndexIntoFileItrImpl* clone() const;
593 
594  virtual int processHistoryIDIndex() const;
595  virtual RunNumber_t run() const;
596  virtual LuminosityBlockNumber_t lumi() const;
597  virtual EntryNumber_t entry() const;
599  virtual EntryNumber_t peekAheadAtEventEntry() const;
600  virtual bool skipLumiInRun();
601 
602  private:
603 
604  virtual void initializeLumi_();
605  virtual bool nextEventRange();
606  virtual bool previousEventRange();
607  virtual bool setToLastEventInRange(int index);
608  virtual EntryType getRunOrLumiEntryType(int index) const;
609  virtual bool isSameLumi(int index1, int index2) const;
610  virtual bool isSameRun(int index1, int index2) const;
611  };
612 
613  //*****************************************************************************
614  //*****************************************************************************
615 
617  public:
619  EntryType entryType,
620  int indexToRun,
621  int indexToLumi,
622  int indexToEventRange,
623  long long indexToEvent,
624  long long nEvents);
625 
626  virtual IndexIntoFileItrImpl* clone() const;
627  virtual int processHistoryIDIndex() const;
628  virtual RunNumber_t run() const;
629  virtual LuminosityBlockNumber_t lumi() const;
630  virtual EntryNumber_t entry() const;
632  virtual EntryNumber_t peekAheadAtEventEntry() const;
633  virtual bool skipLumiInRun();
634 
635  private:
636 
637  virtual void initializeLumi_();
638  virtual bool nextEventRange();
639  virtual bool previousEventRange();
640  virtual bool setToLastEventInRange(int index);
641  virtual EntryType getRunOrLumiEntryType(int index) const;
642  virtual bool isSameLumi(int index1, int index2) const;
643  virtual bool isSameRun(int index1, int index2) const;
644  };
645 
646  //*****************************************************************************
647  //*****************************************************************************
648 
650  public:
660  SortOrder sortOrder,
661  EntryType entryType,
662  int indexToRun,
663  int indexToLumi,
664  int indexToEventRange,
665  long long indexToEvent,
666  long long nEvents);
667 
668 
669  EntryType getEntryType() const {return impl_->getEntryType();}
670  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
671  RunNumber_t run() const {return impl_->run();}
672  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
673  EntryNumber_t entry() const {return impl_->entry();}
674 
677  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
678 
683  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
684 
688  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
689  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
690 
691  // This is intentionally not implemented.
692  // It would be difficult to implement for the no sort mode,
693  // either slow or using extra memory.
694  // It would be easy to implement for the sorted iteration,
695  // but I did not implement it so both cases would offer a
696  // consistent interface.
697  // It looks like in all cases where this would be needed
698  // it would not be difficult to get the event number
699  // directly from the event auxiliary.
700  // We may need to revisit this decision in the future.
701  // EventNumber_t event() const;
702 
703 
706  impl_->next();
707  return *this;
708  }
709 
715  void skipEventForward(int& phIndexOfSkippedEvent,
716  RunNumber_t& runOfSkippedEvent,
717  LuminosityBlockNumber_t& lumiOfSkippedEvent,
718  EntryNumber_t& skippedEventEntry) {
719  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
720  }
721 
729  void skipEventBackward(int& phIndexOfEvent,
730  RunNumber_t& runOfEvent,
731  LuminosityBlockNumber_t& lumiOfEvent,
732  EntryNumber_t& eventEntry) {
733  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
734  }
735 
738  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
739 
742  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
743 
744  void advanceToNextRun() {impl_->advanceToNextRun();}
745  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
746 
747  void advanceToEvent();
748  void advanceToLumi();
749 
750  bool operator==(IndexIntoFileItr const& right) const {
751  return *impl_ == *right.impl_;
752  }
753 
754  bool operator!=(IndexIntoFileItr const& right) const {
755  return !(*this == right);
756  }
757 
759  void initializeRun() {impl_->initializeRun();}
760 
762  void initializeLumi() {impl_->initializeLumi();}
763 
766 
767  private:
768  //for testing
769  friend class ::TestIndexIntoFile;
770  friend class ::TestIndexIntoFile3;
771  friend class ::TestIndexIntoFile4;
772  friend class ::TestIndexIntoFile5;
773 
774  // The rest of these are intended to be used only by code which tests
775  // this class.
776  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
777  int size() const { return impl_->size(); }
778  EntryType type() const { return impl_->type(); }
779  int indexToRun() const { return impl_->indexToRun(); }
780  int indexToLumi() const { return impl_->indexToLumi(); }
781  int indexToEventRange() const { return impl_->indexToEventRange(); }
782  long long indexToEvent() const { return impl_->indexToEvent(); }
783  long long nEvents() const { return impl_->nEvents(); }
784 
786  };
787 
788  //*****************************************************************************
789  //*****************************************************************************
790 
791  class IndexRunKey {
792  public:
794  processHistoryIDIndex_(index),
795  run_(run) {
796  }
797 
799  RunNumber_t run() const {return run_;}
800 
801  bool operator<(IndexRunKey const& right) const {
803  return run_ < right.run();
804  }
806  }
807 
808  private:
811  };
812 
813  //*****************************************************************************
814  //*****************************************************************************
815 
817  public:
819  processHistoryIDIndex_(index),
820  run_(run),
821  lumi_(lumi) {
822  }
823 
825  RunNumber_t run() const {return run_;}
827 
828  bool operator<(IndexRunLumiKey const& right) const {
830  if (run_ == right.run()) {
831  return lumi_ < right.lumi();
832  }
833  return run_ < right.run();
834  }
836  }
837 
838  private:
842  };
843 
844  //*****************************************************************************
845  //*****************************************************************************
846 
848  public:
850  processHistoryIDIndex_(index),
851  run_(run),
852  lumi_(lumi),
853  event_(event) {
854  }
855 
857  RunNumber_t run() const {return run_;}
859  EventNumber_t event() const {return event_;}
860 
861  bool operator<(IndexRunLumiEventKey const& right) const {
863  if (run_ == right.run()) {
864  if (lumi_ == right.lumi()) {
865  return event_ < right.event();
866  }
867  return lumi_ < right.lumi();
868  }
869  return run_ < right.run();
870  }
872  }
873 
874  private:
879  };
880 
881  //*****************************************************************************
882  //*****************************************************************************
883 
884  class EventFinder {
885  public:
886  virtual ~EventFinder() {}
887  virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const = 0;
888  };
889 
890  //*****************************************************************************
891  //*****************************************************************************
892 
893  // The next two functions are used by the output module to fill the
894  // persistent data members.
895 
902  EntryNumber_t entry);
903 
909 
910  //*****************************************************************************
911  //*****************************************************************************
912 
913  // The next group of functions is used by the PoolSource (or other
914  // input related code) to fill the IndexIntoFile.
915 
921  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
922 
927  }
928 
934  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
935 
949  void fillEventNumbers() const;
950 
964  void fillEventEntries() const;
965 
971  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
972 
976  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
977 
980  void inputFileClosed() const;
981 
983  void doneFileInitialization() const;
984 
988  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
989 
993  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
994 
998  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
999 
1000  //*****************************************************************************
1001  //*****************************************************************************
1002 
1004  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
1005 
1006  //*****************************************************************************
1007  //*****************************************************************************
1008 
1010 
1011  struct Transients {
1012  Transients();
1013  void reset();
1015  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1016  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1023  std::shared_ptr<EventFinder> eventFinder_;
1024  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1025  std::vector<EventNumber_t> eventNumbers_;
1026  std::vector<EventEntry> eventEntries_;
1027  std::vector<EventNumber_t> unsortedEventNumbers_;
1028  };
1029 
1030  private:
1031 
1032  //for testing
1033  friend class ::TestIndexIntoFile;
1034  friend class ::TestIndexIntoFile1;
1035  friend class ::TestIndexIntoFile2;
1036  friend class ::TestIndexIntoFile3;
1037  friend class ::TestIndexIntoFile4;
1038  friend class ::TestIndexIntoFile5;
1039 
1042  void fillRunOrLumiIndexes() const;
1043 
1044  void fillUnsortedEventNumbers() const;
1045  void resetEventFinder() const {transient_.eventFinder_.reset();}
1046  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1047  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1048  void sortEvents() const;
1049  void sortEventEntries() const;
1051  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1052  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1055  int& currentIndex() const {return transient_.currentIndex_;}
1058  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1059  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1061  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1062  }
1063 
1065 
1066  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1067  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1068  };
1069 
1070  template <>
1071  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1073  };
1074 
1075 
1077  public:
1079  };
1080 
1082  public:
1084  };
1085 }
1086 
1087 #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
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 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
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)
RunOrLumiIndexes const & runOrLumiIndexes() const