Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
JDETECTOR::JPMTAnalogueSignalProcessor Struct Reference

PMT analogue signal processor. More...

#include <JPMTAnalogueSignalProcessor.hh>

Inheritance diagram for JDETECTOR::JPMTAnalogueSignalProcessor:
JDETECTOR::JPMTSignalProcessorInterface JDETECTOR::JPMTParameters

Public Member Functions

 JPMTAnalogueSignalProcessor (const JPMTParameters &parameters=JPMTParameters())
 Constructor. More...
 
void configure ()
 Configure internal parameters. More...
 
double getDecayTime () const
 Get decay time. More...
 
double getT1 () const
 Get time at transition point from Gaussian to exponential. More...
 
double getY1 () const
 Get amplitude at transition point from Gaussian to exponential. More...
 
double getStartOfLinearisation () const
 Get transition point from a model dependent to linear relation between time-over-threshold and number of photo-electrons. More...
 
double getAmplitude (const double t1_ns) const
 Get amplitude at given time for a one photo-electron pulse. More...
 
double getRiseTime (const double npe, const double th) const
 Get time to pass from threshold to top of analogue pulse. More...
 
double getDecayTime (const double npe, const double th) const
 Get time to pass from top of analogue pulse to threshold. More...
 
double getSaturation (const double y) const
 Get function value with saturation. More...
 
double getDerivativeOfSaturation (const double y) const
 Get derivative of function value with saturation. More...
 
double getGainSpread (int NPE) const
 Get gain spread for given number of photo-electrons. More...
 
double getIntegralOfProbability (const double xmin, const double xmax, const int NPE) const
 Get integral of probability. More...
 
void setPMTParameters (const JPMTParameters &parameters)
 Set PMT parameters. More...
 
virtual bool applyQE () const
 Apply relative QE. More...
 
virtual double getRandomTime (const double t_ns) const
 Get randomised time according transition time distribution. More...
 
virtual bool compare (const JPhotoElectron &first, const JPhotoElectron &second) const
 Compare (arrival times of) photo-electrons. More...
 
virtual double getRandomAmplitude (const int NPE) const
 Get randomised amplitude according gain and gain spread. More...
 
virtual double getProbability (const double npe, const int NPE) const
 Get probability for given charge. More...
 
virtual bool applyThreshold (const double npe) const
 Apply threshold. More...
 
virtual double getRiseTime (const double npe) const
 Get time to reach threshold. More...
 
virtual double getTimeOverThreshold (const double npe) const
 Get time-over-threshold (ToT). More...
 
virtual double getDerivative (const double npe) const
 Get derivative of number of photo-electrons to time-over-threshold. More...
 
virtual double getSurvivalProbability (const int NPE) const
 Probability that a hit survives the simulation of the PMT. More...
 
void operator() (const JCalibration &calibration, const JPMTData< JPMTSignal > &input, JPMTData< JPMTPulse > &output) const
 Process hits. More...
 
virtual void merge (JPMTData< JPMTPulse > &data) const
 Merging of PMT hits. More...
 
double getNPE (const double tot_ns, const double eps=1.0e-3) const
 Get number of photo-electrons. More...
 
const JPMTParametersgetPMTParameters () const
 Get PMT parameters. More...
 
bool is_valid () const
 Check validity of PMT parameters. More...
 
JProperties getProperties (const JEquationParameters &equation=JPMTParameters::getEquationParameters())
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &equation=JPMTParameters::getEquationParameters()) const
 Get properties of this class. More...
 

Static Public Member Functions

static double getMaximalRiseTime (const double th)
 Get maximal rise time for given threshold. More...
 
static double getTH0 ()
 Get lower threshold for rise time evaluation. More...
 
static double getTH1 ()
 Get upper threshold for rise time evaluation. More...
 
static double getTmin ()
 Get two photo-electron resolution for time-over-threshold. More...
 
static double getQmin ()
 Get minimal width of charge distribution. More...
 
static JEquationParametersgetEquationParameters ()
 Get equation parameters. More...
 
static void setEquationParameters (const JEquationParameters &equation)
 Set equation parameters. More...
 

Public Attributes

double QE
 relative quantum efficiency More...
 
double gain
 gain [unit] More...
 
double gainSpread
 gain spread [unit] More...
 
double riseTime_ns
 rise time of analogue pulse [ns] More...
 
double TTS_ns
 transition time spread [ns] More...
 
