Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::HFB Namespace Reference

Functions

void initialize ()
 
G4double getRadiusParameterHFB (const ParticleType t, const G4int A, const G4int Z)
 Get the radius and diffuseness parameters from HFB calculations.
 
G4double getSurfaceDiffusenessHFB (const ParticleType t, const G4int A, const G4int Z)
 

Function Documentation

◆ getRadiusParameterHFB()

G4double G4INCL::HFB::getRadiusParameterHFB ( const ParticleType t,
const G4int A,
const G4int Z )

Get the radius and diffuseness parameters from HFB calculations.

Definition at line 132 of file G4INCLHFB.cc.

132 {
133 // HFB calculations
134 G4double r0=0.;
135 if(t==Neutron)
136 if(radiusN[Z][A]>0.)r0=radiusN[Z][A];
137 if(t==Proton)
138 if(radiusP[Z][A]>0.)r0=radiusP[Z][A];
139 return r0;
140 }
double G4double
Definition G4Types.hh:83
const G4double A[17]

Referenced by G4INCL::ParticleTable::getRadiusParameter(), and G4INCL::ParticleTable::getSurfaceDiffuseness().

◆ getSurfaceDiffusenessHFB()

G4double G4INCL::HFB::getSurfaceDiffusenessHFB ( const ParticleType t,
const G4int A,
const G4int Z )

Definition at line 142 of file G4INCLHFB.cc.

142 {
143 // HFB calculations
144 G4double a=0.;
145 if(t==Neutron)
146 if(diffusenessN[Z][A]>0.)a=diffusenessN[Z][A];
147 if(t==Proton)
148 if(diffusenessP[Z][A]>0.)a=diffusenessP[Z][A];
149 return a;
150 }

Referenced by G4INCL::ParticleTable::getRadiusParameter(), and G4INCL::ParticleTable::getSurfaceDiffuseness().

◆ initialize()

void G4INCL::HFB::initialize ( )

Definition at line 83 of file G4INCLHFB.cc.

83 {
84#else
85 void initialize(const std::string &path) {
86#endif
87
88 // Clear the existing tables, if any
89 cleanTable();
90
91#ifdef INCLXX_IN_GEANT4_MODE
92 if(!G4FindDataDir("G4INCLDATA")) {
94 ed << " Data missing: set environment variable G4INCLDATA\n"
95 << " to point to the directory containing data files needed\n"
96 << " by the INCL++ model" << G4endl;
97 G4Exception("G4INCLDataFile::readData()","table_radius_hfb.dat",
98 FatalException, ed);
99 }
100 G4String dataPath0(G4FindDataDir("G4INCLDATA"));
101 G4String dataPath(dataPath0 + "/table_radius_hfb.dat");
102#else
103 // File name
104 std::string dataPath(path + "/table_radius_hfb.dat");
105 INCL_DEBUG("Reading radius and diffuseness parameters from file " << dataPath << '\n');
106#endif
107
108 // Open the file stream
109 std::ifstream hfbTableIn(dataPath.c_str());
110 if(!hfbTableIn.good()) {
111 std::cerr << "Cannot open " << dataPath << " data file." << '\n';
112 std::abort();
113 return;
114 }
115
116 // read the file
117 G4int z, a, nbnuclei=0;
118 G4double rp, rn, dp, dn;
119 while(hfbTableIn.good()) { /* Loop checking, 22.01.2018, J.L. Rodriguez */
120 hfbTableIn >> z >> a >> rp >> rn >> dp >> dn;
121 radiusP[z][a] = rp;
122 radiusN[z][a] = rn;
123 diffusenessP[z][a] = dp;
124 diffusenessN[z][a] = dn;
125 nbnuclei++;
126 }
127 hfbTableIn.close();
128 INCL_DEBUG("Read " << nbnuclei << " nuclei" << '\n');
129
130 }
const char * G4FindDataDir(const char *)
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define INCL_DEBUG(x)
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67

Referenced by initialize(), and G4INCL::ParticleTable::initialize().