CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FileIndex.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_FileIndex_h
2 #define DataFormats_Provenance_FileIndex_h
3 
4 /*----------------------------------------------------------------------
5 
6 FileIndex.h
7 
8 ----------------------------------------------------------------------*/
9 
10 #include <vector>
11 #include <cassert>
15 
16 #include <iosfwd>
17 
18 namespace edm {
19 
20  class FileIndex {
21 
22  public:
23  typedef long long EntryNumber_t;
24 
25  FileIndex();
27 
29 
31 
32  class Element {
33  public:
34  static EntryNumber_t const invalidEntry = -1LL;
35  Element() : run_(0U), lumi_(0U), event_(0U), entry_(invalidEntry) {
36  }
38  run_(run), lumi_(lumi),
39  event_(event), entry_(entry) {
40  assert(lumi_ != 0U || event_ == 0U);
41  }
43  run_(run), lumi_(lumi), event_(event), entry_(invalidEntry) {}
45  return lumi_ == 0U ? kRun : (event_ == 0U ? kLumi : kEvent);
46  }
51  };
52 
53  typedef std::vector<Element>::const_iterator const_iterator;
54 
55  typedef std::vector<Element>::iterator iterator;
56 
57  void sortBy_Run_Lumi_Event();
59 
62 
65 
68 
71 
74 
77 
78  bool
80  return event ? containsEvent(run, lumi, event) : (lumi ? containsLumi(run, lumi) : containsRun(run));
81  }
82 
83  bool
85  return findEventPosition(run, lumi, event) != entries_.end();
86  }
87 
88  bool
90  return findLumiPosition(run, lumi) != entries_.end();
91  }
92 
93  bool
95  return findRunPosition(run) != entries_.end();
96  }
97 
98  const_iterator begin() const {return entries_.begin();}
99 
100  const_iterator end() const {return entries_.end();}
101 
102  iterator begin() {return entries_.begin();}
103 
104  iterator end() {return entries_.end();}
105 
106  iterator erase(iterator pos) {return entries_.erase(pos);}
107 
108  iterator erase(iterator begin, iterator end) {return entries_.erase(begin, end);}
109 
111 
112  bool empty() const {return entries_.empty();}
113 
114  bool allEventsInEntryOrder() const;
115 
117 
118  struct Transients {
119  Transients();
123  };
124 
125  private:
126 
127  bool& allInEntryOrder() const {return transients_.get().allInEntryOrder_;}
128  bool& resultCached() const {return transients_.get().resultCached_;}
129  SortState& sortState() const {return transients_.get().sortState_;}
130 
131  std::vector<Element> entries_;
133  };
134 
135  bool operator<(FileIndex::Element const& lh, FileIndex::Element const& rh);
136 
137  inline
138  bool operator>(FileIndex::Element const& lh, FileIndex::Element const& rh) {return rh < lh;}
139 
140  inline
141  bool operator>=(FileIndex::Element const& lh, FileIndex::Element const& rh) {return !(lh < rh);}
142 
143  inline
144  bool operator<=(FileIndex::Element const& lh, FileIndex::Element const& rh) {return !(rh < lh);}
145 
146  inline
147  bool operator==(FileIndex::Element const& lh, FileIndex::Element const& rh) {return !(lh < rh || rh < lh);}
148 
149  inline
150  bool operator!=(FileIndex::Element const& lh, FileIndex::Element const& rh) {return lh < rh || rh < lh;}
151 
153  public:
154  bool operator()(FileIndex::Element const& lh, FileIndex::Element const& rh);
155  };
156 
157  std::ostream&
158  operator<<(std::ostream& os, FileIndex const& fileIndex);
159 }
160 
161 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:89
const_iterator findEventEntryPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry) const
Definition: FileIndex.cc:156
bool & allInEntryOrder() const
Definition: FileIndex.h:127
unsigned int EventNumber_t
Definition: EventID.h:30
bool operator()(FileIndex::Element const &lh, FileIndex::Element const &rh)
Definition: FileIndex.cc:186
tuple lumi
Definition: fjr2json.py:41
SortState & sortState() const
Definition: FileIndex.h:129
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
bool int lh
Definition: SSEVec.h:37
uint16_t size_type
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
void sortBy_Run_Lumi_EventEntry()
Definition: FileIndex.cc:34
bool operator<=(View< T > const &, View< T > const &)
Definition: View.h:414
iterator begin()
Definition: FileIndex.h:102
bool containsRun(RunNumber_t run) const
Definition: FileIndex.h:94
EntryNumber_t entry_
Definition: FileIndex.h:50
std::vector< Element >::const_iterator const_iterator
Definition: FileIndex.h:53
bool operator>=(View< T > const &, View< T > const &)
Definition: View.h:428
bool allEventsInEntryOrder() const
Definition: FileIndex.cc:40
static EntryNumber_t const invalidEntry
Definition: FileIndex.h:34
Transient< Transients > transients_
Definition: FileIndex.h:132
bool empty() const
Definition: FileIndex.h:112
long long EntryNumber_t
Definition: FileIndex.h:23
const_iterator findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: FileIndex.cc:85
bool containsLumi(RunNumber_t run, LuminosityBlockNumber_t lumi) const
Definition: FileIndex.h:89
const_iterator findRunPosition(RunNumber_t run) const
Definition: FileIndex.cc:130
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
bool operator>(View< T > const &, View< T > const &)
Definition: View.h:421
const_iterator end() const
Definition: FileIndex.h:100
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
iterator erase(iterator pos)
Definition: FileIndex.h:106
const_iterator findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
Definition: FileIndex.cc:114
LuminosityBlockNumber_t lumi_
Definition: FileIndex.h:48
iterator erase(iterator begin, iterator end)
Definition: FileIndex.h:108
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: FileIndex.h:79
bool containsEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: FileIndex.h:84
const_iterator findLumiOrRunPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
Definition: FileIndex.cc:146
std::vector< Element > entries_
Definition: FileIndex.h:131
void sortBy_Run_Lumi_Event()
Definition: FileIndex.cc:28
Element(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: FileIndex.h:42
void addEntry(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, EntryNumber_t entry)
Definition: FileIndex.cc:22
EntryType getEntryType() const
Definition: FileIndex.h:44
const_iterator findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
Definition: FileIndex.cc:60
bool & resultCached() const
Definition: FileIndex.h:128
std::vector< Element >::size_type size() const
Definition: FileIndex.h:110
const_iterator begin() const
Definition: FileIndex.h:98
unsigned int RunNumber_t
Definition: EventRange.h:32
iterator end()
Definition: FileIndex.h:104
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
EventNumber_t event_
Definition: FileIndex.h:49
Element(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, long long entry)
Definition: FileIndex.h:37
std::vector< Element >::iterator iterator
Definition: FileIndex.h:55