Geant4-11
G4ElectronIonPair.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: G4ElectronIonPair
33//
34// Author: Vladimir Ivanchenko
35//
36// Creation date: 08.07.2008
37//
38// Modifications:
39//
40// -------------------------------------------------------------
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44
45#include "G4ElectronIonPair.hh"
46#include "G4SystemOfUnits.hh"
47#include "G4Material.hh"
48#include "G4MaterialTable.hh"
49#include "G4StepPoint.hh"
50#include "G4VProcess.hh"
51#include "G4ProcessType.hh"
52#include "G4Track.hh"
53#include "Randomize.hh"
54
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56
58{
59 verbose = verb;
60 curMaterial = nullptr;
61 curMeanEnergy = 0.0;
62 nMaterials = 0;
63 invFanoFactor = 1.0/0.2;
64 Initialise();
65}
66
67//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
68
70{}
71
72//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73
75 const G4ParticleDefinition* part,
76 const G4Material* material,
77 G4double edep,
78 G4double niel)
79{
80 G4double nion = 0.0;
81
82 // NIEL does not provide ionisation clusters
83 if(edep > niel) {
84
85 // neutral particles do not produce ionisation along step
86 if(part->GetPDGCharge() != 0.0) {
87
88 // select material
89 if(material != curMaterial) {
91 curMeanEnergy = material->GetIonisation()->GetMeanEnergyPerIonPair();
92
93 // if mean energy is not defined then look into G4 DB
94 if(0.0 == curMeanEnergy) {
96 }
97 }
98 if(curMeanEnergy > 0.0) { nion = (edep - niel)/curMeanEnergy; }
99 }
100 }
101 return nion;
102}
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105
106std::vector<G4ThreeVector>*
108{
109 std::vector<G4ThreeVector>* v = 0;
110
112
113 // sample ionisation along step
114 if(nion > 0) {
115
116 v = new std::vector<G4ThreeVector>;
117 G4ThreeVector prePos = step->GetPreStepPoint()->GetPosition();
118 G4ThreeVector deltaPos = step->GetPostStepPoint()->GetPosition() - prePos;
119 for(G4int i=0; i<nion; ++i) {
120 v->push_back( prePos + deltaPos*G4UniformRand() );
121 }
122 if(verbose > 1 ) {
123 G4cout << "### G4ElectronIonPair::SampleIonisationPoints: "
124 << v->size() << " ion pairs are added" << G4endl;
125 }
126 }
127 return v;
128}
129
130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
131
132G4int
134 const G4TrackVector*,
135 G4int subType) const
136{
137 G4int nholes = 0;
138
139 if(2 == subType || 12 == subType || 13 == subType) { nholes = 1; }
140 return nholes;
141}
142
143//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
144
147{
148 G4String name = mat->GetName();
149 G4double res = 0.0;
150
151 // is this material in the vector?
152 for(G4int j=0; j<nMaterials; j++) {
153 if(name == g4MatNames[j]) {
154 res = g4MatData[j];
156 if(verbose > 0) {
157 G4cout << "### G4ElectronIonPair::FindG4MeanEnergyPerIonPair for "
158 << name << " Epair= " << res/eV << " eV is set"
159 << G4endl;
160 }
161 break;
162 }
163 }
164 return res;
165}
166
167//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
168
170{
173 if(nmat > 0) {
174 G4cout << "### G4ElectronIonPair: mean energy per ion pair available:"
175 << G4endl;
176 for(G4int i=0; i<nmat; ++i) {
177 const G4Material* mat = (*mtable)[i];
179 if(x > 0.0) {
180 G4cout << " " << mat->GetName() << " Epair= "
181 << x/eV << " eV" << G4endl;
182 }
183 }
184 }
185}
186
187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
188
190{
191 if(nMaterials > 0) {
192 G4cout << "### G4ElectronIonPair: mean energy per ion pair "
193 << " for Geant4 materials" << G4endl;
194 for(G4int i=0; i<nMaterials; ++i) {
195 G4cout << " " << g4MatNames[i] << " Epair= "
196 << g4MatData[i]/eV << " eV" << G4endl;
197 }
198 }
199}
200
201//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
202
204{
205 // ICRU Report 31, 1979
206 g4MatNames.push_back("G4_Si");
207 g4MatData.push_back(3.62*eV);
208
209 g4MatNames.push_back("G4_Ge");
210 g4MatData.push_back(2.97*eV);
211
212 g4MatNames.push_back("G4_He");
213 g4MatData.push_back(44.4*eV);
214
215 g4MatNames.push_back("G4_N");
216 g4MatData.push_back(36.4*eV);
217
218 g4MatNames.push_back("G4_O");
219 g4MatData.push_back(32.3*eV);
220
221 g4MatNames.push_back("G4_Ne");
222 g4MatData.push_back(36.8*eV);
223
224 g4MatNames.push_back("G4_Ar");
225 g4MatData.push_back(26.34*eV);
226
227 g4MatNames.push_back("G4_Kr");
228 g4MatData.push_back(24.1*eV);
229
230 g4MatNames.push_back("G4_Xe");
231 g4MatData.push_back(21.6*eV);
232
233 g4MatNames.push_back("G4_lAr");
234 g4MatData.push_back(23.6*eV);
235
236 g4MatNames.push_back("G4_lKr");
237 g4MatData.push_back(20.5*eV);
238
239 g4MatNames.push_back("G4_lXe");
240 g4MatData.push_back(15.6*eV);
241
242 g4MatNames.push_back("G4_AIR");
243 g4MatData.push_back(35.1*eV);
244
245 nMaterials = g4MatData.size();
246}
247
248//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
std::vector< G4Material * > G4MaterialTable
static constexpr double eV
Definition: G4SIunits.hh:201
std::vector< G4Track * > G4TrackVector
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
const G4Material * curMaterial
std::vector< G4String > g4MatNames
G4int SampleNumberOfIonsAlongStep(const G4Step *)
void DumpG4MeanEnergyPerIonPair() const
G4double FindG4MeanEnergyPerIonPair(const G4Material *) const
virtual ~G4ElectronIonPair()
void DumpMeanEnergyPerIonPair() const
G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition *, const G4Material *, G4double edepTotal, G4double edepNIEL=0.0)
G4int ResidualeChargePostStep(const G4ParticleDefinition *, const G4TrackVector *secondary=nullptr, G4int processSubType=-1) const
G4ElectronIonPair(G4int verb)
std::vector< G4double > g4MatData
std::vector< G4ThreeVector > * SampleIonsAlongStep(const G4Step *)
G4double GetMeanEnergyPerIonPair() const
void SetMeanEnergyPerIonPair(G4double value)
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:679
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:222
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:672
const G4String & GetName() const
Definition: G4Material.hh:173
G4double GetPDGCharge() const
const G4ThreeVector & GetPosition() const
Definition: G4Step.hh:62
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
const char * name(G4int ptype)
string material
Definition: eplot.py:19