double threshold
 threshold [npe] More...
 
double slope
 slope [ns/npe] More...
 
double saturation
 saturation [ns] More...
 
bool slewing
 time slewing of analogue signal More...
 

Protected Attributes

double decayTime_ns
 decay time [ns] More...
 
double t1
 time at match point [ns] More...
 
double y1
 amplitude at match point [npe] More...
 
double x1
 Transition point from a logarithmic to a linear relation between time-over-threshold and number of photo-electrons. More...
 

Friends

std::istream & operator>> (std::istream &in, JPMTAnalogueSignalProcessor &object)
 Read PMT signal from input. More...
 

Detailed Description

PMT analogue signal processor.

This class provides for an implementation of the JDETECTOR::JPMTSignalProcessorInterface using a specific model for the analogue pulse of the PMT.
In this, the leading edge of the analogue pulse from the PMT is assumed to be a Gaussian and the tail an exponential.
The width of the Gaussian is referred to as the rise time and the inverse slope of the exponential to the decay time.
The two functions are matched at a point where the values and first derivatives are identical.
Note that the decay time is related to the rise time via the specification JDETECTOR::TIME_OVER_THRESHOLD_NS.

The charge distribution is assumed to be a Gaussian which is centered at the specified gain and truncated by the specified threshold.

The transition times are generated according the specified spread as follows.

Definition at line 51 of file JPMTAnalogueSignalProcessor.hh.

Constructor & Destructor Documentation

JDETECTOR::JPMTAnalogueSignalProcessor::JPMTAnalogueSignalProcessor ( const JPMTParameters parameters = JPMTParameters())
inline

Constructor.

Parameters
parametersPMT parameters

Definition at line 60 of file JPMTAnalogueSignalProcessor.hh.

60  :
62  JPMTParameters(parameters),
63  decayTime_ns(0.0),
64  t1(0.0),
65  y1(0.0),
66  x1(std::numeric_limits<double>::max())
67  {
68  configure();
69  }
double x1
Transition point from a logarithmic to a linear relation between time-over-threshold and number of ph...
void configure()
Configure internal parameters.
JPMTParameters()
Default constructor.
double y1
amplitude at match point [npe]

Member Function Documentation

void JDETECTOR::JPMTAnalogueSignalProcessor::configure ( )
inline

Configure internal parameters.

This method provides the implementations for

  • matching of the leading edge of the analogue pulse (Gaussian) and the tail (exponential); and
  • determination of number of photo-electrons above which the time-over-threshold linearly depends on the number of photo-electrons (apart from saturation).

Note that this method will throw an error if the value of the rise time (i.e. width of the Gaussian) is too large with respect to the specification JDETECTOR::TIME_OVER_THRESHOLD_NS.

Definition at line 83 of file JPMTAnalogueSignalProcessor.hh.

84  {
85  static const int N = 100;
86  static const double precision = 1.0e-3;
87 
88  // check rise time
89 
91  THROW(JValueOutOfRange, "JPMTAnalogueSignalProcessor::configure(): Invalid rise time [ns] " << riseTime_ns);
92  }
93 
94  // decay time
95 
96  const double y = -log(threshold);
97 
98  const double a = y;
99  const double b = riseTime_ns * sqrt(2.0*y) - TIME_OVER_THRESHOLD_NS;
100  const double c = 0.5*riseTime_ns*riseTime_ns;
101 
102  const double Q = b*b - 4.0*a*c;
103 
104  if (Q > 0.0)
105  decayTime_ns = (-b + sqrt(Q)) / (2.0*a);
106  else
107  decayTime_ns = -b / (2.0*a);
108 
109  // fix matching of Gaussian and exponential
110 
111  const double x = riseTime_ns / decayTime_ns;
112 
113  t1 = riseTime_ns*x;
114  y1 = exp(-0.5*x*x);
115 
116  // determine transition point to linear dependence of time-over-threshold as a function of number of photo-electrons
117 
118  const double v = slope / getDerivativeOfSaturation(getTimeOverThreshold(1.0));
119 
120  x1 = std::numeric_limits<double>::max(); // disable linearisation
121 
122  double xmin = 1.0;
123  double xmax = 1.0 / (getDerivative(1.0) * slope);
124 
125  for (int i = 0; i != N; ++i) {
126 
127  const double x = 0.5 * (xmin + xmax);
128  const double u = getDerivative(x) * v;
129 
130  if (fabs(1.0 - u) < precision) {
131  break;
132  }
133 
134  if (u < 1.0)
135  xmin = x;
136  else
137  xmax = x;
138  }
139 
140  x1 = 0.5 * (xmin + xmax);
141  }
double x1
Transition point from a logarithmic to a linear relation between time-over-threshold and number of ph...
double getDerivativeOfSaturation(const double y) const
Get derivative of function value with saturation.
const double TIME_OVER_THRESHOLD_NS
Specification for time-over-threshold corresponding to a one photo-electron pulse.
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.
Definition: JException.hh:633
double threshold
threshold [npe]
double riseTime_ns
rise time of analogue pulse [ns]
static double getMaximalRiseTime(const double th)
Get maximal rise time for given threshold.
virtual double getDerivative(const double npe) const
Get derivative of number of photo-electrons to time-over-threshold.
double y1
amplitude at match point [npe]
double slope
slope [ns/npe]
double JDETECTOR::JPMTAnalogueSignalProcessor::getDecayTime ( ) const
inline

