PMT analogue signal processor.
More...
#include <JPMTAnalogueSignalProcessor.hh>
|
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...
|
|
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.
- If the specified transition time spread (TTS) is negative, the transition times are generated according to the measurements (see method JDETECTOR::getTransitionTime).
- If the specified TTS is positive, the transition times are generated according a Gaussian with a sigma equals to the TTS.
- If the TTS is zero, the transition times are generated without any spread.
Definition at line 46 of file JPMTAnalogueSignalProcessor.hh.
◆ JPMTAnalogueSignalProcessor()
◆ configure()
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 78 of file JPMTAnalogueSignalProcessor.hh.
80 static const int N = 100;
81 static const double precision = 1.0e-3;
86 THROW(JValueOutOfRange,
"JPMTAnalogueSignalProcessor::configure(): Invalid rise time [ns] " <<
riseTime_ns);
97 const double Q = b*b - 4.0*a*c;
115 x1 = std::numeric_limits<double>::max();
120 for (
int i = 0; i != N; ++i) {
122 const double x = 0.5 * (xmin + xmax);
125 if (fabs(1.0 -
u) < precision) {
135 x1 = 0.5 * (xmin + xmax);
◆ getDecayTime() [1/2]
double JDETECTOR::JPMTAnalogueSignalProcessor::getDecayTime |
( |
| ) |
const |
|
inline |
◆ getT1()
double JDETECTOR::JPMTAnalogueSignalProcessor::getT1 |
( |
| ) |
const |
|
inline |
◆ getY1()
double JDETECTOR::JPMTAnalogueSignalProcessor::getY1 |
( |
| ) |
const |
|
inline |
◆ getStartOfLinearisation()
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 177 of file JPMTAnalogueSignalProcessor.hh.
◆ getAmplitude()
double JDETECTOR::JPMTAnalogueSignalProcessor::getAmplitude |
( |
const double |
t1_ns | ) |
const |
|
inline |
Get amplitude at given time for a one photo-electron pulse.
- Parameters
-
- Returns
- amplitude [npe]
Definition at line 189 of file JPMTAnalogueSignalProcessor.hh.
195 return exp(-0.5*x*x);
◆ getRiseTime() [1/2]
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
-
npe | number of photo-electrons |
th | threshold [npe] |
- Returns
- time [ns]
Definition at line 214 of file JPMTAnalogueSignalProcessor.hh.
◆ getDecayTime() [2/2]
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
-
npe | number of photo-electrons |
th | threshold [npe] |
- Returns
- time [ns]
Definition at line 228 of file JPMTAnalogueSignalProcessor.hh.
◆ getMaximalRiseTime()
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
-
- Returns
- rise time [ns]
Definition at line 245 of file JPMTAnalogueSignalProcessor.hh.
247 if (th > 0.0 && th < 1.0)
250 THROW(JValueOutOfRange,
"JPMTAnalogueSignalProcessor::getMaximalRiseTime(): Invalid threshold " << th);
◆ getSaturation()
double JDETECTOR::JPMTAnalogueSignalProcessor::getSaturation |
( |
const double |
y | ) |
const |
|
inline |
◆ getDerivativeOfSaturation()
double JDETECTOR::JPMTAnalogueSignalProcessor::getDerivativeOfSaturation |
( |
const double |
y | ) |
const |
|
inline |
◆ getGainSpread()
double JDETECTOR::JPMTAnalogueSignalProcessor::getGainSpread |
( |
int |
NPE | ) |
const |
|
inline |
Get gain spread for given number of photo-electrons.
- Parameters
-
NPE | number of photo-electrons |
- Returns
- gain spread
Definition at line 284 of file JPMTAnalogueSignalProcessor.hh.
◆ getIntegralOfProbability()
double JDETECTOR::JPMTAnalogueSignalProcessor::getIntegralOfProbability |
( |
const double |
xmin, |
|
|
const double |
xmax, |
|
|
const int |
NPE |
|
) |
| const |
|
inline |
Get integral of probability.
- Parameters
-
xmin | minimum number of photo-electrons |
xmax | maximum number of photo-electrons |
NPE | true number of photo-electrons |
- Returns
- probability
Definition at line 298 of file JPMTAnalogueSignalProcessor.hh.
306 const double mu = NPE *
gain;
309 return (0.5 * TMath::Erfc((zmin - mu) / sqrt(2.0) / sigma) -
310 0.5 * TMath::Erfc((zmax - mu) / sqrt(2.0) / sigma));
◆ setPMTParameters()
void JDETECTOR::JPMTAnalogueSignalProcessor::setPMTParameters |
( |
const JPMTParameters & |
parameters | ) |
|
|
inline |
◆ applyQE()
virtual bool JDETECTOR::JPMTAnalogueSignalProcessor::applyQE |
( |
| ) |
const |
|
inlinevirtual |
◆ getRandomTime()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRandomTime |
( |
const double |
t_ns | ) |
const |
|
inlinevirtual |
◆ compare()
◆ getRandomAmplitude()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRandomAmplitude |
( |
const int |
NPE | ) |
const |
|
inlinevirtual |
◆ getProbability()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getProbability |
( |
const double |
npe, |
|
|
const int |
NPE |
|
) |
| const |
|
inlinevirtual |
Get probability for given charge.
- Parameters
-
npe | observed number of photo-electrons |
NPE | true number of photo-electrons |
- Returns
- probability [npe^-1]
Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.
Definition at line 413 of file JPMTAnalogueSignalProcessor.hh.
417 const double mu = NPE *
gain;
419 const double V = 0.5 * TMath::Erfc((
threshold - mu) / sqrt(2.0) / sigma);
421 return TMath::Gaus(npe, mu, sigma, kTRUE) / V;
◆ applyThreshold()
virtual bool JDETECTOR::JPMTAnalogueSignalProcessor::applyThreshold |
( |
const double |
npe | ) |
const |
|
inlinevirtual |
◆ getRiseTime() [2/2]
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getRiseTime |
( |
const double |
npe | ) |
const |
|
inlinevirtual |
◆ getTimeOverThreshold()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getTimeOverThreshold |
( |
const double |
npe | ) |
const |
|
inlinevirtual |
◆ getDerivative()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getDerivative |
( |
const double |
npe | ) |
const |
|
inlinevirtual |
◆ getSurvivalProbability()
virtual double JDETECTOR::JPMTAnalogueSignalProcessor::getSurvivalProbability |
( |
const int |
NPE | ) |
const |
|
inlinevirtual |
Probability that a hit survives the simulation of the PMT.
- Parameters
-
NPE | number of photo-electrons |
- Returns
- probability
Reimplemented from JDETECTOR::JPMTSignalProcessorInterface.
Definition at line 541 of file JPMTAnalogueSignalProcessor.hh.
547 }
else if (
QE <= 1.0) {
551 for (
int i = 1; i <= NPE; ++i) {
553 const double p = TMath::Binomial(NPE, i) * TMath::Power(
QE, i) * TMath::Power(1.0 -
QE, NPE - i);
554 const double mu = i *
gain;
556 const double V = 0.5 * TMath::Erfc((
threshold - mu) / sqrt(2.0) / sigma);
557 const double W = 0.5 * TMath::Erfc((0.0 - mu) / sqrt(2.0) / sigma);
566 THROW(JValueOutOfRange,
"JPMTAnalogueSignalProcessor::getSurvivalProbability: Invalid QE " <<
QE);
◆ getTH0()
static double JDETECTOR::JPMTAnalogueSignalProcessor::getTH0 |
( |
| ) |
|
|
inlinestatic |
◆ getTH1()
static double JDETECTOR::JPMTAnalogueSignalProcessor::getTH1 |
( |
| ) |
|
|
inlinestatic |
◆ operator()()
Process hits.
- Parameters
-
calibration | PMT calibration |
input | PMT signals |
output | PMT hits |
Definition at line 92 of file JPMTSignalProcessorInterface.hh.
101 for (
int i = 0; i != hit->npe; ++i) {
◆ merge()
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
-
Definition at line 284 of file JPMTSignalProcessorInterface.hh.
293 double t2 = i->t_ns + i->tot_ns;
295 while (++i != data.end() && i->t_ns < t2 +
getTmin()) {
296 t2 = max(t2, i->t_ns + i->tot_ns);
300 out->tot_ns = t2 - t1;
305 data.resize(
distance(data.begin(), out));
◆ getNPE()
double JDETECTOR::JPMTSignalProcessorInterface::getNPE |
( |
const double |
tot_ns, |
|
|
const double |
eps = 1.0e-3 |
|
) |
| const |
|
inlineinherited |
Get number of photo-electrons.
- Parameters
-
tot_ns | time over threshold [ns] |
eps | precision |
- Returns
- number of photo-electrons
Definition at line 316 of file JPMTSignalProcessorInterface.hh.
319 static const int N = 100;
326 for (
int i = 0; i != N; ++i) {
328 const double x = 0.5 * (xmin + xmax);
331 if (fabs(y - tot_ns) < eps) {
341 return 0.5 * (xmin + xmax);
348 for (
int i = 0; i != N; ++i) {
350 const double x = 0.5 * (xmin + xmax);
359 return 0.5 * (xmin + xmax);
◆ getTmin()
static double JDETECTOR::JPMTSignalProcessorInterface::getTmin |
( |
| ) |
|
|
inlinestaticinherited |
◆ getQmin()
static double JDETECTOR::JPMTSignalProcessorInterface::getQmin |
( |
| ) |
|
|
inlinestaticinherited |
◆ getPMTParameters()
const JPMTParameters& JDETECTOR::JPMTParameters::getPMTParameters |
( |
| ) |
const |
|
inlineinherited |
Get PMT parameters.
- Returns
- PMT parameters
Definition at line 95 of file JPMTParameters.hh.
97 return static_cast<const JPMTParameters&>(*
this);
◆ is_valid()
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.
119 if (this->
QE < 0.0 ||
◆ getEquationParameters()
Get equation parameters.
- Returns
- equation parameters
Definition at line 175 of file JPMTParameters.hh.
◆ setEquationParameters()
static void JDETECTOR::JPMTParameters::setEquationParameters |
( |
const JEquationParameters & |
equation | ) |
|
|
inlinestaticinherited |
Set equation parameters.
- Parameters
-
equation | equation parameters |
Definition at line 188 of file JPMTParameters.hh.
◆ getProperties() [1/2]
Get properties of this class.
- Parameters
-
equation | equation parameters
|
Definition at line 199 of file JPMTParameters.hh.
201 return JPMTParametersHelper(*
this, equation);
◆ getProperties() [2/2]
Get properties of this class.
- Parameters
-
equation | equation parameters
|
Definition at line 210 of file JPMTParameters.hh.
212 return JPMTParametersHelper(*
this, equation);
◆ operator>>
Read PMT signal from input.
- Parameters
-
in | input stream |
object | PMT signal |
- Returns
- input stream
Definition at line 334 of file JPMTAnalogueSignalProcessor.hh.
336 in >> static_cast<JPMTParameters&>(
object);
◆ decayTime_ns
double JDETECTOR::JPMTAnalogueSignalProcessor::decayTime_ns |
|
protected |
◆ t1
double JDETECTOR::JPMTAnalogueSignalProcessor::t1 |
|
protected |
◆ y1
double JDETECTOR::JPMTAnalogueSignalProcessor::y1 |
|
protected |
◆ x1
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 601 of file JPMTAnalogueSignalProcessor.hh.
◆ buffer
◆ QE
double JDETECTOR::JPMTParameters::QE |
|
inherited |
◆ gain
double JDETECTOR::JPMTParameters::gain |
|
inherited |
◆ gainSpread
double JDETECTOR::JPMTParameters::gainSpread |
|
inherited |
◆ riseTime_ns
double JDETECTOR::JPMTParameters::riseTime_ns |
|
inherited |
◆ TTS_ns
double JDETECTOR::JPMTParameters::TTS_ns |
|
inherited |
◆ threshold
double JDETECTOR::JPMTParameters::threshold |
|
inherited |
◆ slope
double JDETECTOR::JPMTParameters::slope |
|
inherited |
◆ saturation
double JDETECTOR::JPMTParameters::saturation |
|
inherited |
◆ slewing
bool JDETECTOR::JPMTParameters::slewing |
|
inherited |
The documentation for this struct was generated from the following file:
double t1
time at match point [ns]
double saturation
saturation [ns]
double x1
Transition point from a logarithmic to a linear relation between time-over-threshold and number of ph...
double threshold
threshold [npe]
virtual double getTimeOverThreshold(const double npe) const
Get time-over-threshold (ToT).
virtual double getRiseTime(const double npe) const
Get time to pass threshold.
static JPhotoElectron getEndMarker()
Get end marker.
const double TIME_OVER_THRESHOLD_NS
Specification for time-over-threshold corresponding to a one photo-electron pulse.
double TTS_ns
transition time spread [ns]
static const JTransitionTimeGenerator getTransitionTime
Function object to generate transition time.
double getDerivativeOfSaturation(const double y) const
Get derivative of function value with saturation.
double putTime(const T &t1, const JCalibration &cal)
Get de-calibrated time.
double decayTime_ns
decay time [ns]
virtual bool applyThreshold(const double npe) const
Apply threshold.
static double getTH0()
Get lower threshold for rise time evaluation.
static double getTmin()
Get two photo-electron resolution for time-over-threshold.
double getGainSpread(int NPE) const
Get gain spread for given number of photo-electrons.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
double gainSpread
gain spread [unit]
virtual void merge(JPMTData< JPMTPulse > &data) const
Merging of PMT hits.
virtual bool compare(const JPhotoElectron &first, const JPhotoElectron &second) const
Compare arrival times of photo-electrons.
double getStartOfLinearisation() const
Get transition point from a model dependent to linear relation between time-over-threshold and number...
Data structure for single photo-electron.
std::vector< JElement_t >::iterator iterator
std::vector< JElement_t >::const_iterator const_iterator
bool slewing
time slewing of analogue signal
void configure()
Configure internal parameters.
virtual double getRandomAmplitude(const int NPE) const
Get randomised amplitude according gain and gain spread.
static JEquationParameters & getEquationParameters()
Get equation parameters.
Data structure for PMT digital pulse.
static double getMaximalRiseTime(const double th)
Get maximal rise time for given threshold.
JPMTSignalProcessorInterface()
Default constructor.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JPMTData< JPhotoElectron > buffer
double getRiseTime(const double npe, const double th) const
Get time to pass from threshold to top of analogue pulse.
double getDecayTime() const
Get decay time.
virtual bool applyQE() const
Apply relative QE.
double getSaturation(const double y) const
Get function value with saturation.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
virtual double getRandomTime(const double t_ns) const
Get randomised time according transition time distribution.
double slope
slope [ns/npe]
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 QE
relative quantum efficiency
double riseTime_ns
rise time of analogue pulse [ns]
virtual double getTimeOverThreshold(const double npe) const
Get time over threshold (ToT).
JPMTParameters()
Default constructor.