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 "boost/shared_ptr.hpp"
174 
175 #include <cassert>
176 #include <iosfwd>
177 #include <map>
178 #include <set>
179 #include <vector>
180 
181 namespace edm {
182 
183  class ProcessHistoryRegistry;
184  class RootFile;
185 
187  public:
188  class IndexIntoFileItr;
189  class SortedRunOrLumiItr;
191 
192  typedef long long EntryNumber_t;
193  static int const invalidIndex = -1;
194  static RunNumber_t const invalidRun = 0U;
196  static EventNumber_t const invalidEvent = 0U;
197  static EntryNumber_t const invalidEntry = -1LL;
198 
200 
201  IndexIntoFile();
202  ~IndexIntoFile();
203 
204  ProcessHistoryID const& processHistoryID(int i) const;
205  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
206 
228 
231  IndexIntoFileItr begin(SortOrder sortOrder) const;
232 
234  IndexIntoFileItr end(SortOrder sortOrder) const;
235 
237  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
238 
240  bool empty() const;
241 
263  IndexIntoFileItr
265 
266  IndexIntoFileItr
268 
271  IndexIntoFileItr
273 
276  IndexIntoFileItr
278 
280  IndexIntoFileItr
282 
286  bool containsRun(RunNumber_t run) const;
287 
288  SortedRunOrLumiItr beginRunOrLumi() const;
289  SortedRunOrLumiItr endRunOrLumi() const;
290 
293  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
294 
296  bool containsDuplicateEvents() const;
297 
298  //*****************************************************************************
299  //*****************************************************************************
300 
302  public:
303 
304  RunOrLumiEntry();
305 
314 
317  EntryNumber_t entry() const {return entry_;}
319  RunNumber_t run() const {return run_;}
323 
324  bool isRun() const {return lumi() == invalidLumi;}
325 
329 
330  bool operator<(RunOrLumiEntry const& right) const {
331  if (orderPHIDRun_ == right.orderPHIDRun()) {
332  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
333  return entry_ < right.entry();
334  }
335  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
336  }
337  return orderPHIDRun_ < right.orderPHIDRun();
338  }
339 
340  private:
341  // All Runs, Lumis, and Events associated with the same
342  // ProcessHistory and Run in the same input file are processed
343  // contiguously. This parameter establishes the default order
344  // of processing of these contiguous subsets of data.
346 
347  // All Lumis and Events associated with the same
348  // ProcessHistory, Run, and Lumi in the same input file are
349  // processed contiguously. This parameter establishes the
350  // default order of processing of these contiguous subsets
351  // of data which have the same ProcessHistory and Run.
353 
354  // TTree entry number of Run or Lumi
356 
359  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
360 
361  // These are entry numbers in the Events TTree
362  // Each RunOrLumiEntry is associated with one contiguous range of events.
363  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
364  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
365  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
366  };
367 
368  //*****************************************************************************
369  //*****************************************************************************
370 
372  public:
374 
376  RunNumber_t run() const {return run_;}
378  int indexToGetEntry() const {return indexToGetEntry_;}
379  long long beginEventNumbers() const {return beginEventNumbers_;}
380  long long endEventNumbers() const {return endEventNumbers_;}
381 
382  bool isRun() const {return lumi() == invalidLumi;}
383 
385  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
386 
387  bool operator<(RunOrLumiIndexes const& right) const {
389  if (run_ == right.run()) {
390  return lumi_ < right.lumi();
391  }
392  return run_ < right.run();
393  }
395  }
396 
397  private:
398 
401  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
403 
404  // The next two data members are indexes into the vectors eventNumbers_ and
405  // eventEntries_ (which both have the same number of entries in the same order,
406  // the only difference being that one contains only events numbers and is
407  // smaller in memory).
408 
409  // If there are no events, then the next two are equal (and the value is the
410  // index where the first event would have gone if there had been one)
411 
412  // Note that there can be many RunOrLumiIndexes objects where these two values are
413  // the same if there are many noncontiguous ranges of events associated with the same
414  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
415  // all the noncontiguous ranges in the Events TTree).
416  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
417  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
418  };
419 
420  //*****************************************************************************
421  //*****************************************************************************
422 
423  class EventEntry {
424  public:
427 
428  EventNumber_t event() const {return event_;}
429  EntryNumber_t entry() const {return entry_;}
430 
431  bool operator<(EventEntry const& right) const {
432  return event() < right.event();
433  }
434 
435  bool operator==(EventEntry const& right) const {
436  return event() == right.event();
437  }
438 
439  private:
442  };
443 
444 
445  //*****************************************************************************
446  //*****************************************************************************
447 
449 
450  public:
452 
453  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
454  unsigned runOrLumi() const {return runOrLumi_;}
455 
456  bool operator==(SortedRunOrLumiItr const& right) const;
457  bool operator!=(SortedRunOrLumiItr const& right) const;
459 
460  bool isRun();
461 
462  void getRange(long long& beginEventNumbers,
463  long long& endEventNumbers,
464  EntryNumber_t& beginEventEntry,
465  EntryNumber_t& endEventEntry);
466 
467  RunOrLumiIndexes const& runOrLumiIndexes() const;
468 
469  private:
470 
472 
473  // This is an index into runOrLumiIndexes_
474  // which gives the current position of the iteration
475  unsigned runOrLumi_;
476  };
477 
478 
479  //*****************************************************************************
480  //*****************************************************************************
481 
483 
484  public:
486  EntryType entryType,
487  int indexToRun,
488  int indexToLumi,
489  int indexToEventRange,
490  long long indexToEvent,
491  long long nEvents);
492  virtual ~IndexIntoFileItrImpl();
493 
494  virtual IndexIntoFileItrImpl* clone() const = 0;
495 
496  EntryType getEntryType() const {return type_;}
497 
498  void next ();
499 
500  void skipEventForward(int& phIndexOfSkippedEvent,
501  RunNumber_t& runOfSkippedEvent,
502  LuminosityBlockNumber_t& lumiOfSkippedEvent,
503  EntryNumber_t& skippedEventEntry);
504 
505  void skipEventBackward(int& phIndexOfEvent,
506  RunNumber_t& runOfEvent,
507  LuminosityBlockNumber_t& lumiOfEvent,
508  EntryNumber_t& eventEntry);
509 
510  virtual int processHistoryIDIndex() const = 0;
511  virtual RunNumber_t run() const = 0;
512  virtual LuminosityBlockNumber_t lumi() const = 0;
513  virtual EntryNumber_t entry() const = 0;
514  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
515  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
518  virtual bool skipLumiInRun() = 0;
519 
520  void advanceToNextRun();
521  void advanceToNextLumiOrRun();
522  bool skipToNextEventInLumi();
523  void initializeRun();
524 
526 
527  bool operator==(IndexIntoFileItrImpl const& right) const;
528 
529  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
530  int size() const { return size_; }
531 
532  EntryType type() const { return type_; }
533  int indexToRun() const { return indexToRun_; }
534 
535  int indexToLumi() const { return indexToLumi_; }
536  int indexToEventRange() const { return indexToEventRange_; }
537  long long indexToEvent() const { return indexToEvent_; }
538  long long nEvents() const { return nEvents_; }
539 
541 
542  protected:
543 
544  void setInvalid();
545 
548  void setIndexToEvent(long long value) { indexToEvent_ = value; }
549  void setNEvents(long long value) { nEvents_ = value; }
550 
551  private:
552 
553  virtual void initializeLumi_() = 0;
554  virtual bool nextEventRange() = 0;
555  virtual bool previousEventRange() = 0;
556  bool previousLumiWithEvents();
557  virtual bool setToLastEventInRange(int index) = 0;
558  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
559  virtual bool isSameLumi(int index1, int index2) const = 0;
560  virtual bool isSameRun(int index1, int index2) const = 0;
561 
563  int size_;
564 
569  long long indexToEvent_;
570  long long nEvents_;
571  };
572 
573  //*****************************************************************************
574  //*****************************************************************************
575 
577  public:
579  EntryType entryType,
580  int indexToRun,
581  int indexToLumi,
582  int indexToEventRange,
583  long long indexToEvent,
584  long long nEvents);
585 
586  virtual IndexIntoFileItrImpl* clone() const;
587 
588  virtual int processHistoryIDIndex() const;
589  virtual RunNumber_t run() const;
590  virtual LuminosityBlockNumber_t lumi() const;
591  virtual EntryNumber_t entry() const;
593  virtual EntryNumber_t peekAheadAtEventEntry() const;
594  virtual bool skipLumiInRun();
595 
596  private:
597 
598  virtual void initializeLumi_();
599  virtual bool nextEventRange();
600  virtual bool previousEventRange();
601  virtual bool setToLastEventInRange(int index);
602  virtual EntryType getRunOrLumiEntryType(int index) const;
603  virtual bool isSameLumi(int index1, int index2) const;
604  virtual bool isSameRun(int index1, int index2) const;
605  };
606 
607  //*****************************************************************************
608  //*****************************************************************************
609 
611  public:
613  EntryType entryType,
614  int indexToRun,
615  int indexToLumi,
616  int indexToEventRange,
617  long long indexToEvent,
618  long long nEvents);
619 
620  virtual IndexIntoFileItrImpl* clone() const;
621  virtual int processHistoryIDIndex() const;
622  virtual RunNumber_t run() const;
623  virtual LuminosityBlockNumber_t lumi() const;
624  virtual EntryNumber_t entry() const;
626  virtual EntryNumber_t peekAheadAtEventEntry() const;
627  virtual bool skipLumiInRun();
628 
629  private:
630 
631  virtual void initializeLumi_();
632  virtual bool nextEventRange();
633  virtual bool previousEventRange();
634  virtual bool setToLastEventInRange(int index);
635  virtual EntryType getRunOrLumiEntryType(int index) const;
636  virtual bool isSameLumi(int index1, int index2) const;
637  virtual bool isSameRun(int index1, int index2) const;
638  };
639 
640  //*****************************************************************************
641  //*****************************************************************************
642 
644  public:
654  SortOrder sortOrder,
655  EntryType entryType,
656  int indexToRun,
657  int indexToLumi,
658  int indexToEventRange,
659  long long indexToEvent,
660  long long nEvents);
661 
662 
663  EntryType getEntryType() const {return impl_->getEntryType();}
664  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
665  RunNumber_t run() const {return impl_->run();}
666  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
667  EntryNumber_t entry() const {return impl_->entry();}
668 
671  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
672 
677  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
678 
682  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
683  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
684 
685  // This is intentionally not implemented.
686  // It would be difficult to implement for the no sort mode,
687  // either slow or using extra memory.
688  // It would be easy to implement for the sorted iteration,
689  // but I did not implement it so both cases would offer a
690  // consistent interface.
691  // It looks like in all cases where this would be needed
692  // it would not be difficult to get the event number
693  // directly from the event auxiliary.
694  // We may need to revisit this decision in the future.
695  // EventNumber_t event() const;
696 
697 
700  impl_->next();
701  return *this;
702  }
703 
709  void skipEventForward(int& phIndexOfSkippedEvent,
710  RunNumber_t& runOfSkippedEvent,
711  LuminosityBlockNumber_t& lumiOfSkippedEvent,
712  EntryNumber_t& skippedEventEntry) {
713  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
714  }
715 
723  void skipEventBackward(int& phIndexOfEvent,
724  RunNumber_t& runOfEvent,
725  LuminosityBlockNumber_t& lumiOfEvent,
726  EntryNumber_t& eventEntry) {
727  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
728  }
729 
732  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
733 
736  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
737 
738  void advanceToNextRun() {impl_->advanceToNextRun();}
739  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
740 
741  void advanceToEvent();
742  void advanceToLumi();
743 
744  bool operator==(IndexIntoFileItr const& right) const {
745  return *impl_ == *right.impl_;
746  }
747 
748  bool operator!=(IndexIntoFileItr const& right) const {
749  return !(*this == right);
750  }
751 
753  void initializeRun() {impl_->initializeRun();}
754 
756  void initializeLumi() {impl_->initializeLumi();}
757 
760 
761  private:
762 
763  // The rest of these are intended to be used only by code which tests
764  // this class.
765  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
766  int size() const { return impl_->size(); }
767  EntryType type() const { return impl_->type(); }
768  int indexToRun() const { return impl_->indexToRun(); }
769  int indexToLumi() const { return impl_->indexToLumi(); }
770  int indexToEventRange() const { return impl_->indexToEventRange(); }
771  long long indexToEvent() const { return impl_->indexToEvent(); }
772  long long nEvents() const { return impl_->nEvents(); }
773 
775  };
776 
777  //*****************************************************************************
778  //*****************************************************************************
779 
780  class IndexRunKey {
781  public:
783  processHistoryIDIndex_(index),
784  run_(run) {
785  }
786 
788  RunNumber_t run() const {return run_;}
789 
790  bool operator<(IndexRunKey const& right) const {
792  return run_ < right.run();
793  }
795  }
796 
797  private:
800  };
801 
802  //*****************************************************************************
803  //*****************************************************************************
804 
806  public:
808  processHistoryIDIndex_(index),
809  run_(run),
810  lumi_(lumi) {
811  }
812 
814  RunNumber_t run() const {return run_;}
816 
817  bool operator<(IndexRunLumiKey const& right) const {
819  if (run_ == right.run()) {
820  return lumi_ < right.lumi();
821  }
822  return run_ < right.run();
823  }
825  }
826 
827  private:
831  };
832 
833  //*****************************************************************************
834  //*****************************************************************************
835 
837  public:
839  processHistoryIDIndex_(index),
840  run_(run),
841  lumi_(lumi),
842  event_(event) {
843  }
844 
846  RunNumber_t run() const {return run_;}
848  EventNumber_t event() const {return event_;}
849 
850  bool operator<(IndexRunLumiEventKey const& right) const {
852  if (run_ == right.run()) {
853  if (lumi_ == right.lumi()) {
854  return event_ < right.event();
855  }
856  return lumi_ < right.lumi();
857  }
858  return run_ < right.run();
859  }
861  }
862 
863  private:
868  };
869 
870  //*****************************************************************************
871  //*****************************************************************************
872 
873  class EventFinder {
874  public:
875  virtual ~EventFinder() {}
876  virtual EventNumber_t getEventNumberOfEntry(EntryNumber_t entry) const = 0;
877  };
878 
879  //*****************************************************************************
880  //*****************************************************************************
881 
882  // The next two functions are used by the output module to fill the
883  // persistent data members.
884 
891  EntryNumber_t entry);
892 
898 
899  //*****************************************************************************
900  //*****************************************************************************
901 
902  // The next group of functions is used by the PoolSource (or other
903  // input related code) to fill the IndexIntoFile.
904 
910  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
911 
916  }
917 
923  void setEventFinder(boost::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
924 
938  void fillEventNumbers() const;
939 
953  void fillEventEntries() const;
954 
960  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
961 
965  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
966 
969  void inputFileClosed() const;
970 
972  void doneFileInitialization() const;
973 
977  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
978 
982  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
983 
987  void reduceProcessHistoryIDs(ProcessHistoryRegistry const& processHistoryRegistry);
988 
989  //*****************************************************************************
990  //*****************************************************************************
991 
993  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
994 
995  //*****************************************************************************
996  //*****************************************************************************
997 
999 
1000  struct Transients {
1001  Transients();
1002  void reset();
1004  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1005  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1012  boost::shared_ptr<EventFinder> eventFinder_;
1013  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1014  std::vector<EventNumber_t> eventNumbers_;
1015  std::vector<EventEntry> eventEntries_;
1016  std::vector<EventNumber_t> unsortedEventNumbers_;
1017  };
1018 
1019  private:
1020 
1023  void fillRunOrLumiIndexes() const;
1024 
1025  void fillUnsortedEventNumbers() const;
1026  void resetEventFinder() const {transient_.eventFinder_.reset();}
1027  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1028  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1029  void sortEvents() const;
1030  void sortEventEntries() const;
1032  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1033  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1036  int& currentIndex() const {return transient_.currentIndex_;}
1039  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1040  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1042  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1043  }
1044 
1046 
1047  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1048  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1049  };
1050 
1051  template <>
1052  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1054  };
1055 
1056 
1058  public:
1060  };
1061 
1063  public:
1065  };
1066 }
1067 
1068 #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
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: EventID.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
virtual IndexIntoFileItrImpl * clone() const
IndexRunLumiEventKey(int index, RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
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
boost::shared_ptr< EventFinder > eventFinder_
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
void setEventFinder(boost::shared_ptr< EventFinder > ptr) 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
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