Geant4  10.03
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 99391 2016-09-20 13:32:30Z 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::GetMasterProcessManager() const
97 {
98  return theProcessManagerShadow;
99 }
100 
101 inline
102  void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
103 {
104  theProcessManagerShadow = aNewPM;
105 }
106 
107 inline
108  G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
109 {
110  G4int content = 0;
111  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
112  {
113  content = theQuarkContent[flavor-1];
114  }
115  else
116  {
117 #ifdef G4VERBOSE
118  if (verboseLevel >0)
119  {
120  std::ostringstream message;
121  message << "Invalid Quark Flavor: " << flavor;
122  G4Exception("G4ParticleDefinition::GetQuarkContent()",
123  "InvalidFlavor", JustWarning, message);
124  }
125 #endif
126  }
127  return content;
128 }
129 
130 inline
131  G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
132 {
133  G4int content = 0;
134  if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
135  {
136  content = theAntiQuarkContent[flavor-1];
137  }
138  else
139  {
140 #ifdef G4VERBOSE
141  if (verboseLevel >0)
142  {
143  std::ostringstream message;
144  message << "Invalid Quark Flavor: " << flavor;
145  G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
146  "InvalidFlavor", JustWarning, message);
147  }
148 #endif
149  }
150  return content;
151 }
152 
153 inline
154  void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
155 {
156  theParticleSubType = subtype;
157 }
158 
159 inline
160  void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
161 {
162  theAntiPDGEncoding = aEncoding;
163 }
164 
165 inline
166 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
167 {
168  return fApplyCutsFlag;
169 }
170 
171 inline
172  void G4ParticleDefinition::SetAtomicNumber(G4int i)
173 {
174  theAtomicNumber = i;
175 }
176 
177 inline
178  G4int G4ParticleDefinition::GetAtomicNumber() const
179 {
180  return theAtomicNumber;
181 }
182 
183 inline
184  void G4ParticleDefinition::SetAtomicMass(G4int i)
185 {
186  theAtomicMass = i;
187 }
188 
189 inline
190  G4int G4ParticleDefinition::GetAtomicMass() const
191 {
192  return theAtomicMass;
193 }
194 
195 inline
196  void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
197 {
198  thePDGMagneticMoment = magneticMoment;
199 }
200 
201 inline
202  G4bool G4ParticleDefinition::IsGeneralIon() const
203 {
204  return isGeneralIon;
205 }
206 
207 inline
208  G4int G4ParticleDefinition::GetParticleDefinitionID() const
209 {
210  return g4particleDefinitionInstanceID;
211 }
212