Geant4-11
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleDefinition.icc
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// G4ParticleDefinition inline methods implementation
27//
28// Authors: G.Cosmo, 2 December 1995 - Design, based on object model
29// M.Asai, 29 January 1996 - First implementation
30// --------------------------------------------------------------------
31
32inline
33G4int G4ParticleDefinition::GetInstanceID() const
34{
35 return g4particleDefinitionInstanceID;
36}
37
38inline
39G4bool G4ParticleDefinition::GetPDGStable() const
40{
41 if(IsGeneralIon())
42 { return (GetIonLifeTime()<0.); }
43 else
44 { return thePDGStable; }
45}
46
47inline
48G4double G4ParticleDefinition::GetPDGLifeTime() const
49{
50 return thePDGLifeTime;
51}
52
53inline
54G4double G4ParticleDefinition::GetIonLifeTime() const
55{
56 //-- No longer needed to access to G4IonTable.
57 //-- Method GetIonLifeTime() itself is kept for compatibility
58
59 return thePDGLifeTime;
60}
61
62inline
63G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
64{
65 return theParticleTable;
66}
67
68inline
69G4DecayTable* G4ParticleDefinition::GetDecayTable() const
70{
71 return theDecayTable;
72}
73
74inline
75void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
76{
77 theDecayTable = aDecayTable;
78}
79
80inline
81void G4ParticleDefinition::SetVerboseLevel(G4int value)
82{
83 verboseLevel = value;
84}
85
86inline
87G4int G4ParticleDefinition::GetVerboseLevel() const
88{
89 return verboseLevel;
90}
91
92inline
93G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
94{
95 return theProcessManagerShadow;
96}
97
98inline
99void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
100{
101 theProcessManagerShadow = aNewPM;
102}
103
104inline
105G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
106{
107 G4int content = 0;
108 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
109 {
110 content = theQuarkContent[flavor-1];
111 }
112 else
113 {
114#ifdef G4VERBOSE
115 if (verboseLevel >0)
116 {
117 std::ostringstream message;
118 message << "Invalid Quark Flavor: " << flavor;
119 G4Exception("G4ParticleDefinition::GetQuarkContent()",
120 "InvalidFlavor", JustWarning, message);
121 }
122#endif
123 }
124 return content;
125}
126
127inline
128G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
129{
130 G4int content = 0;
131 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
132 {
133 content = theAntiQuarkContent[flavor-1];
134 }
135 else
136 {
137#ifdef G4VERBOSE
138 if (verboseLevel >0)
139 {
140 std::ostringstream message;
141 message << "Invalid Quark Flavor: " << flavor;
142 G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
143 "InvalidFlavor", JustWarning, message);
144 }
145#endif
146 }
147 return content;
148}
149
150inline
151void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
152{
153 theParticleSubType = subtype;
154}
155
156inline
157void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
158{
159 theAntiPDGEncoding = aEncoding;
160}
161
162inline
163G4bool G4ParticleDefinition::GetApplyCutsFlag() const
164{
165 return fApplyCutsFlag;
166}
167
168inline
169void G4ParticleDefinition::SetAtomicNumber(G4int i)
170{
171 theAtomicNumber = i;
172}
173
174inline
175G4int G4ParticleDefinition::GetAtomicNumber() const
176{
177 return theAtomicNumber;
178}
179
180inline
181void G4ParticleDefinition::SetAtomicMass(G4int i)
182{
183 theAtomicMass = i;
184}
185
186inline
187G4int G4ParticleDefinition::GetAtomicMass() const
188{
189 return theAtomicMass;
190}
191
192inline
193void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
194{
195 thePDGMagneticMoment = magneticMoment;
196}
197
198inline
199G4bool G4ParticleDefinition::IsGeneralIon() const
200{
201 return isGeneralIon;
202}
203
204inline
205G4bool G4ParticleDefinition::IsMuonicAtom() const
206{
207 return isMuonicAtom;
208}
209
210inline
211G4int G4ParticleDefinition::GetParticleDefinitionID() const
212{
213 return g4particleDefinitionInstanceID;
214}
215
216inline
217G4bool G4ParticleDefinition::IsHypernucleus() const
218{
219 if ( GetNumberOfLambdasInHypernucleus() > 0 ) return true;
220 return false;
221}
222
223inline
224G4int G4ParticleDefinition::GetNumberOfLambdasInHypernucleus() const
225{
226 // PDG code of hypernuclei: 10LZZZAAAI
227 G4int numberOfLambdas = 0;
228 if ( thePDGEncoding > 0 ) numberOfLambdas = (thePDGEncoding/10000000)%100;
229 return numberOfLambdas;
230}
231
232inline
233G4bool G4ParticleDefinition::IsAntiHypernucleus() const
234{
235 if ( GetNumberOfAntiLambdasInAntiHypernucleus() > 0 ) return true;
236 return false;
237}
238
239inline
240G4int G4ParticleDefinition::GetNumberOfAntiLambdasInAntiHypernucleus() const
241{
242 // PDG code of anti-hypernuclei: -10LZZZAAAI
243 G4int numberOfAntiLambdas = 0;
244 if ( thePDGEncoding < 0 ) numberOfAntiLambdas = (std::abs(thePDGEncoding)/10000000)%100;
245 return numberOfAntiLambdas;
246}