From c246d02663554732f737e9f56e6458c9e594acf3 Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Fri, 27 Nov 2026 15:23:29 +0100 Subject: [PATCH] TPC painter: SCD y/x grid edge from the pad plane getSCDY2XCoordinatesSector drew the voxel grid of the SCD maps with its y/x edge at x tan(10 deg) - 1.5 cm, while TrackResiduals ends the y/x grid at the pad plane's edge of each row (half the row's pads times its pad width) since 3e84071d24. The two differ by up to 2 % of the half width and the difference changes from row to row with the pad count. With bins refined at the sector edges (outermost bins 0.5 % of the half width) the outermost voxels were drawn in the neighbouring polygon or outside the grid: for the binning -1,-0.995,-0.975,... 434 of 7296 (row, y/x) cells per sector misplaced in 114 of 152 rows, 216 outside the grid; the polygon filled twice and the empty one next to it gave a comb of single cells along the sector edges. Now maxY2X per row is computed as in TrackResiduals::init (identical in all 152 rows). Co-Authored-By: Claude Opus 5.5 --- Detectors/TPC/baserecsim/src/Painter.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Detectors/TPC/baserecsim/src/Painter.cxx b/Detectors/TPC/baserecsim/src/Painter.cxx index a571b50607dd2..56414526a307a 100644 --- a/Detectors/TPC/baserecsim/src/Painter.cxx +++ b/Detectors/TPC/baserecsim/src/Painter.cxx @@ -228,8 +228,6 @@ std::vector painter::getFECCoordinatesSector() std::vector painter::getSCDY2XCoordinatesSector(std::string binningStr) { - const float deadZone = 1.5; - const float secPhi = 20.0 * TMath::DegToRad(); std::vector padCoords; const Mapper& mapper = Mapper::instance(); const auto nPadRows = Mapper::PADROWS; @@ -274,8 +272,10 @@ std::vector painter::getSCDY2XCoordinatesSector(std::st for (int irow = 0; irow < nPadRows; ++irow) { const auto x = mapper.getPadCentre(PadPos(irow, 0)).X(); - maxY2X[irow] = std::tan(.5f * secPhi) - deadZone / x; const auto region = Mapper::REGION[irow]; + // y/x edge = the pad plane's edge in the row, as the TrackResiduals voxel grid + const float halfWidth = 0.5f * mapper.getNumberOfPadsInRowSector(irow) * mapper.getPadRegionInfo(region).getPadWidth(); + maxY2X[irow] = halfWidth / x; const auto ph = mapper.getPadRegionInfo(region).getPadHeight(); const auto xPadBottom = x - ph / 2; const auto xPadTop = x + ph / 2;