a struct for a signal sample for the pure CsI calorimeter
More...
#include <EclConfigurationPure.h>
|
void | InitSample (const TH1F *, const TH1F *) |
| initialisation of signal sample
|
|
double | Accumulate (const double a, const double t0, double *s) const |
|
a struct for a signal sample for the pure CsI calorimeter
Definition at line 55 of file EclConfigurationPure.h.
◆ Accumulate()
double Accumulate |
( |
const double | a, |
|
|
const double | t0, |
|
|
double * | s ) const |
- Parameters
-
[in] | a | Signal amplitude |
[in] | t0 | Signal offset |
[out] | s | Output array with added signal |
- Returns
- Energy deposition in ADC units
Definition at line 57 of file EclConfigurationPure.cc.
58{
59
60
61
62
63
67
68 double t = t0 * itick;
69 double x0 = t, x1 = t + tlen;
70
71 if (x0 > tmax) return 0;
75 }
76
78
79
80 if (x1 < tmax) {
81
82
84
85 imax += 1;
86 }
87
88 double epsilon = 1.0 /
m_ns / 10.;
89 double imind = ceil(x0 -
m_tmin + epsilon);
90
91 int imin = imind;
92 double w = ((
m_tmin - t) + imind - 1) *
double(
m_ns);
93 int jmin = w ;
94 w -= jmin;
95
96
97
98
99 const double w1 = a * w, w0 = a - w1;
100 double sum = 0;
101
102
103 for (
int i = imin, j = jmin; i < imax; i++, j +=
m_ns) {
104 double amp = 0;
105 if (j >= 0) amp = w0 *
m_ft[j] + w1 *
m_ft[j + 1];
106
107
108 s[i] += amp;
109 sum += amp;
110 }
111
113}
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 constexpr int m_nsmp
number of ADC measurements for signal fitting
double m_ft[m_nlPure *m_ns]
Simulated signal shape.
double m_sumscale
energy deposit in fitting window scale factor
◆ InitSample()
void InitSample |
( |
const TH1F * | sampledfun, |
|
|
const TH1F * | sampledfunDerivative ) |
initialisation of signal sample
Definition at line 26 of file EclConfigurationPure.cc.
27{
29 double r1 = 32 /
m_ns;
31
32 ECLSampledShaper dsp(sampledfun, round(r1 / r2));
33 dsp.fillarray(N,
m_ft);
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);
40 double sum = 0;
41 for (
int i = 0; i < N; i++) sum +=
m_ft[i];
43
44 ECLSampledShaper dsp1(sampledfunDerivative, round(r1 / r2));
45 dsp1.fillarray(N,
m_ft1);
46 scale = (r1 / r2) / maxval;
47 for (int i = 0; i < N; ++i)
49}
static double getTick()
See m_tick.
static constexpr int m_ntrg
number of trigger counts per ADC clock tick
double m_ft1[m_nlPure *m_ns]
Simulated signal shape.
◆ m_ft
◆ m_ft1
◆ m_sumscale
The documentation for this struct was generated from the following files: