10 #include <ecl/digitization/EclConfigurationPure.h>
13 #include <ecl/digitization/ECLSampledShaper.h>
21 using namespace Belle2::ECL;
28 const int N = m_ns * m_nlPure;
29 double r1 = 32 / m_ns;
34 double maxval = * max_element(m_ft, m_ft + N);
36 for_each(m_ft1, m_ft1 + N, [maxval](
double & a) { a /= maxval; });
37 double maxval2 = * max_element(m_ft, m_ft + N);
38 assert(maxval2 - 1.0 < 0.001);
40 for (
int i = 0; i < N; i++) sum += m_ft[i];
41 m_sumscale = m_ns / sum;
45 for_each(m_ft1, m_ft1 + N, [r1, r2, maxval](
double & a) { a *= (r1 / r2) / maxval; });
51 total += s.Accumulate(a, t0, c);
61 const double itick = 1 / getTickPure();
62 const double tlen = m_nlPure - 1.0 / m_ns;
63 const double tmax = m_tmin + m_nsmp - 1;
65 double t = t0 * itick;
66 double x0 = t, x1 = t + tlen;
68 if (x0 > tmax)
return 0;
70 if (x1 < m_tmin)
return 0;
85 double epsilon = 1.0 / m_ns / 10.;
86 double imind = ceil(x0 - m_tmin + epsilon);
89 double w = ((m_tmin - t) + imind - 1) * double(m_ns);
96 const double w1 = a * w, w0 = a - w1;
100 for (
int i = imin, j = jmin; i < imax; i++, j += m_ns) {
102 if (j >= 0) amp = w0 * m_ft[j] + w1 * m_ft[j + 1];
109 return sum * m_sumscale;
void fillarray(int N, double *a)
fill the sampled shape array
static double m_tickPure
Digitization tick for pure CsI calorimeter (microseconds)
static double getTick()
See m_tick.
static constexpr int m_ntrg
number of trigger counts per ADC clock tick
Abstract base class for different kinds of events.
void AddHit(const double a, const double t0, const signalsamplepure_t &q)
add hit method
a struct for a signal sample for the pure CsI calorimeter
void InitSample(const TH1F *, const TH1F *)
initialisation of signal sample
double Accumulate(const double a, const double t0, double *s) const