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
G4InuclParticle.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4InuclParticle.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
// 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
28
// 20100409 M. Kelsey -- Drop unused string argument from ctors.
29
// 20100519 M. Kelsey -- Add public access to G4DynamicParticle content
30
// 20100715 M. Kelsey -- Add setKineticEnergy() function
31
// 20100915 M. Kelsey -- Add constructor to copy G4DynamicParticle input
32
// 20110214 M. Kelsey -- Replace integer "model" with enum
33
// 20110225 M. Kelsey -- Add equality operator (NOT sorting!)
34
// 20110721 M. Kelsey -- Add model ID as optional ctor argument (so subclasses
35
// don't have to call SetModel()).
36
// 20110917 M. Kelsey -- Add coalesence to model ID list
37
// 20110919 M. Kelsey -- Move setDefinition code to .cc to allow null argument
38
// 20110922 M. Kelsey -- Add stream argument to printParticle() => print(),
39
// add operator<<().
40
// 20140310 M. Kelsey -- Fix constness in G4PD* passing
41
42
#ifndef G4INUCL_PARTICLE_HH
43
#define G4INUCL_PARTICLE_HH
44
45
#include <iosfwd>
46
#include <
CLHEP/Units/SystemOfUnits.h
>
47
48
#include "
globals.hh
"
49
#include "
G4LorentzVector.hh
"
50
#include "
G4DynamicParticle.hh
"
51
52
class
G4InuclParticle
{
53
public
:
54
// used to indicate model that created instance of G4InuclParticle
55
// 0 default
56
// 1 bullet
57
// 2 target
58
// 3 G4ElementaryParticleCollider
59
// 4 G4IntraNucleiCascader
60
// 5 G4NonEquilibriumEvaporator
61
// 6 G4EquilibriumEvaporator
62
// 7 G4Fissioner
63
// 8 G4BigBanger
64
// 9 G4PreCompound
65
// 10 G4CascadeCoalescence
66
enum
Model
{
DefaultModel
,
bullet
,
target
,
EPCollider
,
INCascader
,
67
NonEquilib
,
Equilib
,
Fissioner
,
BigBanger
,
PreCompound
,
68
Coalescence
};
69
70
public
:
71
G4InuclParticle
() :
modelId
(
DefaultModel
) {}
72
73
G4InuclParticle
(
const
G4DynamicParticle
& dynPart,
Model
model
=
DefaultModel
)
74
:
pDP
(dynPart),
modelId
(
model
) {}
75
76
G4InuclParticle
(
const
G4LorentzVector
&
mom
,
Model
model
=
DefaultModel
)
77
:
modelId
(
model
) {
pDP
.
Set4Momentum
(mom*
CLHEP::GeV
/
CLHEP::MeV
); }
// Bertini to G4 units
78
79
virtual
~G4InuclParticle
() {}
80
81
// Copy and assignment constructors for use with std::vector<>
82
G4InuclParticle
(
const
G4InuclParticle
&
right
)
83
:
pDP
(right.
pDP
),
modelId
(right.
modelId
) {}
84
85
G4InuclParticle
&
operator=
(
const
G4InuclParticle
&
right
);
86
87
// Equality (comparison) operator -- NOT SORTING
88
G4bool
operator==
(
const
G4InuclParticle
&
right
) {
89
return
( (&right ==
this
) || (
pDP
== right.
pDP
) );
// Ignore model code
90
}
91
92
G4bool
operator!=
(
const
G4InuclParticle
&
right
) {
93
return
!
operator==
(right);
94
}
95
96
// This is no longer required, as setMomentum() handles mass adjustment
97
void
setEnergy
() { ; }
98
99
// These are call-throughs to G4DynamicParticle
100
void
setMomentum
(
const
G4LorentzVector
&
mom
);
101
102
void
setKineticEnergy
(
G4double
ekin) {
pDP
.
SetKineticEnergy
(ekin*
CLHEP::GeV
/
CLHEP::MeV
); }
103
104
void
setMass
(
G4double
mass
) {
pDP
.
SetMass
(mass*
CLHEP::GeV
/
CLHEP::MeV
); }
105
106
G4double
getMass
()
const
{
107
return
pDP
.
GetMass
()*
CLHEP::MeV
/
CLHEP::GeV
;
// From G4 to Bertini units
108
}
109
110
G4double
getCharge
()
const
{
111
return
pDP
.
GetCharge
();
112
}
113
114
G4double
getKineticEnergy
()
const
{
115
return
pDP
.
GetKineticEnergy
()*
CLHEP::MeV
/
CLHEP::GeV
;
// From G4 to Bertini units
116
}
117
118
G4double
getEnergy
()
const
{
119
return
pDP
.
GetTotalEnergy
()*
CLHEP::MeV
/
CLHEP::GeV
;
// From G4 to Bertini units
120
}
121
122
G4double
getMomModule
()
const
{
123
return
pDP
.
GetTotalMomentum
()*
CLHEP::MeV
/
CLHEP::GeV
;
// From G4 to Bertini units
124
}
125
126
G4LorentzVector
getMomentum
()
const
{
127
return
pDP
.
Get4Momentum
()*
CLHEP::MeV
/
CLHEP::GeV
;
// From G4 to Bertini units
128
}
129
130
virtual
void
print
(std::ostream& os)
const
;
131
132
const
G4ParticleDefinition
*
getDefinition
()
const
{
133
return
pDP
.
GetDefinition
();
134
}
135
136
const
G4DynamicParticle
&
getDynamicParticle
()
const
{
137
return
pDP
;
138
}
139
140
public
:
141
void
setModel
(
Model
model
) {
modelId
=
model
; }
142
Model
getModel
()
const
{
return
modelId
; }
143
144
protected
:
145
// Special constructors for subclasses to set particle type correctly
146
explicit
G4InuclParticle
(
const
G4ParticleDefinition
* pd,
147
Model
model
=
DefaultModel
)
148
:
modelId
(
model
) {
setDefinition
(pd); }
149
150
// FIXME: Bertini code doesn't pass valid 4-vectors, so force mass value
151
// from supplied PartDefn, with required unit conversions
152
G4InuclParticle
(
const
G4ParticleDefinition
* pd,
const
G4LorentzVector
&
mom
,
153
Model
model
=
DefaultModel
);
154
155
// NOTE: Momentum forced along Z direction
156
G4InuclParticle
(
const
G4ParticleDefinition
* pd,
G4double
ekin,
157
Model
model
=
DefaultModel
)
158
:
pDP
(pd,
G4ThreeVector
(0.,0.,1.),ekin*CLHEP::
GeV
/CLHEP::
MeV
),
modelId
(
model
) {}
159
160
void
setDefinition
(
const
G4ParticleDefinition
* pd);
161
162
private
:
163
G4DynamicParticle
pDP
;
// Carries all the kinematics and info
164
Model
modelId
;
165
};
166
167
// Proper stream output (just calls print())
168
169
std::ostream&
operator<<
(std::ostream& os,
const
G4InuclParticle
&
part
);
170
171
#endif // G4INUCL_PARTICLE_HH
geant4
tree
geant4-10.6-release
source
processes
hadronic
models
cascade
cascade
include
G4InuclParticle.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:39
using
1.8.2 with
ECCE GitHub integration