Get decay time.

Returns
decay time [ns]

Definition at line 149 of file JPMTAnalogueSignalProcessor.hh.

150  {
151  return decayTime_ns;
152  }
double JDETECTOR::JPMTAnalogueSignalProcessor::getT1 ( ) const
inline

Get time at transition point from Gaussian to exponential.

Returns
time [ns]

Definition at line 160 of file JPMTAnalogueSignalProcessor.hh.

161  {
162  return t1;
163  }
double JDETECTOR::JPMTAnalogueSignalProcessor::getY1 ( ) const
inline

Get amplitude at transition point from Gaussian to exponential.

Returns
amplitude [npe]

Definition at line 171 of file JPMTAnalogueSignalProcessor.hh.

172  {
173  return y1;
174  }
double y1
amplitude at match point [npe]
double JDETECTOR::JPMTAnalogueSignalProcessor::getStartOfLinearisation ( ) const
inline

Get transition point from a model dependent to linear relation between time-over-threshold and number of photo-electrons.

Returns
number of photo-electrons [npe]

Definition at line 182 of file JPMTAnalogueSignalProcessor.hh.

183  {
184  return x1;
185  }
double x1
Transition point from a logarithmic to a linear relation between time-over-threshold and number of ph...
double JDETECTOR::JPMTAnalogueSignalProcessor::getAmplitude ( const double  t1_ns) const
inline

Get amplitude at given time for a one photo-electron pulse.

Parameters
t1_nstime [ns]
Returns
amplitude [npe]

Definition at line 194 of file JPMTAnalogueSignalProcessor.hh.

195  {
196  if (t1_ns < t1) {
197 
198  const double x = t1_ns / riseTime_ns;
199 
200  return exp(-0.5*x*x); // Gaussian
201 
202  } else {
203 
204  const double x = t1_ns / decayTime_ns;
205 
206  return exp(-x) / y1; // exponential
207  }
208  }
double riseTime_ns
rise time of analogue pulse [ns]
double y1
amplitude at match point [npe]
double JDETECTOR::JPMTAnalogueSignalProcessor::getRiseTime ( const double  npe,
const double  th 
) const
inline

Get time to pass from threshold to top of analogue pulse.


In this, the leading edge of the analogue pulse is assumed to be Gaussian.

Parameters
npenumber of photo-electrons
ththreshold [npe]
Returns
time [ns]

Definition at line 219 of file JPMTAnalogueSignalProcessor.hh.

220  {
221  return riseTime_ns * sqrt(2.0*log(npe/th)); // Gaussian
222  }
double riseTime_ns
rise time of analogue pulse [ns]
double JDETECTOR::JPMTAnalogueSignalProcessor::getDecayTime ( const double  npe,
const double  th 
) const
inline

Get time to pass from top of analogue pulse to threshold.


In this, the trailing edge of the analogue pulse is assumed to be exponential.

Parameters
npenumber of photo-electrons
ththreshold [npe]
Returns
time [ns]

Definition at line 233 of file JPMTAnalogueSignalProcessor.hh.

234  {
235  if (npe*y1 > th)
236  return decayTime_ns * (log(npe/th) - log(y1)); // exponential
237  else
238  return riseTime_ns * sqrt(2.0*log(npe/th)); // Gaussian
239  }
double riseTime_ns
rise time of analogue pulse [ns]
double y1
amplitude at match point [npe]
static double JDETECTOR::JPMTAnalogueSignalProcessor::getMaximalRiseTime ( const double  th)
inlinestatic

