Skip to content

Merge branch 'muon_bkg_fix' into 'master'

Marco Cattaneo requested to merge cherry-pick-8c368e02 into digi14-patches

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.

See merge request !30 (merged)

Merge request reports