Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
processes
hadronic
models
cascade
cascade
include
G4InuclElementaryParticle.hh
Go to the documentation of this file.
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
// $Id$
27
//
28
// 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
29
// 20100409 M. Kelsey -- Drop unused string argument from ctors.
30
// 20100429 M. Kelsey -- Change "photon()" to "isPhoton()", use enum names
31
// 20100914 M. Kelsey -- Move printout to .cc file
32
// 20100915 M. Kelsey -- Add hyperon() identification function, ctor for
33
// G4DynamicParticle
34
// 20110117 M. Kelsey -- Add antinucleon() and antibaryon() flag
35
// 20110127 M. Kelsey -- Drop generation.
36
// 20110214 M. Kelsey -- Replace integer "model" with enum
37
// 20110321 M. Kelsey -- Fix getStrangeness() to return int
38
// 20110721 M. Kelsey -- Add constructors to take G4ParticleDefinition as
39
// input instead of type code, to allow pass-through of unusable
40
// particles during rescattering. Modify ctors to pass model to
41
// base ctor.
42
// 20110801 M. Kelsey -- Add fill() functions to replicate ctors, allowing
43
// reuse of objects as buffers; c.f. G4InuclNuclei.
44
// 20110922 M. Kelsey -- Add stream argument to printParticle() => print()
45
// 20120608 M. Kelsey -- Fix variable-name "shadowing" compiler warnings.
46
47
#ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
48
#define G4INUCL_ELEMENTARY_PARTICLE_HH
49
50
#include "
G4InuclParticle.hh
"
51
#include "
G4InuclParticleNames.hh
"
52
#include "
globals.hh
"
53
54
class
G4ParticleDefinition
;
55
56
57
class
G4InuclElementaryParticle
:
public
G4InuclParticle
{
58
public
:
59
G4InuclElementaryParticle
()
60
:
G4InuclParticle
() {}
61
62
G4InuclElementaryParticle
(
G4int
ityp,
Model
model
=
DefaultModel
)
63
:
G4InuclParticle
(
makeDefinition
(ityp),
model
) {}
64
65
G4InuclElementaryParticle
(
const
G4DynamicParticle
& dynPart,
66
Model
model
=
DefaultModel
)
67
:
G4InuclParticle
(dynPart,
model
) {}
68
69
G4InuclElementaryParticle
(
const
G4LorentzVector
& mom,
70
G4int
ityp,
Model
model
=
DefaultModel
)
71
:
G4InuclParticle
(
makeDefinition
(ityp), mom,
model
) {}
72
73
G4InuclElementaryParticle
(
G4double
ekin,
G4int
ityp,
74
Model
model
=
DefaultModel
)
75
:
G4InuclParticle
(
makeDefinition
(ityp), ekin,
model
) {}
76
77
// WARNING: This may create a particle without a valid type code!
78
G4InuclElementaryParticle
(
const
G4LorentzVector
& mom,
79
G4ParticleDefinition
* pd,
Model
model
=
DefaultModel
)
80
:
G4InuclParticle
(pd, mom,
model
) {}
81
82
// Copy and assignment constructors for use with std::vector<>
83
G4InuclElementaryParticle
(
const
G4InuclElementaryParticle
&
right
)
84
:
G4InuclParticle
(right) {}
85
86
G4InuclElementaryParticle
&
operator=
(
const
G4InuclElementaryParticle
&
right
);
87
88
// Overwrite data structure (avoids creating/copying temporaries)
89
void
fill
(
G4int
ityp,
Model
model
=
DefaultModel
) {
fill
(0., ityp,
model
); }
90
91
void
fill
(
const
G4LorentzVector
& mom,
G4int
ityp,
Model
model
=
DefaultModel
);
92
93
void
fill
(
G4double
ekin,
G4int
ityp,
Model
model
=
DefaultModel
);
94
95
// WARNING: This may create a particle without a valid type code!
96
void
fill
(
const
G4LorentzVector
& mom,
G4ParticleDefinition
* pd,
97
Model
model
=
DefaultModel
);
98
99
// Assignment and accessor functions
100
void
setType
(
G4int
ityp);
101
G4int
type
()
const
{
return
type
(
getDefinition
()); }
102
103
static
G4int
type
(
const
G4ParticleDefinition
* pd);
104
105
G4bool
isPhoton
()
const
{
return
(
type
() ==
G4InuclParticleNames::photon
); }
106
107
G4bool
pion
()
const
{
return
(
type
()==
G4InuclParticleNames::pionPlus
||
108
type
()==
G4InuclParticleNames::pionMinus
||
109
type
()==
G4InuclParticleNames::pionZero
); }
110
111
G4bool
nucleon
()
const
{
return
(
type
()==
G4InuclParticleNames::proton
||
112
type
()==
G4InuclParticleNames::neutron
); }
113
114
G4bool
antinucleon
()
const
{
115
return
(
type
()==
G4InuclParticleNames::antiProton
||
116
type
()==
G4InuclParticleNames::antiNeutron
); }
117
118
G4int
baryon
()
const
{
// Can use as a bool (!=0 ==> true)
119
return
getDefinition
()->
GetBaryonNumber
();
120
}
121
122
G4bool
antibaryon
()
const
{
return
baryon
() < 0; }
123
124
G4bool
hyperon
()
const
{
return
(
baryon
() &&
getStrangeness
()); }
125
126
G4bool
quasi_deutron
()
const
{
return
(
type
() > 100); }
127
128
G4int
getStrangeness
()
const
{
return
getStrangeness
(
type
()); }
129
130
G4bool
valid
()
const
{
return
type
()>0; }
131
132
virtual
void
print
(std::ostream& os)
const
;
133
134
static
G4int
getStrangeness
(
G4int
type
);
135
static
G4double
getParticleMass
(
G4int
type
);
136
137
protected
:
138
// Convert internal type code to standard GEANT4 pointer
139
static
G4ParticleDefinition
*
makeDefinition
(
G4int
ityp);
140
};
141
142
#endif // G4INUCL_ELEMENTARY_PARTICLE_HH
Generated on Sat May 25 2013 14:33:43 for Geant4 by
1.8.4