Problem 838 - isotropic distribution is no isoropic
Summary: isotropic distribution is no isoropic
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/util (show other problems)
Version: other
Hardware: All Linux
: P2 major
Assignee: dennis.herbert.wright
URL:
Depends on:
Blocks:
 
Reported: 2006-02-07 04:36 CET by n.saito
Modified: 2006-03-13 12:12 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.