296 if (verboseLevel > 3)
297 G4cout <<
"Calling SamplingSecondaries() of G4PenelopePhotoElectricModel" <<
G4endl;
305 if (photonEnergy <= fIntrinsicLowEnergyLimit)
314 if (verboseLevel > 2)
321 if (verboseLevel > 2)
330 size_t shellIndex = SelectRandomShell(Z,photonEnergy);
332 if (verboseLevel > 2)
333 G4cout <<
"Selected shell " << shellIndex <<
" of element " << anElement->
GetName() <<
G4endl;
344 size_t numberOfShells = (size_t) transitionManager->
NumberOfShells(Z);
345 if (shellIndex >= numberOfShells)
346 shellIndex = numberOfShells-1;
358 bindingEnergy = 0.*
eV;
369 if (eKineticEnergy > 0.)
373 cosTheta = SampleElectronDirection(eKineticEnergy);
374 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
376 G4double dirx = sinTheta * std::cos(phi);
377 G4double diry = sinTheta * std::sin(phi);
380 electronDirection.rotateUz(photonDirection);
384 fvect->push_back(electron);
387 bindingEnergy = photonEnergy;
396 if (fAtomDeexcitation && shellIndex<9)
401 size_t nBefore = fvect->size();
403 size_t nAfter = fvect->size();
405 if (nAfter > nBefore)
407 for (
size_t j=nBefore;j<nAfter;j++)
409 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
410 bindingEnergy -= itsEnergy;
412 energyInFluorescence += itsEnergy;
414 energyInAuger += itsEnergy;
423 if (localEnergyDeposit < 0)
426 <<
"G4PenelopePhotoElectricModel::SampleSecondaries() - Negative energy deposit"
428 localEnergyDeposit = 0;
433 if (verboseLevel > 1)
435 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
436 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
437 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
439 G4cout <<
"Incoming photon energy: " << photonEnergy/
keV <<
" keV" <<
G4endl;
440 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
442 G4cout <<
"Outgoing electron " << eKineticEnergy/
keV <<
" keV" <<
G4endl;
443 if (energyInFluorescence)
444 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/
keV <<
" keV" <<
G4endl;
446 G4cout <<
"Auger electrons: " << energyInAuger/
keV <<
" keV" <<
G4endl;
447 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
448 G4cout <<
"Total final state: " <<
449 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/
keV <<
451 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
453 if (verboseLevel > 0)
456 std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger-photonEnergy);
457 if (energyDiff > 0.05*
keV)
459 G4cout <<
"Warning from G4PenelopePhotoElectric: problem with energy conservation: " <<
460 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/
keV
461 <<
" keV (final) vs. " <<
462 photonEnergy/
keV <<
" keV (initial)" << G4endl;
463 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
464 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
465 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
467 G4cout <<
"Incoming photon energy: " << photonEnergy/
keV <<
" keV" <<
G4endl;
468 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
470 G4cout <<
"Outgoing electron " << eKineticEnergy/
keV <<
" keV" <<
G4endl;
471 if (energyInFluorescence)
472 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/
keV <<
" keV" <<
G4endl;
474 G4cout <<
"Auger electrons: " << energyInAuger/
keV <<
" keV" <<
G4endl;
475 G4cout <<
"Local energy deposit " << localEnergyDeposit/
keV <<
" keV" <<
G4endl;
476 G4cout <<
"Total final state: " <<
477 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/
keV <<
479 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
G4int NumberOfShells(G4int Z) const
G4double GetKineticEnergy() const
G4ParticleChangeForGamma * fParticleChange
const G4String & GetName() const
static G4Electron * Definition()
G4double BindingEnergy() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
static constexpr double eV
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeTrackStatus(G4TrackStatus status)
const G4String & GetName() const
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
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
static G4Gamma * Definition()
const G4Material * GetMaterial() const
static G4Gamma * GammaDefinition()