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 99391 2016-09-20 13:32:30Z 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::GetMasterProcessManager() const
98 return theProcessManagerShadow;
102 void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM )
104 theProcessManagerShadow = aNewPM;
108 G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
111 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
113 content = theQuarkContent[flavor-1];
120 std::ostringstream message;
121 message << "Invalid Quark Flavor: " << flavor;
122 G4Exception("G4ParticleDefinition::GetQuarkContent()",
123 "InvalidFlavor", JustWarning, message);
131 G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
134 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor))
136 content = theAntiQuarkContent[flavor-1];
143 std::ostringstream message;
144 message << "Invalid Quark Flavor: " << flavor;
145 G4Exception("G4ParticleDefinition::GetAntiQuarkContent()",
146 "InvalidFlavor", JustWarning, message);
154 void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
156 theParticleSubType = subtype;
160 void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
162 theAntiPDGEncoding = aEncoding;
166 G4bool G4ParticleDefinition::GetApplyCutsFlag() const
168 return fApplyCutsFlag;
172 void G4ParticleDefinition::SetAtomicNumber(G4int i)
178 G4int G4ParticleDefinition::GetAtomicNumber() const
180 return theAtomicNumber;
184 void G4ParticleDefinition::SetAtomicMass(G4int i)
190 G4int G4ParticleDefinition::GetAtomicMass() const
192 return theAtomicMass;
196 void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
198 thePDGMagneticMoment = magneticMoment;
202 G4bool G4ParticleDefinition::IsGeneralIon() const
208 G4int G4ParticleDefinition::GetParticleDefinitionID() const
210 return g4particleDefinitionInstanceID;