2// ********************************************************************
3// * License and Disclaimer *
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. *
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. *
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// ********************************************************************
26// G4ParticleDefinition inline methods implementation
28// Authors: G.Cosmo, 2 December 1995 - Design, based on object model
29// M.Asai, 29 January 1996 - First implementation
30// --------------------------------------------------------------------
33G4int G4ParticleDefinition::GetInstanceID() const
35 return g4particleDefinitionInstanceID;
39G4bool G4ParticleDefinition::GetPDGStable() const
42 { return (GetIonLifeTime()<0.); }
44 { return thePDGStable; }
48G4double G4ParticleDefinition::GetPDGLifeTime() const
50 return thePDGLifeTime;
54G4double G4ParticleDefinition::GetIonLifeTime() const
56 //-- No longer needed to access to G4IonTable.
57 //-- Method GetIonLifeTime() itself is kept for compatibility
59 return thePDGLifeTime;
63G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
65 return theParticleTable;
69G4DecayTable* G4ParticleDefinition::GetDecayTable() const
75void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
77 theDecayTable = aDecayTable;
81void G4ParticleDefinition::SetVerboseLevel(G4int value)
87G4int G4ParticleDefinition::GetVerboseLevel() const
93G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
95 return theProcessManagerShadow;
99void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
101 theProcessManagerShadow = aNewPM;
105G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
108 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
110 content = theQuarkContent[flavor-1];
117 std::ostringstream message;
118 message << "Invalid Quark Flavor: " << flavor;
119 G4Exception("G4ParticleDefinition::GetQuarkContent()",
120 "InvalidFlavor", JustWarning, message);
128G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
131 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
133 content = theAntiQuarkContent[flavor-1];
140 std::ostringstream message;
141 message << "Invalid Quark Flavor: " << flavor;
142 G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
143 "InvalidFlavor", JustWarning, message);
151void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
153 theParticleSubType = subtype;
157void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
159 theAntiPDGEncoding = aEncoding;
163G4bool G4ParticleDefinition::GetApplyCutsFlag() const
165 return fApplyCutsFlag;
169void G4ParticleDefinition::SetAtomicNumber(G4int i)
175G4int G4ParticleDefinition::GetAtomicNumber() const
177 return theAtomicNumber;
181void G4ParticleDefinition::SetAtomicMass(G4int i)
187G4int G4ParticleDefinition::GetAtomicMass() const
189 return theAtomicMass;
193void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
195 thePDGMagneticMoment = magneticMoment;
199G4bool G4ParticleDefinition::IsGeneralIon() const
205G4bool G4ParticleDefinition::IsMuonicAtom() const
211G4int G4ParticleDefinition::GetParticleDefinitionID() const
213 return g4particleDefinitionInstanceID;
217G4bool G4ParticleDefinition::IsHypernucleus() const
219 if ( GetNumberOfLambdasInHypernucleus() > 0 ) return true;
224G4int G4ParticleDefinition::GetNumberOfLambdasInHypernucleus() const
226 // PDG code of hypernuclei: 10LZZZAAAI
227 G4int numberOfLambdas = 0;
228 if ( thePDGEncoding > 0 ) numberOfLambdas = (thePDGEncoding/10000000)%100;
229 return numberOfLambdas;
233G4bool G4ParticleDefinition::IsAntiHypernucleus() const
235 if ( GetNumberOfAntiLambdasInAntiHypernucleus() > 0 ) return true;
240G4int G4ParticleDefinition::GetNumberOfAntiLambdasInAntiHypernucleus() const
242 // PDG code of anti-hypernuclei: -10LZZZAAAI
243 G4int numberOfAntiLambdas = 0;
244 if ( thePDGEncoding < 0 ) numberOfAntiLambdas = (std::abs(thePDGEncoding)/10000000)%100;
245 return numberOfAntiLambdas;