83 anaPIXEshellCS =
nullptr;
84 PIXEshellCS =
nullptr;
85 ePIXEshellCS =
nullptr;
96 delete anaPIXEshellCS;
109 if(!anaPIXEshellCS) {
113 G4cout <<
"### === G4UAtomicDeexcitation::InitialiseForNewRun()" <<
G4endl;
120 if(PIXEshellCS && namePIXExsModel != PIXEshellCS->
GetName())
123 PIXEshellCS =
nullptr;
128 if (namePIXExsModel ==
"ECPSSR_FormFactor")
132 else if(namePIXExsModel ==
"ECPSSR_ANSTO")
136 else if(namePIXExsModel ==
"Empirical")
143 if(ePIXEshellCS && namePIXExsElectronModel != ePIXEshellCS->
GetName())
146 ePIXEshellCS =
nullptr;
150 if(
nullptr == ePIXEshellCS)
152 if(namePIXExsElectronModel ==
"Empirical")
156 else if(namePIXExsElectronModel ==
"ECPSSR_Analytical")
160 else if (namePIXExsElectronModel ==
"Penelope")
181 return transitionManager->
Shell(Z, (std::size_t)shell);
187 std::vector<G4DynamicParticle*>* vectorOfParticles,
195 minGammaEnergy = gammaCut;
196 minElectronEnergy = eCut;
200 G4int provShellId = 0;
219 provShellId = SelectTypeOfTransition(Z, givenShellId);
224 GenerateFluorescence(Z, givenShellId, provShellId);
226 else if (provShellId == -1)
228 aParticle = GenerateAuger(Z, givenShellId);
235 provShellId = SelectTypeOfTransition(Z,newShellId);
238 aParticle = GenerateFluorescence(Z,newShellId,provShellId);
240 else if ( provShellId == -1)
242 aParticle = GenerateAuger(Z, newShellId);
248 vectorOfParticles->push_back(aParticle);
250 else {provShellId = -2;}
252 while (provShellId > -2);
264 vacancyArray.push_back(givenShellId);
272 while(!vacancyArray.empty()){
274 givenShellId = vacancyArray[0];
275 provShellId = SelectTypeOfTransition(Z,givenShellId);
280 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
282 else if(provShellId == -1){
283 aParticle = GenerateAuger(Z, givenShellId);
287 vectorOfParticles->push_back(aParticle);
290 vacancyArray.erase(vacancyArray.begin());
313 if(Z > 93 || Z < 6 ) {
return xsec; }
317 if(pdef == theElectron || pdef == thePositron) {
318 xsec = ePIXEshellCS->
CrossSection(Z,shellEnum,kineticEnergy,0.0,mat);
328 if (pdg != 2212 && pdg != 1000020040)
330 mass = proton_mass_c2;
331 escaled = kineticEnergy*mass/(pdef->
GetPDGMass());
342 xsec = PIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat);
345 xsec = anaPIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat);
348 if (q2) {xsec *= q2;}
357 minGammaEnergy = cut;
364 minElectronEnergy = cut;
381G4int G4UAtomicDeexcitation::SelectTypeOfTransition(
G4int Z,
G4int shellId)
387 G4int provShellId = -1;
397 if ( shellId <= refShell->FinalShellId())
401 if(shellNum ==maxNumOfShells-1)
422 while(transProb < trSize){
425 if(partialProb <= partSum)
445G4UAtomicDeexcitation::GenerateFluorescence(
G4int Z,
G4int shellId,
455 G4double newsinTh = std::sqrt((1.-newcosTh)*(1. + newcosTh));
458 G4double xDir = newsinTh*std::sin(newPhi);
459 G4double yDir = newsinTh*std::cos(newPhi);
468 while (shellId != transitionManager->
469 ReachableShell(Z,shellNum)->FinalShellId())
471 if(shellNum == maxNumOfShells-1)
478 G4int transitionSize = (
G4int)transitionManager->
479 ReachableShell(Z,shellNum)->OriginatingShellIds().size();
485 while (provShellId != transitionManager->
486 ReachableShell(Z,shellNum)->OriginatingShellId(index))
488 if(index == transitionSize-1)
495 G4double transitionEnergy = transitionManager->
496 ReachableShell(Z,shellNum)->TransitionEnergy(index);
498 if (transitionEnergy < minGammaEnergy)
return nullptr;
502 newShellId = transitionManager->
503 ReachableShell(Z,shellNum)->OriginatingShellId(index);
540 if ( shellId <= refAugerTransition->FinalShellId() )
546 if (shellId != pippo ) {
549 if(shellNum == maxNumOfShells)
562 G4int transitionLoopShellIndex = 0;
569 while (transitionLoopShellIndex < transitionSize) {
571 std::vector<G4int>::const_iterator
pos =
574 G4int transitionLoopShellId = *(
pos+transitionLoopShellIndex);
577 G4int augerIndex = 0;
579 if (augerIndex < numberOfPossibleAuger) {
583 transitionLoopShellId);
587 }
while (augerIndex < numberOfPossibleAuger);
589 ++transitionLoopShellIndex;
592 G4double totalVacancyAugerProbability = partSum;
595 G4int transitionRandomShellIndex = 0;
596 G4int transitionRandomShellId = 1;
597 G4int augerIndex = 0;
601 G4int numberOfPossibleAuger = 0;
604 while (transitionRandomShellIndex < transitionSize) {
606 std::vector<G4int>::const_iterator
pos =
609 transitionRandomShellId = *(
pos+transitionRandomShellIndex);
612 numberOfPossibleAuger = (
G4int)(anAugerTransition->
613 AugerTransitionProbabilities(transitionRandomShellId))->size();
615 while (augerIndex < numberOfPossibleAuger) {
617 transitionRandomShellId);
621 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
627 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
break;}
628 ++transitionRandomShellIndex;
640 G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
643 G4double xDir = newsinTh*std::sin(newPhi);
644 G4double yDir = newsinTh*std::cos(newPhi);
653 if (transitionEnergy < minElectronEnergy) {
659 newShellId = transitionRandomShellId;
664 vacancyArray.push_back(newShellId);
669 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
void Initialise()
needs to be called once from other code before start of run
static G4AtomicTransitionManager * Instance()
G4int NumberOfReachableAugerShells(G4int Z) const
G4int AugerOriginatingShellId(G4int index, G4int startShellId) const
G4int FinalShellId() const
returns the id of the shell in wich the transition electron arrives
const G4DataVector * AugerTransitionProbabilities(G4int startShellId) const
G4double AugerTransitionEnergy(G4int index, G4int startShellId) const
const std::vector< G4int > * TransitionOriginatingShellIds() const
Returns the ids of the shells from wich an electron cuuld fill the vacancy in finalShellId.
G4double AugerTransitionProbability(G4int index, G4int startShellId) const
static G4Electron * Electron()
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition *, const G4Material *, const G4double kineticEnergy)
static G4EmParameters * Instance()
const G4String & PIXECrossSectionModel()
const G4String & PIXEElectronCrossSectionModel()
const G4DataVector & TransitionProbabilities() const
Return the probabilities of the transitions.
G4int OriginatingShellId(G4int index) const
Given the index of the originating shells returns its identity.
G4double TransitionProbability(G4int index) const
G4int FinalShellId() const
Return the identity if the vacancy.
static G4LossTableManager * Instance()
G4EmCorrections * EmCorrections()
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
static G4Positron * Positron()
void SetCutForSecondaryPhotons(G4double cut)
Set threshold energy for fluorescence.
virtual ~G4UAtomicDeexcitation()
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4double gammaCut, G4double eCut) override
generation of deexcitation for given atom, shell vacancy and cuts
G4double GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr) override
access or compute PIXE cross section
void InitialiseForNewRun() override
initialisation methods
void SetCutForAugerElectrons(G4double cut)
Set threshold energy for Auger electron production.
void InitialiseForExtraAtom(G4int Z) override
const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell) override
G4double ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition *, G4int Z, G4AtomicShellEnumerator shell, G4double kinE, const G4Material *mat=nullptr) override
access or compute PIXE cross section
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