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 namespace edm {
180 
181  class ProcessHistoryRegistry;
182  class RootFile;
183 
185  public:
186  class IndexIntoFileItr;
187  class SortedRunOrLumiItr;
189 
190  typedef long long EntryNumber_t;
191  static int const invalidIndex = -1;
192  static RunNumber_t const invalidRun = 0U;
194  static EventNumber_t const invalidEvent = 0U;
195  static EntryNumber_t const invalidEntry = -1LL;
196 
198 
199  IndexIntoFile();
200  ~IndexIntoFile();
201 
202  ProcessHistoryID const& processHistoryID(int i) const;
203  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
204 
226 
229  IndexIntoFileItr begin(SortOrder sortOrder) const;
230 
232  IndexIntoFileItr end(SortOrder sortOrder) const;
233 
235  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
236 
238  bool empty() const;
239 
261  IndexIntoFileItr
263 
264  IndexIntoFileItr
266 
269  IndexIntoFileItr
271 
274  IndexIntoFileItr
276 
278  IndexIntoFileItr
280 
284  bool containsRun(RunNumber_t run) const;
285 
286  SortedRunOrLumiItr beginRunOrLumi() const;
287  SortedRunOrLumiItr endRunOrLumi() const;
288 
291  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
292 
294  bool containsDuplicateEvents() const;
295 
296  //*****************************************************************************
297  //*****************************************************************************
298 
300  public:
301 
302  RunOrLumiEntry();
303 
312 
315  EntryNumber_t entry() const {return entry_;}
317  RunNumber_t run() const {return run_;}
321 
322  bool isRun() const {return lumi() == invalidLumi;}
323 
327 
328  bool operator<(RunOrLumiEntry const& right) const {
329  if (orderPHIDRun_ == right.orderPHIDRun()) {
330  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
331  return entry_ < right.entry();
332  }
333  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
334  }
335  return orderPHIDRun_ < right.orderPHIDRun();
336  }
337 
338  private:
339  // All Runs, Lumis, and Events associated with the same
340  // ProcessHistory and Run in the same input file are processed
341  // contiguously. This parameter establishes the default order
342  // of processing of these contiguous subsets of data.
344 
345  // All Lumis and Events associated with the same
346  // ProcessHistory, Run, and Lumi in the same input file are
347  // processed contiguously. This parameter establishes the
348  // default order of processing of these contiguous subsets
349  // of data which have the same ProcessHistory and Run.
351 
352  // TTree entry number of Run or Lumi
354 
357  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
358 
359  // These are entry numbers in the Events TTree
360  // Each RunOrLumiEntry is associated with one contiguous range of events.
361  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
362  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
363  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
364  };
365 
366  //*****************************************************************************
367  //*****************************************************************************
368 
370  public:
372 
374  RunNumber_t run() const {return run_;}
376  int indexToGetEntry() const {return indexToGetEntry_;}
377  long long beginEventNumbers() const {return beginEventNumbers_;}
378  long long endEventNumbers() const {return endEventNumbers_;}
379 
380  bool isRun() const {return lumi() == invalidLumi;}
381 
383  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
384 
385  bool operator<(RunOrLumiIndexes const& right) const {
387  if (run_ == right.run()) {
388  return lumi_ < right.lumi();
389  }
390  return run_ < right.run();
391  }
393  }
394 
395  private:
396 
399  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
401 
402  // The next two data members are indexes into the vectors eventNumbers_ and
403  // eventEntries_ (which both have the same number of entries in the same order,
404  // the only difference being that one contains only events numbers and is
405  // smaller in memory).
406 
407  // If there are no events, then the next two are equal (and the value is the
408  // index where the first event would have gone if there had been one)
409 
410  // Note that there can be many RunOrLumiIndexes objects where these two values are
411  // the same if there are many noncontiguous ranges of events associated with the same
412  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
413  // all the noncontiguous ranges in the Events TTree).
414  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
415  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
416  };
417 
418  //*****************************************************************************
419  //*****************************************************************************
420 
421  class EventEntry {
422  public:
425 
426  EventNumber_t event() const {return event_;}
427  EntryNumber_t entry() const {return entry_;}
428 
429  bool operator<(EventEntry const& right) const {
430  return event() < right.event();
431  }
432 
433  bool operator==(EventEntry const& right) const {
434  return event() == right.event();
435  }
436 
437  private:
440  };
441 
442 
443  //*****************************************************************************
444  //*****************************************************************************
445 
447 
448  public:
450 
451  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
452  unsigned runOrLumi() const {return runOrLumi_;}
453 
454  bool operator==(SortedRunOrLumiItr const& right) const;
455  bool operator!=(SortedRunOrLumiItr const& right) const;
457 
458  bool isRun();
459 
460  void getRange(long long& beginEventNumbers,
461  long long& endEventNumbers,
462  EntryNumber_t& beginEventEntry,
463  EntryNumber_t& endEventEntry);
464 
465  RunOrLumiIndexes const& runOrLumiIndexes() const;
466 
467  private:
468 
470 
471  // This is an index into runOrLumiIndexes_
472  // which gives the current position of the iteration
473  unsigned runOrLumi_;
474  };
475 
476 
477  //*****************************************************************************
478  //*****************************************************************************
479 
481 
482  public:
484  EntryType entryType,
485  int indexToRun,
486  int indexToLumi,
487  int indexToEventRange,
488  long long indexToEvent,
489  long long nEvents);
490  virtual ~IndexIntoFileItrImpl();
491 
492  virtual IndexIntoFileItrImpl* clone() const = 0;
493 
494  EntryType getEntryType() const {return type_;}
495 
496  void next ();
497 
498  void skipEventForward(int& phIndexOfSkippedEvent,
499  RunNumber_t& runOfSkippedEvent,
500  LuminosityBlockNumber_t& lumiOfSkippedEvent,
501  EntryNumber_t& skippedEventEntry);
502 
503  void skipEventBackward(int& phIndexOfEvent,
504  RunNumber_t& runOfEvent,
505  LuminosityBlockNumber_t& lumiOfEvent,
506  EntryNumber_t& eventEntry);
507 
508  virtual int processHistoryIDIndex() const = 0;
509  virtual RunNumber_t run() const = 0;
510  virtual LuminosityBlockNumber_t lumi() const = 0;
511  virtual EntryNumber_t entry() const = 0;
512  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
513  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
516  virtual bool skipLumiInRun() = 0;
517 
518  void advanceToNextRun();
519  void advanceToNextLumiOrRun();
520  bool skipToNextEventInLumi();
521  void initializeRun();
522 
524 
525  bool operator==(IndexIntoFileItrImpl const& right) const;
526 
527  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
528  int size() const { return size_; }
529 
530  EntryType type() const { return type_; }
531  int indexToRun() const { return indexToRun_; }
532 
533  int indexToLumi() const { return indexToLumi_; }
534  int indexToEventRange() const { return indexToEventRange_; }
535  long long indexToEvent() const { return indexToEvent_; }
536  long long nEvents() const { return nEvents_; }
537 
539 
540  protected:
541 
542  void setInvalid();
543 
546  void setIndexToEvent(long long value) { indexToEvent_ = value; }
547  void setNEvents(long long value) { nEvents_ = value; }
548 
549  private:
550 
551  virtual void initializeLumi_() = 0;
552  virtual bool nextEventRange() = 0;
553  virtual bool previousEventRange() = 0;
554  bool previousLumiWithEvents();
555  virtual bool setToLastEventInRange(int index) = 0;
556  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
557  virtual bool isSameLumi(int index1, int index2) const = 0;
558  virtual bool isSameRun(int index1, int index2) const = 0;
559 
561  int size_;
562 
567  long long indexToEvent_;
568  long long nEvents_;
569  };
570 
571  //*****************************************************************************
572  //*****************************************************************************
573 
575  public:
577  EntryType entryType,
578  int indexToRun,
579  int indexToLumi,
580  int indexToEventRange,
581  long long indexToEvent,
582  long long nEvents);
583 
584  virtual IndexIntoFileItrImpl* clone() const;
585 
586  virtual int processHistoryIDIndex() const;
587  virtual RunNumber_t run() const;
588  virtual LuminosityBlockNumber_t lumi() const;
589  virtual EntryNumber_t entry() const;
591  virtual EntryNumber_t peekAheadAtEventEntry() const;
592  virtual bool skipLumiInRun();
593 
594  private:
595 
596  virtual void initializeLumi_();
597  virtual bool nextEventRange();
598  virtual bool previousEventRange();
599  virtual bool setToLastEventInRange(int index);
600  virtual EntryType getRunOrLumiEntryType(int index) const;
601  virtual bool isSameLumi(int index1, int index2) const;
602  virtual bool isSameRun(int index1, int index2) const;
603  };
604 
605  //*****************************************************************************
606  //*****************************************************************************
607 
609  public:
611  EntryType entryType,
612  int indexToRun,
613  int indexToLumi,
614  int indexToEventRange,
615  long long indexToEvent,
616  long long nEvents);
617 
618  virtual IndexIntoFileItrImpl* clone() const;
619  virtual int processHistoryIDIndex() const;
620  virtual RunNumber_t run() const;
621  virtual LuminosityBlockNumber_t lumi() const;
622  virtual EntryNumber_t entry() const;
624  virtual EntryNumber_t peekAheadAtEventEntry() const;
625  virtual bool skipLumiInRun();
626 
627  private:
628 
629  virtual void initializeLumi_();
630  virtual bool nextEventRange();
631  virtual bool previousEventRange();
632  virtual bool setToLastEventInRange(int index);
633  virtual EntryType getRunOrLumiEntryType(int index) const;
634  virtual bool isSameLumi(int index1, int index2) const;
635  virtual bool isSameRun(int index1, int index2) const;
636  };
637 
638  //*****************************************************************************
639  //*****************************************************************************
640 
642  public:
652  SortOrder sortOrder,
653  EntryType entryType,
654  int indexToRun,
655  int indexToLumi,
656  int indexToEventRange,
657  long long indexToEvent,
658  long long nEvents);
659 
660 
661  EntryType getEntryType() const {return impl_->getEntryType();}
662  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
663  RunNumber_t run() const {return impl_->run();}
664  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
665  EntryNumber_t entry() const {return impl_->entry();}
666 
669  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
670 
675  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
676 
680  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
681  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
682 
683  // This is intentionally not implemented.
684  // It would be difficult to implement for the no sort mode,
685  // either slow or using extra memory.
686  // It would be easy to implement for the sorted iteration,
687  // but I did not implement it so both cases would offer a
688  // consistent interface.
689  // It looks like in all cases where this would be needed
690  // it would not be difficult to get the event number
691  // directly from the event auxiliary.
692  // We may need to revisit this decision in the future.
693  // EventNumber_t event() const;
694 
695 
698  impl_->next();
699  return *this;
700  }
701 
707  void skipEventForward(int& phIndexOfSkippedEvent,
708  RunNumber_t& runOfSkippedEvent,
709  LuminosityBlockNumber_t& lumiOfSkippedEvent,
710  EntryNumber_t& skippedEventEntry) {
711  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
712  }
713 
721  void skipEventBackward(int& phIndexOfEvent,
722  RunNumber_t& runOfEvent,
723  LuminosityBlockNumber_t& lumiOfEvent,
724  EntryNumber_t& eventEntry) {
725  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
726  }
727 
730  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
731 
734  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
735 
736  void advanceToNextRun() {impl_->advanceToNextRun();}
737  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
738 
739  void advanceToEvent();
740  void advanceToLumi();
741 
742  bool operator==(IndexIntoFileItr const& right) const {
743  return *impl_ == *right.impl_;
744  }
745 
746  bool operator!=(IndexIntoFileItr const& right) const {
747  return !(*this == right);
748  }
749 
751  void initializeRun() {impl_->initializeRun();}
752 
754  void initializeLumi() {impl_->initializeLumi();}
755 
758 
759  private:
760 
761  // The rest of these are intended to be used only by code which tests
762  // this class.
763  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
764  int size() const { return impl_->size(); }
765  EntryType type() const { return impl_->type(); }
766  int indexToRun() const { return impl_->indexToRun(); }
767  int indexToLumi() const { return impl_->indexToLumi(); }
768  int indexToEventRange() const { return impl_->indexToEventRange(); }
769  long long indexToEvent() const { return impl_->indexToEvent(); }
770  long long nEvents() const { return impl_->nEvents(); }
771 
773  };
774 
775  //*****************************************************************************
776  //*****************************************************************************
777 
778  class IndexRunKey {
779  public:
781  processHistoryIDIndex_(index),
782  run_(run) {
783  }
784 
786  RunNumber_t run() const {return run_;}
787 
788  bool operator<(IndexRunKey const& right) const {
790  return run_ < right.run();
791  }
793  }
794 
795  private:
798  };
799 
800  //*****************************************************************************
801  //*****************************************************************************
802 
804  public:
806  processHistoryIDIndex_(index),
807  run_(run),
808  lumi_(lumi) {
809  }
810 
812  RunNumber_t run() const {return run_;}
814 
815  bool operator<(IndexRunLumiKey const& right) const {
817  if (run_ == right.run()) {
818  return lumi_ < right.lumi();
819  }
820  return run_ < right.run();
821  }
823  }
824 
825  private:
829  };
830 
831  //*****************************************************************************
832  //*****************************************************************************
833 
835  public:
837  processHistoryIDIndex_(index),
838  run_(run),
839  lumi_(lumi),
840  event_(event) {
841  }
842 
844  RunNumber_t run() const {return run_;}
846  EventNumber_t event() const {return event_;}
847 
848  bool operator<(IndexRunLumiEventKey const& right) const {
850  if (run_ == right.run()) {
851  if (lumi_ == right.lumi()) {
852  return event_ < right.event();
853  }
854  return lumi_ < right.lumi();
855  }
856  return run_ < right.run();
857  }
859  }
860 
861  private:
866  };
867 
868  //*****************************************************************************
869  //*****************************************************************************
870 
871  class EventFinder {
872  public:
873  virtual ~EventFinder() {}
874  virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const = 0;
875  };
876 
877  //*****************************************************************************
878  //*****************************************************************************
879 
880  // The next two functions are used by the output module to fill the
881  // persistent data members.
882 
889  EntryNumber_t entry);
890 
896 
897  //*****************************************************************************
898  //*****************************************************************************
899 
900  // The next group of functions is used by the PoolSource (or other
901  // input related code) to fill the IndexIntoFile.
902 
908  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
909 
914  }
915 
921  void setEventFinder(std::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
922 
936  void fillEventNumbers() const;
937 
951  void fillEventEntries() const;
952 
958  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
959 
963  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
964 
967  void inputFileClosed() const;
968 
970  void doneFileInitialization() const;
971 
975  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
976 
980  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
981 
985  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
986 
987  //*****************************************************************************
988  //*****************************************************************************
989 
991  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
992 
993  //*****************************************************************************
994  //*****************************************************************************
995 
997 
998  struct Transients {
999  Transients();
1000  void reset();
1002  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1003  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1010  std::shared_ptr<EventFinder> eventFinder_;
1011  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1012  std::vector<EventNumber_t> eventNumbers_;
1013  std::vector<EventEntry> eventEntries_;
1014  std::vector<EventNumber_t> unsortedEventNumbers_;
1015  };
1016 
1017  private:
1018 
1021  void fillRunOrLumiIndexes() const;
1022 
1023  void fillUnsortedEventNumbers() const;
1024  void resetEventFinder() const {transient_.eventFinder_.reset();}
1025  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1026  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1027  void sortEvents() const;
1028  void sortEventEntries() const;
1030  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1031  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1034  int& currentIndex() const {return transient_.currentIndex_;}
1037  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1038  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1040  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1041  }
1042 
1044 
1045  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1046  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1047  };
1048 
1049  template <>
1050  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1052  };
1053 
1054 
1056  public:
1058  };
1059 
1061  public:
1063  };
1064 }
1065 
1066 #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