304 if (verboseLevel > 3) {
305 G4cout <<
"G4LivermoreComptonModel::SampleSecondaries() E(MeV)= "
324 G4double epsilon0Local = 1. / (1. + 2. * e0m);
325 G4double epsilon0Sq = epsilon0Local * epsilon0Local;
327 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
338 if (verboseLevel > 3) {
339 G4cout <<
"Started loop to sample gamma energy" <<
G4endl;
350 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) *
G4UniformRand();
351 epsilon = std::sqrt(epsilonSq);
354 oneCosT = (1. -
epsilon) / ( epsilon * e0m);
355 sinT2 = oneCosT * (2. - oneCosT);
356 G4double x = std::sqrt(oneCosT/2.) *
cm / wlPhoton;
357 G4double scatteringFunction = ComputeScatteringFunction(x, Z);
358 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
363 G4double sinTheta = std::sqrt (sinT2);
365 G4double dirx = sinTheta * std::cos(phi);
366 G4double diry = sinTheta * std::sin(phi);
375 static G4int maxDopplerIterations = 1000;
377 G4double photonEoriginal = epsilon * photonEnergy0;
384 if (verboseLevel > 3) {
395 if (verboseLevel > 3) {
396 G4cout <<
"Shell ID= " << shellIdx
397 <<
" Ebind(keV)= " << bindingE/
keV <<
G4endl;
400 eMax = photonEnergy0 - bindingE;
405 if (verboseLevel > 3) {
410 G4double pDoppler2 = pDoppler * pDoppler;
412 G4double var3 = var2*var2 - pDoppler2;
413 G4double var4 = var2 - pDoppler2 * cosTheta;
414 G4double var = var4*var4 - var3 + pDoppler2 * var3;
418 G4double scale = photonEnergy0 / var3;
420 if (
G4UniformRand() < 0.5) { photonE = (var4 - varSqrt) * scale; }
421 else { photonE = (var4 + varSqrt) * scale; }
427 }
while (iteration <= maxDopplerIterations && photonE > eMax);
435 if (iteration >= maxDopplerIterations)
437 photonE = photonEoriginal;
444 photonDirection1.rotateUz(photonDirection0);
449 if (photonEnergy1 > 0.) {
462 G4double eKineticEnergy = photonEnergy0 - photonEnergy1 - bindingE;
465 if(eKineticEnergy < 0.0) {
472 G4double electronE = photonEnergy0 * (1. -
epsilon) + electron_mass_c2;
479 cosThetaE = (eTotalEnergy + photonEnergy1 )*
480 (1. - epsilon) / std::sqrt(electronP2);
481 sinThetaE = -1. * sqrt(1. - cosThetaE * cosThetaE);
484 G4double eDirX = sinThetaE * std::cos(phi);
485 G4double eDirY = sinThetaE * std::sin(phi);
489 eDirection.rotateUz(photonDirection0);
491 eDirection,eKineticEnergy) ;
492 fvect->push_back(dp);
497 if (verboseLevel > 3) {
498 G4cout <<
"Started atomic de-excitation " << fAtomDeexcitation <<
G4endl;
501 if(fAtomDeexcitation && iteration < maxDopplerIterations) {
504 size_t nbefore = fvect->size();
508 size_t nafter = fvect->size();
509 if(nafter > nbefore) {
510 for (
size_t i=nbefore; i<nafter; ++i) {
512 if (bindingE >= ((*fvect)[i])->GetKineticEnergy())
515 bindingE -= ((*fvect)[i])->GetKineticEnergy();
530 G4Exception(
"G4LivermoreComptonModel::SampleSecondaries()",
G4double LowEnergyLimit() const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
G4double GetKineticEnergy() const
const G4String & GetName() const
G4ParticleDefinition * GetDefinition() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4int SelectRandomShell(G4int Z) const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
static constexpr double cm
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static constexpr double MeV
void ProposeTrackStatus(G4TrackStatus status)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
static constexpr double keV
double epsilon(double density, double temperature)
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
const G4Material * GetMaterial() const