Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4ParticleDefinition inline methods impleme << 27 // 26 // 28 // Authors: G.Cosmo, 2 December 1995 - Design, << 27 // $Id: G4ParticleDefinition.icc 73598 2013-09-02 09:18:28Z gcosmo $ 29 // M.Asai, 29 January 1996 - First im << 28 // 30 // ------------------------------------------- << 31 29 32 inline G4int G4ParticleDefinition::GetInstance << 30 inline 33 { << 31 G4int G4ParticleDefinition::GetInstanceID() const 34 return g4particleDefinitionInstanceID; << 32 { >> 33 return g4particleDefinitionInstanceID; 35 } 34 } 36 35 37 inline G4bool G4ParticleDefinition::GetPDGStab << 36 inline 38 { << 37 G4ParticleTable* G4ParticleDefinition::GetParticleTable() const 39 if (IsGeneralIon()) { << 38 { 40 return (GetIonLifeTime() < 0.); << 39 return theParticleTable; 41 } << 42 << 43 return thePDGStable; << 44 } 40 } 45 41 46 inline G4double G4ParticleDefinition::GetPDGLi << 42 inline 47 { << 43 G4DecayTable* G4ParticleDefinition::GetDecayTable() const 48 return thePDGLifeTime; << 44 { >> 45 return theDecayTable; 49 } 46 } 50 47 51 inline G4double G4ParticleDefinition::GetIonLi << 48 inline 52 { << 49 void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable) 53 //-- No longer needed to access to G4IonTabl << 50 { 54 //-- Method GetIonLifeTime() itself is kept << 51 theDecayTable = aDecayTable; 55 << 56 return thePDGLifeTime; << 57 } 52 } 58 53 59 inline G4ParticleTable* G4ParticleDefinition:: << 54 inline >> 55 void G4ParticleDefinition::SetVerboseLevel(G4int value) 60 { 56 { 61 return theParticleTable; << 57 verboseLevel = value; 62 } 58 } 63 59 64 inline G4DecayTable* G4ParticleDefinition::Get << 60 inline >> 61 G4int G4ParticleDefinition::GetVerboseLevel() const 65 { 62 { 66 return theDecayTable; << 63 return verboseLevel; 67 } 64 } 68 65 69 inline void G4ParticleDefinition::SetDecayTabl << 66 inline >> 67 G4ProcessManager* G4ParticleDefinition::GetProcessManager() const 70 { 68 { 71 theDecayTable = aDecayTable; << 69 if(g4particleDefinitionInstanceID<0) return 0; >> 70 return G4MT_pmanager; 72 } 71 } 73 72 74 inline void G4ParticleDefinition::SetVerboseLe << 73 inline >> 74 G4ProcessManager* G4ParticleDefinition::GetMasterProcessManager() const 75 { 75 { 76 verboseLevel = value; << 76 return theProcessManagerShadow; 77 } 77 } 78 78 79 inline G4int G4ParticleDefinition::GetVerboseL << 79 inline >> 80 void G4ParticleDefinition::SetMasterProcessManager( G4ProcessManager* aNewPM ) 80 { 81 { 81 return verboseLevel; << 82 theProcessManagerShadow = aNewPM; 82 } 83 } 83 84 84 inline G4ProcessManager* G4ParticleDefinition: << 85 inline >> 86 G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const 85 { 87 { 86 return theProcessManagerShadow; << 88 G4int content = 0; 87 } << 89 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor)) 88 << 90 { 89 inline void G4ParticleDefinition::SetMasterPro << 91 content = theQuarkContent[flavor-1]; 90 { << 91 theProcessManagerShadow = aNewPM; << 92 } << 93 << 94 inline G4int G4ParticleDefinition::GetQuarkCon << 95 { << 96 G4int content = 0; << 97 if ((flavor > 0) && (flavor <= NumberOfQuark << 98 content = theQuarkContent[flavor - 1]; << 99 } 92 } 100 else { << 93 else >> 94 { 101 #ifdef G4VERBOSE 95 #ifdef G4VERBOSE 102 if (verboseLevel > 0) { << 96 if (verboseLevel >0) >> 97 { 103 std::ostringstream message; 98 std::ostringstream message; 104 message << "Invalid Quark Flavor: " << f 99 message << "Invalid Quark Flavor: " << flavor; 105 G4Exception("G4ParticleDefinition::GetQu << 100 G4Exception("G4ParticleDefinition::GetQuarkContent()", 106 } << 101 "InvalidFlavor", JustWarning, message); 107 #endif << 102 } >> 103 #endif 108 } 104 } 109 return content; << 105 return content; 110 } 106 } 111 107 112 inline G4int G4ParticleDefinition::GetAntiQuar << 108 inline >> 109 G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const 113 { 110 { 114 G4int content = 0; 111 G4int content = 0; 115 if ((flavor > 0) && (flavor <= NumberOfQuark << 112 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor)) 116 content = theAntiQuarkContent[flavor - 1]; << 113 { >> 114 content = theAntiQuarkContent[flavor-1]; 117 } 115 } 118 else { << 116 else >> 117 { 119 #ifdef G4VERBOSE 118 #ifdef G4VERBOSE 120 if (verboseLevel > 0) { << 119 if (verboseLevel >0) >> 120 { 121 std::ostringstream message; 121 std::ostringstream message; 122 message << "Invalid Quark Flavor: " << f 122 message << "Invalid Quark Flavor: " << flavor; 123 G4Exception("G4ParticleDefinition::GetAn << 123 G4Exception("G4ParticleDefinition::GetAntiQuarkContent()", 124 message); << 124 "InvalidFlavor", JustWarning, message); 125 } 125 } 126 #endif 126 #endif 127 } << 127 } 128 return content; 128 return content; 129 } 129 } 130 130 131 inline void G4ParticleDefinition::SetParticleS << 131 inline >> 132 void G4ParticleDefinition::SetParticleSubType(const G4String& subtype) 132 { 133 { 133 theParticleSubType = subtype; 134 theParticleSubType = subtype; 134 } 135 } 135 << 136 136 inline void G4ParticleDefinition::SetAntiPDGEn << 137 inline 137 { << 138 void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding) 138 theAntiPDGEncoding = aEncoding; << 139 { >> 140 theAntiPDGEncoding = aEncoding; 139 } 141 } 140 142 141 inline G4bool G4ParticleDefinition::GetApplyCu << 143 inline >> 144 G4bool G4ParticleDefinition::GetApplyCutsFlag() const 142 { 145 { 143 return fApplyCutsFlag; 146 return fApplyCutsFlag; 144 } 147 } 145 148 146 inline void G4ParticleDefinition::SetAtomicNum << 149 inline >> 150 void G4ParticleDefinition::SetAtomicNumber(G4int i) 147 { 151 { 148 theAtomicNumber = i; 152 theAtomicNumber = i; 149 } 153 } 150 154 151 inline G4int G4ParticleDefinition::GetAtomicNu << 155 inline >> 156 G4int G4ParticleDefinition::GetAtomicNumber() const 152 { 157 { 153 return theAtomicNumber; 158 return theAtomicNumber; 154 } 159 } 155 160 156 inline void G4ParticleDefinition::SetAtomicMas << 161 inline >> 162 void G4ParticleDefinition::SetAtomicMass(G4int i) 157 { 163 { 158 theAtomicMass = i; 164 theAtomicMass = i; 159 } 165 } 160 166 161 inline G4int G4ParticleDefinition::GetAtomicMa << 167 inline >> 168 G4int G4ParticleDefinition::GetAtomicMass() const 162 { 169 { 163 return theAtomicMass; 170 return theAtomicMass; 164 } 171 } 165 172 166 inline void G4ParticleDefinition::SetPDGMagnet << 173 inline >> 174 void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment) 167 { 175 { 168 thePDGMagneticMoment = magneticMoment; << 176 thePDGMagneticMoment = magneticMoment; 169 } 177 } 170 178 171 inline G4bool G4ParticleDefinition::IsGeneralI << 179 inline >> 180 G4bool G4ParticleDefinition::IsGeneralIon() const 172 { 181 { 173 return isGeneralIon; 182 return isGeneralIon; 174 } 183 } 175 184 176 inline G4bool G4ParticleDefinition::IsMuonicAt << 185 inline 177 { << 186 G4int G4ParticleDefinition::GetParticleDefinitionID() const 178 return isMuonicAtom; << 179 } << 180 << 181 inline G4int G4ParticleDefinition::GetParticle << 182 { << 183 return g4particleDefinitionInstanceID; << 184 } << 185 << 186 inline G4bool G4ParticleDefinition::IsHypernuc << 187 { << 188 return GetNumberOfLambdasInHypernucleus() > << 189 } << 190 << 191 inline G4int G4ParticleDefinition::GetNumberOf << 192 { 187 { 193 G4int numberOfLambdas = 0; << 188 return g4particleDefinitionInstanceID; 194 // PDG code of hypernuclei: 10LZZZAAAI << 195 if (thePDGEncoding > 0 && thePDGEncoding / 1 << 196 numberOfLambdas = (thePDGEncoding / 100000 << 197 } << 198 return numberOfLambdas; << 199 } 189 } 200 190 201 inline G4bool G4ParticleDefinition::IsAntiHype << 202 { << 203 return GetNumberOfAntiLambdasInAntiHypernucl << 204 } << 205 << 206 inline G4int G4ParticleDefinition::GetNumberOf << 207 { << 208 G4int numberOfAntiLambdas = 0; << 209 // PDG code of anti-hypernuclei: -10LZZZAAAI << 210 if (thePDGEncoding < 0 && thePDGEncoding / 1 << 211 numberOfAntiLambdas = (std::abs(thePDGEnco << 212 } << 213 return numberOfAntiLambdas; << 214 } << 215 191