Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4FermiMomentum Class Reference

#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.)
 

Detailed Description

Definition at line 35 of file G4FermiMomentum.hh.

Constructor & Destructor Documentation

G4FermiMomentum::G4FermiMomentum ( )

Definition at line 31 of file G4FermiMomentum.cc.

31  :
32  theA(0), theZ(0),
33  constofpmax(hbarc*cbrt(3.*pi2))
34 {}
G4FermiMomentum::~G4FermiMomentum ( )

Definition at line 36 of file G4FermiMomentum.cc.

36 {}

Member Function Documentation

G4double G4FermiMomentum::GetFermiMomentum ( G4double  density)
inline

Definition at line 44 of file G4FermiMomentum.hh.

Referenced by GetMomentum().

45  {
46  return constofpmax * cbrt(density * theA);
47  }
G4double density
Definition: TRTMaterials.hh:39
G4ThreeVector G4FermiMomentum::GetMomentum ( G4double  density,
G4double  maxMomentum = -1. 
)
inline

Definition at line 49 of file G4FermiMomentum.hh.

References G4UniformRand, GetFermiMomentum(), and CLHEP::Hep3Vector::mag().

51  {
52  if (maxMomentum < 0 ) maxMomentum=GetFermiMomentum(density);
54 
55  do {
56  p=G4ThreeVector(2.*G4UniformRand()-1.,
57  2.*G4UniformRand()-1.,
58  2.*G4UniformRand()-1.);
59  } while ( p.mag() > 1. );
60  return p*maxMomentum;
61  }
CLHEP::Hep3Vector G4ThreeVector
const char * p
Definition: xmltok.h:285
G4double density
Definition: TRTMaterials.hh:39
#define G4UniformRand()
Definition: Randomize.hh:87
G4double GetFermiMomentum(G4double density)
double mag() const
void G4FermiMomentum::Init ( G4int  anA,
G4int  aZ 
)
inline

Definition at line 42 of file G4FermiMomentum.hh.

Referenced by G4NeutronField::G4NeutronField(), G4ProtonField::G4ProtonField(), and G4Fancy3DNucleus::Init().

42 {theA = anA; theZ = aZ;}

The documentation for this class was generated from the following files: