301 if (verboseLevel > 3)
302 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeGammaConversionModel" <<
G4endl;
310 if (photonEnergy <= fIntrinsicLowEnergyLimit)
321 if (!fEffectiveCharge)
326 fEffectiveCharge =
new std::map<const G4Material*,G4double>;
327 fMaterialInvScreeningRadius =
new std::map<const G4Material*,G4double>;
328 fScreeningFunction =
new std::map<const G4Material*,std::pair<G4double,G4double> >;
331 if (!fEffectiveCharge->count(mat))
335 if (verboseLevel > 0)
339 ed <<
"Unable to allocate the EffectiveCharge data for " <<
341 ed <<
"This can happen only in Unit Tests" <<
G4endl;
342 G4Exception(
"G4PenelopeGammaConversionModel::SampleSecondaries()",
346 G4AutoLock lock(&PenelopeGammaConversionModelMutex);
347 InitializeScreeningFunctions(mat);
356 if (photonEnergy < fSmallEnergy)
361 G4double effC = fEffectiveCharge->find(mat)->second;
364 G4double F00=(-1.774-1.210e1*alz+1.118e1*alz*alz)*T
365 +(8.523+7.326e1*alz-4.441e1*alz*alz)*T*T
366 -(1.352e1+1.211e2*alz-9.641e1*alz*alz)*T*T*T
367 +(8.946+6.205e1*alz-6.341e1*alz*alz)*T*T*T*T;
369 G4double F0b = fScreeningFunction->find(mat)->second.second;
371 G4double invRad = fMaterialInvScreeningRadius->find(mat)->second;
373 std::pair<G4double,G4double> scree = GetScreeningFunctions(bmin);
390 eps = 0.5-xr*std::pow(std::abs(ru2m1),1./3.);
392 eps = 0.5+xr*std::pow(ru2m1,1./3.);
394 scree = GetScreeningFunctions(B);
404 scree = GetScreeningFunctions(B);
413 if (verboseLevel > 4)
416 G4double electronTotEnergy = eps*photonEnergy;
417 G4double positronTotEnergy = (1.0-
eps)*photonEnergy;
425 costheta_el = (costheta_el*electronTotEnergy+kk)/(electronTotEnergy+costheta_el*kk);
427 G4double dirX_el = std::sqrt(1.-costheta_el*costheta_el) * std::cos(phi_el);
428 G4double dirY_el = std::sqrt(1.-costheta_el*costheta_el) * std::sin(phi_el);
434 kk = std::sqrt(positronKineEnergy*(positronKineEnergy+2.*
electron_mass_c2));
435 costheta_po = (costheta_po*positronTotEnergy+kk)/(positronTotEnergy+costheta_po*kk);
437 G4double dirX_po = std::sqrt(1.-costheta_po*costheta_po) * std::cos(phi_po);
438 G4double dirY_po = std::sqrt(1.-costheta_po*costheta_po) * std::sin(phi_po);
446 if (electronKineEnergy > 0.0)
448 G4ThreeVector electronDirection ( dirX_el, dirY_el, dirZ_el);
449 electronDirection.rotateUz(photonDirection);
453 fvect->push_back(electron);
457 localEnergyDeposit += electronKineEnergy;
458 electronKineEnergy = 0;
463 if (positronKineEnergy < 0.0)
465 localEnergyDeposit += positronKineEnergy;
466 positronKineEnergy = 0;
469 positronDirection.rotateUz(photonDirection);
471 positronDirection, positronKineEnergy);
472 fvect->push_back(positron);
477 if (verboseLevel > 1)
479 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
480 G4cout <<
"Energy balance from G4PenelopeGammaConversion" <<
G4endl;
481 G4cout <<
"Incoming photon energy: " << photonEnergy/
keV <<
" keV" <<
G4endl;
482 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
483 if (electronKineEnergy)
484 G4cout <<
"Electron (explicitely produced) " << electronKineEnergy/
keV <<
" keV"
486 if (positronKineEnergy)
487 G4cout <<
"Positron (not at rest) " << positronKineEnergy/
keV <<
" keV" <<
G4endl;
489 if (localEnergyDeposit)
490 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
491 G4cout <<
"Total final state: " << (electronKineEnergy+positronKineEnergy+
494 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
496 if (verboseLevel > 0)
498 G4double energyDiff = std::fabs(electronKineEnergy+positronKineEnergy+
500 if (energyDiff > 0.05*
keV)
501 G4cout <<
"Warning from G4PenelopeGammaConversion: problem with energy conservation: "
502 << (electronKineEnergy+positronKineEnergy+
504 <<
" keV (final) vs. " << photonEnergy/
keV <<
" keV (initial)" << G4endl;
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
const G4String & GetName() const
static const G4double eps
double B(double temperature)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
G4GLOB_DLL std::ostream G4cout
G4ParticleChangeForGamma * fParticleChange
const G4ThreeVector & GetMomentumDirection() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4Positron * Positron()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeTrackStatus(G4TrackStatus status)
static constexpr double keV
const G4Material * GetMaterial() const