Geant4  10.01.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 79342 2014-02-24 11:42:42Z 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 {
48  if(IsGeneralIon())
49  { return GetIonLifeTime(); }
50  else
51  { return thePDGLifeTime; }
52 }
53 
54 inline
55  G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
56 {
57  return theParticleTable;
58 }
59 
60 inline
61  G4DecayTable* G4ParticleDefinition::GetDecayTable() const
62 {
63  return theDecayTable;
64 }
65 
66 inline
67  void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
68 {
69  theDecayTable = aDecayTable;
70 }
71 
72 inline
73  void G4ParticleDefinition::SetVerboseLevel(G4int value)
74 {
75  verboseLevel = value;
76 }
77 
78 inline
79  G4int G4ParticleDefinition::GetVerboseLevel() const
80 {
81  return verboseLevel;
82 }
83 
84 inline
85  G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
86 {
87  if(g4particleDefinitionInstanceID<0) return 0;
88  return G4MT_pmanager;
89 }
90 
91 inline
92  G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
93 {
94  return theProcessManagerShadow;
95 }
96 
97 inline
98  void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
99 {
100  theProcessManagerShadow = aNewPM;
101 }
102 
103 inline
104  G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
105 {
106  G4int content = 0;
107  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
108  {
109  content = theQuarkContent[flavor-1];
110  }
111  else
112  {
113 #ifdef G4VERBOSE
114  if (verboseLevel >0)
115  {
116  std::ostringstream message;
117  message << "Invalid Quark Flavor: " << flavor;
118  G4Exception("G4ParticleDefinition::GetQuarkContent()",
119  "InvalidFlavor", JustWarning, message);
120  }
121 #endif
122  }
123  return content;
124 }
125 
126 inline
127  G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
128 {
129  G4int content = 0;
130  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
131  {
132  content = theAntiQuarkContent[flavor-1];
133  }
134  else
135  {
136 #ifdef G4VERBOSE
137  if (verboseLevel >0)
138  {
139  std::ostringstream message;
140  message << "Invalid Quark Flavor: " << flavor;
141  G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
142  "InvalidFlavor", JustWarning, message);
143  }
144 #endif
145  }
146  return content;
147 }
148 
149 inline
150  void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
151 {
152  theParticleSubType = subtype;
153 }
154 
155 inline
156  void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
157 {
158  theAntiPDGEncoding = aEncoding;
159 }
160 
161 inline
162 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
163 {
164  return fApplyCutsFlag;
165 }
166 
167 inline
168  void G4ParticleDefinition::SetAtomicNumber(G4int i)
169 {
170  theAtomicNumber = i;
171 }
172 
173 inline
174  G4int G4ParticleDefinition::GetAtomicNumber() const
175 {
176  return theAtomicNumber;
177 }
178 
179 inline
180  void G4ParticleDefinition::SetAtomicMass(G4int i)
181 {
182  theAtomicMass = i;
183 }
184 
185 inline
186  G4int G4ParticleDefinition::GetAtomicMass() const
187 {
188  return theAtomicMass;
189 }
190 
191 inline
192  void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
193 {
194  thePDGMagneticMoment = magneticMoment;
195 }
196 
197 inline
198  G4bool G4ParticleDefinition::IsGeneralIon() const
199 {
200  return isGeneralIon;
201 }
202 
203 inline
204  G4int G4ParticleDefinition::GetParticleDefinitionID() const
205 {
206  return g4particleDefinitionInstanceID;
207 }
208