Get maximal rise time for given threshold.

Note that the rise time is entirely constraint by the specification JDETECTOR::TIME_OVER_THRESHOLD_NS.

Parameters
ththreshold [npe]
Returns
rise time [ns]

Definition at line 250 of file JPMTAnalogueSignalProcessor.hh.

251  {
252  if (th > 0.0 && th < 1.0)
253  return 0.5 * TIME_OVER_THRESHOLD_NS / sqrt(-2.0*log(th));
254  else
255  THROW(JValueOutOfRange, "JPMTAnalogueSignalProcessor::getMaximalRiseTime(): Invalid threshold " << th);
256  }
const double TIME_OVER_THRESHOLD_NS
Specification for time-over-threshold corresponding to a one photo-electron pulse.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
double JDETECTOR::JPMTAnalogueSignalProcessor::getSaturation ( const double  y) const
inline

Get function value with saturation.

Parameters
yvalue
Returns
value

Definition at line 265 of file JPMTAnalogueSignalProcessor.hh.

266  {
267  return saturation / sqrt(y*y + saturation*saturation);
268  }
double saturation
saturation [ns]
double JDETECTOR::JPMTAnalogueSignalProcessor::getDerivativeOfSaturation ( const double  y) const
inline

Get derivative of function value with saturation.

Parameters
yvalue
Returns
value

Definition at line 277 of file JPMTAnalogueSignalProcessor.hh.

278  {
279  return (saturation*saturation + y*y) * sqrt(saturation*saturation + y*y) / (saturation * saturation * saturation);
280  }
double saturation
saturation [ns]
double JDETECTOR::JPMTAnalogueSignalProcessor::getGainSpread ( int  NPE) const
inline

Get gain spread for given number of photo-electrons.

Parameters
NPEnumber of photo-electrons
Returns
gain spread

Definition at line 289 of file JPMTAnalogueSignalProcessor.hh.

290  {
291  return sqrt((double) NPE * gain) * gainSpread;
292  }
double gain
gain [unit]
double gainSpread
gain spread [unit]
double JDETECTOR::JPMTAnalogueSignalProcessor::getIntegralOfProbability ( const double  xmin,
const double  xmax,
const int  NPE 
) const
inline

Get integral of probability.

Parameters
xminminimum number of photo-electrons
xmaxmaximum number of photo-electrons
NPEtrue number of photo-electrons
Returns
probability

Definition at line 303 of file JPMTAnalogueSignalProcessor.hh.

304  {
305  double zmin = xmin;
306  double zmax = xmax;
307 
308  if (zmin < threshold) { zmin = threshold; }
309  if (zmax < threshold) { zmax = threshold; }
310 
311  const double mu = NPE * gain;
312  const double sigma = getGainSpread(NPE);
313 
314  return (0.5 * TMath::Erfc((zmin - mu) / sqrt(2.0) / sigma) -
315  0.5 * TMath::Erfc((zmax - mu) / sqrt(2.0) / sigma));
316  }
double gain
gain [unit]
double threshold
threshold [npe]
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
void JDETECTOR::JPMTAnalogueSignalProcessor::setPMTParameters ( const JPMTParameters parameters)
inline

Set PMT parameters.

Parameters
parametersPMT parameters

Definition at line 324 of file JPMTAnalogueSignalProcessor.hh.

325  {
326  static_cast<JPMTParameters&>(*this).setPMTParameters(parameters);
327 
328  configure();
329  }
void configure()
Configure internal parameters.
JPMTParameters()
Default constructor.
virtual bool JDETECTOR::JPMTAnalogueSignalProcessor::applyQE ( ) const
inlinevirtual

Apply relative QE.

Returns
true if accepted; false if rejected

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 354 of file JPMTAnalogueSignalProcessor.hh.

355  {
356  if (QE <= 0.0)
357  return false;
358  else if (QE < 1.0)
359  return gRandom->Rndm() < QE;
360  else
361  return true;
362  }
double QE
relative quantum efficiency
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRandomTime ( const double  t_ns) const
inlinevirtual

Get randomised time according transition time distribution.

Parameters
t_nstime [ns]
Returns
time [ns]

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 371 of file JPMTAnalogueSignalProcessor.hh.

