for (int ix = 0; ix < nx; x += xInc, ix++) {
double y = yMin + yInc / 2;
for (int iy = 0; iy < ny; y += yInc, iy++) {
double r = sqrt (x * x + y * y); // distance of cell from center
double phi = atan2 (y, x); // angle of cell from center
double L = r * cos (theta - phi); // position on detector
for (int ix = 0; ix < nx; x += xInc, ix++) {
double y = yMin + yInc / 2;
for (int iy = 0; iy < ny; y += yInc, iy++) {
double r = sqrt (x * x + y * y); // distance of cell from center
double phi = atan2 (y, x); // angle of cell from center
double L = r * cos (theta - phi); // position on detector