Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PenelopeIonisationCrossSection Class Reference

#include <G4PenelopeIonisationCrossSection.hh>

+ Inheritance diagram for G4PenelopeIonisationCrossSection:

Public Member Functions

 G4PenelopeIonisationCrossSection ()
 Constructor.
 
 ~G4PenelopeIonisationCrossSection ()
 Destructor. Clean all tables.
 
std::vector< G4doubleGetCrossSection (G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)
 
G4double CrossSection (G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)
 
std::vector< G4doubleProbabilities (G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)
 
void SetVerbosityLevel (G4int vl)
 Getter/setter for the verbosity level.
 
G4int GetVerbosityLevel ()
 
- Public Member Functions inherited from G4VhShellCrossSection
 G4VhShellCrossSection (const G4String &xname="")
 
virtual ~G4VhShellCrossSection ()
 
G4int SelectRandomShell (G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)
 
virtual std::vector< G4doubleGetCrossSection (G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)=0
 
virtual G4double CrossSection (G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)=0
 
virtual std::vector< G4doubleProbabilities (G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)=0
 
virtual void SetTotalCS (G4double)
 
const G4StringGetName () const
 

Detailed Description

Definition at line 58 of file G4PenelopeIonisationCrossSection.hh.

Constructor & Destructor Documentation

◆ G4PenelopeIonisationCrossSection()

G4PenelopeIonisationCrossSection::G4PenelopeIonisationCrossSection ( )

Constructor.

NOTICE: working only for e- at the moment (no interface available for e+)

Definition at line 46 of file G4PenelopeIonisationCrossSection.cc.

46 :
47 G4VhShellCrossSection("Penelope"),shellIDTable(0),
48 theCrossSectionHandler(0)
49{
51 nMaxLevels = 9;
52
53 // Verbosity scale:
54 // 0 = nothing
55 // 1 = calculation of cross sections, file openings, sampling of atoms
56 // 2 = entering in methods
57 verboseLevel = 0;
58
59 fLowEnergyLimit = 10.0*eV;
60 fHighEnergyLimit = 100.0*GeV;
61
62 transitionManager = G4AtomicTransitionManager::Instance();
63}
static G4AtomicTransitionManager * Instance()
static G4PenelopeOscillatorManager * GetOscillatorManager()

◆ ~G4PenelopeIonisationCrossSection()

G4PenelopeIonisationCrossSection::~G4PenelopeIonisationCrossSection ( )

Destructor. Clean all tables.

Definition at line 67 of file G4PenelopeIonisationCrossSection.cc.

68{
69 if (theCrossSectionHandler)
70 delete theCrossSectionHandler;
71}

Member Function Documentation

◆ CrossSection()

G4double G4PenelopeIonisationCrossSection::CrossSection ( G4int  Z,
G4AtomicShellEnumerator  shell,
G4double  incidentEnergy,
G4double  mass,
const G4Material mat 
)
virtual

Purely virtual method from the base interface. Returns the cross section for the given shell in the element Z of material mat at the specified energy

Implements G4VhShellCrossSection.

Definition at line 75 of file G4PenelopeIonisationCrossSection.cc.

