Open
Conversation
…eters
- Modified light simulation to apply LAr pulse shape convolution per segment
before summing, allowing for particle-by-particle variation in pulse shape
- Added variable singlet fraction based on PDG code:
* Neutrons and nuclei (including alphas): singlet_fraction = 0.7
* All other particles: singlet_fraction = 0.3
- Implemented optional triple exponential scintillation model:
* New constants: USE_TRIPLE_EXPONENTIAL, FAST_FRACTION, INTERMEDIATE_FRACTION,
TAU_FAST, TAU_INTERMEDIATE, TAU_SLOW
* Default remains double exponential for compatibility
* Can be enabled via detector properties YAML
- Order of operations: LAr convolution (per-segment) → Sum → Poisson → SPE
- Updated sum_light_signals to sum_light_signals_with_scintillation kernel
- Truth backtracking logic verified and maintained correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Implemented optional PDE correction to apply data/MC efficiency ratios to LUT visibility before convolutions and Poisson fluctuations - Added constants ENABLE_PDE_CORRECTION and OP_CHANNEL_PDE_CORRECTION - Supports loading corrections from: * Numpy file (pde_correction_file in YAML) * Direct YAML specification (single value or array) * Default of 1.0 (no correction) when disabled - Modified sum_light_signals_with_scintillation kernel to apply corrections immediately after LUT lookup, before scintillation convolution - Corrections apply uniformly across all channels in each detector unit (2 channels for LCMs, 6 channels for ACLs) - Order: LUT → PDE correction → LAr convolution → Sum → Poisson → SPE - Validated: syntax checks pass, shape validation included 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Changed from uniform channel-per-detector assumption to flexible mapping
- Added DETECTOR_CHANNEL_MAP to explicitly track (TPC, detector, channels)
- Supports explicit mapping via YAML config for mixed detector types:
* 2-channel LCMs
* 6-channel ACLs
- Falls back to inferred uniform mapping if not specified
- PDE_CORRECTION_2D remains (n_tpc, n_detectors_per_tpc) structure
- Expansion to per-channel array now uses detector mapping for correctness
- Enables realistic in-situ measurements with varying detector geometries
Example config:
detector_channel_map:
- {tpc: 0, detector: 0, channels: [0,1,2,3,4,5]} # ACL
- {tpc: 0, detector: 1, channels: [6,7]} # LCM
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-Segment LAr Scintillation with Particle-Dependent Parameters and PDE Corrections
Summary
Three enhancements to light simulation enabling particle-type-dependent pulse shapes and measured detector efficiency corrections:
Change: LAr convolution now applied per segment before summing (previously: sum then convolve).
Particle dependence (PDG-based):
Order: LUT → LAr convolution (per-segment, particle-dependent) → Sum → Poisson → SPE
Note: Slower than previous approach but enables particle-by-particle pulse shape variation.
Adds intermediate component: f(t) = f₁·exp(-t/τ₁) + f₂·exp(-t/τ₂) + (1-f₁-f₂)·exp(-t/τ₃)
Configuration (optional, disabled by default):
use_triple_exponential: True
fast_fraction: 0.3
intermediate_fraction: 0.15 # Needs tuning
tau_intermediate: 0.05 # Needs tuning
Applies data/MC efficiency ratios to LUT visibility before convolutions. Supports mixed detector types (2-ch LCMs, 6-ch ACLs).
Structure: 2D array (n_tpc, n_detectors_per_tpc), auto-expanded to per-channel array.
Configuration:
enable_pde_correction: True
pde_correction_file: "pde_corrections.npy"
Optional: explicit mapping for mixed detector types
detector_channel_map:
- {tpc: 0, detector: 0, channels: [0,1,2,3,4,5]} # ACL (6-ch)
- {tpc: 0, detector: 1, channels: [6,7]} # LCM (2-ch)
Creating corrections:
import numpy as np
Shape: (n_tpc, n_detectors_per_tpc), values ~0.95-1.05
pde_corrections = np.array([[0.97, 1.02, ...], [0.99, 0.97, ...]])
np.save('pde_corrections.npy', pde_corrections)
Technical Details
Modified files: light_sim.py, consts/light.py, simulate_pixels.py
Backward compatible: All features disabled by default
Truth backtracking: Should be consistent with existing implementation (sanity checking on that front needed)
Syntax validated: Python 3