87 transitionManager = 0;
94 delete anaPIXEshellCS;
104 G4cout <<
"### === G4UAtomicDeexcitation::InitialiseForNewRun()" <<
G4endl;
131 G4cout <<
"### G4UAtomicDeexcitation::InitialiseForNewRun WARNING "
134 <<
" is unknown, Analytical cross section will be used" <<
G4endl;
185 G4cout <<
"### G4UAtomicDeexcitation::InitialiseForNewRun WARNING "
188 <<
" is unknown, PIXE is disabled" <<
G4endl;
231 return transitionManager->
Shell(Z,
size_t(shell));
235 std::vector<G4DynamicParticle*>* vectorOfParticles,
245 minGammaEnergy = gammaCut;
246 minElectronEnergy = eCut;
253 G4int provShellId = 0;
268 provShellId = SelectTypeOfTransition(Z, givenShellId);
272 aParticle = GenerateFluorescence(Z,givenShellId,provShellId);
275 else if ( provShellId == -1)
277 aParticle = GenerateAuger(Z, givenShellId);
282 G4Exception(
"G4UAtomicDeexcitation::GenerateParticles()",
"de0002",
JustWarning,
"Energy deposited locally");
289 provShellId = SelectTypeOfTransition(Z,newShellId);
292 aParticle = GenerateFluorescence(Z,newShellId,provShellId);
295 else if ( provShellId == -1)
297 aParticle = GenerateAuger(Z, newShellId);
302 G4Exception(
"G4UAtomicDeexcitation::GenerateParticles()",
"de0002",
JustWarning,
"Energy deposited locally");
308 vectorOfParticles->push_back(aParticle);
311 else {provShellId = -2;}
313 while (provShellId > -2);
317 G4Exception(
"G4UAtomicDeexcitation::GenerateParticles()",
"de0001",
JustWarning,
"Energy deposited locally");
338 if(Z > 93 || Z < 6 ) {
return xsec; }
343 if(pdef == theElectron || pdef == thePositron) {
344 xsec = ePIXEshellCS->
CrossSection(Z,shellEnum,kineticEnergy,0.0,mat);
355 mass = proton_mass_c2;
356 escaled = kineticEnergy*mass/(pdef->
GetPDGMass());
366 if(PIXEshellCS) { xsec = PIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat); }
369 xsec = anaPIXEshellCS->
CrossSection(Z,shellEnum,escaled,mass,mat);
373 if (q2) {xsec *= q2;}
380 minGammaEnergy = cut;
385 minElectronEnergy = cut;
399G4int G4UAtomicDeexcitation::SelectTypeOfTransition(
G4int Z,
G4int shellId)
402 G4Exception(
"G4UAtomicDeexcitation::SelecttypeOfTransition()",
"de0002",
JustWarning,
"Energy deposited locally");
407 G4int provShellId = -1;
416 if ( shellId <= refShell->FinalShellId())
420 if(shellNum ==maxNumOfShells-1)
441 while(transProb < trSize){
445 if(partialProb <= partSum)
468G4UAtomicDeexcitation::GenerateFluorescence(
G4int Z,
G4int shellId,
477 G4Exception(
"G4UAtomicDeexcitation::GenerateFluorescence()",
"de0002",
JustWarning,
"Energy deposited locally");
484 G4double newsinTh = std::sqrt((1.-newcosTh)*(1. + newcosTh));
487 G4double xDir = newsinTh*std::sin(newPhi);
488 G4double yDir = newsinTh*std::cos(newPhi);
497 while (shellId != transitionManager->
498 ReachableShell(Z,shellNum)->FinalShellId())
500 if(shellNum == maxNumOfShells-1)
507 size_t transitionSize = transitionManager->
508 ReachableShell(Z,shellNum)->OriginatingShellIds().size();
514 while (provShellId != transitionManager->
515 ReachableShell(Z,shellNum)->OriginatingShellId(index))
517 if(index == transitionSize-1)
524 G4double transitionEnergy = transitionManager->
525 ReachableShell(Z,shellNum)->TransitionEnergy(index);
527 if (transitionEnergy < minGammaEnergy)
return 0;
531 newShellId = transitionManager->
532 ReachableShell(Z,shellNum)->OriginatingShellId(index);
565 if ( shellId <= refAugerTransition->FinalShellId() )
570 if (shellId != pippo ) {
573 if(shellNum == maxNumOfShells)
590 G4int transitionLoopShellIndex = 0;
598 G4int transitionSize =
600 while (transitionLoopShellIndex < transitionSize) {
602 std::vector<G4int>::const_iterator pos =
605 G4int transitionLoopShellId = *(pos+transitionLoopShellIndex);
606 G4int numberOfPossibleAuger =
608 G4int augerIndex = 0;
612 if (augerIndex < numberOfPossibleAuger) {
617 transitionLoopShellId);
621 }
while (augerIndex < numberOfPossibleAuger);
623 transitionLoopShellIndex++;
651 G4double totalVacancyAugerProbability = partSum;
655 G4int transitionRandomShellIndex = 0;
656 G4int transitionRandomShellId = 1;
657 G4int augerIndex = 0;
662 G4int numberOfPossibleAuger = 0;
666 while (transitionRandomShellIndex < transitionSize) {
668 std::vector<G4int>::const_iterator pos =
671 transitionRandomShellId = *(pos+transitionRandomShellIndex);
674 numberOfPossibleAuger = (anAugerTransition->
675 AugerTransitionProbabilities(transitionRandomShellId))->size();
677 while (augerIndex < numberOfPossibleAuger) {
679 transitionRandomShellId);
683 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
689 if (partSum >= (partialProb*totalVacancyAugerProbability) ) {
break;}
690 transitionRandomShellIndex++;
697 if (!foundFlag) {
return 0;}
701 G4double newsinTh = std::sqrt(1.-newcosTh*newcosTh);
704 G4double xDir = newsinTh*std::sin(newPhi);
705 G4double yDir = newsinTh*std::cos(newPhi);
720 if (transitionEnergy < minElectronEnergy) {
727 newShellId = transitionRandomShellId;
730 newElectronDirection,
G4DLLIMPORT 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 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)
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
const G4String & PIXECrossSectionModel() const
void SetPIXECrossSectionModel(const G4String &)
const G4String & PIXEElectronCrossSectionModel() const
void SetPIXEElectronCrossSectionModel(const G4String &)
G4bool IsFluoActive() const
G4bool IsPIXEActive() const
virtual G4double CrossSection(G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)=0
const G4String & GetName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)