Geant4  10.02.p01
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 //
27 // $Id: G4ParticleDefinition.icc 92918 2015-09-21 15:04:01Z gcosmo $
28 //
29 
30 inline
31  G4int G4ParticleDefinition::GetInstanceID() const
32 {
33  return g4particleDefinitionInstanceID;
34 }
35 
36 inline
37  G4bool G4ParticleDefinition::GetPDGStable() const
38 {
39  if(IsGeneralIon())
40  { return (GetIonLifeTime()<0.); }
41  else
42  { return thePDGStable; }
43 }
44 
45 inline
46  G4double G4ParticleDefinition::GetPDGLifeTime() const
47 { return thePDGLifeTime; }
48 
49 inline
50  G4double G4ParticleDefinition::GetIonLifeTime() const
51 { return thePDGLifeTime; }
52 
53 //-- No longer needed to access to G4IonTable.
54 //-- Method GetIonLifeTime() itself is kept for compatibility
55 //-- but moved to icc file as an inlined method.
56 //inline
57 // G4double G4ParticleDefinition::GetPDGLifeTime() const
58 //{
59 // if(IsGeneralIon())
60 // { return GetIonLifeTime(); }
61 // else
62 // { return thePDGLifeTime; }
63 //}
64 
65 inline
66  G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
67 {
68  return theParticleTable;
69 }
70 
71 inline
72  G4DecayTable* G4ParticleDefinition::GetDecayTable() const
73 {
74  return theDecayTable;
75 }
76 
77 inline
78  void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
79 {
80  theDecayTable = aDecayTable;
81 }
82 
83 inline
84  void G4ParticleDefinition::SetVerboseLevel(G4int value)
85 {
86  verboseLevel = value;
87 }
88 
89 inline
90  G4int G4ParticleDefinition::GetVerboseLevel() const
91 {
92  return verboseLevel;
93 }
94 
95 inline
96  G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
97 {
98  if(g4particleDefinitionInstanceID<0) return 0;
99  return G4MT_pmanager;
100 }
101 
102 inline
103  G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
104 {
105  return theProcessManagerShadow;
106 }
107 
108 inline
109  void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
110 {
111  theProcessManagerShadow = aNewPM;
112 }
113 
114 inline
115  G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
116 {
117  G4int content = 0;
118  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
119  {
120  content = theQuarkContent[flavor-1];
121  }
122  else
123  {
124 #ifdef G4VERBOSE
125  if (verboseLevel >0)
126  {
127  std::ostringstream message;
128  message << "Invalid Quark Flavor: " << flavor;
129  G4Exception("G4ParticleDefinition::GetQuarkContent()",
130  "InvalidFlavor", JustWarning, message);
131  }
132 #endif
133  }
134  return content;
135 }
136 
137 inline
138  G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
139 {
140  G4int content = 0;
141  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
142  {
143  content = theAntiQuarkContent[flavor-1];
144  }
145  else
146  {
147 #ifdef G4VERBOSE
148  if (verboseLevel >0)
149  {
150  std::ostringstream message;
151  message << "Invalid Quark Flavor: " << flavor;
152  G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
153  "InvalidFlavor", JustWarning, message);
154  }
155 #endif
156  }
157  return content;
158 }
159 
160 inline
161  void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
162 {
163  theParticleSubType = subtype;
164 }
165 
166 inline
167  void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
168 {
169  theAntiPDGEncoding = aEncoding;
170 }
171 
172 inline
173 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
174 {
175  return fApplyCutsFlag;
176 }
177 
178 inline
179  void G4ParticleDefinition::SetAtomicNumber(G4int i)
180 {
181  theAtomicNumber = i;
182 }
183 
184 inline
185  G4int G4ParticleDefinition::GetAtomicNumber() const
186 {
187  return theAtomicNumber;
188 }
189 
190 inline
191  void G4ParticleDefinition::SetAtomicMass(G4int i)
192 {
193  theAtomicMass = i;
194 }
195 
196 inline
197  G4int G4ParticleDefinition::GetAtomicMass() const
198 {
199  return theAtomicMass;
200 }
201 
202 inline
203  void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
204 {
205  thePDGMagneticMoment = magneticMoment;
206 }
207 
208 inline
209  G4bool G4ParticleDefinition::IsGeneralIon() const
210 {
211  return isGeneralIon;
212 }
213 
214 inline
215  G4int G4ParticleDefinition::GetParticleDefinitionID() const
216 {
217  return g4particleDefinitionInstanceID;
218 }
219