ATTPC / attpc_engine

AT-TPC Monte Carlo simulation engine in Python
GNU General Public License v3.0
1 stars 0 forks source link

Reaction Threshold less than OR less than or equal to #15

Open gwm17 opened 4 months ago

gwm17 commented 4 months ago

In reaction threshold check, currently say

outgoing_mass < E_cm

which is technically incorrect. Should be

outgoing_mass <= E_cm

However, the normal way to handle an equal to comp with floating points is to define a tolerance for them to be equal. Unfortunately, we have an issue where rn we are expressing the entire kinematics calculation as infinitely precise. So we can only do <= in the very literal sense. We should maybe define a precision for the simulation? Or not? Idk. The temp fix is the < instead of <=, which will generally yield the correct results. But this is kind of an annoying problem that we need to address.

gwm17 commented 4 months ago

Basically, to do this correctly, we need to define the simulation precision.