80{
81 if (verboseLevel > 1)
82 G4cout << "Entering in method G4PenelopeIonisationCrossSection::CrossSection()" << G4endl;
83
84 G4double cross = 0.;
85
86 //Material pointer is not available
87 if (!material)
88 {
89 //CRASH!
91 ed << "The method has been called with a NULL G4Material pointer" << G4endl;
92 G4Exception("G4PenelopeIonisationCrossSection::CrossSection()","em2042",
94 return cross;
95 }
96
97 if (!theCrossSectionHandler)
98 theCrossSectionHandler = new G4PenelopeIonisationXSHandler();
99
100 G4int nmax = std::min(nMaxLevels,transitionManager->NumberOfShells(Z));
101
102 if(G4int(shell) < nmax &&
103 incidentEnergy >= fLowEnergyLimit && incidentEnergy <= fHighEnergyLimit)
104 {
105 //The shells in Penelope are organized per *material*, rather than per
106 //element, so given a material one has to find the proper index for the
107 //given Z and shellID. An appropriate lookup table is used to avoid
108 //recalculation.
109 G4int index = FindShellIDIndex(material,Z,shell);
110
111 //Index is not available!
112 if (index < 0)
113 return cross;
114
115 G4PenelopeCrossSection* theXS =
116 theCrossSectionHandler->GetCrossSectionTableForCouple(G4Electron::Electron(),
117 material,
118 0.);
119
120 //Cross check that everything is fine:
121 G4PenelopeOscillator* theOsc = oscManager->GetOscillatorIonisation(material,index);
122 if (theOsc->GetParentZ() != Z || theOsc->GetShellFlag()-1 != G4int(shell))
123 {
124 //something went wrong!
126 ed << "There is something wrong here: it looks like the index is wrong" << G4endl;
127 ed << "Requested: shell " << G4int(shell) << " and Z = " << Z << G4endl;
128 ed << "Retrieved: " << theOsc->GetShellFlag()-1 << " and Z = " << theOsc->GetParentZ() << G4endl;
129 G4Exception("G4PenelopeIonisationCrossSection::CrossSection()","em2043",
130 JustWarning,ed);
131 return cross;
132 }
133
134
135 G4double crossPerMolecule = (theXS) ? theXS->GetShellCrossSection(index,incidentEnergy) : 0.;
136
137 //Now it must be converted in cross section per atom. I need the number of
138 //atoms of the given Z per molecule.
139 G4double atomsPerMolec = oscManager->GetNumberOfZAtomsPerMolecule(material,Z);
140 if (atomsPerMolec)
141 cross = crossPerMolecule/atomsPerMolec;
142
143
144 if (verboseLevel > 0)
145 {
146 G4cout << "Cross section of shell " << G4int(shell) << " and Z= " << Z;
147 G4cout << " of material: " << material->GetName() << " and energy = " << incidentEnergy/keV << " keV" << G4endl;
148 G4cout << "--> " << cross/barn << " barn" << G4endl;
149 G4cout << "Shell binding energy: " << theOsc->GetIonisationEnergy()/eV << " eV;" ;
150 G4cout << " resonance energy: " << theOsc->GetResonanceEnergy()/eV << "eV" << G4endl;
151 if (verboseLevel > 2)
152 {
153 G4cout << "Cross section per molecule: " << crossPerMolecule/barn << " barn" << G4endl;
154 G4cout << "Atoms " << Z << " per molecule: " << atomsPerMolec << G4endl;
155 }
156 }
157 }
158
159 return cross;
160}
@ JustWarning
@ FatalException
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4double GetShellCrossSection(size_t shellID, G4double energy)
Returns the hard cross section for the given shell (per molecule)
G4PenelopeCrossSection * GetCrossSectionTableForCouple(const G4ParticleDefinition *, const G4Material *, G4double cut)
G4double GetNumberOfZAtomsPerMolecule(const G4Material *, G4int Z)
G4PenelopeOscillator * GetOscillatorIonisation(const G4Material *, G4int)
G4double GetResonanceEnergy() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76

Referenced by GetCrossSection().

◆ GetCrossSection()

std::vector< G4double > G4PenelopeIonisationCrossSection::GetCrossSection ( G4int  Z,
G4double  incidentEnergy,
G4double  mass,
G4double  deltaEnergy,
const G4Material mat 
)
virtual

Purely virtual method from the base interface. Returns the cross section for all levels of element Z in material mat at the given energy

Implements G4VhShellCrossSection.

Definition at line 164 of file G4PenelopeIonisationCrossSection.cc.

168{
169 G4int nmax = std::min(nMaxLevels,transitionManager->NumberOfShells(Z));
170 std::vector<G4double> vec(nmax,0.0);
171 for(G4int i=0; i<nmax; ++i) {
172 vec[i] = CrossSection(Z, G4AtomicShellEnumerator(i), kinEnergy,0.,mat);
173 }
174 return vec;
175}
G4AtomicShellEnumerator
G4double CrossSection(G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat)

Referenced by Probabilities().

◆ GetVerbosityLevel()

G4int G4PenelopeIonisationCrossSection::GetVerbosityLevel ( )
inline

Definition at line 95 of file G4PenelopeIonisationCrossSection.hh.

95{return verboseLevel;};

◆ Probabilities()

std::vector< G4double > G4PenelopeIonisationCrossSection::Probabilities ( G4int  Z,
G4double  incidentEnergy,
G4double  mass,
G4double  deltaEnergy,
const G4Material mat 
)
virtual

Purely virtual method from the base interface. Returns the shell ionisation probabilities for the given Z in the material mat at the specified energy.

Implements G4VhShellCrossSection.

Definition at line 180 of file G4PenelopeIonisationCrossSection.cc.

185{
186 std::vector<G4double> vec = GetCrossSection(Z, kinEnergy,0,0,mat);
187 size_t n = vec.size();
188 size_t i=0;
189 G4double sum = 0.0;
190 for(i=0; i<n; ++i) { sum += vec[i]; }
191 if(sum > 0.0) {
192 sum = 1.0/sum;
193 for(i=0; i<n; ++i) { vec[i] = vec[i]*sum; }
194 }
195 return vec;
196}
std::vector< G4double > GetCrossSection(G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat)

◆ SetVerbosityLevel()

void G4PenelopeIonisationCrossSection::SetVerbosityLevel ( G4int  vl)
inline

Getter/setter for the verbosity level.

Definition at line 94 of file G4PenelopeIonisationCrossSection.hh.

94{verboseLevel = vl;};

The documentation for this class was generated from the following files: