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 class implementation << 27 // 26 // 28 // Authors: G.Cosmo, 2 December 1995 - Design, << 27 // $Id: G4ParticleDefinition.cc,v 1.27 2006/06/29 19:25:52 gunter Exp $ 29 // M.Asai, 29 January 1996 - First im << 28 // GEANT4 tag $Name: geant4-08-01 $ 30 // History: << 29 // 31 // - 1996-2003, H.Kurashige - Revisions << 30 // 32 // - 11.03.2003, H.Kurashige - Restructuring f << 31 // -------------------------------------------------------------- 33 // - 25.01.2013, G.Cosmo, A.Dotti - Introduced << 32 // GEANT 4 class implementation file 34 // - 15.06.2017, K.L.Genser - Added support fo << 33 // 35 // ------------------------------------------- << 34 // History: first implementation, based on object model of >> 35 // 2nd December 1995, G.Cosmo >> 36 // ---------------- G4ParticleDefinition ----------------- >> 37 // first implementation by Makoto Asai, 29 January 1996 >> 38 // revised by G.Cosmo, 29 February 1996 >> 39 // revised by H.Kurashige, 19 April 1996 >> 40 // Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban, 26/6/96 >> 41 // revised by H.Kurashige, 4 July 1996 >> 42 // revised by H.Kurashige, 16 Feb 1997 >> 43 // revised by H.Kurashige, 10 Nov 1997 >> 44 // remove new/delete G4ProcessManager by H.Kurashige 06 June 1998 >> 45 // added Resonance flag and ApplyCuts flag H.Kurashige 27 June 1998 >> 46 // modify FillQuarkContents() for quarks/diquarks H.Kurashige 30 June 1998 >> 47 // modify encoding rule H.Kurashige 23 Oct. 98 >> 48 // modify FillQuarkContents() for deltas 25 Nov.,98 H.Kurashige >> 49 // >> 50 // modify FillQuarkContents() to use G4PDGCodeChecker 17 Aug. 99 H.Kurashige >> 51 // -------------------------------------------------------------- 36 52 37 #include "G4ParticleDefinition.hh" << 38 53 >> 54 #include "G4ParticleDefinition.hh" >> 55 #include "G4ParticleTable.hh" 39 #include "G4DecayTable.hh" 56 #include "G4DecayTable.hh" 40 #include "G4IonTable.hh" << 41 #include "G4PDGCodeChecker.hh" 57 #include "G4PDGCodeChecker.hh" 42 #include "G4ParticleTable.hh" << 43 #include "G4PhysicalConstants.hh" << 44 #include "G4StateManager.hh" << 45 #include "G4SystemOfUnits.hh" << 46 #include "G4Threading.hh" << 47 #include "G4UnitsTable.hh" << 48 << 49 // This new field helps to use the class G4PDe << 50 // << 51 G4PDefManager G4ParticleDefinition::subInstanc << 52 << 53 // This macro changes the references to fields << 54 // in the class G4PDefData. << 55 // << 56 #define G4MT_pmanager \ << 57 ((subInstanceManager.offset()[g4particleDefi << 58 #define G4MT_tmanager \ << 59 ((subInstanceManager.offset()[g4particleDefi << 60 58 61 // ------------------------------------------- << 62 // clang-format off << 63 G4ParticleDefinition::G4ParticleDefinition( 59 G4ParticleDefinition::G4ParticleDefinition( 64 const G4String& aName, << 60 const G4String& aName, 65 G4double mass, << 61 G4double mass, 66 G4double width, << 62 G4double width, 67 G4double charge, << 63 G4double charge, 68 G4int iSpin, << 64 G4int iSpin, 69 G4int iParity, << 65 G4int iParity, 70 G4int iConjugation, << 66 G4int iConjugation, 71 G4int iIsospin, << 67 G4int iIsospin, 72 G4int iIsospin3, << 68 G4int iIsospin3, 73 G4int gParity, << 69 G4int gParity, 74 const G4String& pType, << 70 const G4String& pType, 75 G4int lepton, << 71 G4int lepton, 76 G4int baryon, << 72 G4int baryon, 77 G4int encoding, << 73 G4int encoding, 78 G4bool stable, << 74 G4bool stable, 79 G4double lifetime, << 75 G4double lifetime, 80 G4DecayTable* decaytable, << 76 G4DecayTable *decaytable, 81 G4bool shortlived, << 77 G4bool shortlived, 82 const G4String& subType, << 78 const G4String& subType, 83 G4int anti_encoding, << 79 G4int anti_encoding) 84 G4double magneticMoment) << 80 85 << 81 : theParticleName(aName), 86 : theParticleName(aName), << 82 thePDGMass(mass), 87 thePDGMass(mass), << 83 thePDGWidth(width), 88 thePDGWidth(width), << 84 thePDGCharge(charge), 89 thePDGCharge(charge), << 85 thePDGiSpin(iSpin), 90 thePDGiSpin(iSpin), << 86 thePDGSpin(iSpin*0.5), 91 thePDGSpin(iSpin*0.5), << 87 thePDGiParity(iParity), 92 thePDGiParity(iParity), << 88 thePDGiConjugation(iConjugation), 93 thePDGiConjugation(iConjugation), << 89 thePDGiGParity(gParity), 94 thePDGiGParity(gParity), << 90 thePDGiIsospin(iIsospin), 95 thePDGiIsospin(iIsospin), << 91 thePDGiIsospin3(iIsospin3), 96 thePDGiIsospin3(iIsospin3), << 92 thePDGIsospin(iIsospin*0.5), 97 thePDGIsospin(iIsospin*0.5), << 93 thePDGIsospin3(iIsospin3*0.5), 98 thePDGIsospin3(iIsospin3*0.5), << 94 theLeptonNumber(lepton), 99 thePDGMagneticMoment(magneticMoment), << 95 theBaryonNumber(baryon), 100 theLeptonNumber(lepton), << 96 theParticleType(pType), 101 theBaryonNumber(baryon), << 97 theParticleSubType(subType), 102 theParticleType(pType), << 98 thePDGEncoding(encoding), 103 theParticleSubType(subType), << 99 theAntiPDGEncoding(-1*encoding), 104 thePDGEncoding(encoding), << 100 fShortLivedFlag(shortlived), 105 theAntiPDGEncoding(-1*encoding), << 101 thePDGStable(stable), 106 fShortLivedFlag(shortlived), << 102 thePDGLifeTime(lifetime), 107 thePDGStable(stable), << 103 theDecayTable(decaytable), 108 thePDGLifeTime(lifetime), << 104 theProcessManager(0), 109 theDecayTable(decaytable) << 105 theAtomicNumber(0), 110 // clang-format on << 106 theAtomicMass(0), 111 { << 107 verboseLevel(1), 112 static const G4String nucleus("nucleus"); << 108 fApplyCutsFlag(false) 113 static const G4String muAtom("MuonicAtom"); << 109 { 114 << 110 // check name and register this particle into ParticleTable 115 g4particleDefinitionInstanceID = -1; << 111 theParticleTable = G4ParticleTable::GetParticleTable(); 116 theProcessManagerShadow = nullptr; << 112 theParticleTable->Insert(this); 117 << 118 theParticleTable = G4ParticleTable::GetParti << 119 << 120 // set verboseLevel equal to ParticleTable << 121 verboseLevel = theParticleTable->GetVerboseL << 122 << 123 if (anti_encoding != 0) theAntiPDGEncoding = << 124 << 125 // check quark contents << 126 if (this->FillQuarkContents() != thePDGEncod << 127 #ifdef G4VERBOSE << 128 if (verboseLevel > 0) { << 129 // Using G4cout expecting that it is ava << 130 // in construction of static objects << 131 G4cout << "Particle " << aName << " has << 132 } << 133 #endif << 134 G4Exception("G4ParticleDefintion::G4Partic << 135 "Strange PDGEncoding "); << 136 } << 137 113 138 // check initialization is in Pre_Init state << 114 if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding; 139 G4ApplicationState currentState = G4StateMan << 140 115 141 if (!fShortLivedFlag && (theParticleType != << 116 // check quark contents 142 && (currentState != G4State_PreInit)) << 143 { << 144 #ifdef G4VERBOSE 117 #ifdef G4VERBOSE 145 if (GetVerboseLevel() > 0) { << 118 if (this->FillQuarkContents() != thePDGEncoding) { 146 G4cout << "G4ParticleDefinition (other t << 119 if (verboseLevel>0) { 147 << " should be created in Pre_Ini << 120 // Using G4cerr expecting that it is available in construction of static objects 148 } << 121 G4cerr << "Particle " << aName << " has a strange PDGEncoding " <<G4endl; >> 122 } >> 123 } 149 #endif 124 #endif 150 G4Exception("G4ParticleDefintion::G4Partic << 151 "G4ParticleDefinition should b << 152 } << 153 << 154 if (theParticleTable->GetIonTable()->IsIon(t << 155 SetAtomicNumber(G4int(GetPDGCharge() / epl << 156 SetAtomicMass(GetBaryonNumber()); << 157 } << 158 << 159 if (theParticleTable->GetIonTable()->IsAntiI << 160 SetAtomicNumber(std::abs(G4int(GetPDGCharg << 161 SetAtomicMass(std::abs(GetBaryonNumber())) << 162 } << 163 << 164 // check name and register this particle int << 165 theParticleTable->Insert(this); << 166 } 125 } 167 126 168 G4ParticleDefinition::G4ParticleDefinition() << 127 G4ParticleDefinition::G4ParticleDefinition(const G4ParticleDefinition &) 169 { 128 { 170 G4Exception("G4ParticleDefinition::G4Particl << 129 G4Exception("G4ParticleDefinition::G4ParticleDefinition()", 171 "Illegal call of default constru << 130 "illegal constructor call", FatalException, >> 131 "You call Copy Constructor of G4ParticleDefinition "); 172 } 132 } 173 133 174 G4ParticleDefinition::~G4ParticleDefinition() << 134 G4ParticleDefinition::G4ParticleDefinition() 175 { 135 { 176 if (G4ParticleTable::GetParticleTable()->Get << 136 G4Exception("G4ParticleDefinition::G4ParticleDefinition()", 177 G4StateManager* pStateManager = G4StateMan << 137 "illegal constructor call", FatalException, 178 G4ApplicationState currentState = pStateMa << 138 "You call Default Constructor of G4ParticleDefinition "); 179 if (currentState != G4State_PreInit) { << 180 G4String msg = "Request of deletion for << 181 msg += GetParticleName(); << 182 msg += " has No effects because readyToU << 183 G4Exception("G4ParticleDefinition::~G4Pa << 184 return; << 185 } << 186 << 187 #ifdef G4VERBOSE << 188 if (verboseLevel > 0) { << 189 G4cout << GetParticleName() << " will be << 190 } << 191 #endif << 192 } << 193 delete theDecayTable; << 194 } 139 } 195 140 196 G4bool G4ParticleDefinition::operator==(const << 197 { << 198 return (this->theParticleName == right.thePa << 199 } << 200 141 201 G4bool G4ParticleDefinition::operator!=(const << 142 G4ParticleDefinition::~G4ParticleDefinition() 202 { 143 { 203 return (this->theParticleName != right.thePa << 144 if (theDecayTable!= 0) delete theDecayTable; 204 } 145 } 205 146 206 const G4PDefManager& G4ParticleDefinition::Get << 207 { << 208 // Returns the private data instance manager << 209 return subInstanceManager; << 210 } << 211 147 212 void G4ParticleDefinition::Clean() << 148 const G4ParticleDefinition & G4ParticleDefinition::operator=(const G4ParticleDefinition &right) 213 { 149 { 214 // Clears memory allocated by sub-instance m << 150 if (this != &right) { 215 subInstanceManager.FreeSlave(); << 151 } >> 152 return *this; 216 } 153 } 217 154 218 G4ProcessManager* G4ParticleDefinition::GetPro << 155 G4int G4ParticleDefinition::operator==(const G4ParticleDefinition &right) const 219 { 156 { 220 if (g4particleDefinitionInstanceID < 0) retu << 157 return (this->theParticleName == right.theParticleName); 221 return G4MT_pmanager; << 222 } 158 } 223 159 224 G4VTrackingManager* G4ParticleDefinition::GetT << 160 G4int G4ParticleDefinition::operator!=(const G4ParticleDefinition &right) const 225 { 161 { 226 if (g4particleDefinitionInstanceID < 0) retu << 162 return (this->theParticleName != right.theParticleName); 227 return G4MT_tmanager; << 228 } 163 } 229 164 >> 165 >> 166 230 G4int G4ParticleDefinition::FillQuarkContents( 167 G4int G4ParticleDefinition::FillQuarkContents() >> 168 // calculate quark and anti-quark contents >> 169 // return value is PDG encoding for this particle. >> 170 // It means error if the return value is differnt from >> 171 // this->thePDGEncoding. 231 { 172 { 232 // Calculate quark and anti-quark contents << 233 // Returned value is the PDG encoding for th << 234 // It means error if the return value is dif << 235 // this->thePDGEncoding << 236 << 237 G4int flavor; 173 G4int flavor; 238 for (flavor = 0; flavor < NumberOfQuarkFlavo << 174 for (flavor= 0; flavor<NumberOfQuarkFlavor; flavor++){ 239 theQuarkContent[flavor] = 0; << 175 theQuarkContent[flavor] = 0; 240 theAntiQuarkContent[flavor] = 0; 176 theAntiQuarkContent[flavor] = 0; 241 } 177 } 242 178 243 G4PDGCodeChecker checker; 179 G4PDGCodeChecker checker; 244 checker.SetVerboseLevel(verboseLevel); << 245 180 246 G4int temp = checker.CheckPDGCode(thePDGEnco 181 G4int temp = checker.CheckPDGCode(thePDGEncoding, theParticleType); 247 182 248 if (temp != 0) { << 183 if ( temp != 0) { 249 for (flavor = 0; flavor < NumberOfQuarkFla << 184 for (flavor= 0; flavor<NumberOfQuarkFlavor; flavor++){ 250 theQuarkContent[flavor] = checker.GetQua << 185 theQuarkContent[flavor] = checker.GetQuarkContent(flavor); 251 theAntiQuarkContent[flavor] = checker.Ge 186 theAntiQuarkContent[flavor] = checker.GetAntiQuarkContent(flavor); 252 } 187 } 253 if ((theParticleType == "meson") || (thePa << 188 if ((theParticleType == "meson")||(theParticleType == "baryon")) { 254 // check charge 189 // check charge 255 if (!checker.CheckCharge(thePDGCharge)) << 190 if (!checker.CheckCharge(thePDGCharge) ){ 256 temp = 0; << 191 temp = 0; 257 G4Exception("G4ParticleDefintion::G4Pa << 258 "Inconsistent charge again << 259 #ifdef G4VERBOSE 192 #ifdef G4VERBOSE 260 if (verboseLevel > 0) { << 193 if (verboseLevel>1) { 261 G4cout << "G4ParticleDefinition::Fil << 194 G4cout << " illegal charge (" << thePDGCharge/eplus; 262 << " illegal charge (" << the << 195 G4cout << " PDG code=" << thePDGEncoding <<G4endl; 263 << G4endl; << 196 } 264 } << 265 #endif 197 #endif 266 } 198 } 267 // check spin << 199 // check spin 268 if (checker.GetSpin() != thePDGiSpin) { 200 if (checker.GetSpin() != thePDGiSpin) { 269 temp = 0; << 201 temp=0; 270 G4Exception("G4ParticleDefintion::G4Pa << 271 "Inconsistent spin against << 272 #ifdef G4VERBOSE 202 #ifdef G4VERBOSE 273 if (verboseLevel > 0) { << 203 if (verboseLevel>1) { 274 G4cout << "G4ParticleDefinition::Fil << 204 G4cout << " illegal SPIN (" << thePDGiSpin << "/2"; 275 << " illegal SPIN (" << thePD << 205 G4cout << " PDG code=" << thePDGEncoding <<G4endl; 276 << " PDG code=" << thePDGEnco << 206 } 277 } << 278 #endif 207 #endif 279 } 208 } 280 } 209 } 281 } 210 } 282 return temp; 211 return temp; 283 } 212 } 284 213 285 void G4ParticleDefinition::DumpTable() const 214 void G4ParticleDefinition::DumpTable() const 286 { 215 { 287 G4cout << G4endl; 216 G4cout << G4endl; 288 G4cout << "--- G4ParticleDefinition ---" << 217 G4cout << "--- G4ParticleDefinition ---" << G4endl; 289 G4cout << " Particle Name : " << theParticle 218 G4cout << " Particle Name : " << theParticleName << G4endl; 290 G4cout << " PDG particle code : " << thePDGE 219 G4cout << " PDG particle code : " << thePDGEncoding; 291 G4cout << " [PDG anti-particle code: " << th << 220 G4cout << " [PDG anti-particle code: " << this->GetAntiPDGEncoding() << "]"<< G4endl; 292 G4cout << " Mass [GeV/c2] : " << thePDGMass << 221 G4cout << " Mass [GeV/c2] : " << thePDGMass/GeV ; 293 G4cout << " Width : " << thePDGWidth / G << 222 G4cout << " Width : " << thePDGWidth/GeV << G4endl; 294 G4cout << " Lifetime [nsec] : " << thePDGLif << 223 G4cout << " Lifetime [nsec] : " << thePDGLifeTime/ns << G4endl; 295 G4cout << " Charge [e]: " << thePDGCharge / << 224 G4cout << " Charge [e]: " << thePDGCharge/eplus << G4endl; 296 G4cout << " Spin : " << thePDGiSpin << "/2" 225 G4cout << " Spin : " << thePDGiSpin << "/2" << G4endl; 297 G4cout << " Parity : " << thePDGiParity << G 226 G4cout << " Parity : " << thePDGiParity << G4endl; 298 G4cout << " Charge conjugation : " << thePDG 227 G4cout << " Charge conjugation : " << thePDGiConjugation << G4endl; 299 G4cout << " Isospin : (I,Iz): (" << thePDGiI << 228 G4cout << " Isospin : (I,Iz): (" << thePDGiIsospin <<"/2"; 300 G4cout << " , " << thePDGiIsospin3 << "/2 ) 229 G4cout << " , " << thePDGiIsospin3 << "/2 ) " << G4endl; 301 G4cout << " GParity : " << thePDGiGParity << 230 G4cout << " GParity : " << thePDGiGParity << G4endl; 302 if (thePDGMagneticMoment != 0.0) { << 303 G4cout << " MagneticMoment [MeV/T] : " << << 304 } << 305 G4cout << " Quark contents (d,u,s,c,b,t) 231 G4cout << " Quark contents (d,u,s,c,b,t) : " << theQuarkContent[0]; 306 G4cout << ", " << theQuarkContent[1]; 232 G4cout << ", " << theQuarkContent[1]; 307 G4cout << ", " << theQuarkContent[2]; 233 G4cout << ", " << theQuarkContent[2]; 308 G4cout << ", " << theQuarkContent[3]; 234 G4cout << ", " << theQuarkContent[3]; 309 G4cout << ", " << theQuarkContent[4]; 235 G4cout << ", " << theQuarkContent[4]; 310 G4cout << ", " << theQuarkContent[5] << G4en 236 G4cout << ", " << theQuarkContent[5] << G4endl; 311 G4cout << " AntiQuark contents 237 G4cout << " AntiQuark contents : " << theAntiQuarkContent[0]; 312 G4cout << ", " << theAntiQuarkContent[1]; 238 G4cout << ", " << theAntiQuarkContent[1]; 313 G4cout << ", " << theAntiQuarkContent[2]; 239 G4cout << ", " << theAntiQuarkContent[2]; 314 G4cout << ", " << theAntiQuarkContent[3]; 240 G4cout << ", " << theAntiQuarkContent[3]; 315 G4cout << ", " << theAntiQuarkContent[4]; 241 G4cout << ", " << theAntiQuarkContent[4]; 316 G4cout << ", " << theAntiQuarkContent[5] << 242 G4cout << ", " << theAntiQuarkContent[5] << G4endl; 317 G4cout << " Lepton number : " << theLeptonNu 243 G4cout << " Lepton number : " << theLeptonNumber; 318 G4cout << " Baryon number : " << theBaryonNu 244 G4cout << " Baryon number : " << theBaryonNumber << G4endl; 319 G4cout << " Particle type : " << theParticle << 245 G4cout << " Particle type : " << theParticleType ; 320 G4cout << " [" << theParticleSubType << "]" 246 G4cout << " [" << theParticleSubType << "]" << G4endl; 321 247 322 if ((theParticleTable->GetIonTable()->IsIon( << 248 if ( fShortLivedFlag ){ 323 || (theParticleTable->GetIonTable()->IsA << 324 { << 325 G4cout << " Atomic Number : " << GetAtomic << 326 G4cout << " Atomic Mass : " << GetAtomicM << 327 } << 328 if (fShortLivedFlag) { << 329 G4cout << " ShortLived : ON" << G4endl; 249 G4cout << " ShortLived : ON" << G4endl; 330 } 250 } 331 251 332 if (IsGeneralIon()) { << 252 if ( thePDGStable ){ 333 G4double lftm = GetIonLifeTime(); << 253 G4cout << " Stable : stable" << G4endl; 334 if (lftm < -1000.) { << 254 } else { 335 G4cout << " Stable : No data found -- un << 255 if( theDecayTable != 0 ){ 336 } << 256 theDecayTable->DumpInfo(); 337 else if (lftm < 0.) { << 257 } else { 338 G4cout << " Stable : stable" << G4endl; << 258 G4cout << "Decay Table is not defined !!" <<G4endl; 339 } << 340 else { << 341 G4cout << " Stable : unstable -- lifetim << 342 << "\n Decay table should be con << 343 } << 344 } << 345 else { << 346 if (thePDGStable) { << 347 G4cout << " Stable : stable" << G4endl; << 348 } << 349 else { << 350 if (theDecayTable != nullptr) { << 351 theDecayTable->DumpInfo(); << 352 } << 353 else { << 354 G4cout << "Decay Table is not defined << 355 } << 356 } 259 } 357 } 260 } >> 261 358 } 262 } 359 263 360 void G4ParticleDefinition::SetApplyCutsFlag(G4 264 void G4ParticleDefinition::SetApplyCutsFlag(G4bool flg) 361 { 265 { 362 if (theParticleName == "gamma" || theParticl << 266 if(theParticleName=="gamma" 363 || theParticleName == "proton") << 267 || theParticleName=="e-" >> 268 || theParticleName=="e+") >> 269 { fApplyCutsFlag = flg; } >> 270 else 364 { 271 { 365 fApplyCutsFlag = flg; << 272 G4cerr 366 } << 273 << "G4ParticleDefinition::SetApplyCutsFlag() for " << theParticleName 367 else { << 274 << G4endl; 368 G4cout << "G4ParticleDefinition::SetApplyC << 275 G4cerr 369 G4cout << "becomes obsolete. Production th << 276 << "becomes obsolete. Production threshold is applied only for " 370 << "gamma, e- ,e+ and proton." << G << 277 << "gamma, e- and e+." << G4endl; 371 } 278 } 372 } 279 } 373 280 374 G4double G4ParticleDefinition::CalculateAnomal << 375 { << 376 G4Exception("G4ParticleDefinition::G4Particl << 377 "CalculateAnomaly() method will << 378 281 379 // gives the anomaly of magnetic moment for << 380 if (thePDGiSpin == 1) { << 381 G4double muB = 0.5 * CLHEP::eplus * CLHEP: << 382 return 0.5 * std::fabs(thePDGMagneticMomen << 383 } << 384 282 385 return 0.0; << 386 } << 387 283 388 void G4ParticleDefinition::SetParticleDefiniti << 389 { << 390 if (id < 0) { << 391 g4particleDefinitionInstanceID = subInstan << 392 G4MT_pmanager = nullptr; << 393 } << 394 else { << 395 if (isGeneralIon || isMuonicAtom) { << 396 g4particleDefinitionInstanceID = id; << 397 } << 398 else { << 399 G4ExceptionDescription ed; << 400 ed << "ParticleDefinitionID should not b << 401 G4Exception("G4ParticleDefintion::SetPar << 402 } << 403 } << 404 } << 405 284 406 void G4ParticleDefinition::SetProcessManager(G << 407 { << 408 if (g4particleDefinitionInstanceID < 0 && !i << 409 if (G4Threading::G4GetThreadId() >= 0) { << 410 G4ExceptionDescription ed; << 411 ed << "ProcessManager is being set to " << 412 << " without proper initialization of << 413 << "This operation is thread-unsafe." << 414 G4Exception("G4ParticleDefintion::SetPro << 415 } << 416 SetParticleDefinitionID(); << 417 } << 418 G4MT_pmanager = aProcessManager; << 419 } << 420 285 421 void G4ParticleDefinition::SetTrackingManager( << 286 422 { << 287 423 if (g4particleDefinitionInstanceID < 0 && !i << 288 424 if (G4Threading::G4GetThreadId() >= 0) { << 289 425 G4ExceptionDescription ed; << 290 426 ed << "TrackingManager is being set to " << 291 427 << " without proper initialization of << 292 428 << "This operation is thread-unsafe." << 429 G4Exception("G4ParticleDefintion::SetTra << 430 } << 431 SetParticleDefinitionID(); << 432 } << 433 G4MT_tmanager = aTrackingManager; << 434 } << 435 293