ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4ScreenedNuclearRecoil.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4ScreenedNuclearRecoil.hh
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
//
28
//
29
//
30
//
31
// G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp
32
// GEANT4 tag
33
//
34
//
35
//
36
// Class Description
37
// Process for screened electromagnetic nuclear elastic scattering;
38
// Physics comes from:
39
// Marcus H. Mendenhall and Robert A. Weller,
40
// "Algorithms for the rapid computation of classical cross sections
41
// for screened Coulomb collisions "
42
// Nuclear Instruments and Methods in Physics Research B58 (1991) 11-17
43
// The only input required is a screening function phi(r/a) which is the ratio
44
// of the actual interatomic potential for two atoms with atomic numbers Z1 and
45
// Z2,
46
// to the unscreened potential Z1*Z2*e^2/r where e^2 is elm_coupling in Geant4
47
// units
48
// the actual screening tables are computed externally in a python module
49
// "screened_scattering.py"
50
// to allow very specific screening functions to be added if desired, without
51
// messing with the insides of this code.
52
//
53
// First version, April 2004, Marcus H. Mendenhall, Vanderbilt University
54
// May 1, 2008 -- Added code to allow process to have zero cross section above
55
// max energy, to coordinate with G4MSC. -- mhm
56
//
57
// Class Description - End
58
59
60
#ifndef G4ScreenedNuclearRecoil_h
61
#define G4ScreenedNuclearRecoil_h 1
62
63
#include "
globals.hh
"
64
#include "
G4VDiscreteProcess.hh
"
65
#include "
G4ParticleChange.hh
"
66
#include "
c2_function.hh
"
67
68
#include "
G4PhysicalConstants.hh
"
69
#include "
G4SystemOfUnits.hh
"
70
71
#include <map>
72
#include <vector>
73
74
class
G4VNIELPartition
;
75
76
typedef
c2_const_ptr<G4double>
G4_c2_const_ptr
;
77
typedef
c2_ptr<G4double>
G4_c2_ptr
;
78
typedef
c2_function<G4double>
G4_c2_function
;
79
80
typedef
struct
G4ScreeningTables
{
81
G4double
z1
,
z2
,
m1
,
m2
,
au
,
emin
;
82
G4_c2_const_ptr
EMphiData
;
83
}
G4ScreeningTables
;
84
85
// A class for loading ScreenedCoulombCrossSections
86
class
G4ScreenedCoulombCrossSectionInfo
87
{
88
public
:
89
G4ScreenedCoulombCrossSectionInfo
() { }
90
~G4ScreenedCoulombCrossSectionInfo
() { }
91
92
static
const
char
*
CVSHeaderVers
() {
return
93
"G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp GEANT4 tag "
;
94
}
95
static
const
char
*
CVSFileVers
();
96
};
97
98
// A class for loading ScreenedCoulombCrossSections
99
class
G4ScreenedCoulombCrossSection
:
public
G4ScreenedCoulombCrossSectionInfo
100
{
101
public
:
102
103
G4ScreenedCoulombCrossSection
() :
verbosity
(1) { }
104
G4ScreenedCoulombCrossSection
(
const
G4ScreenedCoulombCrossSection
&src) :
105
G4ScreenedCoulombCrossSectionInfo
(),
verbosity
(src.
verbosity
) { }
106
virtual
~G4ScreenedCoulombCrossSection
();
107
108
typedef
std::map<G4int, G4ScreeningTables>
ScreeningMap
;
109
110
// a local, fast-access mapping of a particle's Z to its full definition
111
typedef
std::map<G4int, class G4ParticleDefinition *>
ParticleCache
;
112
113
// LoadData is called by G4ScreenedNuclearRecoil::GetMeanFreePath
114
// It loads the data tables, builds the elemental cross-section tables.
115
virtual
void
LoadData
(
G4String
screeningKey,
G4int
z1
,
G4double
m1,
116
G4double
recoilCutoff) = 0;
117
118
// BuildMFPTables is called by G4ScreenedNuclearRecoil::GetMeanFreePath
119
//to build the MFP tables for each material
120
void
BuildMFPTables
(
void
);
// scan the MaterialsTable and construct MFP
121
//tables
122
123
virtual
G4ScreenedCoulombCrossSection
*
create
() = 0;
124
// a 'virtual constructor' which clones the class
125
const
G4ScreeningTables
*
GetScreening
(
G4int
Z
)
126
{
return
&(
screeningData
[
Z
]); }
127
void
SetVerbosity
(
G4int
v
) {
verbosity
=
v
; }
128
129
// this process needs element selection weighted only by number density
130
G4ParticleDefinition
*
SelectRandomUnweightedTarget
131
(
const
G4MaterialCutsCouple
* couple);
132
133
enum
{
nMassMapElements
=116 };
134
135
G4double
standardmass
(
G4int
z1
)
136
{
return
z1 <=
nMassMapElements
?
massmap
[
z1
] : 2.5*
z1
; }
137
138
// get the mean-free-path table for the indexed material
139
const
G4_c2_function
*
operator []
(
G4int
materialIndex) {
140
return
MFPTables
.find(materialIndex)!=
MFPTables
.end() ?
141
&(
MFPTables
[materialIndex].get()) : (
G4_c2_function
*)0;
142
}
143
144
protected
:
145
ScreeningMap
screeningData
;
// screening tables for each element
146
ParticleCache
targetMap
;
147
G4int
verbosity
;
148
std::map<G4int, G4_c2_const_ptr >
sigmaMap
;
149
// total cross section for each element
150
std::map<G4int, G4_c2_const_ptr >
MFPTables
;
// MFP for each material
151
152
private
:
153
static
const
G4double
massmap
[
nMassMapElements
+1];
154
155
};
156
157
typedef
struct
G4CoulombKinematicsInfo
{
158
G4double
impactParameter
;
159
G4ScreenedCoulombCrossSection
*
crossSection
;
160
G4double
a1
,
a2
,
sinTheta
,
cosTheta
,
sinZeta
,
cosZeta
,
eRecoil
;
161
G4ParticleDefinition
*
recoilIon
;
162
const
G4Material
*
targetMaterial
;
163
}
G4CoulombKinematicsInfo
;
164
165
class
G4ScreenedCollisionStage
{
166
public
:
167
virtual
void
DoCollisionStep
(
class
G4ScreenedNuclearRecoil
*master,
168
const
class
G4Track
& aTrack,
const
class
G4Step
& aStep)=0;
169
virtual
~G4ScreenedCollisionStage
() {}
170
};
171
172
class
G4ScreenedCoulombClassicalKinematics
:
173
public
G4ScreenedCoulombCrossSectionInfo
,
public
G4ScreenedCollisionStage
{
174
175
public
:
176
G4ScreenedCoulombClassicalKinematics
();
177
virtual
void
DoCollisionStep
(
class
G4ScreenedNuclearRecoil
*master,
178
const
class
G4Track
& aTrack,
const
class
G4Step
& aStep);
179
180
G4bool
DoScreeningComputation
(
class
G4ScreenedNuclearRecoil
*master,
181
const
G4ScreeningTables
*screen,
G4double
eps
,
G4double
beta);
182
183
virtual
~G4ScreenedCoulombClassicalKinematics
() { }
184
185
protected
:
186
// the c2_functions we need to do the work.
187
c2_const_plugin_function_p<G4double>
&
phifunc
;
188
c2_linear_p<G4double>
&
xovereps
;
189
G4_c2_ptr
diff
;
190
};
191
192
class
G4SingleScatter
:
public
G4ScreenedCoulombCrossSectionInfo
,
193
public
G4ScreenedCollisionStage
{
194
195
public
:
196
G4SingleScatter
() { }
197
virtual
void
DoCollisionStep
(
class
G4ScreenedNuclearRecoil
*master,
198
const
class
G4Track
& aTrack,
const
class
G4Step
& aStep);
199
virtual
~G4SingleScatter
() {}
200
};
201
207
class
G4ScreenedNuclearRecoil
:
public
G4ScreenedCoulombCrossSectionInfo
,
208
public
G4VDiscreteProcess
209
{
210
public
:
211
212
friend
class
G4ScreenedCollisionStage
;
213
233
234
G4ScreenedNuclearRecoil
(
const
G4String
& processName =
"ScreenedElastic"
,
235
const
G4String
&ScreeningKey=
"zbl"
,
G4bool
GenerateRecoils=1,
236
G4double
RecoilCutoff=100.0*
eV
,
G4double
PhysicsCutoff=10.0*
eV
);
237
239
virtual
~G4ScreenedNuclearRecoil
();
240
242
virtual
G4double
GetMeanFreePath
(
const
G4Track
&,
G4double
,
243
G4ForceCondition
* );
244
246
virtual
G4VParticleChange
*
PostStepDoIt
(
const
G4Track
& aTrack,
247
const
G4Step
& aStep);
250
virtual
G4bool
IsApplicable
(
const
G4ParticleDefinition
& aParticleType);
253
virtual
void
BuildPhysicsTable
(
const
G4ParticleDefinition
& aParticleType);
256
virtual
void
DumpPhysicsTable
(
const
G4ParticleDefinition
& aParticleType);
262
263
virtual
G4bool
CheckNuclearCollision
(
G4double
A
,
G4double
A1,
264
G4double
apsis);
// return true if hard collision
265
266
virtual
G4ScreenedCoulombCrossSection
*
GetNewCrossSectionHandler
(
void
);
267
269
G4double
GetNIEL
()
const
{
return
NIEL
; }
270
272
void
ResetTables
();
273
// clear all data tables to allow changing energy cutoff, materials, etc.
274
285
286
void
SetMaxEnergyForScattering
(
G4double
energy
) {
processMaxEnergy
=
energy
;}
287
289
std::string
GetScreeningKey
()
const
{
return
screeningKey
; }
290
294
295
void
AllowEnergyDeposition
(
G4bool
flag) {
registerDepositedEnergy
=flag;}
296
298
G4bool
GetAllowEnergyDeposition
()
const
{
return
registerDepositedEnergy
;}
299
306
307
void
EnableRecoils
(
G4bool
flag) {
generateRecoils
=flag; }
308
310
G4bool
GetEnableRecoils
()
const
{
return
generateRecoils
; }
311
317
318
void
SetMFPScaling
(
G4double
scale
) {
MFPScale
=
scale
; }
319
321
G4double
GetMFPScaling
()
const
{
return
MFPScale
; }
322
329
330
void
AvoidNuclearReactions
(
G4bool
flag) {
avoidReactions
=flag; }
331
333
G4bool
GetAvoidNuclearReactions
()
const
{
return
avoidReactions
; }
334
339
340
void
SetRecoilCutoff
(
G4double
energy
) {
recoilCutoff
=
energy
; }
341
343
G4double
GetRecoilCutoff
()
const
{
return
recoilCutoff
; }
344
348
349
void
SetPhysicsCutoff
(
G4double
energy
) {
physicsCutoff
=
energy
;
350
ResetTables
(); }
351
353
G4double
GetPhysicsCutoff
()
const
{
return
physicsCutoff
; }
354
357
358
void
SetNIELPartitionFunction
(
const
G4VNIELPartition
*
part
);
359
366
367
void
SetCrossSectionHardening
(
G4double
fraction,
G4double
HardeningFactor){
368
hardeningFraction
=fraction;
369
hardeningFactor
=HardeningFactor;
370
}
371
373
G4double
GetHardeningFraction
()
const
{
return
hardeningFraction
; }
374
376
G4double
GetHardeningFactor
()
const
{
return
hardeningFactor
; }
377
379
G4double
GetCurrentInteractionLength
()
const
{
380
return
currentInteractionLength
; }
381
385
386
void
SetExternalCrossSectionHandler
(
G4ScreenedCoulombCrossSection
*cs) {
387
externalCrossSectionConstructor
=cs;
388
}
389
391
G4int
GetVerboseLevel
()
const
{
return
verboseLevel
; }
392
393
std::map<G4int, G4ScreenedCoulombCrossSection*> &
GetCrossSectionHandlers
()
394
{
return
crossSectionHandlers
; }
395
396
void
ClearStages
(
void
);
397
398
void
AddStage
(
G4ScreenedCollisionStage
*stage) {
399
collisionStages
.push_back(stage); }
400
401
G4CoulombKinematicsInfo
&
GetKinematics
() {
return
kinematics
; }
402
403
void
SetValidCollision
(
G4bool
flag) {
validCollision
=flag; }
404
405
G4bool
GetValidCollision
()
const
{
return
validCollision
; }
406
409
class
G4ParticleChange
&
GetParticleChange
()
410
{
return
static_cast<
G4ParticleChange
&
>
(*pParticleChange); }
411
414
415
void
DepositEnergy
(
G4int
z1
,
G4double
a1,
const
G4Material
*
material
,
416
G4double
energy
);
417
418
protected
:
420
G4double
highEnergyLimit
;
421
423
G4double
lowEnergyLimit
;
424
427
G4double
processMaxEnergy
;
428
G4String
screeningKey
;
429
G4bool
generateRecoils
,
avoidReactions
;
430
G4double
recoilCutoff
,
physicsCutoff
;
431
G4bool
registerDepositedEnergy
;
432
G4double
IonizingLoss
,
NIEL
;
433
G4double
MFPScale
;
434
G4double
hardeningFraction
,
hardeningFactor
;
435
436
G4ScreenedCoulombCrossSection
*
externalCrossSectionConstructor
;
437
std::vector<G4ScreenedCollisionStage *>
collisionStages
;
438
439
std::map<G4int, G4ScreenedCoulombCrossSection*>
crossSectionHandlers
;
440
441
G4bool
validCollision
;
442
G4CoulombKinematicsInfo
kinematics
;
443
const
G4VNIELPartition
*
NIELPartitionFunction
;
444
};
445
446
// A customized G4CrossSectionHandler which gets its data from
447
// an external program
448
449
class
G4NativeScreenedCoulombCrossSection
:
public
G4ScreenedCoulombCrossSection
450
{
451
public
:
452
G4NativeScreenedCoulombCrossSection
();
453
454
G4NativeScreenedCoulombCrossSection
(
455
const
G4NativeScreenedCoulombCrossSection
&src)
456
:
G4ScreenedCoulombCrossSection
(src),
phiMap
(src.
phiMap
) { }
457
458
G4NativeScreenedCoulombCrossSection
(
459
const
G4ScreenedCoulombCrossSection
&src)
460
:
G4ScreenedCoulombCrossSection
(src) { }
461
462
virtual
~G4NativeScreenedCoulombCrossSection
();
463
464
virtual
void
LoadData
(
G4String
screeningKey,
G4int
z1
,
G4double
m1,
465
G4double
recoilCutoff);
466
467
virtual
G4ScreenedCoulombCrossSection
*
create
()
468
{
return
new
G4NativeScreenedCoulombCrossSection
(*
this
); }
469
470
// get a list of available keys
471
std::vector<G4String>
GetScreeningKeys
()
const
;
472
473
typedef
G4_c2_function
&(*ScreeningFunc)(
G4int
z1
,
G4int
z2
,
474
size_t
nPoints,
G4double
rMax,
G4double
*au);
475
476
void
AddScreeningFunction
(
G4String
name
,
ScreeningFunc
fn) {
477
phiMap
[
name
]=fn;
478
}
479
480
private
:
481
// this is a map used to look up screening function generators
482
std::map<std::string, ScreeningFunc>
phiMap
;
483
};
484
485
G4_c2_function
&
ZBLScreening
(
G4int
z1
,
G4int
z2
,
size_t
npoints,
486
G4double
rMax,
G4double
*auval);
487
488
G4_c2_function
&
MoliereScreening
(
G4int
z1
,
G4int
z2
,
size_t
npoints,
489
G4double
rMax,
G4double
*auval);
490
491
G4_c2_function
&
LJScreening
(
G4int
z1
,
G4int
z2
,
size_t
npoints,
492
G4double
rMax,
G4double
*auval);
493
494
G4_c2_function
&
LJZBLScreening
(
G4int
z1
,
G4int
z2
,
size_t
npoints,
495
G4double
rMax,
G4double
*auval);
496
497
#endif
geant4
tree
geant4-10.6-release
examples
extended
electromagnetic
TestEm7
include
G4ScreenedNuclearRecoil.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:03
using
1.8.2 with
ECCE GitHub integration