LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
OpenRangeSetHandler.h
Go to the documentation of this file.
1 #ifndef art_Framework_Principal_OpenRangeSetHandler_h
2 #define art_Framework_Principal_OpenRangeSetHandler_h
3 
4 // ===================================================================
5 // OpenRangeSetHandler
6 //
7 // This class is used to track the in-memory RangeSet for processes
8 // whose sources are EmptyEvent or similar. The RangeSet is only
9 // seeded with a run number, and the RangeSet grows whenever a new
10 // event is processed. In other words, an OpenRangeSetHandler
11 // instance does not inherit any RangeSet from another source; it
12 // starts from scratch.
13 //
14 // N.B. Event-filtering does not affect the calculation of the
15 // RangeSet since the RangeSet tracks all processed events, even
16 // those that were rejected due to failing a filter criterion.
17 //
18 // In the case of an output-file switch, the RangeSet is
19 // "rebased" (or cleared for an OpenRangeSetHandler). The update
20 // function will appropriately assign the RangeHandler to the
21 // correct IDs when the next event is read. For example, if
22 // EmptyEvent has been configured to produce 20 events for Run 1,
23 // SubRun 0, and there is an output-file switch after event 10,
24 // the RangeSets for the two files will be:
25 //
26 // File A RangeSet = Run: 1 SubRun: 0 Event range: [1,11)
27 // File B RangeSet = Run: 1 SubRun: 0 Event range: [11,20)
28 //
29 // regardless of any events that may have failed a filter.
30 // ===================================================================
31 
36 
37 #include <string>
38 #include <vector>
39 
40 namespace art {
41 
43  public:
44  explicit OpenRangeSetHandler(RunNumber_t r);
45 
46  // This class contains an iterator as a member. It should not be
47  // copied!
50 
53 
54  private:
55  RangeSet do_getSeenRanges() const override;
56 
57  void do_update(EventID const&, bool lastInSubRun) override;
58  void
59  do_flushRanges() override
60  {}
61  void
62  do_maybeSplitRange() override
63  {}
64  void do_rebase() override;
65 
68  };
69 }
70 #endif /* art_Framework_Principal_OpenRangeSetHandler_h */
71 
72 // Local Variables:
73 // mode: c++
74 // End:
std::vector< EventRange >::const_iterator const_iterator
Definition: RangeSet.h:33
auto begin() const
Definition: RangeSet.h:70
void do_maybeSplitRange() override
OpenRangeSetHandler & operator=(OpenRangeSetHandler const &)=delete
void do_update(EventID const &, bool lastInSubRun) override
RangeSet::const_iterator rsIter_
static RangeSet invalid()
Definition: RangeSet.cc:46
HLT enums.
RangeSet do_getSeenRanges() const override
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:119