1 #ifndef __JDETECTOR__JPMTANALOGUESIGNALPROCESSOR__
2 #define __JDETECTOR__JPMTANALOGUESIGNALPROCESSOR__
66 x1(std::numeric_limits<double>::max())
85 static const int N = 100;
86 static const double precision = 1.0e-3;
102 const double Q = b*b - 4.0*a*c;
120 x1 = std::numeric_limits<double>::max();
125 for (
int i = 0; i != N; ++i) {
127 const double x = 0.5 * (xmin + xmax);
130 if (fabs(1.0 - u) < precision) {
140 x1 = 0.5 * (xmin + xmax);
200 return exp(-0.5*x*x);
252 if (th > 0.0 && th < 1.0)
255 THROW(
JValueOutOfRange,
"JPMTAnalogueSignalProcessor::getMaximalRiseTime(): Invalid threshold " << th);
311 const double mu = NPE *
gain;
314 return (0.5 * TMath::Erfc((zmin - mu) / sqrt(2.0) / sigma) -
315 0.5 * TMath::Erfc((zmax - mu) / sqrt(2.0) / sigma));
359 return gRandom->Rndm() <
QE;
376 return gRandom->Gaus(t_ns,
TTS_ns);
422 const double mu = NPE *
gain;
424 const double V = 0.5 * TMath::Erfc((
threshold - mu) / sqrt(2.0) / sigma);
426 return TMath::Gaus(npe, mu, sigma, kTRUE) / V;
552 }
else if (
QE <= 1.0) {
556 for (
int i = 1; i <= NPE; ++i) {
558 const double p = TMath::Binomial(NPE, i) * TMath::Power(
QE, i) * TMath::Power(1.0 -
QE, NPE - i);
559 const double mu = i *
gain;
561 const double V = 0.5 * TMath::Erfc((
threshold - mu) / sqrt(2.0) / sigma);
562 const double W = 0.5 * TMath::Erfc((0.0 - mu) / sqrt(2.0) / sigma);
double x1
Transition point from a logarithmic to a linear relation between time-over-threshold and number of ph...
void setPMTParameters(const JPMTParameters ¶meters)
Set PMT parameters.
double getDerivativeOfSaturation(const double y) const
Get derivative of function value with saturation.
double decayTime_ns
decay time [ns]
double gainSpread
gain spread [unit]
Data structure for single photo-electron.
const double TIME_OVER_THRESHOLD_NS
Specification for time-over-threshold corresponding to a one photo-electron pulse.
void setPMTParameters(const JPMTParameters ¶meters)
Set PMT parameters.
virtual double getTimeOverThreshold(const double npe) const
Get time-over-threshold (ToT).
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
virtual bool applyQE() const
Apply relative QE.
double threshold
threshold [npe]
static double getTH0()
Get lower threshold for rise time evaluation.
double getY1() const
Get amplitude at transition point from Gaussian to exponential.
double riseTime_ns
rise time of analogue pulse [ns]
bool slewing
time slewing of analogue signal
static double getMaximalRiseTime(const double th)
Get maximal rise time for given threshold.
void configure()
Configure internal parameters.
JPMTAnalogueSignalProcessor(const JPMTParameters ¶meters=JPMTParameters())
Constructor.
friend std::istream & operator>>(std::istream &in, JPMTAnalogueSignalProcessor &object)
Read PMT signal from input.
JPMTParameters()
Default constructor.
double getSaturation(const double y) const
Get function value with saturation.
virtual bool compare(const JPhotoElectron &first, const JPhotoElectron &second) const
Compare (arrival times of) photo-electrons.
virtual double getProbability(const double npe, const int NPE) const
Get probability for given charge.
virtual double getSurvivalProbability(const int NPE) const
Probability that a hit survives the simulation of the PMT.
static const JTransitionTimeGenerator getTransitionTime
Function object to generate transition time.
PMT signal processor interface.
double getAmplitude(const double t1_ns) const
Get amplitude at given time for a one photo-electron pulse.
virtual bool applyThreshold(const double npe) const
Apply threshold.
virtual double getRiseTime(const double npe) const
Get time to reach threshold.
virtual double getRandomTime(const double t_ns) const
Get randomised time according transition time distribution.
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
double getDecayTime() const
Get decay time.
PMT analogue signal processor.
double TTS_ns
transition time spread [ns]
Exception for accessing a value in a collection that is outside of its range.
double getT1() const
Get time at transition point from Gaussian to exponential.
Data structure for PMT parameters.
double saturation
saturation [ns]
virtual double getRandomAmplitude(const int NPE) const
Get randomised amplitude according gain and gain spread.
virtual double getDerivative(const double npe) const
Get derivative of number of photo-electrons to time-over-threshold.
static double getTH1()
Get upper threshold for rise time evaluation.
double QE
relative quantum efficiency
double getDecayTime(const double npe, const double th) const
Get time to pass from top of analogue pulse to threshold.
double getIntegralOfProbability(const double xmin, const double xmax, const int NPE) const
Get integral of probability.
double t1
time at match point [ns]
double getStartOfLinearisation() const
Get transition point from a model dependent to linear relation between time-over-threshold and number...
double y1
amplitude at match point [npe]
double slope
slope [ns/npe]
double getRiseTime(const double npe, const double th) const
Get time to pass from threshold to top of analogue pulse.