RdChannelNoiseGenerator.h
Go to the documentation of this file.
1 #ifndef _RdChannelNoiseGenerator_RdChannelNoiseGenerator_h_
2 #define _RdChannelNoiseGenerator_RdChannelNoiseGenerator_h_
3 
4 #include <fwk/VModule.h>
5 #include <utl/ShadowPtr.h>
6 #include <utl/NoiseSaS.h>
7 #include <revt/Station.h>
8 
9 #include <boost/random.hpp>
10 #include <boost/random/exponential_distribution.hpp>
11 #include <boost/random/uniform_real.hpp>
12 
13 
14 namespace evt {
15  class Event;
16 }
17 
18 namespace revt {
19  class Channel;
20 }
21 
22 namespace utl {
23  class Noise;
24 }
25 
26 
27 namespace RdChannelNoiseGenerator {
28 
39 
40  public:
41  // If you define a constructor, you MUST provide an implementation
42  // for it, otherwise the REGISTER_MODULE macro will not register
43  // your module. (Here, implementation in RdChannelNoiseGenerator.cc)
45  ~RdChannelNoiseGenerator() override { }
46 
47  fwk::VModule::ResultFlag Init() override;
48  fwk::VModule::ResultFlag Run(evt::Event& event) override;
50 
51  private:
52  std::string fNoiseType;
53  enum InfoLevel {
54  eNone = 0,
55  eFinal = 1,
57  eObscure = 3,
58  eDebug = 4
59  };
60 
61  // xml settings
65  double fNoiseRMS;
66 
67  boost::mt19937 randgen;
68  boost::uniform_real<double> interval_noise;
69  boost::uniform_real<double> interval_h;
70  boost::variate_generator<boost::mt19937, boost::uniform_real<double> > randomGenerator_sigma;
71  boost::variate_generator<boost::mt19937, boost::uniform_real<double> > randomGenerator_h;
74  friend class utl::ShadowPtr<utl::Noise>;// necessary so that ShadowPtr can delete members of FFTDataContainer
75 
76  // The REGISTER_MODULE macro makes the framework aware of your module.
77  // You need to put this macro at the very end of your module class definition.
78  // Give your module a name (first argument) and specify its
79  // class name (second argument). In the ModuleSequenceExample.xml file,
80  // you can see this module being refered to by the name we give it here.
81 
82  REGISTER_MODULE("RdChannelNoiseGenerator", RdChannelNoiseGenerator);
83 
84  };
85 
86 }
87 
88 
89 #endif
90 
91 // Configure (x)emacs for this file ...
92 // Local Variables:
93 // mode: c++
94 // compile-command: "make -k"
95 // End:
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
REGISTER_MODULE("RdChannelNoiseGenerator", RdChannelNoiseGenerator)
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
Module interface.
Definition: VModule.h:53
boost::variate_generator< boost::mt19937, boost::uniform_real< double > > randomGenerator_h
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
boost::variate_generator< boost::mt19937, boost::uniform_real< double > > randomGenerator_sigma
Module injecting noise at the channel level. The noise characteristics can be set between different m...

, generated on Tue Sep 26 2023.