16 TAPDPulse::TAPDPulse() {
init(10, 3, 1, 2, 2, 9, 3, 8, 0.4, 0.95, 0.8); }
27 double ratiomincutlow,
28 double ratiomincuthigh,
29 double ratiomaxcutlow) {
54 double ratiomincutlow,
55 double ratiomincuthigh,
56 double ratiomaxcutlow) {
58 assert(nsamples == _nsamples);
60 adc_ =
new double[10];
62 _presample = presample;
63 _firstsample = firstsample;
64 _lastsample = lastsample;
66 _timingcutlow = timingcutlow;
67 _timingcuthigh = timingcuthigh;
68 _timingquallow = timingquallow;
69 _timingqualhigh = timingqualhigh;
70 _ratiomincutlow = ratiomincutlow;
71 _ratiomincuthigh = ratiomincuthigh;
72 _ratiomaxcutlow = ratiomaxcutlow;
74 for (
int i = 0;
i < _nsamples;
i++) {
100 for (
int i = 0;
i < _nsamples;
i++) {
101 if (adc_[
i] > adcmax) {
117 assert(n1 < _nsamples && n1 >= 0);
118 assert(n2 < _nsamples && n2 >= 0);
120 double delta = adc_[n1] - adc_[n2];
124 assert(n1 < _nsamples && n1 >= 0);
125 assert(n2 < _nsamples && n2 >= 0);
133 double ratio = (adc_[n1] -
ped) / (adc_[n2] -
ped);
141 if (iadcMax_ <= _timingcutlow || iadcMax_ >= _timingcuthigh)
149 if (iadcMax_ <= _timingquallow || iadcMax_ >= _timingqualhigh)
158 if ((iadcMax_ - _firstsample) < _presample || (iadcMax_ + _lastsample) > _nsamples - 1)
163 bool okSamples = areFitSamplesOK();
164 bool okTiming = isTimingOK();
165 bool okPulse = arePulseRatioOK();
167 bool ok = (okSamples && okTiming && okPulse);
176 if (iadcMax_ < 1 || iadcMax_ >= _nsamples - 1)
179 double ratioNm1 = getRatio(iadcMax_ - 1, iadcMax_);
180 double ratioNp1 = getRatio(iadcMax_ + 1, iadcMax_);
186 if (ratioMin < _ratiomincutlow || ratioMin > _ratiomincuthigh)
196 if (iadcMax_ < 1 || iadcMax_ >= _nsamples - 1)
199 double ratioNm1 = getRatio(iadcMax_ - 1, iadcMax_);
200 double ratioNp1 = getRatio(iadcMax_ + 1, iadcMax_);
212 if (iadcMax_ < 1 || iadcMax_ >= _nsamples - 1)
215 double ratioNm1 = getRatio(iadcMax_ - 1, iadcMax_);
216 double ratioNp1 = getRatio(iadcMax_ + 1, iadcMax_);
219 if (ratioMin < _ratiomincutlow || ratioMin > _ratiomincuthigh)
228 for (
int i = 0;
i < _presample;
i++) {
231 ped /= double(_presample);
244 double *adcNoPed =
new double[10];
245 for (
int i = 0;
i < _nsamples;
i++) {
246 adcNoPed[
i] = adc_[
i] -
ped;
253 _presample = presample;
double getRatio(int, int)
double getDelta(int, int)
double * getAdcWithoutPedestal()
void init(int, int, int, int, int, int, int, int, double, double, double)
uint16_t *__restrict__ uint16_t const *__restrict__ adc