372  {
373  if (TTS_ns < 0.0)
374  return t_ns + getTransitionTime(gRandom->Rndm());
375  else
376  return gRandom->Gaus(t_ns, TTS_ns);
377  }
static const JTransitionTimeGenerator getTransitionTime
Function object to generate transition time.
double TTS_ns
transition time spread [ns]
virtual bool JDETECTOR::JPMTAnalogueSignalProcessor::compare ( const JPhotoElectron first,
const JPhotoElectron second 
) const
inlinevirtual

Compare (arrival times of) photo-electrons.

Parameters
firstfirst photo-electron
secondsecond photo-electron
Returns
true if arrival times of photo-electrons are within rise time of analogue pulses; else false

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 387 of file JPMTAnalogueSignalProcessor.hh.

388  {
389  return second.t_ns < first.t_ns + riseTime_ns;
390  }
double riseTime_ns
rise time of analogue pulse [ns]
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRandomAmplitude ( const int  NPE) const
inlinevirtual

Get randomised amplitude according gain and gain spread.

Parameters
NPEnumber of photo-electrons
Returns
number of photo-electrons

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 399 of file JPMTAnalogueSignalProcessor.hh.

400  {
401  double x;
402 
403  do {
404  x = gRandom->Gaus(NPE*gain, getGainSpread(NPE));
405  } while (x < 0.0);
406 
407  return x;
408  }
double gain
gain [unit]
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getProbability ( const double  npe,
const int  NPE 
) const
inlinevirtual

Get probability for given charge.

Parameters
npeobserved number of photo-electrons
NPEtrue number of photo-electrons
Returns
probability [npe^-1]

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 418 of file JPMTAnalogueSignalProcessor.hh.

419  {
420  if (npe >= threshold) {
421 
422  const double mu = NPE * gain;
423  const double sigma = getGainSpread(NPE);
424  const double V = 0.5 * TMath::Erfc((threshold - mu) / sqrt(2.0) / sigma);
425 
426  return TMath::Gaus(npe, mu, sigma, kTRUE) / V;
427  }
428 
429  return 0.0;
430  }
double gain
gain [unit]
double threshold
threshold [npe]
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
virtual bool JDETECTOR::JPMTAnalogueSignalProcessor::applyThreshold ( const double  npe) const
inlinevirtual

Apply threshold.

Parameters
npenumber of photo-electrons
Returns
true if pass; else false

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 439 of file JPMTAnalogueSignalProcessor.hh.

440  {
441  return npe >= threshold;
442  }
double threshold
threshold [npe]
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRiseTime ( const double  npe) const
inlinevirtual

Get time to reach threshold.

Note that the rise time is defined to be zero for a one photo-electron signal.

Parameters
npenumber of photo-electrons
Returns
time [ns]

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 453 of file JPMTAnalogueSignalProcessor.hh.

454  {
455  if (slewing)
456  return ((getRiseTime(npe, getTH0()) - getRiseTime(npe, this->threshold)) -
457  (getRiseTime(1.0, getTH0()) - getRiseTime(1.0, this->threshold)));
458  else
459  return 0.0;
460  }
double threshold
threshold [npe]
static double getTH0()
Get lower threshold for rise time evaluation.
bool slewing
time slewing of analogue signal
double getRiseTime(const double npe, const double th) const
Get time to pass from threshold to top of analogue pulse.
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getTimeOverThreshold ( const double  npe) const
inlinevirtual

Get time-over-threshold (ToT).

Parameters
npenumber of photo-electrons
Returns
ToT [ns]

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 469 of file JPMTAnalogueSignalProcessor.hh.

470  {
471  if (npe > threshold) {
472 
473  double tot = 0.0;
474 
475  if (npe*y1 > threshold) {
476 
477  if (npe <= getStartOfLinearisation()) {
478 
479  tot += getRiseTime (npe, threshold); // Gaussian
480  tot += getDecayTime(npe, threshold); // exponential
481 
482  } else {
483 
484  tot += getRiseTime (getStartOfLinearisation(), threshold); // Gaussian
485  tot += getDecayTime(getStartOfLinearisation(), threshold); // exponential
486 
487  tot += slope * (npe - getStartOfLinearisation()); // linear
488  }
489 
490  } else {
491 
492  tot += getRiseTime(npe, threshold); // Gaussian
493  tot += getRiseTime(npe, threshold); // Gaussian
494  }
495 
496  return tot * getSaturation(tot);
497 
498  } else {
499 
500  return 0.0;
501  }
502  }
double threshold
threshold [npe]
double getSaturation(const double y) const
Get function value with saturation.
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.
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getDerivative ( const double  npe) const
inlinevirtual

