Skip to content

Add SBND SCE point-cloud correction support#472

Open
abhatfnal wants to merge 3 commits into
WireCell:masterfrom
abhatfnal:sbnd-sce-correction
Open

Add SBND SCE point-cloud correction support#472
abhatfnal wants to merge 3 commits into
WireCell:masterfrom
abhatfnal:sbnd-sce-correction

Conversation

@abhatfnal
Copy link
Copy Markdown

Summary

This PR adds SBND Space Charge Effect correction support to the WireCell clustering point-cloud transform path.

Main changes:

  • Adds SCECorrection and T0SCECorrection.
  • Allows clustering configs to select T0Correction, SCECorrection, or T0SCECorrection.
  • Adds corrected coordinate scopes/arrays such as x_t0scecor, y_t0scecor, and z_t0scecor.
  • Fixes the SCE map unit convention: WCT point-cloud coordinates are in mm, while the SBND SCE ROOT map axes and displacements are in cm. Coordinates are converted to cm before interpolation, and returned displacements are converted back to mm.
  • Adds a guard for empty auxiliary point clouds during scalar aux filling.

Validation

  • Rebuilt WCT successfully with:
./wcb --notests -p install

abhatfnal added 3 commits May 12, 2026 16:39
Adds SCECorrection and T0SCECorrection to the clustering point-cloud transform path.

T0SCECorrection applies the existing T0 correction followed by the SBND SCE backward displacement map.

Extends corrected-point scope handling so configurations can select T0Correction, SCECorrection, or T0SCECorrection and write the corresponding corrected coordinate arrays.

The SBND SCE maps are defined in cm while WCT point-cloud coordinates are in mm, so coordinates are converted to cm before interpolation and returned displacements are converted back to mm.
Avoids throwing when the auxiliary point cloud is empty, allowing downstream point-cloud writing paths to continue when no auxiliary fields are present.
In SBND, points in the +X drift TPC (apa1) arrive at PCTransforms::cal_offset
in a local frame where pin[0] is offset from the global X coordinate.
The SCE map is in global X, so the previous code (which simply did
pin[0]/10) was looking up the wrong region of the map (xx > 200 cm,
outside the bin-center grid). All apa1 points received zero SCE shifts.

Two fixes in cal_offset:

1. Detect local-frame points by comparing pin[0] against the apa's
   inner_bounds() X range. If outside, reflect pin[0] around the anode
   to recover the global X before SCE map lookup.

2. After lookup, if the input was reflected, negate the returned dx
   so that the caller's 'pos_out[0] = pin[0] + dx' applies the
   correction in the original (local) frame direction.

apa0 (East TPC) behavior is unchanged. apa1 (West TPC) now produces
SCE shifts of correct magnitude and direction, consistent with Lane
Kashur's data-driven SCE calibration showing W/E asymmetry of ~1.5x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant