Tcad Delayed Signal Fix (courtesy to John Leong)
Two fixes for forum threads [1,2]
Fix 1: ComponentTcadBase.hh: delayed signal times ignored dynamic weighting field
- Issue: ComponentTcadBase::DelayedSignalTimes() only returned times for electrodes that had a dynamic weighting potential defined. When only a dynamic weighting field was provided, the function returned an empty vector, preventing delayed-signal computation.
- Change: Updated DelayedSignalTimes() to check both m_dwtp and m_dwtf maps. Returns the appropriate time grid if either DWP or DWF is defined.
Fix 2a: Guard against dt = 0 in Sensor::AddSignalWeightingField
- Issue: When two consecutive drift-line points have identical timestamps (ts[i+1] == ts[i]), dt becomes zero, leading to divisions by zero and NaN values in delayed signals.
- Change: Added a guard to skip degenerate segments with dt ≤ Small before computing 1/dt. Optional debug message reports skipped segments when m_debug is enabled.
Fix 2b: Prevent duplicate drift-line points in AvalancheMC
- Issue: AvalancheMC::Terminate() could return x1 == x0 and t1 == t0 when the proposed end point was already within BoundaryDistance, producing duplicate points in the drift path and zero-length segments.
- Change: Modified Terminate() to early-return if the initial step is already within BoundaryDistance, keeping the original x1, t1. Added an optional safety check in DriftLine() to skip identical successive points before appending to the path.