|
| 1 | +# SBND SCE Correction — WCT 0.36 migration & validation |
| 2 | + |
| 3 | +Migration of the SBND Space-Charge-Effect (SCE) correction from the patched WCT 0.33 |
| 4 | +pipeline (which used a `PCTransforms` reflection trick) into a clean, WCT-native |
| 5 | +`IPCTransform` for 0.36, validated against the per-TPC SCE TH3 displacement maps. |
| 6 | + |
| 7 | +## What |
| 8 | + |
| 9 | +- New class `WireCell::Clus::SCECorrection` — an `IPCTransform` that applies T0 |
| 10 | + and the per-TPC SCE displacement maps in one step: |
| 11 | + `x_sce = x_t0 + sign * dx_map(x_t0, y, z)`, apa0 → East TH3, apa1 → West TH3. |
| 12 | +- Reads the SBND dualmap |
| 13 | + (`SCEoffsets_SBND_E500_dualmap_CV_voxelTH3.root`, `TrueBkwd_Displacement_X_{E,W}`) |
| 14 | + via DV metadata `sce_map_file` (axes in cm, sign default −1). |
| 15 | +- Wired through the existing `PCTransformSet` and `ClusteringSwitchScope` |
| 16 | + (`correction_name="SCECorrection"`); merged-APA clustering uses |
| 17 | + `common_sce_coords = ["x_sce","y","z"]`. |
| 18 | +- Toolkit code lives on branch `sbnd-sce-correction-036` off Haiwang's `match`. |
| 19 | + Upstream PR to `WireCell/wire-cell-toolkit` is pending the `clus → root` |
| 20 | + cleanup (the `TFile`/`TH3F` machinery belongs in the `root/` subpackage so |
| 21 | + `clus` stays ROOT-free). |
| 22 | + |
| 23 | +## Result |
| 24 | + |
| 25 | +50 crossing-muon events (apacross 3 GeV detsim), 228 404 paired 3D points, |
| 26 | +per-point comparison of reco displacement against the TH3 map prediction: |
| 27 | + |
| 28 | +| Quantity | Value | |
| 29 | +|---------------------------------------|----------------------| |
| 30 | +| residual (reco − map) rms | E 1.8 µm, W 2.2 µm | |
| 31 | +| residual max | 8.4 µm | |
| 32 | +| East mean|Δx| | 0.4021 cm | |
| 33 | +| West mean|Δx| | 0.5338 cm | |
| 34 | +| **pooled W/E** | **1.327** | |
| 35 | +| reference (map volume-avg) | 1.276 | |
| 36 | +| reference (0.33-era reco) | 1.271 | |
| 37 | + |
| 38 | +The map application is exact to interpolation precision (sub-µm rms vs the |
| 39 | +~5000 µm signal). The track-sampled aggregate ratio is consistent with the |
| 40 | +volume-averaged map reference; the small offset (~4 %) is the crossing-muon |
| 41 | +trajectories preferentially sampling the high-displacement mid-drift region. |
| 42 | + |
| 43 | +Plots: `pics/01_residual.png` (headline, residual histogram), |
| 44 | +`pics/02_dx_vs_drift.png` (slide-style 2D Δx vs drift, per TPC), |
| 45 | +`pics/03_profile_ratio.png` (drift profile + W/E ratio panel). |
| 46 | + |
| 47 | +## Reproduce |
| 48 | + |
| 49 | +```bash |
| 50 | +# Env (FNAL SBND gpvm, SL7 container, our 0.36 + SCECorrection install) |
| 51 | +export SCE_TOP=/exp/sbnd/data/users/abhat/wct_sce |
| 52 | +source $SCE_TOP/restore_sce_env_036_sce.sh |
| 53 | + |
| 54 | +cd $SCE_TOP/sce_test |
| 55 | +export WIRECELL_PATH="$SCE_TOP/sce_test:$WIRECELL_PATH" |
| 56 | +export FHICL_FILE_PATH="$SCE_TOP/sce_test:$FHICL_FILE_PATH" |
| 57 | +lar -n 50 -c wcls-img-clus.fcl \ |
| 58 | + -s $SCE_TOP/validation_crossing_muons/chain_v3/apacross_3gev_detsim_50.root \ |
| 59 | + --no-output |
| 60 | + |
| 61 | +python3 make_validation_plots.py |
| 62 | +cat validation_plots/SUMMARY.txt |
| 63 | +``` |
| 64 | + |
| 65 | +## Files |
| 66 | + |
| 67 | +- `SCECorrection.h` — the new `IPCTransform` (header-only v1). |
| 68 | + Destination in WCT toolkit: `clus/inc/WireCellClus/SCECorrection.h`. |
| 69 | +- `PCTransforms.cxx.patch` — 4-line registration in `clus/src/PCTransforms.cxx`. |
| 70 | +- `wscript_build.patch` — adds `ROOTSYS` to clus link list (will move to `root/` |
| 71 | + subpackage in the upstream PR). |
| 72 | +- `clus.jsonnet` — patched copy of canonical `../clus.jsonnet`; the SCE wiring |
| 73 | + is: `common_sce_coords` local, `sce_map_file` in DV metadata, all-APA coords |
| 74 | + set to `common_sce_coords`, `switch_scope(correction_name="SCECorrection")`, |
| 75 | + an extra `bee_points_set` named `sce` (dumps `x_sce` for validation), and |
| 76 | + `use_config_rse: false` so per-event folders survive multi-event runs. |
| 77 | +- `clus.jsonnet.patch` — diff against canonical `../clus.jsonnet`. |
| 78 | +- `wcls-img-clus.fcl` — symlink to canonical `../wcls-img-clus.fcl`. |
| 79 | +- `make_validation_plots.py` — pairs `img`/`sce` BEE points by `(y,z,q)`, |
| 80 | + re-evaluates the TH3 maps per point, produces the three figures. |
| 81 | +- `pics/` — validation PNGs. |
| 82 | +- `SUMMARY.txt` — headline numbers. |
0 commit comments