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
particles
management
include
G4DynamicParticle.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
//
27
// $Id$
28
//
29
//
30
// ------------------------------------------------------------
31
// GEANT 4 class header file
32
//
33
// History: first implementation, based on object model of
34
// 2nd December 1995, G.Cosmo
35
// ---------------- G4DynamicParticle ----------------
36
// first implementation by Makoto Asai, 29 January 1996
37
// revised by G.Cosmo, 29 February 1996
38
// revised by Hisaya Kurashige, 24 July 1996
39
// revised by Hisaya Kurashige, 19 Oct 1996
40
// revised by Hisaya Kurashige, 19 Feb 1997
41
// ------------------------
42
// Add theDynamicCharge and theElectronOccupancy
43
// 17 AUg. 1999 H.Kurashige
44
// Add thePreAssignedDecayTime 18 Jan. 2001 H.Kurashige
45
// Added MagneticMoment Mar. 2007
46
// ------------------------------------------------------------
47
48
#ifndef G4DynamicParticle_h
49
#define G4DynamicParticle_h 1
50
51
#include <cmath>
52
#include <
CLHEP/Units/SystemOfUnits.h
>
53
54
#include "
globals.hh
"
55
#include "
G4ios.hh
"
56
57
#include "
G4ParticleDefinition.hh
"
58
#include "
G4Allocator.hh
"
59
#include "
G4LorentzVector.hh
"
60
61
#include "
G4ParticleMomentum.hh
"
62
// G4ParticleMomentum is "momentum direction" not "momentum vector"
63
// The name is miss-leading so you should not use G4ParticleMomentum
64
// and you are recommended to use G4ThreeVector instead
65
66
#include "
G4ElectronOccupancy.hh
"
67
68
69
class
G4PrimaryParticle
;
70
class
G4VProcess
;
71
class
G4DecayProducts
;
72
73
class
G4DynamicParticle
74
{
75
// Class Description
76
// The dynamic particle is a class which contains the purely
77
// dynamic aspects of a moving particle. It also has a
78
// pointer to a G4ParticleDefinition object, which holds
79
// all the static information.
80
//
81
82
public
:
// With Description
83
//- constructors
84
G4DynamicParticle
();
85
86
G4DynamicParticle
(
const
G4ParticleDefinition
* aParticleDefinition,
87
const
G4ThreeVector
& aMomentumDirection,
88
G4double
aKineticEnergy);
89
G4DynamicParticle
(
const
G4ParticleDefinition
* aParticleDefinition,
90
const
G4ThreeVector
& aParticleMomentum);
91
G4DynamicParticle
(
const
G4ParticleDefinition
* aParticleDefinition,
92
const
G4LorentzVector
&aParticleMomentum);
93
G4DynamicParticle
(
const
G4ParticleDefinition
* aParticleDefinition,
94
G4double
aTotalEnergy,
95
const
G4ThreeVector
&aParticleMomentum);
96
97
G4DynamicParticle
(
const
G4DynamicParticle
&
right
);
98
99
//- destructor
100
~G4DynamicParticle
();
101
102
//- operators
103
G4DynamicParticle
&
operator=
(
const
G4DynamicParticle
&right);
104
G4int
operator==
(
const
G4DynamicParticle
&right)
const
;
105
G4int
operator!=
(
const
G4DynamicParticle
&right)
const
;
106
107
// new/delete operators are oberloded to use G4Allocator
108
inline
void
*
operator
new
(size_t);
109
inline
void
operator
delete
(
void
*aDynamicParticle);
110
111
//- Set/Get methods
112
113
const
G4ThreeVector
&
GetMomentumDirection
()
const
;
114
// Returns the normalized direction of the momentum
115
void
SetMomentumDirection
(
const
G4ThreeVector
&aDirection);
116
// Sets the normalized direction of the momentum
117
void
SetMomentumDirection
(
G4double
px,
G4double
py,
G4double
pz);
118
// Sets the normalized direction of the momentum by coordinates
119
120
G4ThreeVector
GetMomentum
()
const
;
121
// Returns the current particle momentum vector
122
void
SetMomentum
(
const
G4ThreeVector
&momentum);
123
// set the current particle momentum vector
124
125
G4LorentzVector
Get4Momentum
()
const
;
126
// Returns the current particle energy-momentum 4vector
127
void
Set4Momentum
(
const
G4LorentzVector
&momentum);
128
// Set the current particle energy-momentum 4vector
129
130
131
G4double
GetTotalMomentum
()
const
;
132
// Returns the module of the momentum vector
133
G4double
GetTotalEnergy
()
const
;
134
// Returns the total energy of the particle
135
136
G4double
GetKineticEnergy
()
const
;
137
// Returns the kinetic energy of a particle
138
void
SetKineticEnergy
(
G4double
aEnergy);
139
// Sets the kinetic energy of a particle
140
141
142
G4double
GetProperTime
()
const
;
143
// Returns the current particle proper time
144
void
SetProperTime
(
G4double
);
145
// Set the current particle Proper Time
146
147
148
const
G4ThreeVector
&
GetPolarization
()
const
;
149
void
SetPolarization
(
G4double
polX,
G4double
polY,
G4double
polZ);
150
// Set/Get polarization vector
151
152
153
G4double
GetMass
()
const
;
154
void
SetMass
(
G4double
mass);
155
// set/get dynamical mass
156
// the dynamical mass is set to PDG mass in default
157
158
159
G4double
GetCharge
()
const
;
160
void
SetCharge
(
G4double
charge);
161
void
SetCharge
(
G4int
chargeInUnitOfEplus);
162
// set/get dynamical charge
163
// the dynamical mass is set to PDG charge in default
164
165
G4double
GetSpin
()
const
;
166
void
SetSpin
(
G4double
spin);
167
void
SetSpin
(
G4int
spinInUnitOfHalfInteger);
168
// set/get dynamical spin
169
// the dynamical spin is set to PDG spin in default
170
171
G4double
GetMagneticMoment
()
const
;
172
void
SetMagneticMoment
(
G4double
magneticMoment);
173
// set/get dynamical MagneticMoment
174
// the dynamical mass is set to PDG MagneticMoment in default
175
176
177
const
G4ElectronOccupancy
*
GetElectronOccupancy
()
const
;
178
// Get electron occupancy
179
// ElectronOccupancy is valid only if the particle is ion
180
G4int
GetTotalOccupancy
()
const
;
181
G4int
GetOccupancy
(
G4int
orbit)
const
;
182
void
AddElectron
(
G4int
orbit,
G4int
number = 1);
183
void
RemoveElectron
(
G4int
orbit,
G4int
number = 1);
184
185
186
const
G4ParticleDefinition
*
GetParticleDefinition
()
const
;
187
void
SetDefinition
(
const
G4ParticleDefinition
* aParticleDefinition);
188
// Set/Get particle definition
189
// following method of GetDefinition remains
190
// because of backward compatiblity. It will be removed in future
191
G4ParticleDefinition
*
GetDefinition
()
const
;
192
193
194
const
G4DecayProducts
*
GetPreAssignedDecayProducts
()
const
;
195
void
SetPreAssignedDecayProducts
(
G4DecayProducts
*aDecayProducts);
196
// Set/Get pre-assigned decay channel
197
198
G4double
GetPreAssignedDecayProperTime
()
const
;
199
void
SetPreAssignedDecayProperTime
(
G4double
);
200
// Set/Get pre-assigned proper time when the particle will decay
201
202
203
//- print out information
204
void
DumpInfo
(
G4int
mode= 0)
const
;
205
// mode 0 : default )(minimum)
206
// mode 1 : 0 + electron occupancy
207
208
protected
:
209
void
AllocateElectronOccupancy
();
210
G4double
GetElectronMass
()
const
;
211
212
protected
:
213
G4ThreeVector
theMomentumDirection
;
214
// The normalized momentum vector
215
216
const
G4ParticleDefinition
*
theParticleDefinition
;
217
// Contains the static information of this particle.
218
219
G4ThreeVector
thePolarization
;
220
221
G4double
theKineticEnergy
;
222
223
G4double
theProperTime
;
224
225
G4double
theDynamicalMass
;
226
227
G4double
theDynamicalCharge
;
228
229
G4double
theDynamicalSpin
;
230
231
G4double
theDynamicalMagneticMoment
;
232
233
G4ElectronOccupancy
*
theElectronOccupancy
;
234
235
G4DecayProducts
*
thePreAssignedDecayProducts
;
236
237
G4double
thePreAssignedDecayTime
;
238
239
protected
:
240
G4int
verboseLevel
;
241
242
public
:
// With Description
243
void
SetVerboseLevel
(
G4int
value
);
244
G4int
GetVerboseLevel
()
const
;
245
// Set/Get controle flag for output message
246
// 0: Silent
247
// 1: Warning message
248
// 2: More
249
250
protected
:
251
G4PrimaryParticle
*
primaryParticle
;
252
// This void pointer is used by G4EventManager to maintain the
253
// link between pre-assigned decay products and corresponding
254
// primary particle.
255
256
public
:
257
void
SetPrimaryParticle
(
G4PrimaryParticle
*
p
);
258
void
SetPDGcode
(
G4int
c
);
259
260
public
:
// With Description
261
G4PrimaryParticle
*
GetPrimaryParticle
()
const
;
262
// Return the pointer to the corresponding G4PrimaryParticle object
263
// if this particle is a primary particle OR is defined as a pre-assigned
264
// decay product. Otherwise return null.
265
266
G4int
GetPDGcode
()
const
;
267
// Return the PDG code of this particle. If the particle is known to Geant4
268
// its PDG code defined in G4ParticleDefinition is returned. If it is unknown
269
// (i.e. PDG code in G4ParticleDefinition is 0), PDG code defined in the
270
// corresponding primary particle or pre-assigned decay product will be
271
// returned if available. Otherwise (e.g. for geantino) returns 0.
272
273
protected
:
274
G4int
thePDGcode
;
275
};
276
277
#include "G4DynamicParticle.icc"
278
279
#endif
Generated on Sat May 25 2013 14:33:22 for Geant4 by
1.8.4