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")
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];
74 std::cout <<
"PROTOTYPE2_FEM::GetHBDCh - invalid input caloname " << caloname
75 <<
" i_column " << i_column <<
" i_row " << i_row << std::endl;
81 const std::vector<double> &samples,
94 (gpulse.GetX())[
i] =
i;
96 (gpulse.GetY())[
i] = samples[
i];
101 const double risetime = 4;
103 for (
int iSample = 0; iSample <
NSAMPLES; iSample++)
105 if (abs(gpulse.GetY()[iSample] -
pedestal) > abs(peakval - pedestal))
107 peakval = gpulse.GetY()[iSample];
118 par[1] = peakPos - risetime;
125 fits.SetParameters(par);
126 fits.SetParLimits(0, peakval * 0.9, peakval * 1.1);
127 fits.SetParLimits(1, 0, 24);
128 fits.SetParLimits(2, 2, 4.);
129 fits.SetParLimits(3, 1., 2.);
130 fits.SetParLimits(4, pedestal - abs(peakval), pedestal + abs(peakval));
132 fits.FixParameter(5, 0);
135 for (
int ipoint = 0; ipoint < gpulse.GetN(); ipoint++)
136 if ((gpulse.GetY())[ipoint] == 0)
138 gpulse.RemovePoint(ipoint);
142 gpulse.Fit(&fits,
"MQRN0",
"goff", 0., (
double) NSAMPLES);
146 TCanvas *canvas =
new TCanvas(
"PROTOTYPE2_FEM_SampleFit_PowerLawExp",
147 "PROTOTYPE2_FEM::SampleFit_PowerLawExp");
148 gpulse.DrawClone(
"ap*l");
149 fits.DrawClone(
"same");
157 (fits.GetParameter(0) *
158 pow(fits.GetParameter(2) / fits.GetParameter(3), fits.GetParameter(2))) /
159 exp(fits.GetParameter(
163 peak_sample = fits.GetParameter(1) +
164 fits.GetParameter(2) / fits.GetParameter(3);
168 pedstal = fits.GetParameter(4);
176 par[4] + ((x[0] - 1.5 * par[1]) > 0) *
183 par[0] * pow((x[0] - par[1]), par[2]) * exp(-(x[0] - par[1]) * par[3]);