28 if (caloname ==
"HCALIN")
30 return 64 + 8 * i_column + 2 * i_row;
32 else if (caloname ==
"HCALOUT")
34 return 112 + 8 * i_column + 2 * i_row;
36 else if (caloname ==
"EMCAL_PROTOTYPE2")
46 10 + 48, 11 + 48, 8 + 48, 9 + 48, 14 + 48, 15 + 48, 12 + 48, 13 + 48,
48 2 + 48, 3 + 48, 0 + 48, 1 + 48, 6 + 48, 7 + 48, 4 + 48, 5 + 48,
51 10 + 32, 11 + 32, 8 + 32, 9 + 32, 14 + 32, 15 + 32, 12 + 32, 13 + 32,
53 2 + 32, 3 + 32, 0 + 32, 1 + 32, 6 + 32, 7 + 32, 4 + 32, 5 + 32,
56 10 + 16, 11 + 16, 8 + 16, 9 + 16, 14 + 16, 15 + 16, 12 + 16, 13 + 16,
58 2 + 16, 3 + 16, 0 + 16, 1 + 16, 6 + 16, 7 + 16, 4 + 16, 5 + 16,
61 10, 11, 8, 9, 14, 15, 12, 13,
63 2, 3, 0, 1, 6, 7, 4, 5};
65 const int tower_index =
71 return canmap[tower_index];
73 else if (caloname ==
"EMCAL_HIGHETA")
81 static int canmap[] = {
97 3, 2, 19, 18, 35, 34, 51, 50, 1, 0, 17, 16, 33, 32, 49, 48, 7,
98 6, 23, 22, 39, 38, 55, 54, 5, 4, 21, 20, 37, 36, 53, 52, 11, 10,
99 27, 26, 43, 42, 59, 58, 9, 8, 25, 24, 41, 40, 57, 56, 15, 14, 31,
100 30, 47, 46, 63, 62, 13, 12, 29, 28, 45, 44, 61, 60, 0};
102 const int tower_index =
108 return canmap[tower_index];
111 std::cout <<
"PROTOTYPE3_FEM::GetHBDCh - invalid input caloname " << caloname
112 <<
" i_column " << i_column <<
" i_row " << i_row << std::endl;
118 const std::vector<double> &samples,
131 (gpulse.GetX())[
i] =
i;
133 (gpulse.GetY())[
i] = samples[
i];
138 const double risetime = 4;
140 for (
int iSample = 0; iSample <
NSAMPLES; iSample++)
142 if (abs(gpulse.GetY()[iSample] -
pedestal) > abs(peakval - pedestal))
144 peakval = gpulse.GetY()[iSample];
155 par[1] = peakPos - risetime;
162 fits.SetParameters(par);
163 fits.SetParLimits(0, peakval * 0.9, peakval * 1.1);
164 fits.SetParLimits(1, 0, 24);
165 fits.SetParLimits(2, 2, 4.);
166 fits.SetParLimits(3, 1., 2.);
167 fits.SetParLimits(4, pedestal - abs(peakval), pedestal + abs(peakval));
169 fits.FixParameter(5, 0);
172 for (
int ipoint = 0; ipoint < gpulse.GetN(); ipoint++)
173 if ((gpulse.GetY())[ipoint] == 0 or
174 (gpulse.GetY())[ipoint] >=
177 gpulse.RemovePoint(ipoint);
181 gpulse.Fit(&fits,
"MQRN0",
"goff", 0., (
double) NSAMPLES);
185 TCanvas *canvas =
new TCanvas(
"PROTOTYPE3_FEM_SampleFit_PowerLawExp",
186 "PROTOTYPE3_FEM::SampleFit_PowerLawExp");
187 gpulse.DrawClone(
"ap*l");
188 fits.DrawClone(
"same");
196 (fits.GetParameter(0) *
197 pow(fits.GetParameter(2) / fits.GetParameter(3), fits.GetParameter(2))) /
198 exp(fits.GetParameter(
202 peak_sample = fits.GetParameter(1) +
203 fits.GetParameter(2) / fits.GetParameter(3);
207 pedstal = fits.GetParameter(4);
215 par[4] + ((x[0] - 1.5 * par[1]) > 0) *
222 par[0] * pow((x[0] - par[1]), par[2]) * exp(-(x[0] - par[1]) * par[3]);