Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RegionModel Class Reference

#include <G4RegionModel.hh>

Public Member Functions

 G4RegionModel (const G4int numberOfLayers, const G4int A, const G4int Z)
 
 ~G4RegionModel ()
 
G4double GetDensity (G4double radius)
 
G4double GetPotentialEnergy (G4double r, G4int particle)
 
G4double GetMaximumNucleonMomentum (G4double radius, G4int nucleon)
 

Detailed Description

Definition at line 40 of file G4RegionModel.hh.

Constructor & Destructor Documentation

◆ G4RegionModel()

G4RegionModel::G4RegionModel ( const G4int  numberOfLayers,
const G4int  A,
const G4int  Z 
)

Definition at line 41 of file G4RegionModel.cc.

43 : massNumber(A), protonNumber(Z)
44{
45 //count the radiuses, densities and fermi momenta with A and Z
46 G4double r = radius0*G4cbrt(A);
47
48 if(numberOfLayers==1){
49 radius.push_back(r);
50
51 G4double vol = 4.0/3.0 * pi * r*r*r;
52 G4double rho = G4double(A) / vol;
53 density.push_back(rho);
54
55 G4double protonMass = G4Proton::Proton()->GetPDGMass();
56 G4double neutronMass = G4Neutron::Neutron()->GetPDGMass();
57 G4double protonDensity = G4double(Z) / vol;
58 G4double neutronDensity = G4double(A-Z) / vol;
59
60 protonFermiEnergy.push_back(GetFermiEnergy(protonDensity, protonMass));
61 neutronFermiEnergy.push_back(GetFermiEnergy(neutronDensity, neutronMass));
62
63 protonFermiMomentum.push_back(GetFermiMomentum(protonDensity, protonMass));
64 neutronFermiMomentum.push_back(GetFermiMomentum(neutronDensity, neutronMass));
65
66 G4double fermiEP = *protonFermiEnergy.begin();
67 G4double fermiEN = *neutronFermiEnergy.begin();
68 protonPotentialEnergy.push_back(-(fermiEP + BE));
69 neutronPotentialEnergy.push_back(-(fermiEN + BE));
70 }
71 else{
72 if(numberOfLayers==3){
73 radius.push_back(0.1*r);
74 radius.push_back(0.2*r);
75 radius.push_back(0.9*r);
76
77 }
78 }
79}
double G4double
Definition: G4Types.hh:64
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4Proton * Proton()
Definition: G4Proton.cc:93
const G4double pi

◆ ~G4RegionModel()

G4RegionModel::~G4RegionModel ( )

Definition at line 81 of file G4RegionModel.cc.

81{}

Member Function Documentation

◆ GetDensity()

G4double G4RegionModel::GetDensity ( G4double  radius)

Definition at line 83 of file G4RegionModel.cc.

83 {
84 my_iterator j=density.begin();
85 for(my_iterator i=radius.begin(); i<radius.end(); i++){
86 if(r <= *i) return *j;
87 j++;
88 }
89 return 0;
90}
std::vector< G4double >::const_iterator my_iterator

◆ GetMaximumNucleonMomentum()

G4double G4RegionModel::GetMaximumNucleonMomentum ( G4double  radius,
G4int  nucleon 
)

Definition at line 113 of file G4RegionModel.cc.

114 {
115 if(nucleon == 0){
116 my_iterator j=protonFermiMomentum.begin();
117 for(my_iterator i=radius.begin(); i<radius.end(); i++){
118 if(r <= *i) return *j;
119 j++;
120 }
121 }
122 if(nucleon==1){
123 my_iterator j=neutronFermiMomentum.begin();
124 for(my_iterator i=radius.begin(); i<radius.end(); i++){
125 if(r <= *i) return *j;
126 j++;
127 }
128 }
129 throw G4HadronicException(__FILE__, __LINE__, "G4RegionModel::GetMaximumNucleonMomentum - return value undefined");
130 return 0;
131
132}

◆ GetPotentialEnergy()

G4double G4RegionModel::GetPotentialEnergy ( G4double  r,
G4int  particle 
)

Definition at line 92 of file G4RegionModel.cc.

92 {
93 if(particle == 0){ //proton
94 my_iterator j=protonPotentialEnergy.begin();
95 for(my_iterator i=radius.begin(); i<radius.end(); i++){
96 if(r <= *i) return *j;
97 j++;
98 }
99 return 0;
100 }
101
102 if(particle == 1){ //neutron
103 my_iterator j=neutronPotentialEnergy.begin();
104 for(my_iterator i=radius.begin(); i<radius.end(); i++){
105 if(r <= *i) return *j;
106 j++;
107 }
108 return 0;
109 }
110 return 0;
111}

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