48 :XSTableElectron(0),XSTablePositron(0),
49 theDeltaTable(0),energyGrid(0)
58 std::map< std::pair<const G4Material*,G4double>, G4PenelopeCrossSection*>;
60 theDeltaTable =
new std::map<const G4Material*,G4PhysicsFreeVector*>;
104 G4cout <<
"G4PenelopeIonisationXSHandler. Tables have been cleared"
119 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
128 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
130 "The Cross Section Table for e- was not initialized correctly!");
133 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
144 G4Exception(
"G4PenelopeIonisationXSHandler::GetCrossSectionTableForCouple()",
146 "The Cross Section Table for e+ was not initialized correctly!");
149 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
166 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
177 G4cout <<
"G4PenelopeIonisationXSHandler: going to build cross section table " <<
G4endl;
182 std::pair<const G4Material*,G4double> theKey = std::make_pair(mat,cut);
202 size_t numberOfOscillators = theTable->size();
207 ed <<
"Energy Grid looks not initialized" <<
G4endl;
209 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
223 for (
size_t iosc=0;iosc<numberOfOscillators;iosc++)
237 ed <<
"Problem in calculating the shell XS for shell # "
239 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
244 if (tempStorage->size() != 6)
247 ed <<
"Problem in calculating the shell XS " <<
G4endl;
248 ed <<
"Result has dimension " << tempStorage->size() <<
" instead of 6" <<
G4endl;
249 G4Exception(
"G4PenelopeIonisationXSHandler::BuildXSTable()",
254 XH0 += stre*(*tempStorage)[0];
255 XH1 += stre*(*tempStorage)[1];
256 XH2 += stre*(*tempStorage)[2];
257 XS0 += stre*(*tempStorage)[3];
258 XS1 += stre*(*tempStorage)[4];
259 XS2 += stre*(*tempStorage)[5];
292 G4Exception(
"G4PenelopeIonisationXSHandler::GetDensityCorrection()",
294 "Delta Table not initialized. Was Initialise() run?");
299 G4cout <<
"G4PenelopeIonisationXSHandler::GetDensityCorrection()" <<
G4endl;
308 result = vec->
Value(logene);
313 ed <<
"Unable to build table for " << mat->
GetName() <<
G4endl;
314 G4Exception(
"G4PenelopeIonisationXSHandler::GetDensityCorrection()",
328 size_t numberOfOscillators = theTable->size();
333 ed <<
"Energy Grid for Delta table looks not initialized" <<
G4endl;
335 G4Exception(
"G4PenelopeIonisationXSHandler::BuildDeltaTable()",
351 G4double TST = totalZ/(gamSq*plasmaSq);
356 for (
size_t i=0;i<numberOfOscillators;i++)
375 for (
size_t i=0;i<numberOfOscillators;i++)
391 wl2 = 0.5*(wl2l+wl2u);
393 for (
size_t i=0;i<numberOfOscillators;i++)
403 if ((wl2u-wl2l)>1
e-12*wl2)
409 for (
size_t i=0;i<numberOfOscillators;i++)
414 std::log(1.0+(wl2/(wri*wri)));
416 delta = (delta/totalZ)-wl2/(gamSq*plasmaSq);
440 for (
size_t i=0;i<6;i++)
441 result->push_back(0.);
445 if (energy < ionEnergy)
475 if (resEne > 1
e-6*energy)
484 SDL1 = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)));
511 if (wl < wu-(1
e-5*
eV))
513 H0 += (1.0/(ee-wu)) - (1.0/(ee-wl)) - (1.0/wu) + (1.0/wl) +
514 (1.0-amol)*std::log(((ee-wu)*wl)/((ee-wl)*wu))/ee +
515 amol*(wu-wl)/(ee*ee);
516 H1 += std::log(wu/wl)+(ee/(ee-wu))-(ee/(ee-wl)) +
517 (2.0-amol)*std::log((ee-wu)/(ee-wl)) +
518 amol*(wu*wu-wl*wl)/(2.0*ee*ee);
519 H2 += (2.0-amol)*(wu-wl)+(wu*(2.0*ee-wu)/(ee-wu)) -
520 (wl*(2.0*ee-wl)/(ee-wl)) +
521 (3.0-amol)*ee*std::log((ee-wu)/(ee-wl)) +
522 amol*(wu*wu*wu-wl*wl*wl)/(3.0*ee*ee);
527 if (wl > wu-(1
e-5*
eV))
529 (*result)[0] = constant*H0;
530 (*result)[1] = constant*H1;
531 (*result)[2] = constant*H2;
532 (*result)[3] = constant*S0;
533 (*result)[4] = constant*S1;
534 (*result)[5] = constant*S2;
538 S0 += (1.0/(ee-wu))-(1.0/(ee-wl)) - (1.0/wu) + (1.0/wl) +
539 (1.0-amol)*std::log(((ee-wu)*wl)/((ee-wl)*wu))/ee +
540 amol*(wu-wl)/(ee*ee);
541 S1 += std::log(wu/wl)+(ee/(ee-wu))-(ee/(ee-wl)) +
542 (2.0-amol)*std::log((ee-wu)/(ee-wl)) +
543 amol*(wu*wu-wl*wl)/(2.0*ee*ee);
544 S2 += (2.0-amol)*(wu-wl)+(wu*(2.0*ee-wu)/(ee-wu)) -
545 (wl*(2.0*ee-wl)/(ee-wl)) +
546 (3.0-amol)*ee*std::log((ee-wu)/(ee-wl)) +
547 amol*(wu*wu*wu-wl*wl*wl)/(3.0*ee*ee);
549 (*result)[0] = constant*H0;
550 (*result)[1] = constant*H1;
551 (*result)[2] = constant*H2;
552 (*result)[3] = constant*S0;
553 (*result)[4] = constant*S1;
554 (*result)[5] = constant*S2;
572 for (
size_t i=0;i<6;i++)
573 result->push_back(0.);
577 if (energy < ionEnergy)
594 G4double g12 = (gamma+1.0)*(gamma+1.0);
596 G4double bha1 = amol*(2.0*g12-1.0)/(gammaSq-1.0);
598 G4double bha3 = amol*2.0*gamma*(gamma-1.0)/g12;
599 G4double bha4 = amol*(gamma-1.0)*(gamma-1.0)/g12;
613 if (resEne > 1
e-6*energy)
622 SDL1 = std::log(cutoffEne*(QM+2.0*electron_mass_c2)/(QM*(cutoffEne+2.0*electron_mass_c2)));
650 if (wl < wu-(1
e-5*
eV))
654 H0 += (1.0/wl) - (1.0/wu)- bha1*std::log(wu/wl)/energy
655 + bha2*(wu-wl)/energySq
656 - bha3*(wuSq-wlSq)/(2.0*energySq*
energy)
657 + bha4*(wuSq*wu-wlSq*wl)/(3.0*energySq*energySq);
658 H1 += std::log(wu/wl) - bha1*(wu-wl)/energy
659 + bha2*(wuSq-wlSq)/(2.0*energySq)
660 - bha3*(wuSq*wu-wlSq*wl)/(3.0*energySq*
energy)
661 + bha4*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energySq);
662 H2 += wu - wl - bha1*(wuSq-wlSq)/(2.0*energy)
663 + bha2*(wuSq*wu-wlSq*wl)/(3.0*energySq)
664 - bha3*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energy)
665 + bha4*(wuSq*wuSq*wu-wlSq*wlSq*wl)/(5.0*energySq*energySq);
670 if (wl > wu-(1
e-5*
eV))
672 (*result)[0] = constant*H0;
673 (*result)[1] = constant*H1;
674 (*result)[2] = constant*H2;
675 (*result)[3] = constant*S0;
676 (*result)[4] = constant*S1;
677 (*result)[5] = constant*S2;
684 S0 += (1.0/wl) - (1.0/wu) - bha1*std::log(wu/wl)/energy
685 + bha2*(wu-wl)/energySq
686 - bha3*(wuSq-wlSq)/(2.0*energySq*
energy)
687 + bha4*(wuSq*wu-wlSq*wl)/(3.0*energySq*energySq);
689 S1 += std::log(wu/wl) - bha1*(wu-wl)/energy
690 + bha2*(wuSq-wlSq)/(2.0*energySq)
691 - bha3*(wuSq*wu-wlSq*wl)/(3.0*energySq*
energy)
692 + bha4*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energySq);
694 S2 += wu - wl - bha1*(wuSq-wlSq)/(2.0*energy)
695 + bha2*(wuSq*wu-wlSq*wl)/(3.0*energySq)
696 - bha3*(wuSq*wuSq-wlSq*wlSq)/(4.0*energySq*energy)
697 + bha4*(wuSq*wuSq*wu-wlSq*wlSq*wl)/(5.0*energySq*energySq);
699 (*result)[0] = constant*H0;
700 (*result)[1] = constant*H1;
701 (*result)[2] = constant*H2;
702 (*result)[3] = constant*S0;
703 (*result)[4] = constant*S1;
704 (*result)[5] = constant*S2;
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual ~G4PenelopeIonisationXSHandler()
Destructor. Clean all tables.
std::ostringstream G4ExceptionDescription
G4PenelopeIonisationXSHandler(size_t nBins=200)
G4DataVector * ComputeShellCrossSectionsPositron(G4PenelopeOscillator *, G4double energy, G4double cut, G4double delta)
G4double GetLowEdgeEnergy(size_t binNumber) const
static constexpr double keV
G4double GetIonisationEnergy()
const G4String & GetParticleName() const
std::map< std::pair< const G4Material *, G4double >, G4PenelopeCrossSection * > * XSTablePositron
std::map< const G4Material *, G4PhysicsFreeVector * > * theDeltaTable
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
G4double GetResonanceEnergy() const
G4double Value(G4double theEnergy, size_t &lastidx) const
void AddShellCrossSectionPoint(size_t binNumber, size_t shellID, G4double energy, G4double xs)
G4double GetPlasmaEnergySquared(const G4Material *)
Returns the squared plasma energy.
static constexpr double classic_electr_radius
G4double GetDensityCorrection(const G4Material *, const G4double energy) const
Returns the density coeection for the material at the given energy.
const G4String & GetName() const
void BuildXSTable(const G4Material *, G4double cut, const G4ParticleDefinition *, G4bool isMaster=true)
This can be inkoved only by the master.
static G4PenelopeOscillatorManager * GetOscillatorManager()
G4double GetCutoffRecoilResonantEnergy()
void AddCrossSectionPoint(size_t binNumber, G4double energy, G4double XH0, G4double XH1, G4double XH2, G4double XS0, G4double XS1, G4double XS2)
G4DataVector * ComputeShellCrossSectionsElectron(G4PenelopeOscillator *, G4double energy, G4double cut, G4double delta)
static constexpr double electron_mass_c2
G4double GetOscillatorStrength()
static G4Positron * Positron()
static constexpr double eV
G4PhysicsLogVector * energyGrid
static G4Electron * Electron()
void NormalizeShellCrossSections()
std::map< std::pair< const G4Material *, G4double >, G4PenelopeCrossSection * > * XSTableElectron
G4double G4ParticleHPJENDLHEData::G4double result
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void BuildDeltaTable(const G4Material *)
void PutValue(size_t index, G4double energy, G4double dataValue)
static constexpr double pi
const G4PenelopeCrossSection * GetCrossSectionTableForCouple(const G4ParticleDefinition *, const G4Material *, const G4double cut) const
G4double GetTotalZ(const G4Material *)
G4PenelopeOscillatorManager * oscManager
static constexpr double GeV
size_t GetVectorLength() const