There is a serious flaw in the Geant4.5.1 procedure that randomly choses the target atom for a hadronic interaction. The net result of this error is that the last element stored in the element vector is preferentially selected, regardless of its relative abundance. In other words, the material definition implemented in the detector construction procedure is essentially meaningless for hadronic processes. The problem lies in the subroutine G4HadronicProcess::ChooseAandZ() (in the file G4HadronicProcess.cc), and specifically in the code that assimilates data in the vector runningSum[]. As programmed is version 4.5.1 the value of runningSum[i] is the product of density and microscopic cross section for element i. However, it should be the sum of these quantities for elements 0 to i. A patch for the code from G4HadronicProcess.cc starting at line 62 is reproduced below with the original code commented. for( i=0; i < numberOfElements; ++i ) { // runningSum.push_back(theAtomicNumberDensity[i] * // dispatch->GetMicroscopicCrossSection( aParticle, (*theElementVector)[i], aTemp)); // crossSectionTotal+=runningSum[i]; crossSectionTotal += theAtomicNumberDensity[i] * dispatch->GetMicroscopicCrossSection( aParticle, (*theElementVector)[i], aTemp); runningSum.push_back(crossSectionTotal); }
Thank you for your report. I am redirecting it to the responcible for the hadronic processes.
I fixed this, and it is now with system testing. Thank you again or reporting. Many greetings, Hans-Peter.