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 
168 #include "boost/shared_ptr.hpp"
169 
170 #include <map>
171 #include <vector>
172 #include <cassert>
173 #include <iosfwd>
174 #include <set>
175 
176 namespace edm {
177 
178  class RootFile;
179 
181  public:
182  class IndexIntoFileItr;
183  class SortedRunOrLumiItr;
185 
186  typedef long long EntryNumber_t;
187  static int const invalidIndex = -1;
188  static RunNumber_t const invalidRun = 0U;
190  static EventNumber_t const invalidEvent = 0U;
191  static EntryNumber_t const invalidEntry = -1LL;
192 
194 
195  IndexIntoFile();
196  ~IndexIntoFile();
197 
198  ProcessHistoryID const& processHistoryID(int i) const;
199  std::vector<ProcessHistoryID> const& processHistoryIDs() const;
200 
222 
225  IndexIntoFileItr begin(SortOrder sortOrder) const;
226 
228  IndexIntoFileItr end(SortOrder sortOrder) const;
229 
231  bool iterationWillBeInEntryOrder(SortOrder sortOrder) const;
232 
234  bool empty() const;
235 
257  IndexIntoFileItr
259 
260  IndexIntoFileItr
262 
265  IndexIntoFileItr
267 
270  IndexIntoFileItr
272 
274  IndexIntoFileItr
276 
280  bool containsRun(RunNumber_t run) const;
281 
282  SortedRunOrLumiItr beginRunOrLumi() const;
283  SortedRunOrLumiItr endRunOrLumi() const;
284 
287  void set_intersection(IndexIntoFile const& indexIntoFile, std::set<IndexRunLumiEventKey>& intersection) const;
288 
290  bool containsDuplicateEvents() const;
291 
292  //*****************************************************************************
293  //*****************************************************************************
294 
296  public:
297 
298  RunOrLumiEntry();
299 
308 
311  EntryNumber_t entry() const {return entry_;}
313  RunNumber_t run() const {return run_;}
317 
318  bool isRun() const {return lumi() == invalidLumi;}
319 
322 
323  bool operator<(RunOrLumiEntry const& right) const {
324  if (orderPHIDRun_ == right.orderPHIDRun()) {
325  if (orderPHIDRunLumi_ == right.orderPHIDRunLumi()) {
326  return entry_ < right.entry();
327  }
328  return orderPHIDRunLumi_ < right.orderPHIDRunLumi();
329  }
330  return orderPHIDRun_ < right.orderPHIDRun();
331  }
332 
333  private:
334  // All Runs, Lumis, and Events associated with the same
335  // ProcessHistory and Run in the same input file are processed
336  // contiguously. This parameter establishes the default order
337  // of processing of these contiguous subsets of data.
339 
340  // All Lumis and Events associated with the same
341  // ProcessHistory, Run, and Lumi in the same input file are
342  // processed contiguously. This parameter establishes the
343  // default order of processing of these contiguous subsets
344  // of data which have the same ProcessHistory and Run.
346 
347  // TTree entry number of Run or Lumi
349 
352  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
353 
354  // These are entry numbers in the Events TTree
355  // Each RunOrLumiEntry is associated with one contiguous range of events.
356  // This is disjoint from the ranges associated with all other RunOrLumiEntry's
357  EntryNumber_t beginEvents_; // -1 if a run or a lumi with no events
358  EntryNumber_t endEvents_; // -1 if a run or a lumi with no events
359  };
360 
361  //*****************************************************************************
362  //*****************************************************************************
363 
365  public:
367 
369  RunNumber_t run() const {return run_;}
371  int indexToGetEntry() const {return indexToGetEntry_;}
372  long long beginEventNumbers() const {return beginEventNumbers_;}
373  long long endEventNumbers() const {return endEventNumbers_;}
374 
375  bool isRun() const {return lumi() == invalidLumi;}
376 
378  void setEndEventNumbers(long long v) {endEventNumbers_ = v;}
379 
380  bool operator<(RunOrLumiIndexes const& right) const {
382  if (run_ == right.run()) {
383  return lumi_ < right.lumi();
384  }
385  return run_ < right.run();
386  }
388  }
389 
390  private:
391 
394  LuminosityBlockNumber_t lumi_; // 0 indicates this is a run entry
396 
397  // The next two data members are indexes into the vectors eventNumbers_ and
398  // eventEntries_ (which both have the same number of entries in the same order,
399  // the only difference being that one contains only events numbers and is
400  // smaller in memory).
401 
402  // If there are no events, then the next two are equal (and the value is the
403  // index where the first event would have gone if there had been one)
404 
405  // Note that there can be many RunOrLumiIndexes objects where these two values are
406  // the same if there are many noncontiguous ranges of events associated with the same
407  // PHID-Run-Lumi (this one range in eventNumbers_ corresponds to the union of
408  // all the noncontiguous ranges in the Events TTree).
409  long long beginEventNumbers_; // first event this PHID-Run-Lumi (-1 if a run or not set)
410  long long endEventNumbers_; // one past last event this PHID-Run-Lumi (-1 if a run or not set)
411  };
412 
413  //*****************************************************************************
414  //*****************************************************************************
415 
416  class EventEntry {
417  public:
420 
421  EventNumber_t event() const {return event_;}
422  EntryNumber_t entry() const {return entry_;}
423 
424  bool operator<(EventEntry const& right) const {
425  return event() < right.event();
426  }
427 
428  bool operator==(EventEntry const& right) const {
429  return event() == right.event();
430  }
431 
432  private:
435  };
436 
437 
438  //*****************************************************************************
439  //*****************************************************************************
440 
442 
443  public:
445 
446  IndexIntoFile const* indexIntoFile() const {return indexIntoFile_;}
447  unsigned runOrLumi() const {return runOrLumi_;}
448 
449  bool operator==(SortedRunOrLumiItr const& right) const;
450  bool operator!=(SortedRunOrLumiItr const& right) const;
452 
453  bool isRun();
454 
455  void getRange(long long& beginEventNumbers,
456  long long& endEventNumbers,
457  EntryNumber_t& beginEventEntry,
458  EntryNumber_t& endEventEntry);
459 
460  RunOrLumiIndexes const& runOrLumiIndexes() const;
461 
462  private:
463 
465 
466  // This is an index into runOrLumiIndexes_
467  // which gives the current position of the iteration
468  unsigned runOrLumi_;
469  };
470 
471 
472  //*****************************************************************************
473  //*****************************************************************************
474 
476 
477  public:
479  EntryType entryType,
480  int indexToRun,
481  int indexToLumi,
482  int indexToEventRange,
483  long long indexToEvent,
484  long long nEvents);
485  virtual ~IndexIntoFileItrImpl();
486 
487  virtual IndexIntoFileItrImpl* clone() const = 0;
488 
489  EntryType getEntryType() const {return type_;}
490 
491  void next ();
492 
493  void skipEventForward(int& phIndexOfSkippedEvent,
494  RunNumber_t& runOfSkippedEvent,
495  LuminosityBlockNumber_t& lumiOfSkippedEvent,
496  EntryNumber_t& skippedEventEntry);
497 
498  void skipEventBackward(int& phIndexOfEvent,
499  RunNumber_t& runOfEvent,
500  LuminosityBlockNumber_t& lumiOfEvent,
501  EntryNumber_t& eventEntry);
502 
503  virtual int processHistoryIDIndex() const = 0;
504  virtual RunNumber_t run() const = 0;
505  virtual LuminosityBlockNumber_t lumi() const = 0;
506  virtual EntryNumber_t entry() const = 0;
507  virtual LuminosityBlockNumber_t peekAheadAtLumi() const = 0;
508  virtual EntryNumber_t peekAheadAtEventEntry() const = 0;
509  virtual bool skipLumiInRun() = 0;
510 
511  void advanceToNextRun();
512  void advanceToNextLumiOrRun();
513  bool skipToNextEventInLumi();
514  void initializeRun();
515 
517 
518  bool operator==(IndexIntoFileItrImpl const& right) const;
519 
520  IndexIntoFile const* indexIntoFile() const { return indexIntoFile_; }
521  int size() const { return size_; }
522 
523  EntryType type() const { return type_; }
524  int indexToRun() const { return indexToRun_; }
525 
526  int indexToLumi() const { return indexToLumi_; }
527  int indexToEventRange() const { return indexToEventRange_; }
528  long long indexToEvent() const { return indexToEvent_; }
529  long long nEvents() const { return nEvents_; }
530 
532 
533  protected:
534 
535  void setInvalid();
536 
539  void setIndexToEvent(long long value) { indexToEvent_ = value; }
540  void setNEvents(long long value) { nEvents_ = value; }
541 
542  private:
543 
544  virtual void initializeLumi_() = 0;
545  virtual bool nextEventRange() = 0;
546  virtual bool previousEventRange() = 0;
547  bool previousLumiWithEvents();
548  virtual bool setToLastEventInRange(int index) = 0;
549  virtual EntryType getRunOrLumiEntryType(int index) const = 0;
550  virtual bool isSameLumi(int index1, int index2) const = 0;
551  virtual bool isSameRun(int index1, int index2) const = 0;
552 
554  int size_;
555 
560  long long indexToEvent_;
561  long long nEvents_;
562  };
563 
564  //*****************************************************************************
565  //*****************************************************************************
566 
568  public:
570  EntryType entryType,
571  int indexToRun,
572  int indexToLumi,
573  int indexToEventRange,
574  long long indexToEvent,
575  long long nEvents);
576 
577  virtual IndexIntoFileItrImpl* clone() const;
578 
579  virtual int processHistoryIDIndex() const;
580  virtual RunNumber_t run() const;
581  virtual LuminosityBlockNumber_t lumi() const;
582  virtual EntryNumber_t entry() const;
584  virtual EntryNumber_t peekAheadAtEventEntry() const;
585  virtual bool skipLumiInRun();
586 
587  private:
588 
589  virtual void initializeLumi_();
590  virtual bool nextEventRange();
591  virtual bool previousEventRange();
592  virtual bool setToLastEventInRange(int index);
593  virtual EntryType getRunOrLumiEntryType(int index) const;
594  virtual bool isSameLumi(int index1, int index2) const;
595  virtual bool isSameRun(int index1, int index2) const;
596  };
597 
598  //*****************************************************************************
599  //*****************************************************************************
600 
602  public:
604  EntryType entryType,
605  int indexToRun,
606  int indexToLumi,
607  int indexToEventRange,
608  long long indexToEvent,
609  long long nEvents);
610 
611  virtual IndexIntoFileItrImpl* clone() const;
612  virtual int processHistoryIDIndex() const;
613  virtual RunNumber_t run() const;
614  virtual LuminosityBlockNumber_t lumi() const;
615  virtual EntryNumber_t entry() const;
617  virtual EntryNumber_t peekAheadAtEventEntry() const;
618  virtual bool skipLumiInRun();
619 
620  private:
621 
622  virtual void initializeLumi_();
623  virtual bool nextEventRange();
624  virtual bool previousEventRange();
625  virtual bool setToLastEventInRange(int index);
626  virtual EntryType getRunOrLumiEntryType(int index) const;
627  virtual bool isSameLumi(int index1, int index2) const;
628  virtual bool isSameRun(int index1, int index2) const;
629  };
630 
631  //*****************************************************************************
632  //*****************************************************************************
633 
635  public:
645  SortOrder sortOrder,
646  EntryType entryType,
647  int indexToRun,
648  int indexToLumi,
649  int indexToEventRange,
650  long long indexToEvent,
651  long long nEvents);
652 
653 
654  EntryType getEntryType() const {return impl_->getEntryType();}
655  int processHistoryIDIndex() const {return impl_->processHistoryIDIndex();}
656  RunNumber_t run() const {return impl_->run();}
657  LuminosityBlockNumber_t lumi() const {return impl_->lumi();}
658  EntryNumber_t entry() const {return impl_->entry();}
659 
662  LuminosityBlockNumber_t peekAheadAtLumi() const { return impl_->peekAheadAtLumi(); }
663 
666  EntryNumber_t peekAheadAtEventEntry() const { return impl_->peekAheadAtEventEntry(); }
667 
668  // This is intentionally not implemented.
669  // It would be difficult to implement for the no sort mode,
670  // either slow or using extra memory.
671  // It would be easy to implement for the sorted iteration,
672  // but I did not implement it so both cases would offer a
673  // consistent interface.
674  // It looks like in all cases where this would be needed
675  // it would not be difficult to get the event number
676  // directly from the event auxiliary.
677  // We may need to revisit this decision in the future.
678  // EventNumber_t event() const;
679 
680 
683  impl_->next();
684  return *this;
685  }
686 
692  void skipEventForward(int& phIndexOfSkippedEvent,
693  RunNumber_t& runOfSkippedEvent,
694  LuminosityBlockNumber_t& lumiOfSkippedEvent,
695  EntryNumber_t& skippedEventEntry) {
696  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
697  }
698 
706  void skipEventBackward(int& phIndexOfEvent,
707  RunNumber_t& runOfEvent,
708  LuminosityBlockNumber_t& lumiOfEvent,
709  EntryNumber_t& eventEntry) {
710  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
711  }
712 
715  bool skipLumiInRun() { return impl_->skipLumiInRun(); }
716 
719  bool skipToNextEventInLumi() { return impl_->skipToNextEventInLumi(); }
720 
721  void advanceToNextRun() {impl_->advanceToNextRun();}
722  void advanceToNextLumiOrRun() {impl_->advanceToNextLumiOrRun();}
723 
724  void advanceToEvent();
725  void advanceToLumi();
726 
727  bool operator==(IndexIntoFileItr const& right) const {
728  return *impl_ == *right.impl_;
729  }
730 
731  bool operator!=(IndexIntoFileItr const& right) const {
732  return !(*this == right);
733  }
734 
736  void initializeRun() {impl_->initializeRun();}
737 
739  void initializeLumi() {impl_->initializeLumi();}
740 
743 
744  private:
745 
746  // The rest of these are intended to be used only by code which tests
747  // this class.
748  IndexIntoFile const* indexIntoFile() const { return impl_->indexIntoFile(); }
749  int size() const { return impl_->size(); }
750  EntryType type() const { return impl_->type(); }
751  int indexToRun() const { return impl_->indexToRun(); }
752  int indexToLumi() const { return impl_->indexToLumi(); }
753  int indexToEventRange() const { return impl_->indexToEventRange(); }
754  long long indexToEvent() const { return impl_->indexToEvent(); }
755  long long nEvents() const { return impl_->nEvents(); }
756 
758  };
759 
760  //*****************************************************************************
761  //*****************************************************************************
762 
763  class IndexRunKey {
764  public:
766  processHistoryIDIndex_(index),
767  run_(run) {
768  }
769 
771  RunNumber_t run() const {return run_;}
772 
773  bool operator<(IndexRunKey const& right) const {
775  return run_ < right.run();
776  }
778  }
779 
780  private:
783  };
784 
785  //*****************************************************************************
786  //*****************************************************************************
787 
789  public:
791  processHistoryIDIndex_(index),
792  run_(run),
793  lumi_(lumi) {
794  }
795 
797  RunNumber_t run() const {return run_;}
799 
800  bool operator<(IndexRunLumiKey const& right) const {
802  if (run_ == right.run()) {
803  return lumi_ < right.lumi();
804  }
805  return run_ < right.run();
806  }
808  }
809 
810  private:
814  };
815 
816  //*****************************************************************************
817  //*****************************************************************************
818 
820  public:
822  processHistoryIDIndex_(index),
823  run_(run),
824  lumi_(lumi),
825  event_(event) {
826  }
827 
829  RunNumber_t run() const {return run_;}
831  EventNumber_t event() const {return event_;}
832 
833  bool operator<(IndexRunLumiEventKey const& right) const {
835  if (run_ == right.run()) {
836  if (lumi_ == right.lumi()) {
837  return event_ < right.event();
838  }
839  return lumi_ < right.lumi();
840  }
841  return run_ < right.run();
842  }
844  }
845 
846  private:
851  };
852 
853  //*****************************************************************************
854  //*****************************************************************************
855 
856  class EventFinder {
857  public:
858  virtual ~EventFinder() {}
860  };
861 
862  //*****************************************************************************
863  //*****************************************************************************
864 
865  struct Transients {
866  Transients();
868  std::map<IndexRunKey, EntryNumber_t> runToFirstEntry_;
869  std::map<IndexRunLumiKey, EntryNumber_t> lumiToFirstEntry_;
876  boost::shared_ptr<EventFinder> eventFinder_;
877  std::vector<RunOrLumiIndexes> runOrLumiIndexes_;
878  std::vector<EventNumber_t> eventNumbers_;
879  std::vector<EventEntry> eventEntries_;
880  std::vector<EventNumber_t> unsortedEventNumbers_;
881  };
882 
883  //*****************************************************************************
884  //*****************************************************************************
885 
886  // The next two functions are used by the output module to fill the
887  // persistent data members.
888 
896 
902 
903  //*****************************************************************************
904  //*****************************************************************************
905 
906  // The next group of functions is used by the PoolSource (or other
907  // input related code) to fill the IndexIntoFile.
908 
914  void fixIndexes(std::vector<ProcessHistoryID>& processHistoryIDs);
915 
919  transients_.get().numberOfEvents_ = nevents;
920  }
921 
927  void setEventFinder(boost::shared_ptr<EventFinder> ptr) const {transients_.get().eventFinder_ = ptr;}
928 
942  void fillEventNumbers() const;
943 
957  void fillEventEntries() const;
958 
964  void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const;
965 
969  std::vector<EventNumber_t>& unsortedEventNumbers() const {return transients_.get().unsortedEventNumbers_;}
970 
973  void inputFileClosed() const;
974 
976  void doneFileInitialization() const;
977 
981  std::vector<RunOrLumiEntry>& setRunOrLumiEntries() {return runOrLumiEntries_;}
982 
986  std::vector<ProcessHistoryID>& setProcessHistoryIDs() {return processHistoryIDs_;}
987 
988  //*****************************************************************************
989  //*****************************************************************************
990 
992  std::vector<RunOrLumiEntry> const& runOrLumiEntries() const {return runOrLumiEntries_;}
993 
994  private:
995 
998  void fillRunOrLumiIndexes() const;
999 
1000  void fillUnsortedEventNumbers() const;
1001  void resetEventFinder() const {transients_.get().eventFinder_.reset();}
1002  std::vector<EventEntry>& eventEntries() const {return transients_.get().eventEntries_;}
1003  std::vector<EventNumber_t>& eventNumbers() const {return transients_.get().eventNumbers_;}
1004  void sortEvents() const;
1005  void sortEventEntries() const;
1006  int& previousAddedIndex() const {return transients_.get().previousAddedIndex_;}
1007  std::map<IndexRunKey, EntryNumber_t>& runToFirstEntry() const {return transients_.get().runToFirstEntry_;}
1008  std::map<IndexRunLumiKey, EntryNumber_t>& lumiToFirstEntry() const {return transients_.get().lumiToFirstEntry_;}
1009  EntryNumber_t& beginEvents() const {return transients_.get().beginEvents_;}
1010  EntryNumber_t& endEvents() const {return transients_.get().endEvents_;}
1011  int& currentIndex() const {return transients_.get().currentIndex_;}
1012  RunNumber_t& currentRun() const {return transients_.get().currentRun_;}
1013  LuminosityBlockNumber_t& currentLumi() const {return transients_.get().currentLumi_;}
1014  std::vector<RunOrLumiIndexes>& runOrLumiIndexes() const {return transients_.get().runOrLumiIndexes_;}
1015  size_t numberOfEvents() const {return transients_.get().numberOfEvents_;}
1017  return transients_.get().eventFinder_->getEventNumberOfEntry(entry);
1018  }
1019 
1021 
1022  std::vector<ProcessHistoryID> processHistoryIDs_;
1023  std::vector<RunOrLumiEntry> runOrLumiEntries_;
1024  };
1025 
1026  template <>
1027  struct value_ptr_traits<IndexIntoFile::IndexIntoFileItrImpl> {
1029  };
1030 
1031 
1033  public:
1035  };
1036 
1038  public:
1040  };
1041 }
1042 
1043 #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:41
virtual EntryType getRunOrLumiEntryType(int index) const
virtual bool setToLastEventInRange(int index)=0
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: SSEVec.h:37
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
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)
Transient< Transients > transients_
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 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_
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_
mathSSE::Vec4< T > v
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
are no more events in the current run or lumi.
IndexIntoFileItrNoSort(IndexIntoFile const *indexIntoFile, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
RunOrLumiIndexes const & runOrLumiIndexes() const