80 anaPIXEshellCS =
nullptr;
81 PIXEshellCS =
nullptr;
82 ePIXEshellCS =
nullptr;
91 delete anaPIXEshellCS;
104 if(!anaPIXEshellCS) {
108 G4cout <<
"### === G4UAtomicDeexcitation::InitialiseForNewRun()" <<
G4endl;
117 if(PIXEshellCS && namePIXExsModel != PIXEshellCS->
GetName())
120 PIXEshellCS =
nullptr;
125 if (namePIXExsModel ==
"ECPSSR_FormFactor")
129 else if(namePIXExsModel ==
"Empirical")
137 if(ePIXEshellCS && namePIXExsElectronModel != ePIXEshellCS->
GetName())
140 ePIXEshellCS =
nullptr;
146 if(namePIXExsElectronModel ==
"Empirical")
150 else if(namePIXExsElectronModel ==
"ECPSSR_Analytical")
154 else if (namePIXExsElectronModel ==
"Penelope")
172 return transitionManager->
Shell(Z,
size_t(shell));
176 std::vector<G4DynamicParticle*>* vectorOfParticles,
187 minGammaEnergy = gammaCut;
188 minElectronEnergy = eCut;
192 G4int provShellId = 0;
212 provShellId = SelectTypeOfTransition(Z, givenShellId);
216 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
222 else if ( provShellId == -1)
225 aParticle = GenerateAuger(Z, givenShellId);
238 provShellId = SelectTypeOfTransition(Z,newShellId);
241 aParticle = GenerateFluorescence(Z,newShellId,provShellId);
244 else if ( provShellId == -1)
247 aParticle = GenerateAuger(Z, newShellId);
258 vectorOfParticles->push_back(aParticle);
261 else {provShellId = -2;}
263 while (provShellId > -2);
284 vacancyArray.push_back(givenShellId);
293 while(!vacancyArray.empty()){
296 givenShellId = vacancyArray[0];
297 provShellId = SelectTypeOfTransition(Z,givenShellId);
302 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
308 else if(provShellId == -1){
309 aParticle = GenerateAuger(Z, givenShellId);
320 vectorOfParticles->push_back(aParticle);
323 vacancyArray.erase(vacancyArray.begin());
350 if(Z > 93 || Z < 6 ) {
return xsec; }
357 if(pdef == theElectron || pdef == thePositron) {
358 xsec = ePIXEshellCS->
CrossSection(Z,shellEnum,kineticEnergy,0.0,mat);
369 mass = proton_mass_c2;
370 escaled = kineticEnergy*mass/(pdef->
GetPDGMass());
380 if(PIXEshellCS) { xsec = PIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat); }
383 xsec = anaPIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat);
387 if (q2) {xsec *= q2;}
394 minGammaEnergy = cut;
399 minElectronEnergy = cut;
413G4int G4UAtomicDeexcitation::SelectTypeOfTransition(
G4int Z,
G4int shellId)
422 G4int provShellId = -1;
432 if ( shellId <= refShell->FinalShellId())
436 if(shellNum ==maxNumOfShells-1)
457 while(transProb < trSize){
461 if(partialProb <= partSum)
484G4UAtomicDeexcitation::GenerateFluorescence(
G4int Z,
G4int shellId,
496 G4double newsinTh = std::sqrt((1.-newcosTh)*(1. + newcosTh));
499 G4double xDir = newsinTh*std::sin(newPhi);
500 G4double yDir = newsinTh*std::cos(newPhi);
509 while (shellId != transitionManager->
510 ReachableShell(Z,shellNum)->FinalShellId())
512 if(shellNum == maxNumOfShells-1)
519 size_t transitionSize = transitionManager->
520 ReachableShell(Z,shellNum)->OriginatingShellIds().size();
526 while (provShellId != transitionManager->
527 ReachableShell(Z,shellNum)->OriginatingShellId(index))
529 if(index == transitionSize-1)
536 G4double transitionEnergy = transitionManager->
537 ReachableShell(Z,shellNum)->TransitionEnergy(index);
539 if (transitionEnergy < minGammaEnergy)
return 0;
543 newShellId = transitionManager->
544 ReachableShell(Z,shellNum)->OriginatingShellId(index);
583 if ( shellId <= refAugerTransition->FinalShellId() )
589 if (shellId != pippo ) {
592 if(shellNum == maxNumOfShells)
606 G4int transitionLoopShellIndex = 0;
614 G4int transitionSize =
616 while (transitionLoopShellIndex < transitionSize) {
618 std::vector<G4int>::const_iterator
pos =
621 G4int transitionLoopShellId = *(
pos+transitionLoopShellIndex);
622 G4int numberOfPossibleAuger =
624 G4int augerIndex = 0;
627 if (augerIndex < numberOfPossibleAuger) {
631 transitionLoopShellId);
635 }
while (augerIndex < numberOfPossibleAuger);
637 transitionLoopShellIndex++;
662 G4double totalVacancyAugerProbability = partSum;
665 G4int transitionRandomShellIndex = 0;
666 G4int transitionRandomShellId = 1;
667 G4int augerIndex = 0;
672 G4int numberOfPossibleAuger = 0;
676 while (transitionRandomShellIndex < transitionSize) {
678 std::vector<G4int>::const_iterator
pos =
681 transitionRandomShellId = *(
pos+transitionRandomShellIndex);
684 numberOfPossibleAuger = (anAugerTransition->
685 AugerTransitionProbabilities(transitionRandomShellId))->size();
687 while (augerIndex < numberOfPossibleAuger) {
689 transitionRandomShellId);
693 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
699 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
break;}
700 transitionRandomShellIndex++;
714 G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
717 G4double xDir = newsinTh*std::sin(newPhi);
718 G4double yDir = newsinTh*std::cos(newPhi);
733 if (transitionEnergy < minElectronEnergy) {
742 newShellId = transitionRandomShellId;
748 vacancyArray.push_back(newShellId);
754 newElectronDirection,
G4GLOB_DLL std::ostream G4cout
static G4int GetNumberOfShells(G4int Z)
G4int NumberOfReachableShells(G4int Z) const
const G4AugerTransition * ReachableAugerShell(G4int Z, G4int shellIndex) const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
const G4FluoTransition * ReachableShell(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
G4int NumberOfReachableAugerShells(G4int Z) const
G4int AugerOriginatingShellId(G4int index, G4int startShellId) const
G4int FinalShellId() const
const G4DataVector * AugerTransitionProbabilities(G4int startShellId) const
G4double AugerTransitionEnergy(G4int index, G4int startShellId) const
const std::vector< G4int > * TransitionOriginatingShellIds() const
G4double AugerTransitionProbability(G4int index, G4int startShellId) const
static G4Electron * Electron()
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
static G4EmParameters * Instance()
const G4String & PIXECrossSectionModel()
const G4String & PIXEElectronCrossSectionModel()
const G4DataVector & TransitionProbabilities() const
G4int OriginatingShellId(G4int index) const
G4double TransitionProbability(G4int index) const
G4int FinalShellId() const
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4Positron * Positron()
void SetCutForSecondaryPhotons(G4double cut)
virtual G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)
virtual ~G4UAtomicDeexcitation()
virtual void InitialiseForExtraAtom(G4int Z)
virtual G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=0)
virtual void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4double gammaCut, G4double eCut)
virtual void InitialiseForNewRun()
void SetCutForAugerElectrons(G4double cut)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)
G4bool IsAugerActive() const
G4bool IsFluoActive() const
G4bool IsAugerCascadeActive() const
G4bool IsPIXEActive() const
virtual G4double CrossSection(G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)=0
const G4String & GetName() const