34 #define INCLXX_IN_GEANT4_MODE 1
45 #ifndef INCLXX_IN_GEANT4_MODE
67 const G4int Npairing = (A-
Z)%2;
68 const G4int Zpairing = Z%2;
74 + 93.15*((fA/2.-fZ)*(fA/2.-fZ))/fA
76 if( Npairing == Zpairing ) binding += (Npairing+Zpairing-1) * 12.0 / std::sqrt(fA);
83 theTable[
A][
Z] = mass;
100 friend std::istream &
operator>>(std::istream &
in, MassRecord &record);
107 std::istream &
operator>>(std::istream &
in, MassRecord &record) {
108 return (in >> record.A >> record.Z >> record.excess);
111 G4bool compareA(
const MassRecord &lhs,
const MassRecord &rhs) {
112 return (lhs.A < rhs.A);
117 namespace NuclearMassTable {
127 std::string fileName(path +
"/walletlifetime.dat");
128 INCL_DEBUG(
"Reading real nuclear masses from file " << fileName <<
'\n');
131 std::ifstream massTableIn(fileName.c_str());
132 if(!massTableIn.good()) {
133 std::cerr <<
"Cannot open " << fileName <<
" data file." <<
'\n';
139 std::vector<MassRecord> records;
141 while(massTableIn.good()) {
142 massTableIn >> record;
143 records.push_back(record);
146 INCL_DEBUG(
"Read " << records.size() <<
" nuclear masses" <<
'\n');
149 AMax = std::max_element(records.begin(), records.end(), compareA)->
A;
150 INCL_DEBUG(
"Max A in nuclear-mass table = " << AMax <<
'\n');
151 ZMaxArray =
new G4int[AMax+1];
152 std::fill(ZMaxArray, ZMaxArray+AMax+1, 0);
154 std::fill(theTable, theTable+AMax+1, static_cast<G4double*>(NULL));
157 for(std::vector<MassRecord>::const_iterator i=records.begin(),
e=records.end(); i!=
e; ++i) {
158 ZMaxArray[i->A] =
std::max(ZMaxArray[i->A], i->Z);
164 std::fill(theTable[
A], theTable[A]+ZMaxArray[A]+1, -1.);
168 for(std::vector<MassRecord>::const_iterator i=records.begin(),
e=records.end(); i!=
e; ++i) {
169 setMass(i->A, i->Z, i->A*
amu + i->excess - i->Z*eMass);
174 if(A>AMax || Z>ZMaxArray[A]) {
175 INCL_DEBUG(
"Real mass unavailable for isotope A=" << A <<
", Z=" << Z
176 <<
", using Weizsaecker's formula"
178 return getWeizsaeckerMass(A,Z);
183 INCL_DEBUG(
"Real mass unavailable for isotope A=" << A <<
", Z=" << Z
184 <<
", using Weizsaecker's formula"
186 return getWeizsaeckerMass(A,Z);
194 for(
G4int A=1; A<=AMax; ++
A)
195 delete[] theTable[A];
203 #endif // INCLXX_IN_GEANT4_MODE
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::vector< ExP01TrackerHit * > a
Functions that encapsulate a mass table.
std::istream & operator>>(std::istream &is, HepRandom &dist)
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
double A(double temperature)
G4double powMinus13(G4double x)
G4double pow23(G4double x)
static constexpr double amu