Problem 838

Summary: isotropic distribution is no isoropic
Product: Geant4 Reporter: n.saito
Component: processes/hadronic/utilAssignee: dennis.herbert.wright
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: other   
Hardware: All   
OS: Linux   

Description n.saito 2006-02-07 04:36:57 CET
Isotropic distribution is wrongly created in some files.
For example, in the file processes/hadronic/util/src/G4Nucleus.cc
 G4ThreeVector G4Nucleus::GetFermiMomentum()
  {
   .......
    // - random decay angle
    G4double theta=pi*G4UniformRand();  // isotropic decay angle theta
    G4double phi  =CLHEP::RandFlat::shoot((G4double)0.,(G4double)2*pi);
                                        // isotropic decay angle phi
    // - setup ThreeVector
    G4double pz=std::cos(theta)*ranmax;
    G4double px=std::sin(theta)*std::cos(phi)*ranmax;
    G4double py=std::sin(theta)*std::sin(phi)*ranmax;
    G4ThreeVector p(px,py,pz);
    return p;
  }
Here, theta is taken by UniformRand from 0 to pi. It will create a dense
distribution around theta=0 or pi, it is not isotropic.

One should take a cosTheta and take random number between -1 and 1, like in
other files, for ex. G4eplusAnnihilation.cc.

I have found same problem in G4ReactionKinematics.cc, but I haven't check all
source code in Geant4. There might be same problem.

regards,
Nami
Comment 1 dennis.herbert.wright 2006-03-13 12:12:59 CET
Thank you for spotting this, Nami.  The fix will be included in the next release.