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
G4NuclearStopping.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4NuclearStopping.cc
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
// File name: G4NuclearStopping
32
//
33
// Author: Vladimir Ivanchenko
34
//
35
// Creation date: 20 July 2009
36
//
37
// Modified:
38
//
39
// Warning: this class should be instantiated after G4ionIonisation
40
//
41
// -----------------------------------------------------------------------------
42
//
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
46
#include "
G4NuclearStopping.hh
"
47
#include "
G4ICRU49NuclearStoppingModel.hh
"
48
#include "
G4SystemOfUnits.hh
"
49
#include "
G4PhysicalConstants.hh
"
50
51
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
53
using namespace
std;
54
55
G4NuclearStopping::G4NuclearStopping
(
const
G4String
& processName)
56
:
G4VEmProcess
(processName)
57
{
58
isInitialized
=
false
;
59
SetProcessSubType
(
fNuclearStopping
);
60
SetBuildTableFlag
(
false
);
61
enableAlongStepDoIt
=
true
;
62
enablePostStepDoIt
=
false
;
63
}
64
65
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66
67
G4NuclearStopping::~G4NuclearStopping
()
68
{}
69
70
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71
72
G4bool
G4NuclearStopping::IsApplicable
(
const
G4ParticleDefinition
&
p
)
73
{
74
return
(p.
GetPDGCharge
() != 0.0 && !p.
IsShortLived
());
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
void
G4NuclearStopping::InitialiseProcess
(
const
G4ParticleDefinition
*)
80
{
81
if
(!
isInitialized
) {
82
isInitialized
=
true
;
83
84
if
(!
EmModel
(0)) {
SetEmModel
(
new
G4ICRU49NuclearStoppingModel
()); }
85
AddEmModel
(1,
EmModel
());
86
EmModel
()->
SetActivationHighEnergyLimit
(10*
GeV
);
87
EmModel
()->
SetParticleChange
(&
nParticleChange
);
88
}
89
}
90
91
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92
93
G4double
94
G4NuclearStopping::AlongStepGetPhysicalInteractionLength
(
95
const
G4Track
&,
G4double
,
G4double
,
G4double
&,
G4GPILSelection
* selection)
96
{
97
*selection =
NotCandidateForSelection
;
98
return
DBL_MAX
;
99
}
100
101
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102
103
G4VParticleChange
*
G4NuclearStopping::AlongStepDoIt
(
const
G4Track
&
track
,
104
const
G4Step
&
step
)
105
{
106
nParticleChange
.
InitializeForAlongStep
(track);
107
108
// this line only valid if nuclear stopping
109
// is computed after G4ionIonisation process
110
nParticleChange
.
SetProposedCharge
(step.
GetPostStepPoint
()->
GetCharge
());
111
112
G4double
T2
= step.
GetPostStepPoint
()->
GetKineticEnergy
();
113
114
const
G4ParticleDefinition
*
part
= track.
GetParticleDefinition
();
115
G4double
Z
=
std::abs
(part->
GetPDGCharge
()/
eplus
);
116
G4double
massR =
proton_mass_c2
/part->
GetPDGMass
();
117
118
if
(T2 > 0.0 && T2*massR < Z*Z*
MeV
) {
119
120
G4double
length
= step.
GetStepLength
();
121
if
(length > 0.0) {
122
123
// primary
124
G4double
T1
= step.
GetPreStepPoint
()->
GetKineticEnergy
();
125
G4double
T
= 0.5*(T1 +
T2
);
126
const
G4MaterialCutsCouple
* couple = track.
GetMaterialCutsCouple
();
127
G4double
Tscaled = T*massR;
128
G4VEmModel
* mod =
SelectModel
(Tscaled, couple->
GetIndex
());
129
130
// sample stopping
131
if
(mod->
IsActive
(Tscaled)) {
132
G4double
nloss =
133
length*mod->
ComputeDEDXPerVolume
(couple->
GetMaterial
(),
part
,
T
);
134
nloss =
std::min
(nloss, T1);
135
nParticleChange
.
SetProposedKineticEnergy
(T1 - nloss);
136
nParticleChange
.
ProposeLocalEnergyDeposit
(nloss);
137
nParticleChange
.
ProposeNonIonizingEnergyDeposit
(nloss);
138
}
139
}
140
}
141
return
&
nParticleChange
;
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
146
void
G4NuclearStopping::PrintInfo
()
147
{}
148
149
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150
151
void
G4NuclearStopping::ProcessDescription
(std::ostream& out)
const
152
{
153
out <<
" Nuclear stopping"
;
154
G4VEmProcess::ProcessDescription
(out);
155
}
156
157
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
geant4
tree
geant4-10.6-release
source
processes
electromagnetic
standard
src
G4NuclearStopping.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:35
using
1.8.2 with
ECCE GitHub integration