Skip to content

Updates for FFE and sum_pixel_signals - #338

Merged
mjkramer merged 64 commits into
developfrom
induction-fixes
Oct 14, 2026
Merged

mjkramer merged 64 commits into
developfrom
induction-fixes

Conversation

@mjkramer

@mjkramer mjkramer commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

This PR updates develop to be in line with (but cleaner than) the ffe-test3 branch that I've been using for the FSD Cube shower simulations.

Physics changes:

  • The big one: In sum_pixel_signals, make MAX_TRACKS_PER_PIXEL limit only the amount of saved backtracking info. Previously it also limited the number of segments included in the calculated signal. This fix primarily affects dense showers, whether or not FFE is enabled.
  • Reduce FAR_FIELD_SEGMENT_STEP_CM to 0.1 cm from 0.5 cm. (We can almost certainly raise it back, but TBD.)
  • Fix "off-by-half-a-pitch" bug in calculation of FFE's exclude_radius
  • Fix an or that should have been an and in the exclude_radius cut

Organizational changes:

  • Add support for setting the ff_induction constants using a farfield_properties yaml
  • Add an ff_induction.DIPOLE_SCALE constant (the notorious 1.5)
  • Move FARFIELD_MODE from the simulation_properties to the farfield_properties. The global switch, FARFIELD_ENABLED still lives in simulation_properties.
  • Remove (from ffe-test3, not from develop) the box_lattice and patch (i.e. "near-field") FFE models. The original infinite-plane (i.e. "dipole") model seems to be good enough, but the alternatives can be recovered by reverting the commit that removed them.
  • Add FARFIELD_SIGNAL_MODEL constant. Currently infinite_plane is the only option, but I figured this bit of configurability was worth keeping.
  • Enable FFE for the fsd_cube config. It can be disabled by changing SIMULATION_PROPERTIES back to cosmic_sim.yaml from cosmic_sim_FFE.yaml. FFE remains disabled by default for other detectors.

mjkramer and others added 30 commits July 6, 2026 11:26
`detector` assumes sim.FARFIELD_ENABLED is correct
Quick implementation of a box-aware lattice dipole approximation method
to calculate the far field induced current.

This method includes dipole images for the walls at X and Y in addition
to the Z images across the cathode. The overall method is slightly
different from the original infinite-plane method.

Each method can be selected via a constant flag in
`consts/ff_induction.py`.

The lattice dipole has several new constants, the number of X/Y terms
and the box half-widths (which should eventually use the geometry info
for these numbers).

Both methods have a normalization/scale factor, `DIPOLE_SCALE`,
defined as a constant to adjust the signal strength.

Validated that the code runs, not so much the results yet.
`detector` assumes sim.FARFIELD_ENABLED is correct
@mjkramer

mjkramer commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

I seem to be seeing some strange behavior when I run on the 2x2 with FFE disabled. Namely, the data packets are coming out with a packet_type of 1 (as in LArPix v3) instead of 0 (v2). Whereas enabling FFE is giving me the expected packet_type of 0. I'm converting this to a draft PR until I understand what's happening.

@mjkramer
mjkramer marked this pull request as draft October 8, 2026 16:45
@mjkramer

mjkramer commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

I'm unable to reproduce the issue mentioned in my previous comment. Something was likely to have been inconsistent in my environment.

Running (in the 2x2) with FFE disabled gives the expected output. Running with FFE enabled shows that, at the very least, the normalization needs to be significantly re-scaled for the 2x2. But it runs! And it's opt-in for the non-FSDCube cases. So I'd propose that, after an approving review, we go ahead and merge this (to avoid branch divergence) and then we can proceed with further tuning and validation.

Without FFE:

image

With FFE:

image

@mjkramer
mjkramer marked this pull request as ready for review October 9, 2026 21:42
Comment thread larndsim/config/config.yaml Resolved
Comment thread larndsim/detsim.py Resolved
@mjkramer

mjkramer commented Oct 14, 2026 •

Copy link
Copy Markdown
Member Author

The severe excess of inductive hits, as shown above, was due to a factor of 1/100 I lost in the "arbitrary" normalization when going back to the original infinite-plane dipole model instead of Andrew's "patch" model (where the normalization is determined by the pixel size). The event display below shows what we get now, with FFE enabled.

It may be worth restoring Andrew's model, either to use by default (assuming it's "fast enough"), or to at least serve as a way of cross-checking the normalization of the infinite-plane model. But that can be the subject of a separate PR.

Given the fact that the 2x2 has a module that's not like the others, we also need a way to set the normalization separately for each module. And we'll need to forward the pixel-width of each module to the patch model. Again, separate PR.

image

@cuddandr

Copy link
Copy Markdown
Collaborator

Looks good to me. Ship it.

@mjkramer
mjkramer merged commit d8147f8 into develop Oct 14, 2026
2 checks passed
@mjkramer
mjkramer deleted the induction-fixes branch October 14, 2026 22:23
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.

2 participants