Get derivative of number of photo-electrons to time-over-threshold.

Parameters
npenumber of photo-electrons
Returns
dnpe/dToT [ns^-1]

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 511 of file JPMTAnalogueSignalProcessor.hh.

512  {
513  if (npe >= threshold) {
514 
515  const double z = riseTime_ns / sqrt(2.0 * log(npe/threshold));
516 
517  double y = 0.0;
518 
519  if (npe*y1 > threshold) {
520 
521  if (npe <= getStartOfLinearisation())
522  y = npe / (z + decayTime_ns); // Gaussian + exponential
523  else
524  y = 1.0 / slope; // linear
525 
526  } else {
527 
528  y = npe / (2.0 * z); // Gaussian + Gaussian
529  }
530 
532 
533  } else {
534 
535  return 0.0;
536  }
537  }
double getDerivativeOfSaturation(const double y) const
Get derivative of function value with saturation.
virtual double getTimeOverThreshold(const double npe) const
Get time-over-threshold (ToT).
double threshold
threshold [npe]
double riseTime_ns
rise time of analogue pulse [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]
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getSurvivalProbability ( const int  NPE) const
inlinevirtual

Probability that a hit survives the simulation of the PMT.

Parameters
NPEnumber of photo-electrons
Returns
probability

Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.

Definition at line 546 of file JPMTAnalogueSignalProcessor.hh.

547  {
548  if (QE <= 0.0) {
549 
550  return 0.0;
551 
552  } else if (QE <= 1.0) {
553 
554  double P = 0.0;
555 
556  for (int i = 1; i <= NPE; ++i) {
557 
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;
560  const double sigma = getGainSpread(i);
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);
563 
564  P += p*V/W;
565  }
566 
567  return P;
568 
569  } else {
570 
571  THROW(JValueOutOfRange, "JPMTAnalogueSignalProcessor::getSurvivalProbability: Invalid QE " << QE);
572  }
573  }
double gain
gain [unit]
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
double threshold
threshold [npe]
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
double QE
relative quantum efficiency
static double JDETECTOR::JPMTAnalogueSignalProcessor::getTH0 ( )
inlinestatic

Get lower threshold for rise time evaluation.

Returns
threshold [npe]

Definition at line 581 of file JPMTAnalogueSignalProcessor.hh.

582  {
583  return 0.1;
584  }
static double JDETECTOR::JPMTAnalogueSignalProcessor::getTH1 ( )
inlinestatic

Get upper threshold for rise time evaluation.

Returns
threshold [npe]

Definition at line 592 of file JPMTAnalogueSignalProcessor.hh.

593  {
594  return 0.9;
595  }
void JDETECTOR::JPMTSignalProcessorInterface::operator() ( const JCalibration calibration,
const JPMTData< JPMTSignal > &  input,
JPMTData< JPMTPulse > &  output 
) const
inlineinherited

Process hits.

Parameters
calibrationPMT calibration
inputPMT signals
outputPMT hits

Definition at line 92 of file JPMTSignalProcessorInterface.hh.

95  {
96  // apply transition time distribution to each photo-electron.
97 
98  buffer.clear();
99 
100  for (JPMTData<JPMTSignal>::const_iterator hit = input.begin(); hit != input.end(); ++hit) {
101  for (int i = 0; i != hit->npe; ++i) {
102  if (applyQE()) {
103  buffer.push_back(JPhotoElectron(getRandomTime(hit->t_ns)));
104  }
105  }
106  }
107 
108  if (!buffer.empty()) {
109 
111 
112  buffer.sort();
113 
114 
115  // generate PMT hits from time sequence of photo-electrons.
116 
117  for (JPMTData<JPhotoElectron>::const_iterator q = buffer.begin(), p = q++; q != buffer.end(); ++q) {
118 
119  while (compare(*p,*q)) {
120  ++q;
121  }
122 
123  const double npe = getRandomAmplitude(distance(p,q));
124 
125  if (applyThreshold(npe)) {
126  output.push_back(JPMTPulse(putTime(p->t_ns + getRiseTime(npe), calibration), getTimeOverThreshold(npe)));
127  }
128 
129  p = q;
130  }
131 
132  // merge overlapping PMT hits.
133 
134  merge(output);
135  }
136  }
Data structure for PMT digital pulse.
virtual double getRandomAmplitude(const int NPE) const
Get randomised amplitude according gain and gain spread.
Data structure for single photo-electron.
virtual void merge(JPMTData< JPMTPulse > &data) const
Merging of PMT hits.
virtual bool applyQE() const
Apply relative QE.
virtual double getRiseTime(const double npe) const
Get time to pass threshold.
double putTime(const T &t1, const JCalibration &cal)
Get de-calibrated time.
virtual bool applyThreshold(const double npe) const
Apply threshold.
virtual bool compare(const JPhotoElectron &first, const JPhotoElectron &second) const
Compare arrival times of photo-electrons.
static JPhotoElectron getEndMarker()
Get end marker.
virtual double getRandomTime(const double t_ns) const
Get randomised time according transition time distribution.
virtual double getTimeOverThreshold(const double npe) const
Get time over threshold (ToT).
std::vector< JElement_t >::const_iterator const_iterator
virtual void JDETECTOR::JPMTSignalProcessorInterface::merge ( JPMTData< JPMTPulse > &  data) const
inlinevirtualinherited

