8#include <ecl/digitization/algorithms.h>
11using namespace Belle2::ECL;
13double Belle2::ECL::ShaperDSP(
double Ti)
15 return ShaperDSP(Ti, (
const double*)0);
18double Belle2::ECL::ShaperDSP(
double Ti,
const float* sf)
22 for (
int i = 0; i < 10; i++) sd[i] = sf[i];
23 return ShaperDSP(Ti, sd);
25 return ShaperDSP(Ti, (
const double*)0);
28double Belle2::ECL::ShaperDSP(
double Ti,
const double* s)
30 const double scale = 27.7221;
31 static const double defs[10] = {0.5, 0.6483, 0.4017, 0.3741, 0.8494, 0.00144547, 4.7071, 0.8156, 0.5556, 0.2752};
33 double t = Ti * (127. / 144.) - s[0];
34 const double dt = 0.2;
36 double fm = Sv123(t - dt, s[2], s[3], s[7], s[8], s[1], s[4]);
37 double f0 = Sv123(t, s[2], s[3], s[7], s[8], s[1], s[4]);
38 double fp = Sv123(t + dt, s[2], s[3], s[7], s[8], s[1], s[4]);
41 double svp = (1 - w) * f0 + (0.5 * w) * (fp + fm);
44 double y = t / s[6], z = t / s[2];
45 svp -= s[5] * exp(-y) * (1 - exp(-z) * (1 + z * (1 + z * (1 / 2. + z * (1 / 6. + z * (1 / 24. + z * (1 / 120.)))))));
50double Belle2::ECL::ShaperDSPofflineFit(
double Ti,
const double* s,
double scale)
56 const double dt = 0.2;
58 double fm = Sv123(t - dt, s[2], s[3], s[7], s[8], s[1], s[4]);
59 double f0 = Sv123(t, s[2], s[3], s[7], s[8], s[1], s[4]);
60 double fp = Sv123(t + dt, s[2], s[3], s[7], s[8], s[1], s[4]);
62 double svp = (1 - w) * f0 + (0.5 * w) * (fp + fm);
65 double y = t / s[6], z = t / s[2];
66 svp -= s[5] * exp(-y) * (1 - exp(-z) * (1 + z * (1 + z * (1 / 2. + z * (1 / 6. + z * (1 / 24. + z * (1 / 120.)))))));