12#include <framework/logging/Logger.h>
41 enum {c_NumPmtPixels = 16};
66 if (pmtPixel >= c_NumPmtPixels) {
67 B2ERROR(
"TOPPmtTTSPar::appendGaussian: invalid PMT pixel "
68 <<
LogVar(
"PMT pixel", pmtPixel + 1));
82 void appendGaussian(
unsigned pmtPixel,
double fraction,
double mean,
double sigma)
112 if (pmtPixel >= c_NumPmtPixels) {
113 B2ERROR(
"TOPPmtTTSPar::getGaussians: invalid PMT pixel. "
114 "Returning data for pixel 1."
115 <<
LogVar(
"PMT pixel", pmtPixel + 1));
130 if (pmtPixel >= c_NumPmtPixels)
return 0;
132 double prob = gRandom->Rndm();
135 s = s + gaus.fraction;
137 return gRandom->Gaus(gaus.mean, gaus.sigma);
150 for (
int ich = 0 ; ich < c_NumPmtPixels ; ich++) {
152 sum = sum + gaus.fraction;
154 if (sum == 0)
return;
156 gaus.fraction = gaus.fraction / sum;
Parameterized TTS for each PMT pixel.
std::vector< Gaussian > m_gaussians[c_NumPmtPixels]
TTS distribution composed of Gaussians.
TOPPmtTTSPar()
Default constructor.
int getNumOfPixels() const
Returns number of PMT pixels.
std::string m_serialNumber
serial number, e.g.
TOPPmtTTSPar(const std::string &serialNumber)
Full constructor.
void normalizeFractions()
Normalizes the gaussian fractions to unity.
void appendGaussian(unsigned pmtPixel, double fraction, double mean, double sigma)
Append gaussian using its parameters (frac, mean, sigma)
double getRandomTime(unsigned pmtPixel) const
Returns a random number, generated according to the distribution.
void appendGaussian(unsigned pmtPixel, const Gaussian &gaus)
Append struct gauss.
ClassDef(TOPPmtTTSPar, 2)
ClassDef.
const std::vector< Gaussian > & getGaussians(unsigned pmtPixel) const
Returns vector of gaussians.
const std::string & getSerialNumber() const
Returns PMT serial number.
Class to store variables with their name which were sent to the logging service.
Abstract base class for different kinds of events.
Gaussian distribution parameters.
float fraction
area normalization
float mean
peak position [ns]
float sigma
peak width [ns]