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

Data creator: uniformly random data, specified range plus offset (pedestal) More...

Inheritance diagram for UniformNoiseCreator:
DataCreatorBase

Public Member Functions

 UniformNoiseCreator (std::string name, float RMS, float pedestal=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 baseline
 pedestal More...
 
float width
 (half)width of the uniform distribution 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: uniformly random data, specified range plus offset (pedestal)

Definition at line 90 of file raw_test.cc.

Constructor & Destructor Documentation

UniformNoiseCreator::UniformNoiseCreator ( std::string  name,
float  RMS,
float  pedestal = 0. 
)
inline

Constructor: assigns data set name and noise parameters.

Definition at line 97 of file raw_test.cc.

97  :
99  baseline(pedestal), width(RMS * std::sqrt(12.))
100  {}
float baseline
pedestal
Definition: raw_test.cc:92
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 width
(half)width of the uniform distribution
Definition: raw_test.cc:93

Member Function Documentation

virtual InputData_t UniformNoiseCreator::create ( size_t  size)
inlineoverridevirtual

Creates and returns the data sample.

Implements DataCreatorBase.

Definition at line 103 of file raw_test.cc.

104  {
105  std::uniform_real_distribution<float> noise
106  (baseline - width, baseline + width);
108  for (auto& item: data)
109  item = InputData_t::size_type(noise(random_engine));
110  return data;
111  } // create()
static std::default_random_engine random_engine
Random engine shared by all the data creators.
Definition: raw_test.cc:66
float baseline
pedestal
Definition: raw_test.cc:92
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
float width
(half)width of the uniform distribution
Definition: raw_test.cc:93
std::vector< short > InputData_t
Definition: raw_test.cc:63

Member Data Documentation

float UniformNoiseCreator::baseline

pedestal

Definition at line 92 of file raw_test.cc.

float UniformNoiseCreator::width

(half)width of the uniform distribution

Definition at line 93 of file raw_test.cc.


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