Backport of ISF_Event and ISF_Geant4Event clean-up from master + fix for ATLASSIM-6002
Back-port const-correctness clean-up for the ISF_Event
and ISF_Geant4Event
packages from master (!54611 (merged), !56168 (merged), !56249 (merged) and !56342 (merged)) - orginal changes by @fwinkl.
The reordering of some calls as part of this clean-up uncovered a bug where the output of std::vector::front()
on an empty vector is undefined. Patched ISFTruthIncident.cxx
to fix a logic hole which allowed this to happen. This should fix ATLASSIM-6002.
While it wasn't strictly necessary to back-port the fixes from master I would prefer to keep the branches in sync as far as possible.
Also fixed logic in FastCaloSimV2Tool.cxx
to not create an ISFTruthIncident
in the case that the MuonPunchThroughTool does not return any secondaries.