505 if (verboseLevel > 3)
506 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeIonisationModel" <<
G4endl;
511 if (kineticEnergy0 <= fIntrinsicLowEnergyLimit)
525 kineticEnergy1=kineticEnergy0;
528 cosThetaSecondary=1.0;
529 targetOscillator = -1;
532 SampleFinalStateElectron(material,cutE,kineticEnergy0);
534 SampleFinalStatePositron(material,cutE,kineticEnergy0);
539 G4Exception(
"G4PenelopeIonisationModel::SamplingSecondaries()",
543 if (energySecondary == 0)
return;
545 if (verboseLevel > 3)
547 G4cout <<
"G4PenelopeIonisationModel::SamplingSecondaries() for " <<
549 G4cout <<
"Final eKin = " << kineticEnergy1 <<
" keV" <<
G4endl;
550 G4cout <<
"Final cosTheta = " << cosThetaPrimary <<
G4endl;
551 G4cout <<
"Delta-ray eKin = " << energySecondary <<
" keV" <<
G4endl;
552 G4cout <<
"Delta-ray cosTheta = " << cosThetaSecondary <<
G4endl;
557 G4double sint = std::sqrt(1. - cosThetaPrimary*cosThetaPrimary);
559 G4double dirx = sint * std::cos(phiPrimary);
560 G4double diry = sint * std::sin(phiPrimary);
564 electronDirection1.rotateUz(particleDirection0);
566 if (kineticEnergy1 > 0)
576 G4double ionEnergyInPenelopeDatabase =
577 (*theTable)[targetOscillator]->GetIonisationEnergy();
581 G4int shFlag = (*theTable)[targetOscillator]->GetShellFlag();
582 G4int Z = (
G4int) (*theTable)[targetOscillator]->GetParentZ();
591 if (Z > 0 && shFlag<30)
593 shell = transitionManager->
Shell(Z,shFlag-1);
601 energySecondary += ionEnergyInPenelopeDatabase-
bindingEnergy;
608 if (energySecondary < 0)
614 localEnergyDeposit += energySecondary;
615 energySecondary = 0.0;
623 if (fAtomDeexcitation && !fPIXEflag && shell)
628 size_t nBefore = fvect->size();
630 size_t nAfter = fvect->size();
632 if (nAfter > nBefore)
634 for (
size_t j=nBefore;j<nAfter;j++)
636 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
637 localEnergyDeposit -= itsEnergy;
639 energyInFluorescence += itsEnergy;
641 energyInAuger += itsEnergy;
648 if (energySecondary > cutE)
651 G4double sinThetaE = std::sqrt(1.-cosThetaSecondary*cosThetaSecondary);
653 G4double xEl = sinThetaE * std::cos(phiEl);
654 G4double yEl = sinThetaE * std::sin(phiEl);
657 eDirection.rotateUz(particleDirection0);
659 eDirection,energySecondary) ;
660 fvect->push_back(electron);
664 localEnergyDeposit += energySecondary;
668 if (localEnergyDeposit < 0)
671 <<
"G4PenelopeIonisationModel::SampleSecondaries - Negative energy deposit"
673 localEnergyDeposit=0.;
677 if (verboseLevel > 1)
679 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
680 G4cout <<
"Energy balance from G4PenelopeIonisation" <<
G4endl;
681 G4cout <<
"Incoming primary energy: " << kineticEnergy0/
keV <<
" keV" <<
G4endl;
682 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
683 G4cout <<
"Outgoing primary energy: " << kineticEnergy1/
keV <<
" keV" <<
G4endl;
685 if (energyInFluorescence)
686 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/
keV <<
" keV" <<
G4endl;
688 G4cout <<
"Auger electrons: " << energyInAuger/
keV <<
" keV" <<
G4endl;
689 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
690 G4cout <<
"Total final state: " << (energySecondary+energyInFluorescence+kineticEnergy1+
691 localEnergyDeposit+energyInAuger)/
keV <<
693 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
696 if (verboseLevel > 0)
698 G4double energyDiff = std::fabs(energySecondary+energyInFluorescence+kineticEnergy1+
699 localEnergyDeposit+energyInAuger-kineticEnergy0);
700 if (energyDiff > 0.05*
keV)
701 G4cout <<
"Warning from G4PenelopeIonisation: problem with energy conservation: " <<
702 (energySecondary+energyInFluorescence+kineticEnergy1+localEnergyDeposit+energyInAuger)/
keV <<
703 " keV (final) vs. " <<
704 kineticEnergy0/
keV <<
" keV (initial)" << G4endl;
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
static G4Electron * Definition()
G4ParticleDefinition * GetDefinition() const
G4double BindingEnergy() const
const G4String & GetParticleName() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static constexpr double eV
G4ParticleChangeForLoss * fParticleChange
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4Positron * Positron()
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
static G4Electron * Electron()
static constexpr double pi
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4double bindingEnergy(G4int A, G4int Z)
static G4AtomicTransitionManager * Instance()
static constexpr double keV
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
static G4Gamma * Definition()
const G4Material * GetMaterial() const