Merging of PMT hits.

Hits with overlapping time-over-threshold signals should -de facto- be combined. In this, the leading edge is maintained and the time-over-threshold is set to the difference between the overall trailing and leading edges. As a result, the number of PMT hits may be reduced.

Parameters
dataPMT hits

Definition at line 284 of file JPMTSignalProcessorInterface.hh.

285  {
286  using namespace std;
287 
288  JPMTData<JPMTPulse>::iterator out = data.begin();
289 
290  for (JPMTData<JPMTPulse>::iterator i = data.begin(); i != data.end(); ) {
291 
292  double t1 = i->t_ns;
293  double t2 = i->t_ns + i->tot_ns;
294 
295  while (++i != data.end() && i->t_ns < t2 + getTmin()) {
296  t2 = max(t2, i->t_ns + i->tot_ns);
297  }
298 
299  out->t_ns = t1;
300  out->tot_ns = t2 - t1;
301 
302  ++out;
303  }
304 
305  data.resize(distance(data.begin(), out));
306  }
static double getTmin()
Get two photo-electron resolution for time-over-threshold.
std::vector< JElement_t >::iterator iterator
double JDETECTOR::JPMTSignalProcessorInterface::getNPE ( const double  tot_ns,
const double  eps = 1.0e-3 
) const
inlineinherited

Get number of photo-electrons.

Parameters
tot_nstime over threshold [ns]
epsprecision
Returns
number of photo-electrons

Definition at line 316 of file JPMTSignalProcessorInterface.hh.

318  {
319  static const int N = 100;
320 
321  if (tot_ns > 0.0) {
322 
323  double xmin = 0.0;
324  double xmax = 100.0;
325 
326  for (int i = 0; i != N; ++i) {
327 
328  const double x = 0.5 * (xmin + xmax);
329  const double y = this->getTimeOverThreshold(x);
330 
331  if (fabs(y - tot_ns) < eps) {
332  return x;
333  }
334 
335  if (y < tot_ns)
336  xmin = x;
337  else
338  xmax = x;
339  }
340 
341  return 0.5 * (xmin + xmax);
342 
343  } else {
344 
345  double xmin = 0.0;
346  double xmax = 2.0;
347 
348  for (int i = 0; i != N; ++i) {
349 
350  const double x = 0.5 * (xmin + xmax);
351  const double y = this->getTimeOverThreshold(x);
352 
353  if (y == 0.0)
354  xmin = x;
355  else
356  xmax = x;
357  }
358 
359  return 0.5 * (xmin + xmax);
360  }
361  }
virtual double getTimeOverThreshold(const double npe) const
Get time over threshold (ToT).
static double JDETECTOR::JPMTSignalProcessorInterface::getTmin ( )
inlinestaticinherited

Get two photo-electron resolution for time-over-threshold.

Returns
minimal time [ns]

Definition at line 369 of file JPMTSignalProcessorInterface.hh.

370  {
371  return 1.0;
372  }
static double JDETECTOR::JPMTSignalProcessorInterface::getQmin ( )
inlinestaticinherited

Get minimal width of charge distribution.

Returns
minimal charge [npe]

Definition at line 380 of file JPMTSignalProcessorInterface.hh.

381  {
382  return 1.0e-3;
383  }
const JPMTParameters& JDETECTOR::JPMTParameters::getPMTParameters ( ) const
inlineinherited

