Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4ParticleDefinition.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// ---------------- G4ParticleDefinition ----------------
36// first implementation by Makoto Asai, 29 January 1996
37// revised by G.Cosmo, 29 February 1996
38// revised by H.Kurashige, 19 April 1996
39// revised by H.Kurashige, 4 July 1996
40// added GetEnergyCuts() and GetLengthCuts() by G.Cosmo, 11 July 1996
41// added Set/GetVerboseLevel() H.Kurashige 11 Nov. 1997
42// added SetCuts() and ResetCuts H.Kurashige 15 Nov.1996
43// change SetProcessManager as public H.Kurashige 06 June 1998
44// added GetEnergyThreshold H.Kurashige 08 June 1998
45// added ShortLived flag and ApplyCuts flag H.Kurashige 27 June 1998
46// fixed some improper codings H.Kurashige 08 Apr. 1999
47// added sub-type H.Kurashige 15 Feb. 2000
48// added RestoreCuts H.Kurashige 09 Mar. 2001
49// restructuring for Cuts per Region by Hisaya 11 MAr.2003
50// added MagneticMoment Mar. 2007
51// ------------------------------------------------------------
52
53#ifndef G4ParticleDefinition_h
54#define G4ParticleDefinition_h 1
55
56#include <vector>
58
59#include "globals.hh"
60#include "G4ios.hh"
61
63class G4DecayTable;
64class G4ParticleTable;
66
68{
69 // Class Description
70 // This class containes all the static data of a particle.
71 // It also has uses a process manager in order to collect
72 // all the processes this kind of particle can undertake.
73 //
74
76
77 public: // With Description
78 // Only one type of constructor can be used for G4ParticleDefinition.
79 // If you want to create new particle, you must set name of the particle
80 // at construction. Most of members seen as arguments of the constructor
81 // (except last 3 arguments concerning with decay ) are "constant"
82 // and can not be changed later. (No "SET" methods are available)
83 // Each type of particle must be constructed as a unique object
84 // of special class derived from G4ParticleDefinition.
85 // see G4ParticleTypes for detail
86
87 G4ParticleDefinition(const G4String& aName,
88 G4double mass,
89 G4double width,
90 G4double charge,
91 G4int iSpin,
92 G4int iParity,
93 G4int iConjugation,
94 G4int iIsospin,
95 G4int iIsospinZ,
96 G4int gParity,
97 const G4String& pType,
98 G4int lepton,
99 G4int baryon,
101 G4bool stable,
102 G4double lifetime,
103 G4DecayTable *decaytable,
104 G4bool shortlived = false,
105 const G4String& subType ="",
106 G4int anti_encoding =0,
107 G4double magneticMoment = 0.0);
108
109 virtual ~G4ParticleDefinition();
110
111 public: // With Description
112 // By these following Getxxxx methods, you can get values
113 // for members which can not be changed
114 //
115 const G4String& GetParticleName() const { return theParticleName; }
116
117 G4double GetPDGMass() const { return thePDGMass; }
118 G4double GetPDGWidth() const { return thePDGWidth; }
119 G4double GetPDGCharge() const { return thePDGCharge; }
120
121 G4double GetPDGSpin() const { return thePDGSpin; }
122 G4int GetPDGiSpin() const { return thePDGiSpin; }
123 G4int GetPDGiParity() const { return thePDGiParity; }
124 G4int GetPDGiConjugation() const { return thePDGiConjugation; }
125 G4double GetPDGIsospin() const { return thePDGIsospin; }
126 G4double GetPDGIsospin3() const { return thePDGIsospin3; }
127 G4int GetPDGiIsospin() const { return thePDGiIsospin; }
128 G4int GetPDGiIsospin3() const { return thePDGiIsospin3; }
129 G4int GetPDGiGParity() const { return thePDGiGParity; }
130
131 G4double GetPDGMagneticMoment() const { return thePDGMagneticMoment; }
132 void SetPDGMagneticMoment(G4double mageticMoment);
134 // gives the anomaly of magnetic moment for spin 1/2 particles
135
136 const G4String& GetParticleType() const { return theParticleType; }
137 const G4String& GetParticleSubType() const { return theParticleSubType; }
138 G4int GetLeptonNumber() const { return theLeptonNumber; }
139 G4int GetBaryonNumber() const { return theBaryonNumber; }
140
141 G4int GetPDGEncoding() const { return thePDGEncoding; }
142 G4int GetAntiPDGEncoding() const { return theAntiPDGEncoding; }
143 void SetAntiPDGEncoding(G4int aEncoding);
144
145
148 // return the number of quark with flavor contained in this particle.
149 // The value of flavor is assigned as follows
150 // 1:d, 2:u, 3:s, 4:c, 5:b, 6:t
151
152
153 public: // With Description
154 // ShortLived flag
155 G4bool IsShortLived() const { return fShortLivedFlag; }
156
157 G4bool GetPDGStable() const { return thePDGStable; }
158 void SetPDGStable(const G4bool aFlag) { thePDGStable=aFlag; }
159
160 G4double GetPDGLifeTime() const { return thePDGLifeTime; }
161 void SetPDGLifeTime(G4double aLifeTime) { thePDGLifeTime = aLifeTime; }
162
163 public:// With Description
165 void SetDecayTable(G4DecayTable* aDecayTable);
166 // Set/Get Decay Table
167 // !! Decay Table can be modified !!
168
169 public: // With Description
171 void SetProcessManager(G4ProcessManager* aProcessManager);
172 // Set/Get Process Manager
173 // !! Process Manager can be modified !!
174
176 // get pointer to the particle table
177
178 void DumpTable() const;
179 // Prints information of data members.
180
181 protected:
183 // calculate quark and anti-quark contents
184 // return value is PDG encoding for this particle.
185 // It means error if the return value is deffernt from
186 // this->thePDGEncoding.
187
188 void SetParticleSubType(const G4String& subtype);
189
190 public: // With Description
191 // Get AtomicNumber and AtomicMass
192 // These properties are defined for nucleus
195
196 protected:
199
200 public:
203 // controle flag for output message
204 // 0: Silent
205 // 1: Warning message
206 // 2: More
207
208 protected:
209 // !!! can not use "copy constructor" nor "default constructor" !!!!
212
213 private:
214 // !!! Assignment operation is forbidden !!!
215 const G4ParticleDefinition & operator=(const G4ParticleDefinition &right);
216
217 public:
218 G4int operator==(const G4ParticleDefinition &right) const;
219 G4int operator!=(const G4ParticleDefinition &right) const;
220
221 private:
222 // Values following can not be changed
223 // i.e. No Setxxxx Methods for them
224
225 G4String theParticleName;
226 // The name of the particle.
227 // Each object must have its specific name!!
228
229 // --- following member values must be defined with Units
230 G4double thePDGMass;
231 // The mass of the particle, in units of equivalent energy.
232
233 G4double thePDGWidth;
234 // The decay width of the particle, usually the width of a
235 // Breit-Wigner function, assuming that you are near the
236 // mass center anyway. (in units of equivalent energy)
237
238 G4double thePDGCharge;
239 // The charge of the particle.(in units of Coulomb)
240
241 // ---- following members are quantum number
242 // i.e. discrete numbers can be allowded
243 // So, you can defined only by using integer in constructor
244 G4int thePDGiSpin;
245 // The total spin of the particle, also often denoted as
246 // capital J, in units of 1/2.
247 G4double thePDGSpin;
248 // The total spin of the particle, in units of 1.
249
250 G4int thePDGiParity;
251 // The parity quantum number, in units of 1. If the parity
252 // is not defined for this particle, we will set this to 0.
253
254 G4int thePDGiConjugation;
255 // This charge conjugation quantum number in units of 1.
256
257 G4int thePDGiGParity;
258 // The value of the G-parity quantum number.
259
260 G4int thePDGiIsospin;
261 G4int thePDGiIsospin3;
262 // The isospin and its 3rd-component in units of 1/2.
263 G4double thePDGIsospin;
264 G4double thePDGIsospin3;
265 // The isospin quantum number in units of 1.
266
267 G4double thePDGMagneticMoment;
268 // The magnetic moment.
269
270 G4int theLeptonNumber;
271 // The lepton quantum number.
272
273 G4int theBaryonNumber;
274 // The baryon quantum number.
275
276 G4String theParticleType;
277 // More general textual type description of the particle.
278
279 G4String theParticleSubType;
280 // Textual type description of the particle
281 // eg. pion, lamda etc.
282
283 G4int thePDGEncoding;
284 // The Particle Data Group integer identifier of this particle
285
286 G4int theAntiPDGEncoding;
287 // The Particle Data Group integer identifier of the anti-particle
288
289 protected:
293 // the number of quark (minus Sign means anti-quark) contents
294 // The value of flavor is assigned as follows
295 // 0:d, 1:u, 2:s, 3:c, 4:b, 5:t
296
297 private:
298 // Following members can be changed after construction
299
300 G4bool fShortLivedFlag;
301 // Particles which have true value of this flag
302 // will not be tracked by TrackingManager
303
304 G4bool thePDGStable;
305 // Is an indicator that this particle is stable. It must
306 // not decay. If the user tries to assign a kind of decay
307 // object to it, it will refuse to take it.
308
309 G4double thePDGLifeTime;
310 // Is related to the decay width of the particle. The mean
311 // life time is given in seconds.
312
313 class G4DecayTable *theDecayTable;
314 // Points DecayTable
315
316 private:
317 class G4ProcessManager *theProcessManager;
318 // Points to G4ProcessManager
319
320 G4ParticleTable* theParticleTable;
321
322 private:
323 G4int theAtomicNumber;
324 G4int theAtomicMass;
325
326 private:
327 G4int verboseLevel;
328
329 private:
330 G4bool fApplyCutsFlag;
331 public:
332
335
336};
337
338#include "G4ParticleDefinition.icc"
339
340#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4double GetPDGMagneticMoment() const
G4ProcessManager * GetProcessManager() const
G4double GetPDGIsospin() const
G4int GetAtomicNumber() const
const G4String & GetParticleType() const
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4int GetVerboseLevel() const
void SetPDGMagneticMoment(G4double mageticMoment)
G4int operator==(const G4ParticleDefinition &right) const
G4int operator!=(const G4ParticleDefinition &right) const
G4int GetAtomicMass() const
void SetPDGStable(const G4bool aFlag)
G4int GetQuarkContent(G4int flavor) const
void SetVerboseLevel(G4int value)
G4double GetPDGWidth() const
void SetParticleSubType(const G4String &subtype)
G4double GetPDGCharge() const
void SetPDGLifeTime(G4double aLifeTime)
G4DecayTable * GetDecayTable() const
G4int theQuarkContent[NumberOfQuarkFlavor]
void SetAtomicMass(G4int)
G4ParticleTable * GetParticleTable() const
void SetAntiPDGEncoding(G4int aEncoding)
void SetDecayTable(G4DecayTable *aDecayTable)
G4double CalculateAnomaly() const
G4double GetPDGLifeTime() const
G4bool GetApplyCutsFlag() const
const G4String & GetParticleName() const
G4double GetPDGIsospin3() const
void SetProcessManager(G4ProcessManager *aProcessManager)
void SetAtomicNumber(G4int)
const G4String & GetParticleSubType() const
G4int GetAntiQuarkContent(G4int flavor) const