81 anaPIXEshellCS =
nullptr;
82 PIXEshellCS =
nullptr;
83 ePIXEshellCS =
nullptr;
92 delete anaPIXEshellCS;
105 if(!anaPIXEshellCS) {
109 G4cout <<
"### === G4UAtomicDeexcitation::InitialiseForNewRun()" <<
G4endl;
118 if(PIXEshellCS && namePIXExsModel != PIXEshellCS->
GetName())
121 PIXEshellCS =
nullptr;
126 if (namePIXExsModel ==
"ECPSSR_FormFactor")
130 else if(namePIXExsModel ==
"Empirical")
138 if(ePIXEshellCS && namePIXExsElectronModel != ePIXEshellCS->
GetName())
141 ePIXEshellCS =
nullptr;
147 if(namePIXExsElectronModel ==
"Empirical")
151 else if(namePIXExsElectronModel ==
"ECPSSR_Analytical")
155 else if (namePIXExsElectronModel ==
"Penelope")
173 return transitionManager->
Shell(Z,
size_t(shell));
177 std::vector<G4DynamicParticle*>* vectorOfParticles,
188 minGammaEnergy = gammaCut;
189 minElectronEnergy = eCut;
193 G4int provShellId = 0;
213 provShellId = SelectTypeOfTransition(Z, givenShellId);
217 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
223 else if ( provShellId == -1)
226 aParticle = GenerateAuger(Z, givenShellId);
239 provShellId = SelectTypeOfTransition(Z,newShellId);
242 aParticle = GenerateFluorescence(Z,newShellId,provShellId);
245 else if ( provShellId == -1)
248 aParticle = GenerateAuger(Z, newShellId);
259 vectorOfParticles->push_back(aParticle);
262 else {provShellId = -2;}
264 while (provShellId > -2);
285 vacancyArray.push_back(givenShellId);
294 while(!vacancyArray.empty()){
297 givenShellId = vacancyArray[0];
298 provShellId = SelectTypeOfTransition(Z,givenShellId);
303 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
309 else if(provShellId == -1){
310 aParticle = GenerateAuger(Z, givenShellId);
321 vectorOfParticles->push_back(aParticle);
324 vacancyArray.erase(vacancyArray.begin());
351 if(Z > 93 || Z < 6 ) {
return xsec; }
358 if(pdef == theElectron || pdef == thePositron) {
359 xsec = ePIXEshellCS->
CrossSection(Z,shellEnum,kineticEnergy,0.0,mat);
371 escaled = kineticEnergy*mass/(pdef->
GetPDGMass());
381 if(PIXEshellCS) { xsec = PIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat); }
384 xsec = anaPIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat);
388 if (q2) {xsec *= q2;}
395 minGammaEnergy = cut;
400 minElectronEnergy = cut;
423 G4int provShellId = -1;
433 if ( shellId <= refShell->FinalShellId())
437 if(shellNum ==maxNumOfShells-1)
458 while(transProb < trSize){
462 if(partialProb <= partSum)
485 G4UAtomicDeexcitation::GenerateFluorescence(
G4int Z,
G4int shellId,
497 G4double newsinTh = std::sqrt((1.-newcosTh)*(1. + newcosTh));
500 G4double xDir = newsinTh*std::sin(newPhi);
501 G4double yDir = newsinTh*std::cos(newPhi);
510 while (shellId != transitionManager->
511 ReachableShell(Z,shellNum)->FinalShellId())
513 if(shellNum == maxNumOfShells-1)
520 size_t transitionSize = transitionManager->
521 ReachableShell(Z,shellNum)->OriginatingShellIds().size();
527 while (provShellId != transitionManager->
528 ReachableShell(Z,shellNum)->OriginatingShellId(index))
530 if(index == transitionSize-1)
537 G4double transitionEnergy = transitionManager->
538 ReachableShell(Z,shellNum)->TransitionEnergy(index);
540 if (transitionEnergy < minGammaEnergy)
return 0;
544 newShellId = transitionManager->
545 ReachableShell(Z,shellNum)->OriginatingShellId(index);
584 if ( shellId <= refAugerTransition->FinalShellId() )
590 if (shellId != pippo ) {
593 if(shellNum == maxNumOfShells)
607 G4int transitionLoopShellIndex = 0;
615 G4int transitionSize =
617 while (transitionLoopShellIndex < transitionSize) {
619 std::vector<G4int>::const_iterator
pos =
622 G4int transitionLoopShellId = *(pos+transitionLoopShellIndex);
623 G4int numberOfPossibleAuger =
625 G4int augerIndex = 0;
628 if (augerIndex < numberOfPossibleAuger) {
632 transitionLoopShellId);
636 }
while (augerIndex < numberOfPossibleAuger);
638 transitionLoopShellIndex++;
663 G4double totalVacancyAugerProbability = partSum;
666 G4int transitionRandomShellIndex = 0;
667 G4int transitionRandomShellId = 1;
668 G4int augerIndex = 0;
673 G4int numberOfPossibleAuger = 0;
677 while (transitionRandomShellIndex < transitionSize) {
679 std::vector<G4int>::const_iterator pos =
682 transitionRandomShellId = *(pos+transitionRandomShellIndex);
685 numberOfPossibleAuger = (anAugerTransition->
686 AugerTransitionProbabilities(transitionRandomShellId))->size();
688 while (augerIndex < numberOfPossibleAuger) {
690 transitionRandomShellId);
694 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
700 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
break;}
701 transitionRandomShellIndex++;
715 G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
718 G4double xDir = newsinTh*std::sin(newPhi);
719 G4double yDir = newsinTh*std::cos(newPhi);
734 if (transitionEnergy < minElectronEnergy) {
743 newShellId = transitionRandomShellId;
749 vacancyArray.push_back(newShellId);
755 newElectronDirection,
G4double AugerTransitionProbability(G4int index, G4int startShellId) const
G4int AugerOriginatingShellId(G4int index, G4int startShellId) const
static G4LossTableManager * Instance()
G4bool IsFluoActive() const
static constexpr double proton_mass_c2
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)
G4bool IsPIXEActive() const
const G4AugerTransition * ReachableAugerShell(G4int Z, G4int shellIndex) const
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4int NumberOfReachableShells(G4int Z) const
virtual void InitialiseForExtraAtom(G4int Z)
const G4String & GetName() const
G4double AugerTransitionEnergy(G4int index, G4int startShellId) const
const G4DataVector & TransitionProbabilities() const
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)
const G4String & GetParticleName() const
G4bool IsAugerActive() const
static constexpr double twopi
G4int FinalShellId() const
G4int OriginatingShellId(G4int index) const
virtual void InitialiseForNewRun()
void SetCutForSecondaryPhotons(G4double cut)
G4GLOB_DLL std::ostream G4cout
void SetCutForAugerElectrons(G4double cut)
const G4String & PIXECrossSectionModel()
G4EmCorrections * EmCorrections()
static constexpr double eplus
G4int NumberOfReachableAugerShells(G4int Z) const
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)
static G4Positron * Positron()
G4double GetPDGMass() const
G4double TransitionProbability(G4int index) const
const G4FluoTransition * ReachableShell(G4int Z, size_t shellIndex) const
static G4EmParameters * Instance()
static G4Electron * Electron()
const std::vector< G4int > * TransitionOriginatingShellIds() const
virtual void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4double gammaCut, G4double eCut)
virtual ~G4UAtomicDeexcitation()
const G4DataVector * AugerTransitionProbabilities(G4int startShellId) const
G4double GetPDGCharge() const
G4int FinalShellId() const
static G4AtomicTransitionManager * Instance()
const G4String & PIXEElectronCrossSectionModel()
virtual G4double CrossSection(G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)=0
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
G4bool IsAugerCascadeActive() const
static const G4double pos
static G4int GetNumberOfShells(G4int Z)