43 max_energy_(10.0f*
GeV),
50 GGcout(
"GGEMSRangeCuts",
"GGEMSRangeCuts", 3) <<
"GGEMSRangeCuts creating..." <<
GGendl;
55 GGcout(
"GGEMSRangeCuts",
"GGEMSRangeCuts", 3) <<
"GGEMSRangeCuts created!!!" <<
GGendl;
64 GGcout(
"GGEMSRangeCuts",
"~GGEMSRangeCuts", 3) <<
"GGEMSRangeCuts erasing..." <<
GGendl;
80 GGcout(
"GGEMSRangeCuts",
"~GGEMSRangeCuts", 3) <<
"GGEMSRangeCuts erased!!!" <<
GGendl;
91 std::ostringstream oss(std::ostringstream::out);
92 oss <<
"Distance cut for photon " << cut <<
" mm is too small!!! Minimum value is " <<
PHOTON_DISTANCE_CUT <<
" mm!!!";
105 std::ostringstream oss(std::ostringstream::out);
106 oss <<
"Distance cut for electron " << cut <<
" mm is too small!!! Minimum value is " <<
ELECTRON_DISTANCE_CUT <<
" mm!!!";
119 std::ostringstream oss(std::ostringstream::out);
120 oss <<
"Cut distance for positron " << cut <<
" mm is too small!!! Minimum value is " <<
POSITRON_DISTANCE_CUT <<
" mm!!!";
132 if (particle_name !=
"gamma" && particle_name !=
"e+" && particle_name !=
"e-") {
133 std::ostringstream oss(std::ostringstream::out);
134 oss <<
"Wrong particle name, the particle can be only:" << std::endl;
135 oss <<
" - gamma" << std::endl;
136 oss <<
" - e+" << std::endl;
137 oss <<
" - e-" << std::endl;
143 if (particle_name ==
"gamma") {
146 else if (particle_name ==
"e-") {
149 else if (particle_name ==
"e+") {
164 GGfloat kinetic_energy_cut = 0.0f;
170 if (particle_name ==
"gamma") {
173 else if (particle_name ==
"e+" || particle_name ==
"e-") {
181 if (particle_name ==
"e-" || particle_name ==
"e+" ) {
184 if (kinetic_energy_cut < kLowEnergy) {
185 kinetic_energy_cut /= ( 1.0f + (1.0f - kinetic_energy_cut/kLowEnergy) * kTune / (cut*material_table->
density_of_material_[index_mat]));
197 if (particle_name ==
"gamma") {
200 else if (particle_name ==
"e-") {
203 else if (particle_name ==
"e+") {
207 return kinetic_energy_cut;
231 for (
GGsize j = 0; j < number_of_elements; ++j) {
247 std::vector<GGfloat> loss;
262 for (
GGsize j = 0; j < number_of_elements; ++j) {
265 loss.push_back(value);
289 value = (s0 + 0.5f*q) * dltau;
292 value = (s0 - 0.5f*q) * dltau;
322 if (particle_name ==
"gamma") {
325 else if (particle_name ==
"e-") {
328 else if (particle_name ==
"e+") {
331 log_energy_table_element->
SetValue(j, value);
364 if (std::abs(atomic_number - gZ) > 0.1f) {
366 GGfloat const kZsquare = gZ*gZ;
367 GGfloat const kZlog = logf(gZ);
368 GGfloat const kZlogsquare = kZlog*kZlog;
370 s200keV = (0.2651f - 0.1501f*kZlog + 0.02283f*kZlogsquare) * kZsquare;
371 tmin = (0.552f + 218.5f/gZ + 557.17f/kZsquare) *
MeV;
372 smin = (0.01239f + 0.005585f*kZlog - 0.000923f*kZlogsquare) * expf(1.5f*kZlog);
373 cmin = logf(s200keV/smin) / (logf(tmin/t200keV) * logf(tmin/t200keV));
374 tlow = 0.2f * expf(-7.355f/sqrtf(gZ)) *
MeV;
375 slow = s200keV * expf(0.042f*gZ*logf(t200keV/tlow)*logf(t200keV/tlow));
376 s1keV = 300.0f*kZsquare;
377 clow = logf(s1keV/slow) / logf(tlow/t1keV);
379 chigh = (7.55e-5f - 0.0542e-5f*gZ ) * kZsquare * gZ/logf(t100MeV/tmin);
385 if (energy < t1keV) {
386 xs = slow * expf(clow*logf(tlow/t1keV));
389 xs = slow * expf(clow*logf(tlow/energy));
392 else if (energy < t200keV) {
393 xs = s200keV * expf(0.042f*gZ*logf(t200keV/energy)*logf(t200keV/energy));
395 else if(energy < tmin) {
396 xs = smin * expf(cmin*logf(tmin/energy)*logf(tmin/energy));
399 xs = smin + chigh*logf(energy/tmin);
428 if (fabs(atomic_number - eZ) > 0.1f) {
431 ionpot = 1.6e-5f*
MeV * expf(0.9f*logf(eZ)) / Mass;
432 ionpotlog = logf(ionpot);
442 GGfloat beta2 = taul*t2 / (t1*t1);
443 GGfloat f = 1.f - beta2 + logf(tsq/2.0f) + (0.5f + 0.25f*tsq + (1.f+2.f*taul) * logf(0.5f)) / (t1*t1);
444 dEdx = (logf(2.f*taul + 4.f) - 2.f*ionpotlog + f) / beta2;
446 GGfloat clow = dEdx * sqrtf(taul);
447 dEdx = clow / sqrtf(energy / Mass);
453 GGfloat beta2 = tau*t2 / ( t1*t1 );
454 GGfloat f = 1.f - beta2 + logf(tsq/2.f) + (0.5f + 0.25f*tsq + (1.f + 2.f*tau)*logf(0.5f)) / (t1*t1);
455 dEdx = (logf(2.f*tau + 4.f) - 2.f*ionpotlog + f) / beta2;
459 GGfloat cbrem = (cbr1 + cbr2*eZ) * (cbr3 + cbr4*logf(energy/Thigh));
460 cbrem = eZ * (eZ+1.f) * cbrem * tau / beta2;
491 if (fabs(atomic_number-Z) > 0.1f) {
494 ionpot = 1.6e-5f*
MeV * expf(0.9f*logf(Z))/Mass;
495 ionpotlog = logf(ionpot);
505 GGfloat beta2 = taul*t2 / (t1*t1);
506 GGfloat f = 2.f * logf(taul) -(6.f*taul+1.5f*tsq-taul*(1.f-tsq/3.f)/t2-tsq*(0.5f-tsq/12.f)/(t2*t2))/(t1*t1);
507 dEdx = (logf(2.f*taul+4.f)-2.f*ionpotlog+f)/beta2;
509 GGfloat clow = dEdx * sqrtf(taul);
510 dEdx = clow/sqrtf(energy/Mass);
516 GGfloat beta2 = tau*t2/(t1*t1);
517 GGfloat f = 2.f*logf(tau)-(6.f*tau+1.5f*tsq-tau*(1.f-tsq/3.f)/t2-tsq*(0.5f-tsq/12.f)/(t2*t2))/(t1*t1);
518 dEdx = (logf(2.f*tau+4.f)-2.f*ionpotlog+f)/beta2;
522 GGfloat cbrem = (cbr1+cbr2*Z)*(cbr3+cbr4*logf(energy/Thigh));
523 cbrem = Z*(Z+1.f)*cbrem*tau/beta2;
545 if (length_cut < r1)
return t1;
553 if (r > rmax) rmax = r;
554 if (r < length_cut) {
558 else if (r > length_cut) {
571 while (fabs(1.0f - r3/length_cut) > epsilon) {
572 if (length_cut <= r3) {
602 for (
GGsize j = 0; j < number_activated_devices; ++j) {