25 if (not geo->isModuleIDValid(moduleID)) {
26 B2FATAL(
"TOP::PixelPositions: invalid slot number, moduleID = " << moduleID);
30 const auto&
module = geo->getModule(moduleID);
31 const auto& pmtArray =
module.getPMTArray();
32 m_NRows = pmtArray.getNumPixelRows();
35 const auto& prism =
module.getPrism();
36 double Ah = prism.getWidth() / 2;
37 double yUp = prism.getThickness() / 2;
38 double yDown = yUp - prism.getExitThickness();
40 const auto& pmtArrayDispl =
module.getPMTArrayDisplacement();
41 double x0 = pmtArrayDispl.getX();
42 double y0 = pmtArrayDispl.getY() + (yUp + yDown) / 2;
44 const auto& pmt = pmtArray.getPMT();
45 double a = pmt.getDx();
46 double b = pmt.getDy();
48 std::vector<double> xCenters;
49 for (
unsigned aColumn = 1; aColumn <= pmtArray.getNumColumns(); aColumn++) {
50 for (
unsigned pmtColumn = 1; pmtColumn <= pmt.getNumColumns(); pmtColumn++) {
51 xCenters.push_back(pmtArray.getX(aColumn) + pmt.getX(pmtColumn) + x0);
55 std::vector<double> yCenters;
56 for (
unsigned aRow = 1; aRow <= pmtArray.getNumRows(); aRow++) {
57 for (
unsigned pmtRow = 1; pmtRow <= pmt.getNumRows(); pmtRow++) {
58 yCenters.push_back(pmtArray.getY(aRow) + pmt.getY(pmtRow) + y0);
62 for (
auto y : yCenters) {
63 double y1 = std::max(y - b / 2, yDown);
64 double y2 = std::min(y + b / 2, yUp);
65 double Dy = std::max(y2 - y1, 0.0);
66 double yc = (Dy > 0) ? (y1 + y2) / 2 : y;
67 for (
auto x : xCenters) {
68 double x1 = std::max(x - a / 2, -Ah);
69 double x2 = std::min(x + a / 2, Ah);
70 double Dx = std::max(x2 - x1, 0.0);
71 double xc = (Dx > 0) ? (x1 + x2) / 2 : x;
77 for (
size_t i = 0; i <
m_pixels.size(); i++) {
80 int pmtID = mapper.getPmtID(
pixelID);