OmnibusNoiseFilter.h
Go to the documentation of this file.
1 /** Remove all possible noise from a microboone-like detector.
2  *
3  * This filter is a kitchen sink class and is a candidate for
4  * factoring.
5  */
6 
7 #ifndef WIRECELLSIGPROC_OMNIBUSNOISEFILTER
8 #define WIRECELLSIGPROC_OMNIBUSNOISEFILTER
9 
14 
15 #include "WireCellUtil/Waveform.h"
16 #include "WireCellUtil/Logging.h"
17 
18 
19 #include <vector>
20 #include <map>
21 #include <string>
22 
23 namespace WireCell {
24  namespace SigProc {
25 
26  /**
27  The Omnibus Noise Filter applies two series of IChannelFilter
28  objects. The first series is applied on a per-channel basis and
29  the second is applied on groups of channels as determined by
30  its channel grouping.
31  */
33  public:
34  typedef std::vector< std::vector<int> > grouped_channels_t;
35 
36  /// Create an OmnibusNoiseFilter.
37  OmnibusNoiseFilter(std::string intag="orig", std::string outtag="raw");
38  virtual ~OmnibusNoiseFilter();
39 
40  /// IFrameFilter interface.
41  virtual bool operator()(const input_pointer& in, output_pointer& out);
42 
43  /// IConfigurable interface.
44  virtual void configure(const WireCell::Configuration& config);
46 
47 
48 
49 
50  // Local methods. Real code should not use these. Expose for unit tests
51 
52  void set_channel_filters(std::vector<WireCell::IChannelFilter::pointer> filters) {
54  }
55  void set_channel_status_filters(std::vector<WireCell::IChannelFilter::pointer> filters) {
57  }
58  void set_grouped_filters(std::vector<WireCell::IChannelFilter::pointer> filters) {
60  }
62  m_noisedb = ndb;
63  }
64 
65  private:
66  // number of time ticks in the waveforms processed. Set to 0 and first input trace sets it.
67  size_t m_nticks;
69  std::vector<WireCell::IChannelFilter::pointer> m_perchan, m_grouped, m_perchan_status;
71 
72  std::map<std::string, std::string> m_maskmap;
73 
75  };
76 
77  }
78 }
79 #endif
80 
81 // Local Variables:
82 // mode: c++
83 // c-basic-offset: 4
84 // End:
std::vector< WireCell::IChannelFilter::pointer > m_perchan
virtual void configure(const WireCell::Configuration &config)
IConfigurable interface.
std::vector< std::vector< int > > grouped_channels_t
void set_channel_filters(std::vector< WireCell::IChannelFilter::pointer > filters)
std::string string
Definition: nybbler.cc:12
std::map< std::string, std::string > m_maskmap
virtual bool operator()(const input_pointer &in, output_pointer &out)
IFrameFilter interface.
std::vector< WireCell::IChannelFilter::pointer > m_grouped
std::shared_ptr< const IFrame > input_pointer
Definition: IFunctionNode.h:39
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
void set_channel_noisedb(WireCell::IChannelNoiseDatabase::pointer ndb)
static Config * config
Definition: config.cpp:1054
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
void set_channel_status_filters(std::vector< WireCell::IChannelFilter::pointer > filters)
std::shared_ptr< const IFrame > output_pointer
Definition: IFunctionNode.h:40
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
std::vector< WireCell::IChannelFilter::pointer > m_perchan_status
Definition: Main.h:22
OmnibusNoiseFilter(std::string intag="orig", std::string outtag="raw")
Create an OmnibusNoiseFilter.
Json::Value Configuration
Definition: Configuration.h:50
WireCell::IChannelNoiseDatabase::pointer m_noisedb
void set_grouped_filters(std::vector< WireCell::IChannelFilter::pointer > filters)
def filters(nticks=9600, tick=0.5 *units.us, npitches=3000, pitch=1.0)
Definition: __init__.py:555