Fix to Muon/MuonBackground to allow MCParticles unsorted by the keys
Muon/MuonBackground seg faulted if the KeyedContainer<MCParticle>
is not sorted by the key.
MuonBackground::calculateStartingNumberOfHits(int)
used to obtain the number of particles from the key of the last element in the container. And booked memory for storing information based on this number. The code has been changed such that it does not rely on a specific order for the keys (and there can be keys missing) by using a std::map
instead.
Also changed for loops to more readable range based ones.