Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNADiracRMatrixExcitationModel.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// Created on 2016/05/02
27//
28// Authors: D Sakata, S. Incerti
29//
30// This class perform electric excitation for electron transportation in gold,
31// based on Dirac B-Spline R-Matrix method with scaled experimental data
32// for low energy.
33// See following reference paper
34// Phys.Rev.A77,062711(2008) and Phys.Rev.A78,042713(2008)
35
37#include "G4SystemOfUnits.hh"
39#include "G4LossTableManager.hh"
40#include "G4Gamma.hh"
41#include "G4RandomDirection.hh"
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
44
45using namespace std;
46
47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48
50(const G4ParticleDefinition*,const G4String& nam) :
51 G4VEmModel(nam), isInitialised(false), fTableData(0)
52{
53 fpMaterialDensity = 0;
54 fHighEnergyLimit = 0;
55 fExperimentalEnergyLimit= 0;
56 fLowEnergyLimit = 0;
57 fParticleDefinition = 0;
58
59 verboseLevel = 0;
60
61 if (verboseLevel > 0)
62 {
63 G4cout << "Dirac R-matrix excitation model is constructed " << G4endl;
64 }
65
67 statCode = false;
68}
69
70//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
71
73{
74 if (fTableData) delete fTableData;
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78
80(const G4ParticleDefinition* particle,const G4DataVector& /*cuts*/)
81{
82
83 if (verboseLevel > 3)
84 {
85 G4cout <<
86 "Calling G4DNADiracRMatrixExcitationModel::Initialise()"
87 << G4endl;
88 }
89
90 fParticleDefinition = particle;
91
92 if(particle->GetParticleName() == "e-")
93 {
94 fTableFile = "dna/sigma_excitation_e_diracrmatrix_Z79";
95 fLowEnergyLimit = 10 * eV;
96 fExperimentalEnergyLimit = 577.* eV;
97 fHighEnergyLimit = 1.0 * GeV;
98 }
99 else
100 {
101 G4Exception("G4DNADiracRMatrixExcitationModel::Initialise","em0001",
102 FatalException,"Not defined for other particles than electrons.");
103 return;
104 }
105
106 G4double scaleFactor = 1. * cm * cm;
107 fTableData = new G4DNACrossSectionDataSet
108 (new G4LogLogInterpolation,eV,scaleFactor );
109 fTableData->LoadData(fTableFile);
110
111 if( verboseLevel>0 )
112 {
113 G4cout << "Dirac R-matrix excitation model is initialized " << G4endl
114 << "Energy range: "
115 << LowEnergyLimit() / eV << " eV - "<< HighEnergyLimit() / keV << " keV "
116 << " for "<< particle->GetParticleName()
117 << G4endl;
118 }
119
120 if (isInitialised){return;}
122 isInitialised = true;
123}
124
125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126
128 (const G4Material* material,
129 const G4ParticleDefinition* particleDefinition,
130 G4double ekin,
131 G4double,
132 G4double)
133{
134 if (verboseLevel > 3)
135 {
136 G4cout <<
137 "Calling CrossSectionPerVolume() of G4DNADiracRMatrixExcitationModel"
138 << G4endl;
139 }
140
141 G4double atomicNDensity = material->GetAtomicNumDensityVector()[0];
142
143 // Protection: for single element
144 if(material->GetNumberOfElements()>1) return 0.;
145
146 G4double z = material->GetZ();
147
148 // Protection: for Gold
149 if(z!=79){return 0.;}
150
151 G4double sigma=0.;
152
153 if(atomicNDensity!= 0.0)
154 {
155 if (ekin >= fLowEnergyLimit && ekin < fExperimentalEnergyLimit)
156 {
157 sigma = fTableData->FindValue(ekin);
158 }
159 else if ((fExperimentalEnergyLimit <= ekin) && (ekin < fHighEnergyLimit))
160 {
161 sigma = GetExtendedTotalCrossSection(material,particleDefinition,ekin);
162 }
163
164 if (verboseLevel > 2)
165 {
166 G4cout<<"__________________________________" << G4endl;
167 G4cout<<"=== G4DNADiracRMatrixExcitationModel - XS INFO START"<<G4endl;
168 G4cout<<"=== Kinetic energy (eV)=" << ekin/eV << " particle : "
169 <<particleDefinition->GetParticleName() << G4endl;
170 G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^2)"
171 <<sigma/cm/cm << G4endl;
172 G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^-1)="
173 <<sigma*atomicNDensity/(1./cm) << G4endl;
174 G4cout<<"=== G4DNADiracRMatrixExcitationModel - XS INFO END"<<G4endl;
175 }
176 }
177
178 return sigma*atomicNDensity;
179}
180
181//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
182
184 (std::vector<G4DynamicParticle*>* /*fvect*/,
185 const G4MaterialCutsCouple* couple,
186 const G4DynamicParticle* aDynamicParticle,
188{
189
190 if (verboseLevel > 3)
191 {
192 G4cout <<
193 "Calling SampleSecondaries() of G4DNADiracRMatrixExcitationModel"
194 << G4endl;
195 }
196
197 G4ParticleDefinition* particle = aDynamicParticle->GetDefinition();
198 G4double k = aDynamicParticle->GetKineticEnergy();
199
200 G4int level = RandomSelect(couple->GetMaterial(),particle,
201 k);
202 G4double excitationEnergy = ExcitationEnergyAu[level]*eV;
203 G4double newEnergy = k - excitationEnergy;
204
205 if (newEnergy > 0)
206 {
207 //Energy Loss
209 (aDynamicParticle->GetMomentumDirection());
211 if(!statCode) fParticleChangeForGamma->SetProposedKineticEnergy(newEnergy);
213 }
214}
215
216//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217
219 (const G4Material* material,
220 const G4ParticleDefinition* particle,
221 G4double kineticEnergy)
222{
223 G4double value=0;
224
225 size_t N=fTableData->NumberOfComponents();
226
227 for(int i=0;i<(int)N;i++){
228 value = value+GetExtendedPartialCrossSection(material,i,particle,
229 kineticEnergy);
230 }
231
232 return value;
233}
234
235//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
236
238 (const G4Material*,
239 G4int level,
240 const G4ParticleDefinition* particle,
241 G4double kineticEnergy)
242{
243 G4double value=0;
244
245 if(particle->GetParticleName()=="e-"){
246
247 if(level==0){
248 // y = [0]+[1]/pow(x-2,2)
249 value = paramFuncTCS_5dto6s1[0]+paramFuncTCS_5dto6s1[1]
250 /std::pow(kineticEnergy/eV-paramFuncTCS_5dto6s1[2],2);
251 }
252 else if(level==1){
253 // y = [0]+[1]/pow(x-2,2)
254 value = paramFuncTCS_5dto6s2[0]+paramFuncTCS_5dto6s2[1]
255 /std::pow(kineticEnergy/eV-paramFuncTCS_5dto6s2[2],2);
256 }
257 else if(level==2){
258 // y = [0]+[1]*log(x-2)/(x-[2])
259 value = paramFuncTCS_6sto6p1[0]+paramFuncTCS_6sto6p1[1]
260 *G4Log(kineticEnergy/eV-paramFuncTCS_6sto6p1[2])
261 /(kineticEnergy/eV-paramFuncTCS_6sto6p1[2]);
262 }
263 else if(level==3){
264 // y = [0]+[1]*log(x-2)/(x-[2])
265 value = paramFuncTCS_6sto6p2[0]+paramFuncTCS_6sto6p2[1]
266 *G4Log(kineticEnergy/eV-paramFuncTCS_6sto6p2[2])
267 /(kineticEnergy/eV-paramFuncTCS_6sto6p2[2]);
268 }
269 }
270
271 return value*cm*cm;
272}
273
274//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
275
276G4int G4DNADiracRMatrixExcitationModel::RandomSelect
277 (const G4Material* material,
278 const G4ParticleDefinition* particle,
279 G4double kineticEnergy)
280{
281 G4double value = 0.;
282
283 std::size_t NOfComp = fTableData->NumberOfComponents();
284
285 auto valuesBuffer = new G4double[NOfComp];
286
287 const G4int n = (G4int)fTableData->NumberOfComponents();
288
289 G4int i(n);
290
291 while (i > 0)
292 {
293 --i;
294 if
295 ((fLowEnergyLimit<=kineticEnergy)&&(kineticEnergy<fExperimentalEnergyLimit))
296 {
297 valuesBuffer[i] = fTableData->GetComponent(i)->FindValue(kineticEnergy);
298 }
299 else if
300 ((fExperimentalEnergyLimit<=kineticEnergy)&&(kineticEnergy<fHighEnergyLimit))
301 {
302 valuesBuffer[i]
303 = GetExtendedPartialCrossSection(material,i,particle,kineticEnergy);
304 }
305 value += valuesBuffer[i];
306 }
307 value *= G4UniformRand();
308 i = n;
309 while (i > 0)
310 {
311 --i;
312 if (valuesBuffer[i] > value)
313 {
314 delete[] valuesBuffer;
315 return i;
316 }
317 value -= valuesBuffer[i];
318 }
319 if (valuesBuffer) delete[] valuesBuffer;
320 return 9999;
321}
322
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
G4double G4Log(G4double x)
Definition: G4Log.hh:227
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
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual size_t NumberOfComponents(void) const
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
virtual G4bool LoadData(const G4String &argFileName)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4DNADiracRMatrixExcitationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNADiracRMatrixExcitationModel")
virtual G4double GetExtendedTotalCrossSection(const G4Material *material, const G4ParticleDefinition *, G4double kineticEnergy)
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
virtual G4double GetExtendedPartialCrossSection(const G4Material *material, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4Material * GetMaterial() const
G4double GetZ() const
Definition: G4Material.cc:745
size_t GetNumberOfElements() const
Definition: G4Material.hh:181
const G4double * GetAtomicNumDensityVector() const
Definition: G4Material.hh:211
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
const G4String & GetParticleName() const
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:124
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
#define N
Definition: crc32.c:56