 |
Belle II Software
release-05-01-25
|
14 #include <framework/logging/Logger.h>
28 class TOPPmtTTSPar :
public TObject {
43 enum {c_NumPmtPixels = 16};
68 if (pmtPixel >= c_NumPmtPixels) {
69 B2ERROR(
"TOPPmtTTSPar::appendGaussian: invalid PMT pixel "
70 <<
LogVar(
"PMT pixel", pmtPixel + 1));
84 void appendGaussian(
unsigned pmtPixel,
double fraction,
double mean,
double sigma)
87 gaus.fraction = fraction;
114 if (pmtPixel >= c_NumPmtPixels) {
115 B2ERROR(
"TOPPmtTTSPar::getGaussians: invalid PMT pixel. "
116 "Returning data for pixel 1."
117 <<
LogVar(
"PMT pixel", pmtPixel + 1));
132 if (pmtPixel >= c_NumPmtPixels)
return 0;
134 double prob = gRandom->Rndm();
137 s = s + gaus.fraction;
139 return gRandom->Gaus(gaus.mean, gaus.sigma);
152 for (
int ich = 0 ; ich < c_NumPmtPixels ; ich++) {
154 sum = sum + gaus.fraction;
156 if (sum == 0)
return;
158 gaus.fraction = gaus.fraction / sum;
void normalizeFractions()
Normalizes the gaussian fractions to unity.
double getRandomTime(unsigned pmtPixel) const
Returns a random number, generated according to the distribution.
int getNumOfPixels() const
Returns number of PMT pixels.
float mean
peak position [ns]
float sigma
peak width [ns]
Abstract base class for different kinds of events.
TOPPmtTTSPar()
Default constructor.
Class to store variables with their name which were sent to the logging service.
std::string m_serialNumber
serial number, e.g.
const std::string & getSerialNumber() const
Returns PMT serial number.
std::vector< Gaussian > m_gaussians[c_NumPmtPixels]
TTS distribution composed of Gaussians.
const std::vector< Gaussian > & getGaussians(unsigned pmtPixel) const
Returns vector of gaussians.
float fraction
area normalization
ClassDef(TOPPmtTTSPar, 2)
ClassDef.
void appendGaussian(unsigned pmtPixel, const Gaussian &gaus)
Append struct gauss.