In source/processes/hadronic/models/neutron_hp/src/G4NeutronHPPhotonDist.cc at line #490 theta is sampled uniformly within [0;pi] angle interval while it is assumed to be uniform within [-1;1] cosine interval. 487 if(ii<nIso) 488 { 489 // isotropic distribution 490 G4double theta = pi*G4UniformRand(); 491 G4double phi = twopi*G4UniformRand(); 492 G4double sinth = std::sin(theta); 493 G4double en = thePhotons->operator[](i)->GetTotalEnergy(); 494 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) ); 495 thePhotons->operator[](i)->SetMomentum( tempVector ) ; 496 } Obvious fix is: ... G4double cosTheta = -1.0 + 2.0*G4UniformRand(); G4double phi = twopi*G4UniformRand(); G4double sinTheta = std::sqrt(1.0 - cosTheta*cosTheta); ... G4ThreeVector tempVector(en*sinTheta*std::cos(phi), en*sinTheta*std::sin(phi), en*cosTheta); ...
Thank you for reporting problem and also providing fix for it. The fix will be included in future release
Hello. I have decided not to open a new report but reopen this one instead. The same issue with theta sampling has been found in: http://www-geant4.kek.jp/lxr/source/processes/hadronic/models/particle_hp/src/G4ParticleHPCaptureFS.cc#L156 http://www-geant4.kek.jp/lxr/source//processes/hadronic/models/particle_hp/src/G4ParticleHPCaptureFS.cc#L272 http://www-geant4.kek.jp/lxr/source/processes/hadronic/models/particle_hp/src/G4ParticleHPFissionFS.cc#L285 and also this "half-isotropic" distribution: http://www-geant4.kek.jp/lxr/source/processes/hadronic/models/particle_hp/src/G4ParticleHPIsotropic.cc#L98