BackTracker "HitToEveTrackIDEs" does not fill # electrons
See lines 182-200 of BackTracker.cc in LArSim. Note the field is left uninitialized and for debug builds this means one can get pretty much any number there.
#3 Updated by Jason Stock over 1 year ago
Confirmed bug. The behavior is as described. EveTrackIDEs does not initialize the number of electrons, resulting in an undefined behaviour (any number could be spit out).
As a quick fix, I have made the trackIdToE map now use a pair<double, double> for it's value_type, making the first energy, and the second numElectrons. This isn't the most readable solution, but it is quick to implement and does correct the problem.
As to readability, this fix could be improved with either a clever typedef, or a very simple struct in the near future.