SharedFilter.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_SharedFilter_h
2 #define art_Framework_Core_SharedFilter_h
3 // vim: set sw=2 expandtab :
4 
11 #include "fhiclcpp/ParameterSet.h"
12 
13 #include <string>
14 
15 namespace art {
16 
18  public:
21 
22  explicit SharedFilter(fhicl::ParameterSet const& pset)
23  : detail::Filter{pset}
24  , detail::SharedModule{pset.get<std::string>("module_label")}
25  {}
26 
27  template <typename Config>
29  : SharedFilter{config.get_PSet()}
30  {}
31 
32  std::string workerType() const;
33 
34  private:
35  void setupQueues(detail::SharedResources const& resources) override final;
36  void beginJobWithFrame(ProcessingFrame const&) override final;
37  void endJobWithFrame(ProcessingFrame const&) override final;
39  ProcessingFrame const&) override final;
41  FileBlock const&,
42  ProcessingFrame const&) override final;
44  FileBlock const&,
45  ProcessingFrame const&) override final;
47  FileBlock const&,
48  ProcessingFrame const&) override final;
49  bool beginRunWithFrame(Run&, ProcessingFrame const&) override final;
50  bool endRunWithFrame(Run&, ProcessingFrame const&) override final;
51  bool beginSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
52  bool endSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
53  bool filterWithFrame(Event&, ProcessingFrame const&) override final;
54 
55  virtual void beginJob(ProcessingFrame const&);
56  virtual void endJob(ProcessingFrame const&);
57  virtual void respondToOpenInputFile(FileBlock const&,
58  ProcessingFrame const&);
59  virtual void respondToCloseInputFile(FileBlock const&,
60  ProcessingFrame const&);
61  virtual void respondToOpenOutputFiles(FileBlock const&,
62  ProcessingFrame const&);
63  virtual void respondToCloseOutputFiles(FileBlock const&,
64  ProcessingFrame const&);
65  virtual void beginRun(Run&, ProcessingFrame const&);
66  virtual void endRun(Run&, ProcessingFrame const&);
67  virtual void beginSubRun(SubRun&, ProcessingFrame const&);
68  virtual void endSubRun(SubRun&, ProcessingFrame const&);
69  virtual bool filter(Event&, ProcessingFrame const&) = 0;
70  };
71 
72 } // namespace art
73 
74 #endif /* art_Framework_Core_SharedFilter_h */
75 
76 // Local Variables:
77 // mode: c++
78 // End:
void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:33
void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:19
void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:26
virtual void respondToOpenInputFile(FileBlock const &, ProcessingFrame const &)
std::string string
Definition: nybbler.cc:12
bool beginRunWithFrame(Run &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:59
virtual void endSubRun(SubRun &, ProcessingFrame const &)
bool beginSubRunWithFrame(SubRun &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:73
SharedFilter(fhicl::ParameterSet const &pset)
Definition: SharedFilter.h:22
SharedFilter(Table< Config > const &config)
Definition: SharedFilter.h:28
virtual void endJob(ProcessingFrame const &)
Definition: SharedFilter.cc:98
void endJobWithFrame(ProcessingFrame const &) override final
Definition: SharedFilter.cc:53
Definition: Run.h:17
virtual void respondToOpenOutputFiles(FileBlock const &, ProcessingFrame const &)
void beginJobWithFrame(ProcessingFrame const &) override final
Definition: SharedFilter.cc:47
virtual void respondToCloseOutputFiles(FileBlock const &, ProcessingFrame const &)
virtual void respondToCloseInputFile(FileBlock const &, ProcessingFrame const &)
bool filterWithFrame(Event &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:87
static Config * config
Definition: config.cpp:1054
void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:40
void setupQueues(detail::SharedResources const &resources) override final
Definition: SharedFilter.cc:13
virtual void endRun(Run &, ProcessingFrame const &)
virtual void beginRun(Run &, ProcessingFrame const &)
auto const & get_PSet() const
Definition: ProducerTable.h:47
std::string workerType() const
Definition: SharedFilter.cc:7
virtual void beginSubRun(SubRun &, ProcessingFrame const &)
bool endSubRunWithFrame(SubRun &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:80
virtual void beginJob(ProcessingFrame const &)
Definition: SharedFilter.cc:94
bool endRunWithFrame(Run &, ProcessingFrame const &) override final
Definition: SharedFilter.cc:66
virtual bool filter(Event &, ProcessingFrame const &)=0