LDMX Software
NoiseGenerator.h
Go to the documentation of this file.
1
7#ifndef TOOLS_NOISEGENERATOR_H
8#define TOOLS_NOISEGENERATOR_H
9
10//----------------//
11// C++ StdLib //
12//----------------//
13
14#include <vector>
15
16//--------------//
17// boost::math //
18//--------------//
19#include <boost/math/distributions/poisson.hpp>
20
21//----------//
22// ROOT //
23//----------//
24#include "Framework/Logger.h"
25#include "TRandom3.h"
26
27namespace ldmx {
28
30 public:
32 NoiseGenerator(double noiseValue = 0.0001, bool gauss = true);
33
35 ~NoiseGenerator() = default;
36
38 void seedGenerator(uint64_t seed);
39
41 bool hasSeed() const { return random_.get() != nullptr; }
42
50 std::vector<double> generateNoiseHits(int emptyChannels);
51
53 void setNoiseThreshold(double noiseThreshold) {
54 noise_threshold_ = noiseThreshold;
55 }
56
58 void setNoise(double noise) { noise_ = noise; };
59
61 void setPedestal(double pedestal) { pedestal_ = pedestal; };
62
63 private:
65 std::unique_ptr<TRandom3> random_{nullptr};
66
69
71 double noise_{1};
72
74 double pedestal_{0};
75
78
80 std::unique_ptr<boost::math::poisson_distribution<> > poisson_dist_;
81
82 enableLogging("NoiseGenerator")
83}; // NoiseGenerator
84
85} // namespace ldmx
86
87#endif // TOOLS_NOISEGENERATOR_H
double noise_
Mean noise.
std::unique_ptr< boost::math::poisson_distribution<> > poisson_dist_
pdf for poisson errors
std::vector< double > generateNoiseHits(int emptyChannels)
Generate noise hits_.
NoiseGenerator(double noiseValue=0.0001, bool gauss=true)
Constructor.
double pedestal_
Pedestal or baseline.
std::unique_ptr< TRandom3 > random_
Random number generator.
void setPedestal(double pedestal)
Set the pedestal.
void seedGenerator(uint64_t seed)
Seed the generator.
void setNoiseThreshold(double noiseThreshold)
Set the noise threshold.
double noise_threshold_
The noise threshold.
bool hasSeed() const
Has been seeded?
void setNoise(double noise)
Set the mean noise.
~NoiseGenerator()=default
Destructor.
bool use_gaussian_model_
Gaussian flag.