Problem locates at function “Garfield::Sensor::AddSignalWeightingField()” in file “Source/Garfield/Sensor.cc”. The for loop start from Line 738 calculates all delayed signal in each electrode. At Line 735, dt may be 0, because the last two elements in vector xs and vector ts may be exactly the same in some case. This will cause calcuated scale is NaN, thus the signal is NaN.
Why there’re two identical element in the vector? I checked where these 2 vectors come from, it turns out that the function is called in Line 571, function “Garfield::AvalancheMC::DriftLine” , file “Source/Garfield/AvalancheMC.cc”. The “path” parameter stores paritlce 4D information.
![]()
After checking carefully, I think the “Garfield::AvalancheMC::Terminate” function will cause an unexpected dupulication of a boundary point. The following picture shows Line 494 to Line 504 in function “Garfield::AvalancheMC::DriftLine”. If x0 lies at sensor boundary, or very close to, then Terminate function will assign x1=x0 and emplace_back.
Here is the reason. If x0 is close enough to the boundary, then x1 will always be outside, thus status == -5 or xm will not in area, then x1 will not be assigned the value of xm. Therefore, x1 will remain the value of x0 and t1 remain the value of t0, emplace_back a exactly same point to the path.


