fix a bug where the muon punch through simulation overestimate the number of punch-through particles
The code uses lround
to convert floats into integers when sampling from the CDF for the distribution of the number of punch-through particles. The float number describes the number of punch-through particles. A value between 0-1 should mean zero particles. Using lround
will give us a 50% probability of having one particle when the number is between 0 to 1, so the simulation gives us more particles than expected.
The fix use int
to select the integer closer to zero.