LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 // vim: set sw=2 expandtab :
4 
5 //
6 // OpenRangeSetHandler
7 //
8 // This class is used to track the in-memory RangeSet for processes
9 // whose sources are EmptyEvent or similar. The RangeSet is only
10 // seeded with a run number, and the RangeSet grows whenever a new
11 // event is processed. In other words, an OpenRangeSetHandler
12 // instance does not inherit any RangeSet from another source; it
13 // starts from scratch.
14 //
15 // N.B. Event-filtering does not affect the calculation of the
16 // RangeSet since the RangeSet tracks all processed events, even
17 // those that were rejected due to failing a filter criterion.
18 //
19 // In the case of an output-file switch, the RangeSet is
20 // "rebased" (or cleared for an OpenRangeSetHandler). The update
21 // function will appropriately assign the RangeHandler to the
22 // correct IDs when the next event is read. For example, if
23 // EmptyEvent has been configured to produce 20 events for Run 1,
24 // SubRun 0, and there is an output-file switch after event 10,
25 // the RangeSets for the two files will be:
26 //
27 // File A RangeSet = Run: 1 SubRun: 0 Event range: [1,11)
28 // File B RangeSet = Run: 1 SubRun: 0 Event range: [11,20)
29 //
30 // regardless of any events that may have failed a filter.
31 //
32 
36 
37 namespace art {
38 
39  class OpenRangeSetHandler final : public RangeSetHandler {
40  public:
41  virtual ~OpenRangeSetHandler();
42 
44  explicit OpenRangeSetHandler(RangeSet const&);
45 
48 
51 
52  private:
53  HandlerType do_type() const override;
54  RangeSet do_getSeenRanges() const override;
55 
56  void do_update(EventID const&, bool lastInSubRun) override;
57  void do_flushRanges() override;
58  void do_maybeSplitRange() override;
59  void do_rebase() override;
60  RangeSetHandler* do_clone() const override;
61 
63  std::size_t idx_{0};
64  };
65 
66 } // namespace art
67 
68 #endif /* art_Framework_Principal_OpenRangeSetHandler_h */
69 
70 // Local Variables:
71 // mode: c++
72 // End:
TRandom r
Definition: spectrum.C:23
OpenRangeSetHandler & operator=(OpenRangeSetHandler const &)
HandlerType do_type() const override
void do_maybeSplitRange() override
void do_update(EventID const &, bool lastInSubRun) override
RangeSetHandler * do_clone() const override
static RangeSet invalid()
Definition: RangeSet.cc:45
Definition: MVAAlg.h:12
RangeSet do_getSeenRanges() const override
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120