Line #399 in G4ParticlePhotonDist.cc replaces the first element of thePhotons at each iteration because variable "count" is not incremented and the else-block starting at line #394 is ended with "break". The "break" statement could not be removed since all of the continuum photons must be tested together against "maximumE". I would propose something like this at line #394: else { size_t sz = 0; for ( std::vector< G4double >::iterator it = photons_e.begin() ; it < photons_e.end() ; it++ ) { thePhotons->operator[](sz)->SetKineticEnergy( *it ); sz++; } //G4cout << "OK " << actualMult[0] << " j " << j << " total photons E " // << std::accumulate( photons_e.begin() , photons_e.end() , 0.0 )/eV << " ratio " << std::accumulate( photons_e.begin() , photons_e.end() , 0.0 ) / maximumE // << G4endl; break; } The behaviour could be reproduced shooting 14MeV neutrons into Mg target. The (n,p) and (n,a) reactions generate a number of photons but only one of them has a non-zero energy.
Thanks again for your bug fix. It has been implemented.