75 G4double G4SeltzerBergerModel::ylimit[101] = {0.0};
76 G4double G4SeltzerBergerModel::expnumlim = -12.;
91 for(
size_t i=0; i<101; ++i) {
106 char* path = getenv(
"G4LEDATA");
112 for(
size_t i=0; i<numOfElm; ++i) {
115 else if(Z > 100) { Z = 100; }
118 if(!dataSB[Z]) { ReadData(Z, path); }
127 void G4SeltzerBergerModel::ReadData(
size_t Z,
const char* path)
132 if(dataSB[Z]) {
return; }
133 const char* datadir = path;
136 datadir = getenv(
"G4LEDATA");
139 "Environment variable G4LEDATA not defined");
143 std::ostringstream ost;
144 ost << datadir <<
"/brem_SB/br" <<
Z;
145 std::ifstream
fin(ost.str().c_str());
146 if( !
fin.is_open()) {
148 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
149 <<
"> is not opened!" <<
G4endl;
151 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
157 const G4double emaxlog = 4*log(10.);
161 ylimit[
Z] = v->
Value(0.97, emaxlog);
164 ed <<
"Bremsstrahlung data file <" << ost.str().c_str()
165 <<
"> is not retrieved!" <<
G4endl;
167 ed,
"G4LEDATA version should be G4EMLOW6.23 or later.");
178 if(gammaEnergy < 0.0 ||
kinEnergy <= 0.0) {
return 0.0; }
184 if(!dataSB[Z]) { ReadData(Z); }
194 if(xxx < expnumlim) { cross = 0.0; }
195 else { cross *= exp(xxx); }
214 G4double cut = std::min(cutEnergy, kineticEnergy);
215 G4double emax = std::min(maxEnergy, kineticEnergy);
216 if(cut >= emax) {
return; }
250 ((kineticEnergy > epeaklimit) || (kineticEnergy < elowlimit))) {
251 G4double ylim = std::min(ylimit[Z],1.1*dataSB[Z]->
Value(0.97, y));
252 if(ylim > vmax) { vmax = ylim; }
254 if(x0 < 0.05) { vmax *= 1.2; }
261 if(x < 0.0) { x = 0.0; }
262 gammaEnergy = sqrt(x);
264 v = dataSB[
Z]->
Value(x1, y);
270 G4double e2 = kineticEnergy - gammaEnergy;
274 if(xxx < expnumlim) { v = 0.0; }
275 else { v *= exp(xxx); }
278 if (v > 1.05*vmax && nwarn < 20) {
280 G4cout <<
"### G4SeltzerBergerModel Warning: Majoranta exceeded! "
281 << v <<
" > " << vmax <<
" by " << v/vmax
282 <<
" Egamma(MeV)= " << gammaEnergy
283 <<
" Ee(MeV)= " << kineticEnergy
289 G4cout <<
"### G4SeltzerBergerModel Warnings will not be printed anymore"
307 vdp->push_back(gamma);
310 - gammaEnergy*gammaDirection).unit();
320 G4double finalE = kineticEnergy - gammaEnergy;