#include <G4FermiMomentum.hh>
Public Member Functions | |
G4FermiMomentum () | |
~G4FermiMomentum () | |
void | Init (G4int anA, G4int aZ) |
G4double | GetFermiMomentum (G4double density) |
G4ThreeVector | GetMomentum (G4double density, G4double maxMomentum=-1.) |
Definition at line 35 of file G4FermiMomentum.hh.
G4FermiMomentum::G4FermiMomentum | ( | ) |
G4FermiMomentum::~G4FermiMomentum | ( | ) |
G4ThreeVector G4FermiMomentum::GetMomentum | ( | G4double | density, | |
G4double | maxMomentum = -1. | |||
) | [inline] |
Definition at line 49 of file G4FermiMomentum.hh.
References G4UniformRand, and GetFermiMomentum().
00051 { 00052 if (maxMomentum < 0 ) maxMomentum=GetFermiMomentum(density); 00053 G4ThreeVector p; 00054 00055 do { 00056 p=G4ThreeVector(2.*G4UniformRand()-1., 00057 2.*G4UniformRand()-1., 00058 2.*G4UniformRand()-1.); 00059 } while ( p.mag() > 1. ); 00060 return p*maxMomentum; 00061 }
Definition at line 42 of file G4FermiMomentum.hh.
Referenced by G4NeutronField::G4NeutronField(), G4ProtonField::G4ProtonField(), and G4Fancy3DNucleus::Init().