Geant4-11
G4PEEffectFluoModel.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// -------------------------------------------------------------------
28//
29// GEANT4 Class file
30//
31//
32// File name: G4PEEffectFluoModel
33//
34// Author: Vladimir Ivanchenko on base of G4PEEffectModel
35//
36// Creation date: 13.06.2010
37//
38// Modifications:
39//
40// Class Description:
41// Implementation of the photo-electric effect with deexcitation
42//
43// -------------------------------------------------------------------
44//
45//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47
50#include "G4SystemOfUnits.hh"
51#include "G4Electron.hh"
52#include "G4Gamma.hh"
53#include "Randomize.hh"
54#include "G4Material.hh"
55#include "G4DataVector.hh"
58#include "G4LossTableManager.hh"
60
61//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62
63using namespace std;
64
66 : G4VEmModel(nam)
67{
72 fParticleChange = nullptr;
73 fAtomDeexcitation = nullptr;
74
75 fSandiaCof.resize(4,0.0);
76
77 // default generator
79}
80
81//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
82
84{}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
87
89 const G4DataVector&)
90{
92 if(nullptr == fParticleChange) {
94 }
96 fMatEnergyTh.resize(nmat, 0.0);
97 for(size_t i=0; i<nmat; ++i) {
99 ->GetSandiaTable()->GetSandiaCofForMaterial(0, 0);
100 //G4cout << "G4PEEffectFluoModel::Initialise Eth(eV)= "
101 // << fMatEnergyTh[i]/eV << G4endl;
102 }
103}
104
105//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
106
112{
113 // This method may be used only if G4MaterialCutsCouple pointer
114 // has been set properly
117
118 G4double x1 = 1 / energy;
119
120 return x1 * (fSandiaCof[0] + x1 * (fSandiaCof[1] +
121 x1 * (fSandiaCof[2] + x1 * fSandiaCof[3])));
122}
123
124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
125
131{
132 // This method may be used only if G4MaterialCutsCouple pointer
133 // has been set properly
134 energy = std::max(energy, fMatEnergyTh[material->GetIndex()]);
135 const G4double* SandiaCof =
136 material->GetSandiaTable()->GetSandiaCofForMaterial(energy);
137
138 G4double x1 = 1 / energy;
139
140 return x1 * (SandiaCof[0] + x1 * (SandiaCof[1] +
141 x1 * (SandiaCof[2] + x1 * SandiaCof[3])));
142}
143
144//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
145
146void
147G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
148 const G4MaterialCutsCouple* couple,
149 const G4DynamicParticle* aDynamicPhoton,
150 G4double,
151 G4double)
152{
153 SetCurrentCouple(couple);
154 const G4Material* aMaterial = couple->GetMaterial();
155
156 G4double energy = aDynamicPhoton->GetKineticEnergy();
157
158 // select randomly one element constituing the material.
159 const G4Element* anElement = SelectRandomAtom(aMaterial,theGamma,energy);
160
161 //
162 // Photo electron
163 //
164
165 // Select atomic shell
166 G4int nShells = anElement->GetNbOfAtomicShells();
167 G4int i = 0;
168 for(; i<nShells; ++i) {
169 /*
170 G4cout << "i= " << i << " E(eV)= " << energy/eV
171 << " Eb(eV)= " << anElement->GetAtomicShell(i)/eV
172 << " " << anElement->GetName()
173 << G4endl;
174 */
175 if(energy >= anElement->GetAtomicShell(i)) { break; }
176 }
177
178 G4double edep = energy;
179
180 // Normally one shell is available
181 if (i < nShells) {
182
183 G4double bindingEnergy = anElement->GetAtomicShell(i);
184 edep = bindingEnergy;
185 G4double esec = 0.0;
186
187 // sample deexcitation
188 //
190 G4int index = couple->GetIndex();
192 G4int Z = G4lrint(anElement->GetZ());
194 const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
195 G4double eshell = shell->BindingEnergy();
196 if(eshell > bindingEnergy && eshell <= energy) {
197 bindingEnergy = eshell;
198 edep = eshell;
199 }
200 G4int nbefore = fvect->size();
201 fAtomDeexcitation->GenerateParticles(fvect, shell, Z, index);
202 G4int nafter = fvect->size();
203 for (G4int j=nbefore; j<nafter; ++j) {
204 G4double e = ((*fvect)[j])->GetKineticEnergy();
205 if(esec + e > edep) {
206 // correct energy in order to have energy balance
207 e = edep - esec;
208 ((*fvect)[j])->SetKineticEnergy(e);
209 esec += e;
210 /*
211 G4cout << "### G4PEffectFluoModel Edep(eV)= " << edep/eV
212 << " Esec(eV)= " << esec/eV
213 << " E["<< j << "](eV)= " << e/eV
214 << " N= " << nafter
215 << " Z= " << Z << " shell= " << i
216 << " Ebind(keV)= " << bindingEnergy/keV
217 << " Eshell(keV)= " << shell->BindingEnergy()/keV
218 << G4endl;
219 */
220 // delete the rest of secondaries (should not happens)
221 for (G4int jj=nafter-1; jj>j; --jj) {
222 delete (*fvect)[jj];
223 fvect->pop_back();
224 }
225 break;
226 }
227 esec += e;
228 }
229 edep -= esec;
230 }
231 }
232 // create photo electron
233 //
234 G4double elecKineEnergy = energy - bindingEnergy;
235 if (elecKineEnergy > fminimalEnergy) {
237 GetAngularDistribution()->SampleDirection(aDynamicPhoton,
238 elecKineEnergy,
239 i, couple->GetMaterial()),
240 elecKineEnergy);
241 fvect->push_back(aParticle);
242 } else {
243 edep += elecKineEnergy;
244 elecKineEnergy = 0.0;
245 }
246 if(std::abs(energy - elecKineEnergy - esec - edep) > CLHEP::eV) {
247 G4cout << "### G4PEffectFluoModel dE(eV)= "
248 << (energy - elecKineEnergy - esec - edep)/eV
249 << " shell= " << i
250 << " E(keV)= " << energy/keV
251 << " Ebind(keV)= " << bindingEnergy/keV
252 << " Ee(keV)= " << elecKineEnergy/keV
253 << " Esec(keV)= " << esec/keV
254 << " Edep(keV)= " << edep/keV
255 << G4endl;
256 }
257 }
258
259 // kill primary photon
262 if(edep > 0.0) {
264 }
265}
266
267//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4AtomicShellEnumerator
static constexpr double keV
Definition: G4SIunits.hh:202
static constexpr double eV
Definition: G4SIunits.hh:201
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double BindingEnergy() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
Definition: G4Electron.cc:93
G4double GetZ() const
Definition: G4Element.hh:131
G4int GetNbOfAtomicShells() const
Definition: G4Element.hh:147
G4double GetAtomicShell(G4int index) const
Definition: G4Element.cc:366
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:679
G4SandiaTable * GetSandiaTable() const
Definition: G4Material.hh:225
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:672
G4VAtomDeexcitation * fAtomDeexcitation
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4ParticleDefinition * theGamma
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4ParticleDefinition * theElectron
std::vector< G4double > fSandiaCof
std::vector< G4double > fMatEnergyTh
G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) override
G4ParticleChangeForGamma * fParticleChange
G4PEEffectFluoModel(const G4String &nam="PhotoElectric")
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double, G4double) override
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector< G4double > &coeff) const
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:621
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:123
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:472
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:580
void SetDeexcitationFlag(G4bool val)
Definition: G4VEmModel.hh:823
void SetAngularDistribution(G4VEmAngularDistribution *)
Definition: G4VEmModel.hh:628
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:490
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double eV
G4double energy(const ThreeVector &p, const G4double m)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double bindingEnergy(G4int A, G4int Z)
string material
Definition: eplot.py:19
int G4lrint(double ad)
Definition: templates.hh:134