45 float e,
x,
y, xx, yy,
xy;
67 std::vector<EmcModule>::iterator ph;
89 std::vector<EmcModule>::iterator ph;
105 std::vector<EmcModule>::iterator ph;
113 if ((*ph).ich == ich)
127 std::vector<EmcModule>::iterator ph;
148 float e,
x,
y, xx, yy,
xy;
149 float ecore, ecorecorr;
159 const float thresh = 0.01;
161 std::vector<EmcModule>::iterator ph;
162 float xcg, ycg, xx,
xy, yy;
198 float et, xcg, ycg, xx,
xy, yy;
199 float e1, e2, e3, e4;
200 int ix0, iy0, isx, isy;
203 ix0 = int(xcg + 0.5);
204 iy0 = int(ycg + 0.5);
222 return (e1 + e2 + e3 + e4);
229 float et, xcg, ycg, xx,
xy, yy;
230 int ich, ix0, iy0, nhit;
240 ix0 = int(xcg + 0.5);
241 iy0 = int(ycg + 0.5);
252 std::vector<EmcModule>::iterator ph;
270 if (abs(idx) <= 1 && abs(idy) <= 1)
284 std::vector<EmcModule>::iterator ph;
299 if ((*ph).amp > emax)
346 int ixypk, ixpk, iypk,
in, nh, ic;
352 float ratio, eg, dx,
dy,
a;
356 std::vector<EmcModule>::iterator ph;
357 std::vector<EmcModule> hl;
385 for (ic = 0; ic < nhit; ic++)
387 float amp = hlist[ic].
amp;
390 int ich = hlist[ic].
ich;
399 while ((inA < nhit) && (hlist[inA].ich <= ichmax))
411 while ((inA >= 0) && (hlist[inA].
ich >= ichmin))
424 std::cout <<
"!!! Error in EmcCluster::GetSubClusters(): too many peaks in a cluster (>"
426 <<
"). May need tower energy threshold increase for clustering." << std::endl;
448 for (
int ich = 0; ich < nhit; ich++)
450 hl.push_back(hlist[ich]);
453 PkList.push_back(peak);
457 ppeaks.push_back(hlist[PeakCh[0]]);
470 for (ipk = 0; ipk < npk; ipk++)
472 Energy[ipk] =
new float[nhit];
474 totEnergy =
new float[nhit];
475 tmpEnergy =
new float[nhit];
476 for (
int i = 0;
i < nhit; ++
i)
488 for (ipk = 0; ipk < npk; ipk++)
493 ratio = Energy[ipk][ic] / totEnergy[ic];
495 eg = hlist[ic].
amp * ratio;
496 ixypk = hlist[ic].
ich;
509 for (in = ic + 1; in < nhit; in++)
527 ratio = Energy[ipk][
in] / totEnergy[
in];
529 eg = hlist[
in].
amp * ratio;
531 xpk[ipk] += eg *
idx;
532 ypk[ipk] += eg * idy;
540 for (in = ic - 1; in >= 0; in--)
558 ratio = Energy[ipk][
in] / totEnergy[
in];
560 eg = hlist[
in].
amp * ratio;
562 xpk[ipk] += eg *
idx;
563 ypk[ipk] += eg * idy;
568 xpk[ipk] = xpk[ipk] / epk[ipk] + ixpk;
569 ypk[ipk] = ypk[ipk] / epk[ipk] + iypk;
572 for (in = 0; in < nhit; in++)
582 if (
ABS(dx) < 2.5 &&
ABS(dy) < 2.5)
593 float flim = 0.000001;
594 for (in = 0; in < nhit; in++)
596 if (tmpEnergy[in] > flim)
598 totEnergy[
in] = tmpEnergy[
in];
602 totEnergy[
in] = flim;
610 for (ipk = 0; ipk < npk; ipk++)
615 for (in = 0; in < nhit; in++)
617 if (tmpEnergy[in] > 0)
620 a = hlist[
in].
amp * Energy[ipk][
in] / tmpEnergy[
in];
660 for (ipk = 0; ipk < npk; ipk++)
668 for (in = 0; in < nhit; in++)
671 for (ig = igmpk1[ipk]; ig <= igmpk2[ipk]; ig++)
680 Energy[ipk][
in] +=
a;
688 for (ipk = 0; ipk < npk; ipk++)
691 for (in = 0; in < nhit; in++)
693 if (tmpEnergy[in] > 0)
696 a = hlist[
in].
amp * Energy[ipk][
in] / tmpEnergy[
in];
710 ppeaks.push_back(hlist[PeakCh[ipk]]);
712 for (in = 0; in < nh; in++)
714 hl.push_back(phit[in]);
717 PkList.push_back(peak);
724 for (ipk = 0; ipk < npk; ipk++)
726 delete[] Energy[ipk];