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
G4CascadeDeexciteBase.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4CascadeDeexciteBase.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
// Semi-concrete base class for de-excitation modules, analogous to
28
// G4CascadeColliderBase.
29
//
30
// 20130806 M. Kelsey -- Per A. Dotti, move zero vector to file scope to
31
// address thread-collision problem.
32
33
#include "
G4CascadeDeexciteBase.hh
"
34
#include "
G4CascadeCheckBalance.hh
"
35
#include "
G4CascadeParameters.hh
"
36
#include "
G4CollisionOutput.hh
"
37
#include "
G4Fragment.hh
"
38
#include "
G4InuclNuclei.hh
"
39
#include "
G4InuclSpecialFunctions.hh
"
40
#include "
G4SystemOfUnits.hh
"
41
#include <vector>
42
43
using namespace
G4InuclSpecialFunctions;
44
45
46
// Constructor and destructor
47
48
G4CascadeDeexciteBase::G4CascadeDeexciteBase
(
const
char
*
name
)
49
:
G4VCascadeDeexcitation
(name), balance(0),
A
(0),
Z
(0), EEXS(0) {
50
if
(
G4CascadeParameters::checkConservation
())
51
balance
=
new
G4CascadeCheckBalance
(name);
52
}
53
54
G4CascadeDeexciteBase::~G4CascadeDeexciteBase
() {
55
delete
balance
;
56
}
57
58
void
G4CascadeDeexciteBase::setVerboseLevel
(
G4int
verbose) {
59
G4VCascadeDeexcitation::setVerboseLevel
(verbose);
60
if
(
balance
)
balance
->
setVerboseLevel
(verbose);
61
}
62
63
64
// Copy pertinent information from G4Fragment for modules
65
66
void
G4CascadeDeexciteBase::getTargetData
(
const
G4Fragment
&
target
) {
67
A
= target.
GetA_asInt
();
68
Z
= target.
GetZ_asInt
();
69
PEX
= target.
GetMomentum
()/
GeV
;
// Convert from G4 to Bertini units
70
EEXS
= target.
GetExcitationEnergy
();
71
}
72
73
74
// Create (fill) new G4Fragment with proper momentum/energy handling
75
76
namespace
{
77
static
const
G4LorentzVector
zero
(0.,0.,0.,0.);
// File scope avoids churn
78
}
79
80
const
G4Fragment
&
81
G4CascadeDeexciteBase::makeFragment
(
G4int
fragA,
G4int
fragZ,
G4double
EX) {
82
return
makeFragment
(
zero
, fragA, fragZ, EX);
83
}
84
85
const
G4Fragment
&
86
G4CascadeDeexciteBase::makeFragment
(
G4LorentzVector
mom
,
G4int
fragA,
87
G4int
fragZ,
G4double
EX) {
88
if
(
verboseLevel
>2) {
89
G4cout
<<
" >>> "
<<
theName
<<
"::makeFragment "
<< mom <<
" "
<< fragA
90
<<
" "
<< fragZ <<
" "
<< EX <<
G4endl
;
91
}
92
93
// Adjust four-momentum so that mass is nucleus + excitation
94
G4double
mass
=
95
G4InuclNuclei::getNucleiMass
(fragA,fragZ) + EX/
GeV
;
96
mom.
setVectM
(mom.
vect
(),
mass
);
97
98
// Overwrite previous fragment contents, zeroing out excitons
99
aFragment
.
SetZandA_asInt
(fragZ, fragA);
100
aFragment
.
SetMomentum
(mom*
GeV
);
// Bertini uses GeV!
101
aFragment
.
SetNumberOfHoles
(0,0);
102
aFragment
.
SetNumberOfExcitedParticle
(0,0);
103
104
return
aFragment
;
105
}
106
107
// Decide wether nuclear fragment is candidate for G4BigBanger
108
109
G4bool
G4CascadeDeexciteBase::explosion
(
const
G4Fragment
& fragment)
const
{
110
return
explosion
(fragment.
GetA_asInt
(), fragment.
GetZ_asInt
(),
111
fragment.
GetExcitationEnergy
());
// in MeV
112
}
113
114
G4bool
G4CascadeDeexciteBase::explosion
(
G4int
fragA,
G4int
fragZ,
115
G4double
excitation)
const
{
116
if
(
verboseLevel
)
G4cout
<<
" >>> "
<<
theName
<<
"::explosion ?"
<<
G4endl
;
117
118
const
G4int
a_cut = 20;
119
const
G4double
be_cut = 3.0;
120
121
// Neutron balls, or small fragments with high excitations can explode
122
return
((fragA <= a_cut || fragZ==0) &&
123
(excitation >= be_cut *
bindingEnergy
(fragA,fragZ))
124
);
125
}
126
127
128
// Validate output for energy, momentum conservation, etc.
129
130
G4bool
G4CascadeDeexciteBase::validateOutput
(
const
G4Fragment
&
target
,
131
G4CollisionOutput
& output) {
132
if
(!
balance
)
return
true
;
// Skip checks unless requested
133
134
if
(
verboseLevel
> 1)
135
G4cout
<<
" >>> "
<<
theName
<<
"::validateOutput"
<<
G4endl
;
136
137
balance
->
setVerboseLevel
(
verboseLevel
);
138
balance
->
collide
(target, output);
139
return
balance
->
okay
();
// Returns false if violations
140
}
141
142
G4bool
G4CascadeDeexciteBase::validateOutput
(
const
G4Fragment
&
target
,
143
const
std::vector<G4InuclElementaryParticle>& particles) {
144
if
(!
balance
)
return
true
;
// Skip checks unless requested
145
146
if
(
verboseLevel
> 1)
147
G4cout
<<
" >>> "
<<
theName
<<
"::validateOutput"
<<
G4endl
;
148
149
balance
->
setVerboseLevel
(
verboseLevel
);
150
balance
->
collide
(target, particles);
151
return
balance
->
okay
();
// Returns false if violations
152
}
153
154
G4bool
G4CascadeDeexciteBase::validateOutput
(
const
G4Fragment
&
target
,
155
const
std::vector<G4InuclNuclei>& fragments) {
156
if
(!
balance
)
return
true
;
// Skip checks unless requested
157
158
if
(
verboseLevel
> 1)
159
G4cout
<<
" >>> "
<<
theName
<<
"::validateOutput"
<<
G4endl
;
160
161
balance
->
setVerboseLevel
(
verboseLevel
);
162
balance
->
collide
(target, fragments);
163
return
balance
->
okay
();
// Returns false if violations
164
}
geant4
tree
geant4-10.6-release
source
processes
hadronic
models
cascade
cascade
src
G4CascadeDeexciteBase.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:39
using
1.8.2 with
ECCE GitHub integration