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
G4Fragment.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Fragment.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 header G4Fragment
30
//
31
// by V. Lara (May 1998)
32
//
33
// Modifications:
34
// 03.05.2010 V.Ivanchenko General cleanup of inline functions: objects
35
// are accessed by reference; remove double return
36
// tolerance of excitation energy at modent it is computed;
37
// safe computation of excitation for exotic fragments
38
// 18.05.2010 V.Ivanchenko added member theGroundStateMass and inline
39
// method which allowing to compute this value once and use
40
// many times
41
// 26.09.2010 V.Ivanchenko added number of protons, neutrons, proton holes
42
// and neutron holes as members of the class and Get/Set methods;
43
// removed not needed 'const'; removed old debug staff and unused
44
// private methods; add comments and reorder methods for
45
// better reading
46
47
#ifndef G4Fragment_h
48
#define G4Fragment_h 1
49
50
#include "
globals.hh
"
51
#include "
G4Allocator.hh
"
52
#include "
G4LorentzVector.hh
"
53
#include "
G4ThreeVector.hh
"
54
#include "
G4NuclearPolarization.hh
"
55
#include "
G4NucleiProperties.hh
"
56
#include "
G4Proton.hh
"
57
#include "
G4Neutron.hh
"
58
#include <vector>
59
60
class
G4ParticleDefinition
;
61
62
class
G4Fragment
;
63
typedef
std::vector<G4Fragment*>
G4FragmentVector
;
64
65
class
G4Fragment
66
{
67
public
:
68
69
// ============= CONSTRUCTORS ==================
70
71
// Default constructor - obsolete
72
G4Fragment
();
73
74
// Destructor
75
~G4Fragment
();
76
77
// Copy constructor
78
G4Fragment
(
const
G4Fragment
&
right
);
79
80
// A,Z and 4-momentum - main constructor for fragment
81
G4Fragment
(
G4int
A
,
G4int
Z
,
const
G4LorentzVector
& aMomentum);
82
83
// 4-momentum and pointer to G4particleDefinition (for gammas, e-)
84
G4Fragment
(
const
G4LorentzVector
& aMomentum,
85
const
G4ParticleDefinition
* aParticleDefinition);
86
87
// ============= OPERATORS ==================
88
89
G4Fragment
&
operator=
(
const
G4Fragment
&right);
90
G4bool
operator==
(
const
G4Fragment
&right)
const
;
91
G4bool
operator!=
(
const
G4Fragment
&right)
const
;
92
93
friend
std::ostream&
operator<<
(std::ostream&,
const
G4Fragment
&);
94
95
// new/delete operators are overloded to use G4Allocator
96
inline
void
*
operator
new
(size_t);
97
inline
void
operator
delete
(
void
*aFragment);
98
99
// ============= GENERAL METHODS ==================
100
101
inline
G4int
GetZ_asInt
()
const
;
102
inline
G4int
GetA_asInt
()
const
;
103
inline
void
SetZandA_asInt
(
G4int
Znew,
G4int
Anew);
104
105
inline
G4double
GetExcitationEnergy
()
const
;
106
inline
void
SetExcEnergyAndMomentum
(
G4double
eexc,
const
G4LorentzVector
&);
107
108
inline
G4double
GetGroundStateMass
()
const
;
109
110
inline
G4double
GetBindingEnergy
()
const
;
111
112
inline
const
G4LorentzVector
&
GetMomentum
()
const
;
113
inline
void
SetMomentum
(
const
G4LorentzVector
&
value
);
114
115
// computation of mass for any Z and A
116
inline
G4double
ComputeGroundStateMass
(
G4int
Z,
G4int
A)
const
;
117
118
// extra methods
119
inline
G4double
GetSpin
()
const
;
120
inline
void
SetSpin
(
G4double
value);
121
122
inline
G4int
GetCreatorModelType
()
const
;
123
inline
void
SetCreatorModelType
(
G4int
value);
124
125
// obsolete methods
126
127
inline
G4double
GetZ
()
const
;
128
inline
G4double
GetA
()
const
;
129
inline
void
SetZ
(
G4double
value);
130
inline
void
SetA
(
G4double
value);
131
132
// ============= METHODS FOR PRE-COMPOUND MODEL ===============
133
134
inline
G4int
GetNumberOfExcitons
()
const
;
135
136
inline
G4int
GetNumberOfParticles
()
const
;
137
inline
G4int
GetNumberOfCharged
()
const
;
138
inline
void
SetNumberOfExcitedParticle
(
G4int
valueTot,
G4int
valueP);
139
140
inline
G4int
GetNumberOfHoles
()
const
;
141
inline
G4int
GetNumberOfChargedHoles
()
const
;
142
inline
void
SetNumberOfHoles
(
G4int
valueTot,
G4int
valueP=0);
143
144
// these methods will be removed in future
145
inline
void
SetNumberOfParticles
(
G4int
value);
146
inline
void
SetNumberOfCharged
(
G4int
value);
147
148
// ============= METHODS FOR PHOTON EVAPORATION ===============
149
150
inline
G4int
GetNumberOfElectrons
()
const
;
151
inline
void
SetNumberOfElectrons
(
G4int
value);
152
153
inline
G4int
GetFloatingLevelNumber
()
const
;
154
inline
void
SetFloatingLevelNumber
(
G4int
value);
155
156
inline
const
G4ParticleDefinition
*
GetParticleDefinition
()
const
;
157
inline
void
SetParticleDefinition
(
const
G4ParticleDefinition
*
p
);
158
159
inline
G4double
GetCreationTime
()
const
;
160
inline
void
SetCreationTime
(
G4double
time
);
161
162
// G4Fragment class is not responsible for creation and delition of
163
// G4NuclearPolarization object
164
inline
G4NuclearPolarization
*
NuclearPolarization
();
165
inline
G4NuclearPolarization
*
GetNuclearPolarization
()
const
;
166
inline
void
SetNuclearPolarization
(
G4NuclearPolarization
*);
167
168
void
SetAngularMomentum
(
const
G4ThreeVector
&);
169
G4ThreeVector
GetAngularMomentum
()
const
;
170
171
// ============= PRIVATE METHODS ==============================
172
173
private
:
174
175
void
ExcitationEnergyWarning
();
176
177
void
NumberOfExitationWarning
(
const
G4String
&);
178
179
inline
void
CalculateExcitationEnergy
();
180
181
inline
void
CalculateGroundStateMass
();
182
183
// ============= DATA MEMBERS ==================
184
185
G4int
theA
;
186
187
G4int
theZ
;
188
189
G4double
theExcitationEnergy
;
190
191
G4double
theGroundStateMass
;
192
193
G4LorentzVector
theMomentum
;
194
195
// Nuclear polarisation by default is nullptr
196
G4NuclearPolarization
*
thePolarization
;
197
198
// creator model type
199
G4int
creatorModel
;
200
201
// Exciton model data members
202
G4int
numberOfParticles
;
203
G4int
numberOfCharged
;
204
G4int
numberOfHoles
;
205
G4int
numberOfChargedHoles
;
206
207
// Gamma evaporation data members
208
G4int
numberOfShellElectrons
;
209
G4int
xLevel
;
210
211
const
G4ParticleDefinition
*
theParticleDefinition
;
212
213
G4double
spin
;
214
G4double
theCreationTime
;
215
216
static
const
G4double
minFragExcitation
;
217
};
218
219
// ============= INLINE METHOD IMPLEMENTATIONS ===================
220
221
#if defined G4HADRONIC_ALLOC_EXPORT
222
extern
G4DLLEXPORT
G4Allocator<G4Fragment>
*&
pFragmentAllocator
();
223
#else
224
extern
G4DLLIMPORT
G4Allocator<G4Fragment>
*&
pFragmentAllocator
();
225
#endif
226
227
inline
void
* G4Fragment::operator
new
(size_t)
228
{
229
if
(!
pFragmentAllocator
()) {
pFragmentAllocator
() =
new
G4Allocator<G4Fragment>
; }
230
return
(
void
*)
pFragmentAllocator
()->MallocSingle();
231
}
232
233
inline
void
G4Fragment::operator
delete
(
void
* aFragment)
234
{
235
pFragmentAllocator
()->FreeSingle((
G4Fragment
*) aFragment);
236
}
237
238
inline
void
G4Fragment::CalculateExcitationEnergy
()
239
{
240
theExcitationEnergy
=
theMomentum
.
mag
() -
theGroundStateMass
;
241
if
(
theExcitationEnergy
<
minFragExcitation
) {
242
if
(
theExcitationEnergy
< -
minFragExcitation
) {
ExcitationEnergyWarning
(); }
243
theExcitationEnergy
= 0.0;
244
}
245
}
246
247
inline
G4double
248
G4Fragment::ComputeGroundStateMass
(
G4int
Z
,
G4int
A
)
const
249
{
250
return
G4NucleiProperties::GetNuclearMass
(A, Z);
251
}
252
253
inline
void
G4Fragment::CalculateGroundStateMass
()
254
{
255
theGroundStateMass
=
G4NucleiProperties::GetNuclearMass
(
theA
,
theZ
);
256
}
257
258
inline
G4int
G4Fragment::GetA_asInt
()
const
259
{
260
return
theA
;
261
}
262
263
inline
G4int
G4Fragment::GetZ_asInt
()
const
264
{
265
return
theZ
;
266
}
267
268
inline
void
G4Fragment::SetZandA_asInt
(
G4int
Znew,
G4int
Anew)
269
{
270
theZ
= Znew;
271
theA
= Anew;
272
CalculateGroundStateMass
();
273
}
274
275
inline
G4double
G4Fragment::GetExcitationEnergy
()
const
276
{
277
return
theExcitationEnergy
;
278
}
279
280
inline
G4double
G4Fragment::GetGroundStateMass
()
const
281
{
282
return
theGroundStateMass
;
283
}
284
285
inline
void
G4Fragment::SetExcEnergyAndMomentum
(
G4double
eexc,
286
const
G4LorentzVector
&
v
)
287
{
288
theExcitationEnergy
= eexc;
289
theMomentum
.
set
(0.0, 0.0, 0.0,
theGroundStateMass
+ eexc);
290
theMomentum
.
boost
(v.
boostVector
());
291
}
292
293
inline
G4double
G4Fragment::GetBindingEnergy
()
const
294
{
295
return
(
theA
-
theZ
)*
CLHEP::neutron_mass_c2
+
theZ
*
CLHEP::proton_mass_c2
296
-
theGroundStateMass
;
297
}
298
299
inline
const
G4LorentzVector
&
G4Fragment::GetMomentum
()
const
300
{
301
return
theMomentum
;
302
}
303
304
inline
void
G4Fragment::SetMomentum
(
const
G4LorentzVector
&
value
)
305
{
306
theMomentum
=
value
;
307
CalculateExcitationEnergy
();
308
}
309
310
inline
G4double
G4Fragment::GetZ
()
const
311
{
312
return
G4double
(
theZ
);
313
}
314
315
inline
G4double
G4Fragment::GetA
()
const
316
{
317
return
G4double
(
theA
);
318
}
319
320
inline
void
G4Fragment::SetZ
(
const
G4double
value
)
321
{
322
theZ
=
G4lrint
(value);
323
CalculateGroundStateMass
();
324
}
325
326
inline
void
G4Fragment::SetA
(
const
G4double
value
)
327
{
328
theA
=
G4lrint
(value);
329
CalculateGroundStateMass
();
330
}
331
332
inline
G4int
G4Fragment::GetNumberOfExcitons
()
const
333
{
334
return
numberOfParticles
+
numberOfHoles
;
335
}
336
337
inline
G4int
G4Fragment::GetNumberOfParticles
()
const
338
{
339
return
numberOfParticles
;
340
}
341
342
inline
G4int
G4Fragment::GetNumberOfCharged
()
const
343
{
344
return
numberOfCharged
;
345
}
346
347
inline
348
void
G4Fragment::SetNumberOfExcitedParticle
(
G4int
valueTot,
G4int
valueP)
349
{
350
numberOfParticles
= valueTot;
351
numberOfCharged
= valueP;
352
if
(valueTot < valueP) {
353
NumberOfExitationWarning
(
"SetNumberOfExcitedParticle"
);
354
}
355
}
356
357
inline
G4int
G4Fragment::GetNumberOfHoles
()
const
358
{
359
return
numberOfHoles
;
360
}
361
362
inline
G4int
G4Fragment::GetNumberOfChargedHoles
()
const
363
{
364
return
numberOfChargedHoles
;
365
}
366
367
inline
void
G4Fragment::SetNumberOfHoles
(
G4int
valueTot,
G4int
valueP)
368
{
369
numberOfHoles
= valueTot;
370
numberOfChargedHoles
= valueP;
371
if
(valueTot < valueP) {
372
NumberOfExitationWarning
(
"SetNumberOfHoles"
);
373
}
374
}
375
376
inline
void
G4Fragment::SetNumberOfParticles
(
G4int
value
)
377
{
378
numberOfParticles
=
value
;
379
}
380
381
inline
void
G4Fragment::SetNumberOfCharged
(
G4int
value
)
382
{
383
numberOfCharged
=
value
;
384
if
(value >
numberOfParticles
) {
385
NumberOfExitationWarning
(
"SetNumberOfCharged"
);
386
}
387
}
388
389
inline
G4int
G4Fragment::GetNumberOfElectrons
()
const
390
{
391
return
numberOfShellElectrons
;
392
}
393
394
inline
void
G4Fragment::SetNumberOfElectrons
(
G4int
value
)
395
{
396
numberOfShellElectrons
=
value
;
397
}
398
399
inline
G4int
G4Fragment::GetCreatorModelType
()
const
400
{
401
return
creatorModel
;
402
}
403
404
inline
void
G4Fragment::SetCreatorModelType
(
G4int
value
)
405
{
406
creatorModel
=
value
;
407
}
408
409
inline
G4double
G4Fragment::GetSpin
()
const
410
{
411
return
spin
;
412
}
413
414
inline
void
G4Fragment::SetSpin
(
G4double
value
)
415
{
416
spin
=
value
;
417
}
418
419
inline
G4int
G4Fragment::GetFloatingLevelNumber
()
const
420
{
421
return
xLevel
;
422
}
423
424
inline
void
G4Fragment::SetFloatingLevelNumber
(
G4int
value
)
425
{
426
xLevel
=
value
;
427
}
428
429
inline
430
const
G4ParticleDefinition
*
G4Fragment::GetParticleDefinition
(
void
)
const
431
{
432
return
theParticleDefinition
;
433
}
434
435
inline
void
G4Fragment::SetParticleDefinition
(
const
G4ParticleDefinition
*
p
)
436
{
437
theParticleDefinition
=
p
;
438
}
439
440
inline
G4double
G4Fragment::GetCreationTime
()
const
441
{
442
return
theCreationTime
;
443
}
444
445
inline
void
G4Fragment::SetCreationTime
(
G4double
time
)
446
{
447
theCreationTime
=
time
;
448
}
449
450
inline
G4NuclearPolarization
*
G4Fragment::NuclearPolarization
()
451
{
452
return
thePolarization
;
453
}
454
455
inline
G4NuclearPolarization
*
G4Fragment::GetNuclearPolarization
()
const
456
{
457
return
thePolarization
;
458
}
459
460
inline
void
G4Fragment::SetNuclearPolarization
(
G4NuclearPolarization
*
p
)
461
{
462
thePolarization
=
p
;
463
}
464
465
#endif
466
467
geant4
tree
geant4-10.6-release
source
processes
hadronic
models
util
include
G4Fragment.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:51
using
1.8.2 with
ECCE GitHub integration