Public Member Functions | Public Attributes | List of all members
GaussianNoiseCreator Class Reference

Data creator: Gaussian random data. More...

Inheritance diagram for GaussianNoiseCreator:
DataCreatorBase

Public Member Functions

 GaussianNoiseCreator (std::string name, float sigma, float mu=0.)
 Constructor: assigns data set name and noise parameters. More...
 
virtual InputData_t create (size_t size) override
 Creates and returns the data sample. More...
 
- Public Member Functions inherited from DataCreatorBase
 DataCreatorBase (std::string new_name)
 Constructor: just assigns a name to this data set. More...
 
std::string name () const
 Returns the name of this set. More...
 
virtual ~DataCreatorBase ()
 Virtual destructor. More...
 

Public Attributes

float mean
 mean of the noise Gaussian (pedestal) More...
 
float stdev
 standard deviation of the noise Gaussian (RMS) More...
 

Additional Inherited Members

- Public Types inherited from DataCreatorBase
typedef std::vector< short > InputData_t
 
- Static Public Attributes inherited from DataCreatorBase
static std::default_random_engine random_engine
 Random engine shared by all the data creators. More...
 

Detailed Description

Data creator: Gaussian random data.

Definition at line 117 of file raw_test.cc.

Constructor & Destructor Documentation

GaussianNoiseCreator::GaussianNoiseCreator ( std::string  name,
float  sigma,
float  mu = 0. 
)
inline

Constructor: assigns data set name and noise parameters.

Definition at line 124 of file raw_test.cc.

124  :
126  mean(mu), stdev(sigma)
127  {}
float stdev
standard deviation of the noise Gaussian (RMS)
Definition: raw_test.cc:120
std::string name() const
Returns the name of this set.
Definition: raw_test.cc:72
DataCreatorBase(std::string new_name)
Constructor: just assigns a name to this data set.
Definition: raw_test.cc:69
float mean
mean of the noise Gaussian (pedestal)
Definition: raw_test.cc:119

Member Function Documentation

virtual InputData_t GaussianNoiseCreator::create ( size_t  size)
inlineoverridevirtual

Creates and returns the data sample.

Implements DataCreatorBase.

Definition at line 130 of file raw_test.cc.

131  {
132  std::normal_distribution<float> noise(mean, stdev);
134  for (auto& item: data)
135  item = InputData_t::size_type(noise(random_engine));
136  return data;
137  } // create()
float stdev
standard deviation of the noise Gaussian (RMS)
Definition: raw_test.cc:120
static std::default_random_engine random_engine
Random engine shared by all the data creators.
Definition: raw_test.cc:66
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< short > InputData_t
Definition: raw_test.cc:63
float mean
mean of the noise Gaussian (pedestal)
Definition: raw_test.cc:119

Member Data Documentation

float GaussianNoiseCreator::mean

mean of the noise Gaussian (pedestal)

Definition at line 119 of file raw_test.cc.

float GaussianNoiseCreator::stdev

standard deviation of the noise Gaussian (RMS)

Definition at line 120 of file raw_test.cc.


The documentation for this class was generated from the following file: