qupid 0.2
Quasi-Signal Generation Model for Pixelized Detector
Loading...
Searching...
No Matches
QPMonteCarlo.hpp
1#ifndef __QPMONTECARLO__
2#define __QPMONTECARLO__ 1
3
4#include <string>
5#include <vector>
6
8class QPRandomBase;
9
21 public:
23 struct Record{
24 double fAmp;
25 double fX;
26 double fY;
27 double fSigma;
28 int fNpix;
29 };
30
33 QPMonteCarlo(QPDigitizerBase* digitizer, QPRandomBase& random);
34
40 void SetPositionRange(const double& xmin, const double& xmax,
41 const double& ymin, const double& ymax);
44 void SetAmplitude(const double& amp); // fixed amplitude
48 void SetAmplitudeRange(const double& min, const double& max);// uniform per event
52 void SetSigma(const double& sigma);
55 void SetThreshold(const double& threshold);
56
65 Record Shoot(); // one event (see draw order above)
69 std::vector<Record> Run(int ntrial); // Shoot() ntrial times, accumulated
70
76 static bool WriteCSV(const std::vector<Record>& records,
77 const std::string& filename);
78
80 QPDigitizerBase* GetDigitizer() const {return fDigitizer;}
81
82 protected:
83 private:
84 QPDigitizerBase* fDigitizer = nullptr;
85 QPRandomBase& fRandom;
86
87 double fXmin = 0.;
88 double fXmax = 0.;
89 double fYmin = 0.;
90 double fYmax = 0.;
91 double fAmp = 0.;
92 double fAmpMin = 0.;
93 double fAmpMax = 0.;
94 bool fRandomAmp = false;
95 double fSigma = 1.;
96 double fThreshold = 0.;
97};
98
99#endif
Abstract pixel-matrix digitizer: owns the injected signals and the matrix geometry; concrete classes ...
Monte Carlo driver for cluster-size studies.
void SetThreshold(const double &threshold)
Pixel firing threshold.
Record Shoot()
Generate one event.
void SetAmplitude(const double &amp)
Fixed amplitude for every event; disables the amplitude draw.
void SetSigma(const double &sigma)
Width of the injected Gaussian.
QPDigitizerBase * GetDigitizer() const
std::vector< Record > Run(int ntrial)
Shoot() ntrial times.
static bool WriteCSV(const std::vector< Record > &records, const std::string &filename)
Write records as CSV: header line amp,x,y,sig,npix, values with %.17g (round-trip double precision).
void SetPositionRange(const double &xmin, const double &xmax, const double &ymin, const double &ymax)
Uniform draw ranges for the signal position, µm.
void SetAmplitudeRange(const double &min, const double &max)
Per-event uniform amplitude draw.
Abstract random number source.
One generated event, plain data only.
int fNpix
pixels above threshold (cluster size)
double fSigma
value placed on both diagonal entries of the covariance-form matrix S
double fAmp
signal amplitude, electrons
double fY
signal position y, µm
double fX
signal position x, µm