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