Problem 832

Summary: Unsupported Z (atomic number) for G4StableIsotopes
Product: Geant4 Reporter: nanjo
Component: processes/hadronic/managementAssignee: dennis.herbert.wright
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.1   
Hardware: PC   
OS: Linux   

Description nanjo 2006-01-17 07:16:56 CET
The member functions of G4StableIsotopes class such as
G4StableIsotopes::GetNumberOfIsotopes(G4int Z) take an argument of an atomic
number , Z. The maximum atomic number allowed is  obviously Z=92 according to
the source code but there is no protection against a larger value of Z.

This function is used in  G4HadronicProcess::ChooseAandZ(...) as follows.

217       G4double * running = new G4double[theIso.GetNumberOfIsotopes(localZ)];
     218       for (i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
     219       {
     220         G4double
fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(localZ)+i);
     221         G4double
runningA=theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
     222         running[i]=fracInPercent*std::pow(runningA, 2./3.);
     223         // rough approximation; to get it better, redesign getMSC to
not use G4Element, see also below
     224         if(i!=0) running[i] += running[i-1];
     225       }
     226       G4double trial = G4UniformRand();
     227       G4double sum = running[theIso.GetNumberOfIsotopes(localZ)-1];
     228       for(i=0; i<theIso.GetNumberOfIsotopes(localZ); i++)
     229       {
     230         currentN =
theIso.GetIsotopeNucleonCount(theIso.GetFirstIsotope(localZ)+i);
     231         if(running[i]/sum>trial) break;
     232       }
     233       delete [] running;
     234     }
     235     targetNucleus.SetParameters(currentN, currentZ);
Here, a bad value of currentN makes G4Exception.
Could you add some protection in G4StableIsotopes and add some treatment for
Z>92  in G4HadronicProcess::ChooseAandZ(...) ?

Best regards,
Hajiem Nanjo

         High Energy Physics, Department of Physics, Kyoto University,
                             Hajime Nanjo
Comment 1 dennis.herbert.wright 2006-03-13 16:54:59 CET
Currently, there is no isotope with Z > 92 in our tables.  Until such entries are
created, G4HadronicProcess will test for Z > 92 and throw a G4Exception (fatal)
whenever this is the case.