diff --git a/source/processes/hadronic/models/particle_hp/include/G4ParticleHPParticleYield.hh b/source/processes/hadronic/models/particle_hp/include/G4ParticleHPParticleYield.hh index 8857a17f15b..717fca32f83 100644 --- a/source/processes/hadronic/models/particle_hp/include/G4ParticleHPParticleYield.hh +++ b/source/processes/hadronic/models/particle_hp/include/G4ParticleHPParticleYield.hh @@ -105,11 +105,18 @@ class G4ParticleHPParticleYield } } + // The interpolating G4ParticleHPVector::GetY(G4double) overload is + // non-const, so on the const-qualified member vectors below overload + // resolution used to fall back silently to GetY(G4int) const via an + // implicit double->int conversion: the fission neutron yield was read + // as "y of table point floor(E)" - i.e. the thermal nubar for all + // reactor-relevant energies - instead of nubar(E). The const_casts + // restore the energy-interpolating lookup. inline G4double GetMean(G4double anEnergy) const { if (simpleMean) { - return theSimpleMean.GetY(anEnergy); + return const_cast(theSimpleMean).GetY(anEnergy); } return theMean.GetValue(anEnergy); } @@ -121,7 +128,7 @@ class G4ParticleHPParticleYield { return theSpontPrompt; } - return thePrompt.GetY(anEnergy); + return const_cast(thePrompt).GetY(anEnergy); } inline G4double GetDelayed(G4double anEnergy) const @@ -131,7 +138,7 @@ class G4ParticleHPParticleYield { return theSpontDelayed; } - return theDelayed.GetY(anEnergy); + return const_cast(theDelayed).GetY(anEnergy); } inline G4double GetDecayConstant(G4int i) const