mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 14:38:14 +02:00
Solved problem in photon finder
This commit is contained in:
parent
2fe24c108b
commit
ea1222ac5b
@ -429,10 +429,15 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
|
||||
for (ic = -(clusterSize / 2); ic < (clusterSize / 2) + 1;
|
||||
ic++) {
|
||||
|
||||
if ((iy + ir) >= iy && (iy + ir) < ny &&
|
||||
(ix + ic) >= ix && (ix + ic) < nx) {
|
||||
if ((iy + ir) >= 0 && (iy + ir) < ny &&
|
||||
(ix + ic) >= 0 && (ix + ic) < nx) {
|
||||
|
||||
|
||||
if ((iy + ir) >= iy && (ix + ic) >= ix ) {
|
||||
val[(iy + ir) * nx + ix + ic] =
|
||||
subtractPedestal(data, ix + ic, iy + ir, cm);
|
||||
|
||||
}
|
||||
v = &(val[(iy + ir) * nx + ix + ic]);
|
||||
tot += *v;
|
||||
if (ir <= 0 && ic <= 0)
|
||||
@ -443,9 +448,9 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
|
||||
tl += *v;
|
||||
if (ir >= 0 && ic >= 0)
|
||||
tr += *v;
|
||||
if (*v > max) {
|
||||
if (*v > max) //{
|
||||
max = *v;
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -513,12 +518,19 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
|
||||
for (ic = -(clusterSize / 2);
|
||||
ic < (clusterSize / 2) + 1; ic++) {
|
||||
if ((iy + ir) >= 0 && (iy + ir) < ny &&
|
||||
(ix + ic) >= 0 && (ix + ic) < nx)
|
||||
(ix + ic) >= 0 && (ix + ic) < nx) {
|
||||
(clusters + nph)
|
||||
->set_data(val[(iy + ir) * nx + ix + ic],
|
||||
ic, ir);
|
||||
if (val[(iy + ir) * nx + ix + ic]>max)
|
||||
good=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (good==0) {
|
||||
(clusters + nph)->print();
|
||||
cout << max << " " << val[iy * nx + ix] << endl;
|
||||
}
|
||||
good = 1;
|
||||
if (eMin > 0 && tot < eMin)
|
||||
good = 0;
|
||||
|
@ -216,14 +216,18 @@ class single_photon_hit {
|
||||
|
||||
// int ix, iy;
|
||||
|
||||
printf("***************\n");
|
||||
printf("** %d %d **\n",x,y);
|
||||
for (int iy = 0; iy < dy; iy++) {
|
||||
for (int ix = 0; ix < dx; ix++) {
|
||||
printf("%d \t", data[ix + iy * dx]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("***************\n");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
assign the value to the element of the cluster matrix, with relative
|
||||
coordinates where the center of the cluster is (0,0) \param v value to be
|
||||
|
Loading…
x
Reference in New Issue
Block a user