454{
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487 if (fVerboseLevel > 3)
488 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeIonisationModel" <<
G4endl;
489
492
493 if (kineticEnergy0 <= fIntrinsicLowEnergyLimit)
494 {
497 return ;
498 }
499
502
504
505
506
507 fKineticEnergy1=kineticEnergy0;
508 fCosThetaPrimary=1.0;
509 fEnergySecondary=0.0;
510 fCosThetaSecondary=1.0;
511 fTargetOscillator = -1;
512
514 SampleFinalStateElectron(material,cutE,kineticEnergy0);
516 SampleFinalStatePositron(material,cutE,kineticEnergy0);
517 else
518 {
521 G4Exception(
"G4PenelopeIonisationModel::SamplingSecondaries()",
523
524 }
525 if (fEnergySecondary == 0) return;
526
527 if (fVerboseLevel > 3)
528 {
529 G4cout <<
"G4PenelopeIonisationModel::SamplingSecondaries() for " <<
531 G4cout <<
"Final eKin = " << fKineticEnergy1 <<
" keV" <<
G4endl;
532 G4cout <<
"Final cosTheta = " << fCosThetaPrimary <<
G4endl;
533 G4cout <<
"Delta-ray eKin = " << fEnergySecondary <<
" keV" <<
G4endl;
534 G4cout <<
"Delta-ray cosTheta = " << fCosThetaSecondary <<
G4endl;
535 G4cout <<
"Oscillator: " << fTargetOscillator <<
G4endl;
536 }
537
538
539 G4double sint = std::sqrt(1. - fCosThetaPrimary*fCosThetaPrimary);
541 G4double dirx = sint * std::cos(phiPrimary);
542 G4double diry = sint * std::sin(phiPrimary);
544
546 electronDirection1.rotateUz(particleDirection0);
547
548 if (fKineticEnergy1 > 0)
549 {
552 }
553 else
555
556
557 G4double ionEnergyInPenelopeDatabase =
558 (*theTable)[fTargetOscillator]->GetIonisationEnergy();
559
560
561
562 G4int shFlag = (*theTable)[fTargetOscillator]->GetShellFlag();
563 G4int Z = (
G4int) (*theTable)[fTargetOscillator]->GetParentZ();
564
565
568
570
571 if (Z > 0 && shFlag<30)
572 {
573 shell = transitionManager->
Shell(Z,shFlag-1);
575
576 }
577
578
579
580
581 fEnergySecondary += ionEnergyInPenelopeDatabase-
bindingEnergy;
582
584
587
588 if (fEnergySecondary < 0)
589 {
590
591
592
593
594 localEnergyDeposit += fEnergySecondary;
595 fEnergySecondary = 0.0;
596 }
597
598
599
600
601
602
603 if (fAtomDeexcitation && !fPIXEflag && shell)
604 {
607 {
608 std::size_t nBefore = fvect->size();
610 std::size_t nAfter = fvect->size();
611
612 if (nAfter>nBefore)
613 {
614 for (std::size_t j=nBefore;j<nAfter;++j)
615 {
616 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
617 if (itsEnergy < localEnergyDeposit)
618 {
619 localEnergyDeposit -= itsEnergy;
621 energyInFluorescence += itsEnergy;
623 energyInAuger += itsEnergy;
624 }
625 else
626 {
627 delete (*fvect)[j];
628 (*fvect)[j] = nullptr;
629 }
630 }
631 }
632 }
633 }
634
635
636 if (fEnergySecondary > cutE)
637 {
639 G4double sinThetaE = std::sqrt(1.-fCosThetaSecondary*fCosThetaSecondary);
641 G4double xEl = sinThetaE * std::cos(phiEl);
642 G4double yEl = sinThetaE * std::sin(phiEl);
645 eDirection.rotateUz(particleDirection0);
647 eDirection,fEnergySecondary) ;
648 fvect->push_back(electron);
649 }
650 else
651 {
652 localEnergyDeposit += fEnergySecondary;
653 fEnergySecondary = 0;
654 }
655
656 if (localEnergyDeposit < 0)
657 {
658 G4Exception(
"G4PenelopeIonisationModel::SampleSecondaries()",
659 "em2099",
JustWarning,
"WARNING: Negative local energy deposit");
660 localEnergyDeposit=0.;
661 }
663
664 if (fVerboseLevel > 1)
665 {
666 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
667 G4cout <<
"Energy balance from G4PenelopeIonisation" <<
G4endl;
668 G4cout <<
"Incoming primary energy: " << kineticEnergy0/keV <<
" keV" <<
G4endl;
669 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
670 G4cout <<
"Outgoing primary energy: " << fKineticEnergy1/keV <<
" keV" <<
G4endl;
671 G4cout <<
"Delta ray " << fEnergySecondary/keV <<
" keV" <<
G4endl;
672 if (energyInFluorescence)
673 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
674 if (energyInAuger)
675 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
676 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
677 G4cout <<
"Total final state: " << (fEnergySecondary+energyInFluorescence+fKineticEnergy1+
678 localEnergyDeposit+energyInAuger)/keV <<
680 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
681 }
682
683 if (fVerboseLevel > 0)
684 {
685 G4double energyDiff = std::fabs(fEnergySecondary+energyInFluorescence+fKineticEnergy1+
686 localEnergyDeposit+energyInAuger-kineticEnergy0);
687 if (energyDiff > 0.05*keV)
688 G4cout <<
"Warning from G4PenelopeIonisation: problem with energy conservation: " <<
689 (fEnergySecondary+energyInFluorescence+fKineticEnergy1+localEnergyDeposit+energyInAuger)/keV <<
690 " keV (final) vs. " <<
691 kineticEnergy0/keV <<
" keV (initial)" <<
G4endl;
692 }
693
694}
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 ProposeMomentumDirection(const G4ThreeVector &Pfinal)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
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)