LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SharedFilter.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
4 namespace art {
5 
7  : Filter{pset}, SharedModule{pset.get<std::string>("module_label")}
8  {}
9 
10  std::unique_ptr<Worker>
12  {
13  return std::make_unique<WorkerT<SharedFilter>>(this, wp);
14  }
15 
16  void
18  {
19  createQueues(resources);
20  }
21 
22  void
24  ProcessingFrame const& frame)
25  {
26  respondToOpenInputFile(fb, frame);
27  }
28 
29  void
31  ProcessingFrame const& frame)
32  {
33  respondToCloseInputFile(fb, frame);
34  }
35 
36  void
38  ProcessingFrame const& frame)
39  {
40  respondToOpenOutputFiles(fb, frame);
41  }
42 
43  void
45  ProcessingFrame const& frame)
46  {
47  respondToCloseOutputFiles(fb, frame);
48  }
49 
50  void
52  {
53  beginJob(frame);
54  }
55 
56  void
58  {
59  endJob(frame);
60  }
61 
62  bool
64  {
65  beginRun(r, frame);
66  return true;
67  }
68 
69  bool
71  {
72  endRun(r, frame);
73  return true;
74  }
75 
76  bool
78  {
79  beginSubRun(sr, frame);
80  return true;
81  }
82 
83  bool
85  {
86  endSubRun(sr, frame);
87  return true;
88  }
89 
90  bool
92  {
93  return filter(e, frame);
94  }
95 
96  // Default implementations
97  void
99  {}
100 
101  void
103  {}
104 
105  void
107  {}
108 
109  void
111  ProcessingFrame const&)
112  {}
113 
114  void
116  ProcessingFrame const&)
117  {}
118 
119  void
121  ProcessingFrame const&)
122  {}
123 
124  void
126  {}
127 
128  void
130  {}
131 
132  void
134  {}
135 
136  void
138  {}
139 
140 } // namespace art
TRandom r
Definition: spectrum.C:23
bool endSubRunWithFrame(SubRun &, ProcessingFrame const &) final
Definition: SharedFilter.cc:84
virtual void respondToOpenInputFile(FileBlock const &, ProcessingFrame const &)
bool filterWithFrame(Event &, ProcessingFrame const &) final
Definition: SharedFilter.cc:91
virtual void endSubRun(SubRun &, ProcessingFrame const &)
bool beginRunWithFrame(Run &, ProcessingFrame const &) final
Definition: SharedFilter.cc:63
void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &) final
Definition: SharedFilter.cc:30
void endJobWithFrame(ProcessingFrame const &) final
Definition: SharedFilter.cc:57
SharedFilter(fhicl::ParameterSet const &pset)
Definition: SharedFilter.cc:6
virtual void endJob(ProcessingFrame const &)
Definition: Run.h:37
virtual void respondToOpenOutputFiles(FileBlock const &, ProcessingFrame const &)
void beginJobWithFrame(ProcessingFrame const &) final
Definition: SharedFilter.cc:51
bool endRunWithFrame(Run &, ProcessingFrame const &) final
Definition: SharedFilter.cc:70
virtual void respondToCloseOutputFiles(FileBlock const &, ProcessingFrame const &)
virtual void respondToCloseInputFile(FileBlock const &, ProcessingFrame const &)
virtual void endRun(Run &, ProcessingFrame const &)
void setupQueues(detail::SharedResources const &resources) final
Definition: SharedFilter.cc:17
virtual void beginRun(Run &, ProcessingFrame const &)
TFile fb("Li6.root")
std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp) final
Definition: SharedFilter.cc:11
void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) final
Definition: SharedFilter.cc:37
void createQueues(SharedResources const &resources)
Definition: SharedModule.cc:34
virtual void beginSubRun(SubRun &, ProcessingFrame const &)
void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &) final
Definition: SharedFilter.cc:23
Definition: MVAAlg.h:12
bool beginSubRunWithFrame(SubRun &, ProcessingFrame const &) final
Definition: SharedFilter.cc:77
virtual void beginJob(ProcessingFrame const &)
Definition: SharedFilter.cc:98
Float_t e
Definition: plot.C:35
virtual bool filter(Event &, ProcessingFrame const &)=0
void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) final
Definition: SharedFilter.cc:44