|
qupid 0.2
Quasi-Signal Generation Model for Pixelized Detector
|
Monte Carlo driver for cluster-size studies. More...
#include <QPMonteCarlo.hpp>
Classes | |
| struct | Record |
| One generated event, plain data only. More... | |
Public Member Functions | |
| QPMonteCarlo (QPDigitizerBase *digitizer, QPRandomBase &random) | |
| void | SetPositionRange (const double &xmin, const double &xmax, const double &ymin, const double &ymax) |
| Uniform draw ranges for the signal position, µm. | |
| void | SetAmplitude (const double &) |
| Fixed amplitude for every event; disables the amplitude draw. | |
| void | SetAmplitudeRange (const double &min, const double &max) |
| Per-event uniform amplitude draw. | |
| void | SetSigma (const double &sigma) |
| Width of the injected Gaussian. | |
| void | SetThreshold (const double &threshold) |
| Pixel firing threshold. | |
| Record | Shoot () |
| Generate one event. | |
| std::vector< Record > | Run (int ntrial) |
Shoot() ntrial times. | |
| QPDigitizerBase * | GetDigitizer () const |
Static Public Member Functions | |
| 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). | |
Monte Carlo driver for cluster-size studies.
Per event: draw a signal position (and optionally an amplitude), inject one isometric Gaussian signal into the digitizer, count the pixels above threshold, clear the digitizer. Positions are in µm, amplitudes and thresholds in electrons.
The per-event draw order is fixed by Shoot() and must not change: x, then y, then amplitude (amplitude only when SetAmplitudeRange was used; SetAmplitude keeps it fixed and draws nothing). Regression baselines depend on this order.
Definition at line 20 of file QPMonteCarlo.hpp.
| QPMonteCarlo::QPMonteCarlo | ( | QPDigitizerBase * | digitizer, |
| QPRandomBase & | random | ||
| ) |
| digitizer | target digitizer; not owned |
| random | random engine; caller-owned, kept by reference |
Definition at line 11 of file QPMonteCarlo.cpp.
| void QPMonteCarlo::SetPositionRange | ( | const double & | xmin, |
| const double & | xmax, | ||
| const double & | ymin, | ||
| const double & | ymax | ||
| ) |
Uniform draw ranges for the signal position, µm.
| xmin | lower x bound |
| xmax | upper x bound |
| ymin | lower y bound |
| ymax | upper y bound |
Definition at line 14 of file QPMonteCarlo.cpp.
| void QPMonteCarlo::SetAmplitude | ( | const double & | amp | ) |
Fixed amplitude for every event; disables the amplitude draw.
| amp | amplitude, electrons |
Definition at line 22 of file QPMonteCarlo.cpp.
| void QPMonteCarlo::SetAmplitudeRange | ( | const double & | min, |
| const double & | max | ||
| ) |
Per-event uniform amplitude draw.
| min | lower bound, electrons |
| max | upper bound, electrons |
Definition at line 27 of file QPMonteCarlo.cpp.
| void QPMonteCarlo::SetSigma | ( | const double & | sigma | ) |
Width of the injected Gaussian.
| sigma | value placed on both diagonal entries of the covariance-form matrix |
Definition at line 33 of file QPMonteCarlo.cpp.
| void QPMonteCarlo::SetThreshold | ( | const double & | threshold | ) |
Pixel firing threshold.
| threshold | threshold, electrons |
Definition at line 37 of file QPMonteCarlo.cpp.
| QPMonteCarlo::Record QPMonteCarlo::Shoot | ( | ) |
Generate one event.
Draws x, then y, then the amplitude (only when SetAmplitudeRange is active); injects one QPSignalGaussian with 
Definition at line 41 of file QPMonteCarlo.cpp.
References QPDigitizerBase::ClearSignal(), QPMonteCarlo::Record::fAmp, QPMonteCarlo::Record::fNpix, QPMonteCarlo::Record::fSigma, QPMonteCarlo::Record::fX, QPMonteCarlo::Record::fY, QPDigitizerBase::GetFiredPixel(), QPDigitizerBase::InjectSignal(), and QPRandomBase::Uniform().
Referenced by Run().
| std::vector< QPMonteCarlo::Record > QPMonteCarlo::Run | ( | int | ntrial | ) |
Shoot() ntrial times.
| ntrial | number of events |
Definition at line 62 of file QPMonteCarlo.cpp.
References Shoot().
|
static |
Write records as CSV: header line amp,x,y,sig,npix, values with %.17g (round-trip double precision).
| records | events to write |
| filename | output path |
Definition at line 71 of file QPMonteCarlo.cpp.
|
inline |
Definition at line 80 of file QPMonteCarlo.hpp.