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#include <time.h>
14
15#include <iostream>
16#include <vector>
17
18//--------------//
19// boost::math //
20//--------------//
21#include <boost/math/distributions/poisson.hpp>
22
23//----------//
24// ROOT //
25//----------//
26#include "Math/DistFunc.h"
27#include "TRandom3.h"
28
29namespace ldmx {
30
32 public:
34 NoiseGenerator(double noiseValue = 0.0001, bool gauss = true);
35
38
40 void seedGenerator(uint64_t seed);
41
43 bool hasSeed() const { return random_.get() != nullptr; }
44
52 std::vector<double> generateNoiseHits(int emptyChannels);
53
55 void setNoiseThreshold(double noiseThreshold) {
56 noiseThreshold_ = noiseThreshold;
57 }
58
60 void setNoise(double noise) { noise_ = noise; };
61
63 void setPedestal(double pedestal) { pedestal_ = pedestal; };
64
65 private:
67 std::unique_ptr<TRandom3> random_{nullptr};
68
70 double noiseThreshold_{4};
71
73 double noise_{1};
74
76 double pedestal_{0};
77
80
82 std::unique_ptr<boost::math::poisson_distribution<> > poisson_dist_;
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.
double pedestal_
Pedestal or baseline.
double noiseThreshold_
The noise threshold.
std::unique_ptr< TRandom3 > random_
Random number generator.
void setPedestal(double pedestal)
Set the pedestal.
~NoiseGenerator()
Destructor.
bool useGaussianModel_
Gaussian flag.
void seedGenerator(uint64_t seed)
Seed the generator.
void setNoiseThreshold(double noiseThreshold)
Set the noise threshold.
bool hasSeed() const
Has been seeded?
void setNoise(double noise)
Set the mean noise.