All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DummyFilter_module.cc
Go to the documentation of this file.
1 /**
2  * @file DummyFilter_module.cc
3  * @brief An _art_ filter which does nothing.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date July 15, 2021
6  *
7  */
8 
9 // framework libraries
10 #include "art/Framework/Core/SharedFilter.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 
13 
14 //------------------------------------------------------------------------------
15 /**
16  * @brief Filter module which passes everything.
17  * @see DummyProducer
18  *
19  * This module accepts any FHiCL configuration (which it ignores), acts like a
20  * filter that passes everything, does not consume anything and does not produce
21  * anything.
22  *
23  * It is a "good" way to remove a filter module from a job without having to
24  * mess with much configuration: just target it with a:
25  *
26  * physics.producers.redundantmod.module_type: DummyFilter
27  *
28  *
29  * Configuration parameters
30  * =========================
31  *
32  * Anything.
33  *
34  */
35 class DummyFilter: public art::SharedFilter {
36 
37  public:
38 
39  DummyFilter(fhicl::ParameterSet const& params, const art::ProcessingFrame&)
40  : art::SharedFilter{ params }
41  { async<art::InEvent>(); }
42 
43  virtual bool filter(art::Event&, const art::ProcessingFrame&) override
44  { return true; }
45 
46 }; // class DummyFilter
47 
48 
49 DEFINE_ART_MODULE(DummyFilter)
50 
51 //------------------------------------------------------------------------------
52 
DummyFilter(fhicl::ParameterSet const &params, const art::ProcessingFrame &)
Filter module which passes everything.
virtual bool filter(art::Event &, const art::ProcessingFrame &) override