EDFilter.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_EDFilter_h
2 #define art_Framework_Core_EDFilter_h
3 // vim: set sw=2 expandtab :
4 
10 #include "fhiclcpp/ParameterSet.h"
11 
12 #include <string>
13 
14 namespace art {
15 
16  class EDFilter : public detail::Filter, private detail::LegacyModule {
17  public:
20 
21  explicit EDFilter(fhicl::ParameterSet const& pset)
22  : detail::Filter{pset}
23  , detail::LegacyModule{pset.get<std::string>("module_label")}
24  {}
25 
26  template <typename Config>
27  explicit EDFilter(Table<Config> const& config) : EDFilter{config.get_PSet()}
28  {}
29 
34 
35  std::string workerType() const;
36 
37  private:
38  void setupQueues(detail::SharedResources const& resources) override final;
39  void beginJobWithFrame(ProcessingFrame const&) override final;
40  void endJobWithFrame(ProcessingFrame const&) override final;
42  ProcessingFrame const&) override final;
44  FileBlock const&,
45  ProcessingFrame const&) override final;
47  FileBlock const&,
48  ProcessingFrame const&) override final;
50  FileBlock const&,
51  ProcessingFrame const&) override final;
52  bool beginRunWithFrame(Run&, ProcessingFrame const&) override final;
53  bool endRunWithFrame(Run&, ProcessingFrame const&) override final;
54  bool beginSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
55  bool endSubRunWithFrame(SubRun&, ProcessingFrame const&) override final;
56  bool filterWithFrame(Event&, ProcessingFrame const&) override final;
57 
58  virtual void beginJob();
59  virtual void endJob();
60  virtual void respondToOpenInputFile(FileBlock const&);
61  virtual void respondToCloseInputFile(FileBlock const&);
62  virtual void respondToOpenOutputFiles(FileBlock const&);
63  virtual void respondToCloseOutputFiles(FileBlock const&);
64  virtual bool beginRun(Run&);
65  virtual bool endRun(Run&);
66  virtual bool beginSubRun(SubRun&);
67  virtual bool endSubRun(SubRun&);
68  virtual bool filter(Event&) = 0;
69  };
70 
71 } // namespace art
72 
73 #endif /* art_Framework_Core_EDFilter_h */
74 
75 // Local Variables:
76 // mode: c++
77 // End:
base_engine_t & createEngine(seed_t seed)
void beginJobWithFrame(ProcessingFrame const &) override final
Definition: EDFilter.cc:47
bool beginSubRunWithFrame(SubRun &, ProcessingFrame const &) override final
Definition: EDFilter.cc:71
void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: EDFilter.cc:26
virtual void respondToOpenOutputFiles(FileBlock const &)
Definition: EDFilter.cc:107
void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: EDFilter.cc:33
bool endRunWithFrame(Run &, ProcessingFrame const &) override final
Definition: EDFilter.cc:65
std::string string
Definition: nybbler.cc:12
virtual bool beginRun(Run &)
Definition: EDFilter.cc:115
EDFilter(Table< Config > const &config)
Definition: EDFilter.h:27
bool endSubRunWithFrame(SubRun &, ProcessingFrame const &) override final
Definition: EDFilter.cc:77
std::set< std::string > const & sharedResources() const
Definition: SharedModule.cc:28
std::string workerType() const
Definition: EDFilter.cc:7
virtual bool filter(Event &)=0
Definition: Run.h:17
void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: EDFilter.cc:19
virtual bool beginSubRun(SubRun &)
Definition: EDFilter.cc:127
void endJobWithFrame(ProcessingFrame const &) override final
Definition: EDFilter.cc:53
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDFilter.cc:103
bool filterWithFrame(Event &, ProcessingFrame const &) override final
Definition: EDFilter.cc:83
ScheduleID scheduleID() const noexcept
Definition: LegacyModule.cc:12
static Config * config
Definition: config.cpp:1054
bool beginRunWithFrame(Run &, ProcessingFrame const &) override final
Definition: EDFilter.cc:59
virtual void beginJob()
Definition: EDFilter.cc:91
void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &) override final
Definition: EDFilter.cc:40
auto const & get_PSet() const
Definition: ProducerTable.h:47
virtual bool endSubRun(SubRun &)
Definition: EDFilter.cc:133
virtual void respondToCloseOutputFiles(FileBlock const &)
Definition: EDFilter.cc:111
void setupQueues(detail::SharedResources const &resources) override final
Definition: EDFilter.cc:13
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.h:21
virtual void endJob()
Definition: EDFilter.cc:95
virtual bool endRun(Run &)
Definition: EDFilter.cc:121
hep::concurrency::SerialTaskQueueChain * serialTaskQueueChain() const
Definition: SharedModule.cc:22
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDFilter.cc:99