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 // ********************************************************************
27 // $Id: G4ParticleDefinition.icc 92918 2015-09-21 15:04:01Z gcosmo $
31 G4int G4ParticleDefinition::GetInstanceID() const
33 return g4particleDefinitionInstanceID;
37 G4bool G4ParticleDefinition::GetPDGStable() const
40 { return (GetIonLifeTime()<0.); }
42 { return thePDGStable; }
46 G4double G4ParticleDefinition::GetPDGLifeTime() const
47 { return thePDGLifeTime; }
50 G4double G4ParticleDefinition::GetIonLifeTime() const
51 { return thePDGLifeTime; }
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.
57 // G4double G4ParticleDefinition::GetPDGLifeTime() const
60 // { return GetIonLifeTime(); }
62 // { return thePDGLifeTime; }
66 G4ParticleTable* G4ParticleDefinition::GetParticleTable() const
68 return theParticleTable;
72 G4DecayTable* G4ParticleDefinition::GetDecayTable() const
78 void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
80 theDecayTable = aDecayTable;
84 void G4ParticleDefinition::SetVerboseLevel(G4int value)
90 G4int G4ParticleDefinition::GetVerboseLevel() const
96 G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
98 if(g4particleDefinitionInstanceID<0) return 0;
103 G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const
105 return theProcessManagerShadow;
109 void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
111 theProcessManagerShadow = aNewPM;
115 G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
118 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
120 content = theQuarkContent[flavor-1];
127 std::ostringstream message;
128 message << "Invalid Quark Flavor: " << flavor;
129 G4Exception("G4ParticleDefinition::GetQuarkContent()",
130 "InvalidFlavor", JustWarning, message);
138 G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
141 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
143 content = theAntiQuarkContent[flavor-1];
150 std::ostringstream message;
151 message << "Invalid Quark Flavor: " << flavor;
152 G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
153 "InvalidFlavor", JustWarning, message);
161 void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
163 theParticleSubType = subtype;
167 void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
169 theAntiPDGEncoding = aEncoding;
173 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
175 return fApplyCutsFlag;
179 void G4ParticleDefinition::SetAtomicNumber(G4int i)
185 G4int G4ParticleDefinition::GetAtomicNumber() const
187 return theAtomicNumber;
191 void G4ParticleDefinition::SetAtomicMass(G4int i)
197 G4int G4ParticleDefinition::GetAtomicMass() const
199 return theAtomicMass;
203 void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
205 thePDGMagneticMoment = magneticMoment;
209 G4bool G4ParticleDefinition::IsGeneralIon() const
215 G4int G4ParticleDefinition::GetParticleDefinitionID() const
217 return g4particleDefinitionInstanceID;