Get PMT parameters.

Returns
PMT parameters

Definition at line 95 of file JPMTParameters.hh.

96  {
97  return static_cast<const JPMTParameters&>(*this);
98  }
Data structure for PMT parameters.
bool JDETECTOR::JPMTParameters::is_valid ( ) const
inlineinherited

Check validity of PMT parameters.

Returns
true if valid; else false

Definition at line 117 of file JPMTParameters.hh.

118  {
119  if (this->QE < 0.0 ||
120  this->gain < 0.0 ||
121  this->gainSpread < 0.0 ||
122  this->threshold < 0.0) {
123  return false;
124  }
125 
126  return true;
127  }
double gain
gain [unit]
double gainSpread
gain spread [unit]
double threshold
threshold [npe]
double QE
relative quantum efficiency
static JEquationParameters& JDETECTOR::JPMTParameters::getEquationParameters ( )
inlinestaticinherited

Get equation parameters.

Returns
equation parameters

Definition at line 175 of file JPMTParameters.hh.

176  {
177  static JEquationParameters equation("=", ",", "./", "#");
178 
179  return equation;
180  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
static void JDETECTOR::JPMTParameters::setEquationParameters ( const JEquationParameters equation)
inlinestaticinherited

Set equation parameters.

Parameters
equationequation parameters

Definition at line 188 of file JPMTParameters.hh.

189  {
190  getEquationParameters() = equation;
191  }
static JEquationParameters & getEquationParameters()
Get equation parameters.
JProperties JDETECTOR::JPMTParameters::getProperties ( const JEquationParameters equation = JPMTParameters::getEquationParameters())
inlineinherited

Get properties of this class.

Parameters
equationequation parameters

Definition at line 199 of file JPMTParameters.hh.

200  {
201  return JPMTParametersHelper(*this, equation);
202  }
JProperties JDETECTOR::JPMTParameters::getProperties ( const JEquationParameters equation = JPMTParameters::getEquationParameters()) const
inlineinherited

Get properties of this class.

Parameters
equationequation parameters

Definition at line 210 of file JPMTParameters.hh.

211  {
212  return JPMTParametersHelper(*this, equation);
213  }

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JPMTAnalogueSignalProcessor object 
)
friend

Read PMT signal from input.

Parameters
ininput stream
objectPMT signal
Returns
input stream

Definition at line 339 of file JPMTAnalogueSignalProcessor.hh.

340  {
341  in >> static_cast<JPMTParameters&>(object);
342 
343  object.configure();
344 
345  return in;
346  }
JPMTParameters()
Default constructor.

Member Data Documentation

double JDETECTOR::JPMTAnalogueSignalProcessor::decayTime_ns
protected

decay time [ns]

Definition at line 598 of file JPMTAnalogueSignalProcessor.hh.

double JDETECTOR::JPMTAnalogueSignalProcessor::t1
protected

time at match point [ns]

Definition at line 599 of file JPMTAnalogueSignalProcessor.hh.

double JDETECTOR::JPMTAnalogueSignalProcessor::y1
protected

amplitude at match point [npe]

Definition at line 600 of file JPMTAnalogueSignalProcessor.hh.

double JDETECTOR::JPMTAnalogueSignalProcessor::x1
protected

Transition point from a logarithmic to a linear relation between time-over-threshold and number of photo-electrons.


Measurements by B. Schermer and R. Bruijn at Nikhef.

Definition at line 606 of file JPMTAnalogueSignalProcessor.hh.

double JDETECTOR::JPMTParameters::QE
inherited

relative quantum efficiency

Definition at line 216 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::gain
inherited

gain [unit]

Definition at line 217 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::gainSpread
inherited

gain spread [unit]

Definition at line 218 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::riseTime_ns
inherited

rise time of analogue pulse [ns]

Definition at line 219 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::TTS_ns
inherited

transition time spread [ns]

Definition at line 220 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::threshold
inherited

threshold [npe]

Definition at line 221 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::slope
inherited

slope [ns/npe]

Definition at line 222 of file JPMTParameters.hh.

double JDETECTOR::JPMTParameters::saturation
inherited

saturation [ns]

Definition at line 223 of file JPMTParameters.hh.

bool JDETECTOR::JPMTParameters::slewing
inherited

time slewing of analogue signal

Definition at line 224 of file JPMTParameters.hh.


The documentation for this struct was generated from the following file: