Investigate local-frame x/y axis hierarchy (post_dir/travel_dir KL asymmetry) #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Investigate whether the local-frame x/y axes carry an unintended hierarchy.
The local-frame rotation (Rodrigues,
giant/data/transforms.py:local_frame_rotation) only pinspre_dir → ẑ; the azimuthal orientation about the local z-axis is otherwise left free and should be arbitrary. If the scattering distribution were truly azimuthally symmetric, the x and y components ofpost_dir/travel_dirshould validate near-identically.But they don't: checkpoint validation shows a notably different KL(real‖gen) for x vs y — e.g.
travel_dx0.00281 vstravel_dy0.00061. That asymmetry is surprising and suggests either a non-arbitrary orientation is baked into the frame construction (does the azimuthal reference axis privilege one transverse axis?) or there's real azimuthal structure the frame isn't capturing. If it's an artefact, randomise/symmetrise the azimuth; if it's real structure, make sure the model can represent it.Source: Jan & Tobias meeting 2026-07-07, action item added 2026-07-08.
Finding: the local frame's transverse axes are pinned to the world x/y axes — not arbitrary
Investigated the Rodrigues construction in
local_frame_rotation. It uses the minimal rotation carryingpre_dir → ẑ(rotation aboutpre_dir × ẑby exactly the angle between them, no extra twist about local z). That fixes the azimuthal reference, and it fixes it to the world frame.Analytic
The local transverse axes, in world coords (θ, φ = polar/azimuth of
pre_dir):(cosθ + sin²φ·(1−cosθ), −sinφcosφ·(1−cosθ), −cosφ·sinθ)(−sinφcosφ·(1−cosθ), cosθ + cos²φ·(1−cosθ), −sinφ·sinθ)As θ → 0 these collapse to x̂ and ŷ. Numerically:
For a forward-going particle the local x-axis literally is the world x-axis (local-y = world-y). The frame rotates the polar tilt out but never spins the transverse plane.
What this means for the KL asymmetry
Two verified facts:
pre_dir→std(dx)=std(dy)=0.1228, means ≈ 0. The travel_dx vs travel_dy KL gap is not a bug in the rotation code.std(dx)/std(dy) ≈ 3.0— the world anisotropy is inherited verbatim, not washed out.So the observed asymmetry is almost certainly real world-frame structure: the detector/beam geometry is not azimuthally symmetric in the world x–y plane (layered calorimeter, beam near ±z, transverse detector shape), and the frame passes it through rather than symmetrising it.
Recommendation
post_dir/travel_dirkeep full 3D local components, and local-x tracks world-x so the net sees the asymmetry directly). The open question is whether the model is fitting it well — the KL gap suggests dx is fit worse than dy — which is a capacity/loss-weighting question, not a frame-construction one.Follow-up to close the loop
Confirm from a parquet file that (a)
pre_diris forward-peaked (beam along ±z) and (b) the world x/y marginals of the true scattering genuinely differ. That would nail it as real physics.(Verified with a numerical experiment on the actual
local_frame_rotation/inv_local_frame_rotationimplementation.)