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 RootFile;
184 
186  public:
187  class IndexIntoFileItr;
188  class SortedRunOrLumiItr;
190 
191  typedef long long EntryNumber_t;
192  static int const invalidIndex = -1;
193  static RunNumber_t const invalidRun = 0U;
195  static EventNumber_t const invalidEvent = 0U;
196  static EntryNumber_t const invalidEntry = -1LL;
197 
199 
200  IndexIntoFile();
201  ~IndexIntoFile();
202 
203  ProcessHistoryID const& processHistoryID(int i) const;
204  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
205 
227 
230  IndexIntoFileItr begin(SortOrder sortOrder) const;
231 
233  IndexIntoFileItr end(SortOrder sortOrder) const;
234 
236  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
237 
239  bool empty() const;
240 
262  IndexIntoFileItr
264 
265  IndexIntoFileItr
267 
270  IndexIntoFileItr
272 
275  IndexIntoFileItr
277 
279  IndexIntoFileItr
281 
285  bool containsRun(RunNumber_t run) const;
286 
287  SortedRunOrLumiItr beginRunOrLumi() const;
288  SortedRunOrLumiItr endRunOrLumi() const;
289 
292  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
293 
295  bool containsDuplicateEvents() const;
296 
297  //*****************************************************************************
298  //*****************************************************************************
299 
301  public:
302 
303  RunOrLumiEntry();
304 
313 
316  EntryNumber_t entry() const {return entry_;}
318  RunNumber_t run() const {return run_;}
322 
323  bool isRun() const {return lumi() == invalidLumi;}
324 
328 
329  bool operator<(RunOrLumiEntry const& right) const {
330  if (orderPHIDRun_ == right.orderPHIDRun()) {
331  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
332  return entry_ < right.entry();
333  }
334  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
335  }
336  return orderPHIDRun_ < right.orderPHIDRun();
337  }
338 
339  private:
340  // All Runs, Lumis, and Events associated with the same
341  // ProcessHistory and Run in the same input file are processed
342  // contiguously. This parameter establishes the default order
343  // of processing of these contiguous subsets of data.
345 
346  // All Lumis and Events associated with the same
347  // ProcessHistory, Run, and Lumi in the same input file are
348  // processed contiguously. This parameter establishes the
349  // default order of processing of these contiguous subsets
350  // of data which have the same ProcessHistory and Run.
352 
353  // TTree entry number of Run or Lumi
355 
358  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
359 
360  // These are entry numbers in the Events TTree
361  // Each RunOrLumiEntry is associated with one contiguous range of events.
362  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
363  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
364  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
365  };
366 
367  //*****************************************************************************
368  //*****************************************************************************
369 
371  public:
373 
375  RunNumber_t run() const {return run_;}
377  int indexToGetEntry() const {return indexToGetEntry_;}
378  long long beginEventNumbers() const {return beginEventNumbers_;}
379  long long endEventNumbers() const {return endEventNumbers_;}
380 
381  bool isRun() const {return lumi() == invalidLumi;}
382 
384  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
385 
386  bool operator<(RunOrLumiIndexes const& right) const {
388  if (run_ == right.run()) {
389  return lumi_ < right.lumi();
390  }
391  return run_ < right.run();
392  }
394  }
395 
396  private:
397 
400  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
402 
403  // The next two data members are indexes into the vectors eventNumbers_ and
404  // eventEntries_ (which both have the same number of entries in the same order,
405  // the only difference being that one contains only events numbers and is
406  // smaller in memory).
407 
408  // If there are no events, then the next two are equal (and the value is the
409  // index where the first event would have gone if there had been one)
410 
411  // Note that there can be many RunOrLumiIndexes objects where these two values are
412  // the same if there are many noncontiguous ranges of events associated with the same
413  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
414  // all the noncontiguous ranges in the Events TTree).
415  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
416  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
417  };
418 
419  //*****************************************************************************
420  //*****************************************************************************
421 
422  class EventEntry {
423  public:
426 
427  EventNumber_t event() const {return event_;}
428  EntryNumber_t entry() const {return entry_;}
429 
430  bool operator<(EventEntry const& right) const {
431  return event() < right.event();
432  }
433 
434  bool operator==(EventEntry const& right) const {
435  return event() == right.event();
436  }
437 
438  private:
441  };
442 
443 
444  //*****************************************************************************
445  //*****************************************************************************
446 
448 
449  public:
451 
452  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
453  unsigned runOrLumi() const {return runOrLumi_;}
454 
455  bool operator==(SortedRunOrLumiItr const& right) const;
456  bool operator!=(SortedRunOrLumiItr const& right) const;
458 
459  bool isRun();
460 
461  void getRange(long long& beginEventNumbers,
462  long long& endEventNumbers,
463  EntryNumber_t& beginEventEntry,
464  EntryNumber_t& endEventEntry);
465 
466  RunOrLumiIndexes const& runOrLumiIndexes() const;
467 
468  private:
469 
471 
472  // This is an index into runOrLumiIndexes_
473  // which gives the current position of the iteration
474  unsigned runOrLumi_;
475  };
476 
477 
478  //*****************************************************************************
479  //*****************************************************************************
480 
482 
483  public:
485  EntryType entryType,
486  int indexToRun,
487  int indexToLumi,
488  int indexToEventRange,
489  long long indexToEvent,
490  long long nEvents);
491  virtual ~IndexIntoFileItrImpl();
492 
493  virtual IndexIntoFileItrImpl* clone() const = 0;
494 
495  EntryType getEntryType() const {return type_;}
496 
497  void next ();
498 
499  void skipEventForward(int& phIndexOfSkippedEvent,
500  RunNumber_t& runOfSkippedEvent,
501  LuminosityBlockNumber_t& lumiOfSkippedEvent,
502  EntryNumber_t& skippedEventEntry);
503 
504  void skipEventBackward(int& phIndexOfEvent,
505  RunNumber_t& runOfEvent,
506  LuminosityBlockNumber_t& lumiOfEvent,
507  EntryNumber_t& eventEntry);
508 
509  virtual int processHistoryIDIndex() const = 0;
510  virtual RunNumber_t run() const = 0;
511  virtual LuminosityBlockNumber_t lumi() const = 0;
512  virtual EntryNumber_t entry() const = 0;
513  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
514  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
517  virtual bool skipLumiInRun() = 0;
518 
519  void advanceToNextRun();
520  void advanceToNextLumiOrRun();
521  bool skipToNextEventInLumi();
522  void initializeRun();
523 
525 
526  bool operator==(IndexIntoFileItrImpl const& right) const;
527 
528  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
529  int size() const { return size_; }
530 
531  EntryType type() const { return type_; }
532  int indexToRun() const { return indexToRun_; }
533 
534  int indexToLumi() const { return indexToLumi_; }
535  int indexToEventRange() const { return indexToEventRange_; }
536  long long indexToEvent() const { return indexToEvent_; }
537  long long nEvents() const { return nEvents_; }
538 
540 
541  protected:
542 
543  void setInvalid();
544 
547  void setIndexToEvent(long long value) { indexToEvent_ = value; }
548  void setNEvents(long long value) { nEvents_ = value; }
549 
550  private:
551 
552  virtual void initializeLumi_() = 0;
553  virtual bool nextEventRange() = 0;
554  virtual bool previousEventRange() = 0;
555  bool previousLumiWithEvents();
556  virtual bool setToLastEventInRange(int index) = 0;
557  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
558  virtual bool isSameLumi(int index1, int index2) const = 0;
559  virtual bool isSameRun(int index1, int index2) const = 0;
560 
562  int size_;
563 
568  long long indexToEvent_;
569  long long nEvents_;
570  };
571 
572  //*****************************************************************************
573  //*****************************************************************************
574 
576  public:
578  EntryType entryType,
579  int indexToRun,
580  int indexToLumi,
581  int indexToEventRange,
582  long long indexToEvent,
583  long long nEvents);
584 
585  virtual IndexIntoFileItrImpl* clone() const;
586 
587  virtual int processHistoryIDIndex() const;
588  virtual RunNumber_t run() const;
589  virtual LuminosityBlockNumber_t lumi() const;
590  virtual EntryNumber_t entry() const;
592  virtual EntryNumber_t peekAheadAtEventEntry() const;
593  virtual bool skipLumiInRun();
594 
595  private:
596 
597  virtual void initializeLumi_();
598  virtual bool nextEventRange();
599  virtual bool previousEventRange();
600  virtual bool setToLastEventInRange(int index);
601  virtual EntryType getRunOrLumiEntryType(int index) const;
602  virtual bool isSameLumi(int index1, int index2) const;
603  virtual bool isSameRun(int index1, int index2) const;
604  };
605 
606  //*****************************************************************************
607  //*****************************************************************************
608 
610  public:
612  EntryType entryType,
613  int indexToRun,
614  int indexToLumi,
615  int indexToEventRange,
616  long long indexToEvent,
617  long long nEvents);
618 
619  virtual IndexIntoFileItrImpl* clone() const;
620  virtual int processHistoryIDIndex() const;
621  virtual RunNumber_t run() const;
622  virtual LuminosityBlockNumber_t lumi() const;
623  virtual EntryNumber_t entry() const;
625  virtual EntryNumber_t peekAheadAtEventEntry() const;
626  virtual bool skipLumiInRun();
627 
628  private:
629 
630  virtual void initializeLumi_();
631  virtual bool nextEventRange();
632  virtual bool previousEventRange();
633  virtual bool setToLastEventInRange(int index);
634  virtual EntryType getRunOrLumiEntryType(int index) const;
635  virtual bool isSameLumi(int index1, int index2) const;
636  virtual bool isSameRun(int index1, int index2) const;
637  };
638 
639  //*****************************************************************************
640  //*****************************************************************************
641 
643  public:
653  SortOrder sortOrder,
654  EntryType entryType,
655  int indexToRun,
656  int indexToLumi,
657  int indexToEventRange,
658  long long indexToEvent,
659  long long nEvents);
660 
661 
662  EntryType getEntryType() const {return impl_->getEntryType();}
663  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
664  RunNumber_t run() const {return impl_->run();}
665  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
666  EntryNumber_t entry() const {return impl_->entry();}
667 
670  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
671 
676  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
677 
681  EntryNumber_t firstEventEntryThisRun() const { return impl_->firstEventEntryThisRun(); }
682  EntryNumber_t firstEventEntryThisLumi() const { return impl_->firstEventEntryThisLumi(); }
683 
684  // This is intentionally not implemented.
685  // It would be difficult to implement for the no sort mode,
686  // either slow or using extra memory.
687  // It would be easy to implement for the sorted iteration,
688  // but I did not implement it so both cases would offer a
689  // consistent interface.
690  // It looks like in all cases where this would be needed
691  // it would not be difficult to get the event number
692  // directly from the event auxiliary.
693  // We may need to revisit this decision in the future.
694  // EventNumber_t event() const;
695 
696 
699  impl_->next();
700  return *this;
701  }
702 
708  void skipEventForward(int& phIndexOfSkippedEvent,
709  RunNumber_t& runOfSkippedEvent,
710  LuminosityBlockNumber_t& lumiOfSkippedEvent,
711  EntryNumber_t& skippedEventEntry) {
712  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
713  }
714 
722  void skipEventBackward(int& phIndexOfEvent,
723  RunNumber_t& runOfEvent,
724  LuminosityBlockNumber_t& lumiOfEvent,
725  EntryNumber_t& eventEntry) {
726  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
727  }
728 
731  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
732 
735  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
736 
737  void advanceToNextRun() {impl_->advanceToNextRun();}
738  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
739 
740  void advanceToEvent();
741  void advanceToLumi();
742 
743  bool operator==(IndexIntoFileItr const& right) const {
744  return *impl_ == *right.impl_;
745  }
746 
747  bool operator!=(IndexIntoFileItr const& right) const {
748  return !(*this == right);
749  }
750 
752  void initializeRun() {impl_->initializeRun();}
753 
755  void initializeLumi() {impl_->initializeLumi();}
756 
759 
760  private:
761 
762  // The rest of these are intended to be used only by code which tests
763  // this class.
764  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
765  int size() const { return impl_->size(); }
766  EntryType type() const { return impl_->type(); }
767  int indexToRun() const { return impl_->indexToRun(); }
768  int indexToLumi() const { return impl_->indexToLumi(); }
769  int indexToEventRange() const { return impl_->indexToEventRange(); }
770  long long indexToEvent() const { return impl_->indexToEvent(); }
771  long long nEvents() const { return impl_->nEvents(); }
772 
774  };
775 
776  //*****************************************************************************
777  //*****************************************************************************
778 
779  class IndexRunKey {
780  public:
782  processHistoryIDIndex_(index),
783  run_(run) {
784  }
785 
787  RunNumber_t run() const {return run_;}
788 
789  bool operator<(IndexRunKey const& right) const {
791  return run_ < right.run();
792  }
794  }
795 
796  private:
799  };
800 
801  //*****************************************************************************
802  //*****************************************************************************
803 
805  public:
807  processHistoryIDIndex_(index),
808  run_(run),
809  lumi_(lumi) {
810  }
811 
813  RunNumber_t run() const {return run_;}
815 
816  bool operator<(IndexRunLumiKey const& right) const {
818  if (run_ == right.run()) {
819  return lumi_ < right.lumi();
820  }
821  return run_ < right.run();
822  }
824  }
825 
826  private:
830  };
831 
832  //*****************************************************************************
833  //*****************************************************************************
834 
836  public:
838  processHistoryIDIndex_(index),
839  run_(run),
840  lumi_(lumi),
841  event_(event) {
842  }
843 
845  RunNumber_t run() const {return run_;}
847  EventNumber_t event() const {return event_;}
848 
849  bool operator<(IndexRunLumiEventKey const& right) const {
851  if (run_ == right.run()) {
852  if (lumi_ == right.lumi()) {
853  return event_ < right.event();
854  }
855  return lumi_ < right.lumi();
856  }
857  return run_ < right.run();
858  }
860  }
861 
862  private:
867  };
868 
869  //*****************************************************************************
870  //*****************************************************************************
871 
872  class EventFinder {
873  public:
874  virtual ~EventFinder() {}
876  };
877 
878  //*****************************************************************************
879  //*****************************************************************************
880 
881  // The next two functions are used by the output module to fill the
882  // persistent data members.
883 
891 
897 
898  //*****************************************************************************
899  //*****************************************************************************
900 
901  // The next group of functions is used by the PoolSource (or other
902  // input related code) to fill the IndexIntoFile.
903 
909  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
910 
915  }
916 
922  void setEventFinder(boost::shared_ptr<EventFinder> ptr) const {transient_.eventFinder_ = ptr;}
923 
937  void fillEventNumbers() const;
938 
952  void fillEventEntries() const;
953 
959  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
960 
964  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transient_.unsortedEventNumbers_;}
965 
968  void inputFileClosed() const;
969 
971  void doneFileInitialization() const;
972 
976  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
977 
981  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
982 
987 
988  //*****************************************************************************
989  //*****************************************************************************
990 
992  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
993 
994  //*****************************************************************************
995  //*****************************************************************************
996 
998 
999  struct Transients {
1000  Transients();
1001  void reset();
1003  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
1004  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
1011  boost::shared_ptr<EventFinder> eventFinder_;
1012  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
1013  std::vector<EventNumber_t> eventNumbers_;
1014  std::vector<EventEntry> eventEntries_;
1015  std::vector<EventNumber_t> unsortedEventNumbers_;
1016  };
1017 
1018  private:
1019 
1022  void fillRunOrLumiIndexes() const;
1023 
1024  void fillUnsortedEventNumbers() const;
1025  void resetEventFinder() const {transient_.eventFinder_.reset();}
1026  std::vector<EventEntry>& eventEntries() const {return transient_.eventEntries_;}
1027  std::vector<EventNumber_t>& eventNumbers() const {return transient_.eventNumbers_;}
1028  void sortEvents() const;
1029  void sortEventEntries() const;
1031  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transient_.runToFirstEntry_;}
1032  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transient_.lumiToFirstEntry_;}
1035  int& currentIndex() const {return transient_.currentIndex_;}
1038  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transient_.runOrLumiIndexes_;}
1039  size_t numberOfEvents() const {return transient_.numberOfEvents_;}
1041  return transient_.eventFinder_->getEventNumberOfEntry(entry);
1042  }
1043 
1045 
1046  std::vector<ProcessHistoryID> processHistoryIDs_; // of reduced process histories
1047  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1048  };
1049 
1050  template <>
1051  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1053  };
1054 
1055 
1057  public:
1059  };
1060 
1062  public:
1064  };
1065 }
1066 
1067 #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
void reduceProcessHistoryIDs()
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 int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
static EventNumber_t const invalidEvent
virtual EntryNumber_t peekAheadAtEventEntry() const =0
std::map< IndexRunLumiKey, EntryNumber_t > lumiToFirstEntry_
bool operator<(RunOrLumiIndexes const &right) const
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
int & previousAddedIndex() const
void sortVector_Run_Or_Lumi_Entries()
size_t numberOfEvents() const
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_
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
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
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