472{
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505 if (verboseLevel > 3)
506 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeIonisationModel" <<
G4endl;
507
510
511 if (kineticEnergy0 <= fIntrinsicLowEnergyLimit)
512 {
515 return ;
516 }
517
520
522
523
524
525 kineticEnergy1=kineticEnergy0;
526 cosThetaPrimary=1.0;
527 energySecondary=0.0;
528 cosThetaSecondary=1.0;
529 targetOscillator = -1;
530
532 SampleFinalStateElectron(material,cutE,kineticEnergy0);
534 SampleFinalStatePositron(material,cutE,kineticEnergy0);
535 else
536 {
539 G4Exception(
"G4PenelopeIonisationModel::SamplingSecondaries()",
541
542 }
543 if (energySecondary == 0) return;
544
545 if (verboseLevel > 3)
546 {
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;
554 }
555
556
557 G4double sint = std::sqrt(1. - cosThetaPrimary*cosThetaPrimary);
559 G4double dirx = sint * std::cos(phiPrimary);
560 G4double diry = sint * std::sin(phiPrimary);
562
564 electronDirection1.rotateUz(particleDirection0);
565
566 if (kineticEnergy1 > 0)
567 {
570 }
571 else
573
574
575
576 G4double ionEnergyInPenelopeDatabase =
577 (*theTable)[targetOscillator]->GetIonisationEnergy();
578
579
580
581 G4int shFlag = (*theTable)[targetOscillator]->GetShellFlag();
582 G4int Z = (
G4int) (*theTable)[targetOscillator]->GetParentZ();
583
584
587
588
590
591 if (Z > 0 && shFlag<30)
592 {
593 shell = transitionManager->
Shell(Z,shFlag-1);
595
596 }
597
598
599
600
601 energySecondary += ionEnergyInPenelopeDatabase-
bindingEnergy;
602
604
607
608 if (energySecondary < 0)
609 {
610
611
612
613
614 localEnergyDeposit += energySecondary;
615 energySecondary = 0.0;
616 }
617
618
619
620
621
622
623 if (fAtomDeexcitation && !fPIXEflag && shell)
624 {
627 {
628 size_t nBefore = fvect->size();
630 size_t nAfter = fvect->size();
631
632 if (nAfter>nBefore)
633 {
634 for (size_t j=nBefore;j<nAfter;j++)
635 {
636 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
637 if (itsEnergy < localEnergyDeposit)
638 {
639 localEnergyDeposit -= itsEnergy;
641 energyInFluorescence += itsEnergy;
643 energyInAuger += itsEnergy;
644 }
645 else
646 {
647 delete (*fvect)[j];
648 (*fvect)[j] = nullptr;
649 }
650
651 }
652 }
653 }
654 }
655
656
657 if (energySecondary > cutE)
658 {
660 G4double sinThetaE = std::sqrt(1.-cosThetaSecondary*cosThetaSecondary);
662 G4double xEl = sinThetaE * std::cos(phiEl);
663 G4double yEl = sinThetaE * std::sin(phiEl);
666 eDirection.rotateUz(particleDirection0);
668 eDirection,energySecondary) ;
669 fvect->push_back(electron);
670 }
671 else
672 {
673 localEnergyDeposit += energySecondary;
674 energySecondary = 0;
675 }
676
677 if (localEnergyDeposit < 0)
678 {
679 G4Exception(
"G4PenelopeIonisationModel::SampleSecondaries()",
680 "em2099",
JustWarning,
"WARNING: Negative local energy deposit");
681 localEnergyDeposit=0.;
682 }
684
685 if (verboseLevel > 1)
686 {
687 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
688 G4cout <<
"Energy balance from G4PenelopeIonisation" <<
G4endl;
689 G4cout <<
"Incoming primary energy: " << kineticEnergy0/keV <<
" keV" <<
G4endl;
690 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
691 G4cout <<
"Outgoing primary energy: " << kineticEnergy1/keV <<
" keV" <<
G4endl;
692 G4cout <<
"Delta ray " << energySecondary/keV <<
" keV" <<
G4endl;
693 if (energyInFluorescence)
694 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
695 if (energyInAuger)
696 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
697 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
698 G4cout <<
"Total final state: " << (energySecondary+energyInFluorescence+kineticEnergy1+
699 localEnergyDeposit+energyInAuger)/keV <<
701 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
702 }
703
704 if (verboseLevel > 0)
705 {
706 G4double energyDiff = std::fabs(energySecondary+energyInFluorescence+kineticEnergy1+
707 localEnergyDeposit+energyInAuger-kineticEnergy0);
708 if (energyDiff > 0.05*keV)
709 G4cout <<
"Warning from G4PenelopeIonisation: problem with energy conservation: " <<
710 (energySecondary+energyInFluorescence+kineticEnergy1+localEnergyDeposit+energyInAuger)/keV <<
711 " keV (final) vs. " <<
712 kineticEnergy0/keV <<
" keV (initial)" <<
G4endl;
713 }
714
715}
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Definition()
static G4Gamma * Definition()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
static G4Positron * Positron()
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)