47 :XSTableElectron(0),XSTablePositron(0),
48 theDeltaTable(0),energyGrid(0)
57 std::map< std::pair<const G4Material*,G4double>, G4PenelopeCrossSection*>;
59 theDeltaTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
103 G4cout <<
"G4PenelopeIonisationXSHandler. Tables have been cleared"
118 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
127 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
129 "The Cross Section Table for e- was not initialized correctly!");
132 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
143 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
145 "The Cross Section Table for e+ was not initialized correctly!");
148 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
165 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
176 G4cout <<
"G4PenelopeIonisationXSHandler: going to build cross section table " <<
G4endl;
181 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
201 size_t numberOfOscillators = theTable->size();
206 ed <<
"Energy Grid looks not initialized" <<
G4endl;
208 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
222 for (
size_t iosc=0;iosc<numberOfOscillators;iosc++)
236 ed <<
"Problem in calculating the shell XS for shell # "
238 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
243 if (tempStorage->size() != 6)
246 ed <<
"Problem in calculating the shell XS " <<
G4endl;
247 ed <<
"Result has dimension " << tempStorage->size() <<
" instead of 6" <<
G4endl;
248 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
253 XH0 += stre*(*tempStorage)[0];
254 XH1 += stre*(*tempStorage)[1];
255 XH2 += stre*(*tempStorage)[2];
256 XS0 += stre*(*tempStorage)[3];
257 XS1 += stre*(*tempStorage)[4];
258 XS2 += stre*(*tempStorage)[5];
291 G4Exception(
"G4PenelopeIonisationXSHandler::GetDensityCorrection()",
293 "Delta Table not initialized. Was Initialise() run?");
298 G4cout <<
"G4PenelopeIonisationXSHandler::GetDensityCorrection()" <<
G4endl;
307 result = vec->
Value(logene);
312 ed <<
"Unable to build table for " << mat->
GetName() <<
G4endl;
313 G4Exception(
"G4PenelopeIonisationXSHandler::GetDensityCorrection()",
327 size_t numberOfOscillators = theTable->size();
332 ed <<
"Energy Grid for Delta table looks not initialized" <<
G4endl;
334 G4Exception(
"G4PenelopeIonisationXSHandler::BuildDeltaTable()",
350 G4double TST = totalZ/(gamSq*plasmaSq);
355 for (
size_t i=0;i<numberOfOscillators;i++)
374 for (
size_t i=0;i<numberOfOscillators;i++)
390 wl2 = 0.5*(wl2l+wl2u);
392 for (
size_t i=0;i<numberOfOscillators;i++)
402 if ((wl2u-wl2l)>1
e-12*wl2)
408 for (
size_t i=0;i<numberOfOscillators;i++)
413 std::log(1.0+(wl2/(wri*wri)));
415 delta = (delta/totalZ)-wl2/(gamSq*plasmaSq);
439 for (
size_t i=0;i<6;i++)
440 result->push_back(0.);
444 if (energy < ionEnergy)
453 G4double beta = (gammaSq-1.0)/gammaSq;
456 G4double XHDT0 = std::log(gammaSq)-beta;
474 if (resEne > 1
e-6*energy)
483 SDL1 = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)));
510 if (wl < wu-(1
e-5*
eV))
512 H0 += (1.0/(ee-wu)) - (1.0/(ee-wl)) - (1.0/wu) + (1.0/wl) +
513 (1.0-amol)*std::log(((ee-wu)*wl)/((ee-wl)*wu))/ee +
514 amol*(wu-wl)/(ee*ee);
515 H1 += std::log(wu/wl)+(ee/(ee-wu))-(ee/(ee-wl)) +
516 (2.0-amol)*std::log((ee-wu)/(ee-wl)) +
517 amol*(wu*wu-wl*wl)/(2.0*ee*ee);
518 H2 += (2.0-amol)*(wu-wl)+(wu*(2.0*ee-wu)/(ee-wu)) -
519 (wl*(2.0*ee-wl)/(ee-wl)) +
520 (3.0-amol)*ee*std::log((ee-wu)/(ee-wl)) +
521 amol*(wu*wu*wu-wl*wl*wl)/(3.0*ee*ee);
526 if (wl > wu-(1
e-5*
eV))
528 (*result)[0] = constant*H0;
529 (*result)[1] = constant*H1;
530 (*result)[2] = constant*H2;
531 (*result)[3] = constant*S0;
532 (*result)[4] = constant*S1;
533 (*result)[5] = constant*S2;
537 S0 += (1.0/(ee-wu))-(1.0/(ee-wl)) - (1.0/wu) + (1.0/wl) +
538 (1.0-amol)*std::log(((ee-wu)*wl)/((ee-wl)*wu))/ee +
539 amol*(wu-wl)/(ee*ee);
540 S1 += std::log(wu/wl)+(ee/(ee-wu))-(ee/(ee-wl)) +
541 (2.0-amol)*std::log((ee-wu)/(ee-wl)) +
542 amol*(wu*wu-wl*wl)/(2.0*ee*ee);
543 S2 += (2.0-amol)*(wu-wl)+(wu*(2.0*ee-wu)/(ee-wu)) -
544 (wl*(2.0*ee-wl)/(ee-wl)) +
545 (3.0-amol)*ee*std::log((ee-wu)/(ee-wl)) +
546 amol*(wu*wu*wu-wl*wl*wl)/(3.0*ee*ee);
548 (*result)[0] = constant*H0;
549 (*result)[1] = constant*H1;
550 (*result)[2] = constant*H2;
551 (*result)[3] = constant*S0;
552 (*result)[4] = constant*S1;
553 (*result)[5] = constant*S2;
571 for (
size_t i=0;i<6;i++)
572 result->push_back(0.);
576 if (energy < ionEnergy)
585 G4double beta = (gammaSq-1.0)/gammaSq;
588 G4double XHDT0 = std::log(gammaSq)-beta;
593 G4double g12 = (gamma+1.0)*(gamma+1.0);
595 G4double bha1 = amol*(2.0*g12-1.0)/(gammaSq-1.0);
597 G4double bha3 = amol*2.0*gamma*(gamma-1.0)/g12;
598 G4double bha4 = amol*(gamma-1.0)*(gamma-1.0)/g12;
612 if (resEne > 1
e-6*energy)
621 SDL1 = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)));
649 if (wl < wu-(1
e-5*
eV))
653 H0 += (1.0/wl) - (1.0/wu)- bha1*std::log(wu/wl)/energy
654 + bha2*(wu-wl)/energySq
655 - bha3*(wuSq-wlSq)/(2.0*energySq*
energy)
656 + bha4*(wuSq*wu-wlSq*wl)/(3.0*energySq*energySq);
657 H1 += std::log(wu/wl) - bha1*(wu-wl)/energy
658 + bha2*(wuSq-wlSq)/(2.0*energySq)
659 - bha3*(wuSq*wu-wlSq*wl)/(3.0*energySq*
energy)
660 + bha4*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energySq);
661 H2 += wu - wl - bha1*(wuSq-wlSq)/(2.0*energy)
662 + bha2*(wuSq*wu-wlSq*wl)/(3.0*energySq)
663 - bha3*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energy)
664 + bha4*(wuSq*wuSq*wu-wlSq*wlSq*wl)/(5.0*energySq*energySq);
669 if (wl > wu-(1
e-5*
eV))
671 (*result)[0] = constant*H0;
672 (*result)[1] = constant*H1;
673 (*result)[2] = constant*H2;
674 (*result)[3] = constant*S0;
675 (*result)[4] = constant*S1;
676 (*result)[5] = constant*S2;
683 S0 += (1.0/wl) - (1.0/wu) - bha1*std::log(wu/wl)/energy
684 + bha2*(wu-wl)/energySq
685 - bha3*(wuSq-wlSq)/(2.0*energySq*
energy)
686 + bha4*(wuSq*wu-wlSq*wl)/(3.0*energySq*energySq);
688 S1 += std::log(wu/wl) - bha1*(wu-wl)/energy
689 + bha2*(wuSq-wlSq)/(2.0*energySq)
690 - bha3*(wuSq*wu-wlSq*wl)/(3.0*energySq*
energy)
691 + bha4*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energySq);
693 S2 += wu - wl - bha1*(wuSq-wlSq)/(2.0*energy)
694 + bha2*(wuSq*wu-wlSq*wl)/(3.0*energySq)
695 - bha3*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energy)
696 + bha4*(wuSq*wuSq*wu-wlSq*wlSq*wl)/(5.0*energySq*energySq);
698 (*result)[0] = constant*H0;
699 (*result)[1] = constant*H1;
700 (*result)[2] = constant*H2;
701 (*result)[3] = constant*S0;
702 (*result)[4] = constant*S1;
703 (*result)[5] = constant*S2;