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
G4HadronicProcess.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4HadronicProcess.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
//
26
//
27
// -------------------------------------------------------------------
28
//
29
// GEANT4 Class header file
30
//
31
// G4HadronicProcess
32
//
33
// This is the top level Hadronic Process class
34
// The inelastic, elastic, capture, and fission processes
35
// should derive from this class
36
//
37
// original by H.P.Wellisch
38
// J.L. Chuma, TRIUMF, 10-Mar-1997
39
// Last modified: 04-Apr-1997
40
// 19-May-2008 V.Ivanchenko cleanup and added comments
41
// 05-Jul-2010 V.Ivanchenko cleanup commented lines
42
// 28-Jul-2012 M.Maire add function GetTargetDefinition()
43
// 14-Sep-2012 Inherit from RestDiscrete, use subtype code (now in ctor) to
44
// configure base-class
45
// 28-Sep-2012 M. Kelsey -- Undo inheritance change, keep new ctor
46
47
#ifndef G4HadronicProcess_h
48
#define G4HadronicProcess_h 1
49
50
#include "
globals.hh
"
51
#include "
G4VDiscreteProcess.hh
"
52
#include "
G4EnergyRangeManager.hh
"
53
#include "
G4Nucleus.hh
"
54
#include "
G4ReactionProduct.hh
"
55
#include "
G4HadronicProcessType.hh
"
56
#include "
G4CrossSectionDataStore.hh
"
57
#include <vector>
58
59
class
G4Track
;
60
class
G4Step
;
61
class
G4Element
;
62
class
G4ParticleChange
;
63
class
G4HadronicInteraction
;
64
class
G4HadronicProcessStore
;
65
class
G4VCrossSectionDataSet
;
66
class
G4VLeadingParticleBiasing
;
67
68
class
G4HadronicProcess
:
public
G4VDiscreteProcess
69
{
70
public
:
71
G4HadronicProcess
(
const
G4String
& processName=
"Hadronic"
,
72
G4ProcessType
procType=
fHadronic
);
73
74
// Preferred signature for subclasses, specifying their subtype here
75
G4HadronicProcess
(
const
G4String
& processName,
76
G4HadronicProcessType
subType);
77
78
~G4HadronicProcess
()
override
;
79
80
// register generator of secondaries
81
void
RegisterMe
(
G4HadronicInteraction
*
a
);
82
83
// get cross section per element
84
G4double
GetElementCrossSection
(
const
G4DynamicParticle
*
part
,
85
const
G4Element
* elm,
86
const
G4Material
*
mat
=
nullptr
);
87
88
// obsolete method to get cross section per element
89
inline
90
G4double
GetMicroscopicCrossSection
(
const
G4DynamicParticle
* part,
91
const
G4Element
* elm,
92
const
G4Material
*
mat
=
nullptr
)
93
{
return
GetElementCrossSection
(part, elm,
mat
); }
94
95
// generic PostStepDoIt recommended for all derived classes
96
G4VParticleChange
*
PostStepDoIt
(
const
G4Track
& aTrack,
97
const
G4Step
& aStep)
override
;
98
99
// initialisation of physics tables and G4HadronicProcessStore
100
void
PreparePhysicsTable
(
const
G4ParticleDefinition
&)
override
;
101
102
// build physics tables and print out the configuration of the process
103
void
BuildPhysicsTable
(
const
G4ParticleDefinition
&)
override
;
104
105
// dump physics tables
106
void
DumpPhysicsTable
(
const
G4ParticleDefinition
&
p
);
107
108
// add cross section data set
109
void
AddDataSet
(
G4VCrossSectionDataSet
* aDataSet);
110
111
// access to the list of hadronic interactions
112
std::vector<G4HadronicInteraction*>&
GetHadronicInteractionList
();
113
114
// access to an hadronic interaction by name
115
G4HadronicInteraction
*
GetHadronicModel
(
const
G4String
&);
116
117
// get inverse cross section per volume
118
G4double
GetMeanFreePath
(
const
G4Track
&aTrack,
G4double
,
119
G4ForceCondition
*)
override
;
120
121
// access to the target nucleus
122
inline
const
G4Nucleus
*
GetTargetNucleus
()
const
123
{
return
&
targetNucleus
; }
124
125
// G4ParticleDefinition* GetTargetDefinition();
126
inline
const
G4Isotope
*
GetTargetIsotope
()
127
{
return
targetNucleus
.
GetIsotope
(); }
128
129
void
ProcessDescription
(std::ostream& outFile)
const override
;
130
131
protected
:
132
133
// generic method to choose secondary generator
134
// recommended for all derived classes
135
inline
G4HadronicInteraction
*
ChooseHadronicInteraction
(
136
const
G4HadProjectile
& aHadProjectile,
G4Nucleus
& aTargetNucleus,
137
const
G4Material
* aMaterial,
const
G4Element
* anElement)
138
{
return
theEnergyRangeManager
.
GetHadronicInteraction
(aHadProjectile,
139
aTargetNucleus,
140
aMaterial,anElement);
141
}
142
143
// access to the target nucleus
144
inline
G4Nucleus
*
GetTargetNucleusPointer
()
145
{
return
&
targetNucleus
; }
146
147
public
:
148
149
// scale cross section
150
void
BiasCrossSectionByFactor
(
G4double
aScale);
151
void
MultiplyCrossSectionBy
(
G4double
factor);
152
inline
G4double
CrossSectionFactor
()
const
153
{
return
aScaleFactor
; }
154
155
// Integral option
156
inline
void
SetIntegral
(
G4bool
val)
157
{
useIntegralXS
= val; }
158
159
// Energy-momentum non-conservation limits and reporting
160
inline
void
SetEpReportLevel
(
G4int
level)
161
{
epReportLevel
= level; }
162
163
inline
void
SetEnergyMomentumCheckLevels
(
G4double
relativeLevel,
G4double
absoluteLevel)
164
{
epCheckLevels
.first = relativeLevel;
165
epCheckLevels
.second = absoluteLevel;
166
levelsSetByProcess
=
true
;
167
}
168
169
inline
std::pair<G4double, G4double>
GetEnergyMomentumCheckLevels
()
const
170
{
return
epCheckLevels
; }
171
172
// access to the cross section data store
173
inline
G4CrossSectionDataStore
*
GetCrossSectionDataStore
()
174
{
return
theCrossSectionDataStore
;}
175
176
protected
:
177
178
void
DumpState
(
const
G4Track
&,
const
G4String
&,
G4ExceptionDescription
&);
179
180
// access to the chosen generator
181
inline
G4HadronicInteraction
*
GetHadronicInteraction
()
const
182
{
return
theInteraction
; }
183
184
// access to the cross section data set
185
inline
G4double
GetLastCrossSection
()
186
{
return
theLastCrossSection
; }
187
188
// fill result
189
void
FillResult
(
G4HadFinalState
* aR,
const
G4Track
& aT);
190
191
// Check the result for catastrophic energy non-conservation
192
G4HadFinalState
*
CheckResult
(
const
G4HadProjectile
&
thePro
,
193
const
G4Nucleus
&
targetNucleus
,
194
G4HadFinalState
* result);
195
196
// Check 4-momentum balance
197
void
CheckEnergyMomentumConservation
(
const
G4Track
&,
const
G4Nucleus
&);
198
199
private
:
200
201
void
InitialiseLocal
();
202
203
G4double
XBiasSurvivalProbability
();
204
G4double
XBiasSecondaryWeight
();
205
206
// hide assignment operator as private
207
G4HadronicProcess
&
operator=
(
const
G4HadronicProcess
&
right
);
208
G4HadronicProcess
(
const
G4HadronicProcess
&);
209
210
// Set E/p conservation check levels from environment variables
211
void
GetEnergyMomentumCheckEnvvars
();
212
213
protected
:
214
215
G4HadProjectile
thePro
;
216
217
G4ParticleChange
*
theTotalResult
;
218
219
G4double
fWeight
;
220
221
G4int
epReportLevel
;
222
223
private
:
224
225
G4EnergyRangeManager
theEnergyRangeManager
;
226
227
G4HadronicInteraction
*
theInteraction
;
228
229
G4CrossSectionDataStore
*
theCrossSectionDataStore
;
230
231
G4HadronicProcessStore
*
theProcessStore
;
232
233
G4Nucleus
targetNucleus
;
234
235
bool
G4HadronicProcess_debug_flag
;
236
237
bool
useIntegralXS
;
238
239
G4int
nMatWarn
;
240
241
G4int
nICelectrons
;
242
243
G4int
idxIC
;
244
245
// Energy-momentum checking
246
std::pair<G4double, G4double>
epCheckLevels
;
247
G4bool
levelsSetByProcess
;
248
249
std::vector<G4VLeadingParticleBiasing*>
theBias
;
250
251
G4double
theInitialNumberOfInteractionLength
;
252
253
G4double
aScaleFactor
;
254
G4bool
xBiasOn
;
255
G4double
theLastCrossSection
;
256
};
257
258
#endif
259
geant4
tree
geant4-10.6-release
source
processes
hadronic
management
include
G4HadronicProcess.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:38
using
1.8.2 with
ECCE GitHub integration