AddNoise.h
Go to the documentation of this file.
1 // This adds noise to traces of its input frame to make a new output
2 // frame. It should be given voltage-level input. The model
3 // determins the noise waveform length so should be made to coincide
4 // with the length of input waveforms. Thus, this component works
5 // only on rectangular, dense frames
6 
7 #ifndef WIRECELL_GEN_ADDNOISE
8 #define WIRECELL_GEN_ADDNOISE
9 
12 #include "WireCellIface/IRandom.h"
14 #include "WireCellUtil/Waveform.h"
15 #include "WireCellUtil/Logging.h"
16 
17 #include <string>
18 
19 namespace WireCell {
20  namespace Gen {
21 
22  class AddNoise : public IFrameFilter, public IConfigurable {
23  public:
24  AddNoise(const std::string& model = "",
25  const std::string& rng="Random");
26 
27  virtual ~AddNoise();
28 
29  /// IFrameFilter
30  virtual bool operator()(const input_pointer& inframe, output_pointer& outframe);
31 
32  /// IConfigurable
33  virtual void configure(const WireCell::Configuration& config);
35 
36  private:
39 
42  double m_rep_percent;
43 
45  };
46  }
47 }
48 
49 #endif
virtual void configure(const WireCell::Configuration &config)
IConfigurable.
Definition: AddNoise.cxx:46
std::string string
Definition: nybbler.cc:12
virtual bool operator()(const input_pointer &inframe, output_pointer &outframe)
IFrameFilter.
Definition: AddNoise.cxx:61
Log::logptr_t log
Definition: AddNoise.h:44
AddNoise(const std::string &model="", const std::string &rng="Random")
Definition: AddNoise.cxx:19
std::shared_ptr< const IFrame > input_pointer
Definition: IFunctionNode.h:39
IChannelSpectrum::pointer m_model
Definition: AddNoise.h:38
std::string m_model_tn
Definition: AddNoise.h:40
static Config * config
Definition: config.cpp:1054
std::shared_ptr< Interface > pointer
Definition: Interface.h:16
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Definition: AddNoise.cxx:33
std::shared_ptr< const IFrame > output_pointer
Definition: IFunctionNode.h:40
std::shared_ptr< spdlog::logger > logptr_t
Definition: Logging.h:24
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
IRandom::pointer m_rng
Definition: AddNoise.h:37
std::string m_rng_tn
Definition: AddNoise.h:40