10#include <ecl/digitization/EclConfigurationPure.h>
13#include <ecl/digitization/ECLSampledShaper.h>
21using namespace Belle2::ECL;
29 double r1 = 32 /
m_ns;
34 double maxval = * max_element(
m_ft,
m_ft + N);
35 double scale = 1.0 / maxval;
36 for (
int i = 0; i < N; ++i)
38 double maxval2 = * max_element(
m_ft,
m_ft + N);
39 assert(maxval2 - 1.0 < 0.001);
41 for (
int i = 0; i < N; i++) sum +=
m_ft[i];
46 scale = (r1 / r2) / maxval;
47 for (
int i = 0; i < N; ++i)
54 total += s.Accumulate(a, t0, c);
68 double t = t0 * itick;
69 double x0 = t, x1 = t + tlen;
71 if (x0 > tmax)
return 0;
88 double epsilon = 1.0 /
m_ns / 10.;
89 double imind = ceil(x0 -
m_tmin + epsilon);
92 double w = ((
m_tmin - t) + imind - 1) * double(
m_ns);
99 const double w1 = a * w, w0 = a - w1;
103 for (
int i = imin, j = jmin; i < imax; i++, j +=
m_ns) {
105 if (j >= 0) amp = w0 * m_ft[j] + w1 * m_ft[j + 1];
112 return sum * m_sumscale;
void fillarray(int N, double *a)
fill the sampled shape array
static constexpr double m_tmin
lower range of the signal fitting region in ADC clocks
static double getTickPure()
Getter for m_tickPure.
static constexpr int m_ns
number of samples per ADC clock
static constexpr int m_nlPure
length of samples signal in number of ADC clocks
static double m_tickPure
Digitization tick for pure CsI calorimeter (microseconds)
static constexpr int m_nsmp
number of ADC measurements for signal fitting
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 m_ft[m_nlPure *m_ns]
Simulated signal shape.
double Accumulate(const double a, const double t0, double *s) const
double m_sumscale
energy deposit in fitting window scale factor
double m_ft1[m_nlPure *m_ns]
Simulated signal shape.