55#define G4MT_pmanager ((subInstanceManager.offset()[g4particleDefinitionInstanceID]).theProcessManager)
56#define G4MT_tmanager ((subInstanceManager.offset()[g4particleDefinitionInstanceID]).theTrackingManager)
82 : theParticleName(aName),
87 thePDGSpin(iSpin*0.5),
88 thePDGiParity(iParity),
89 thePDGiConjugation(iConjugation),
90 thePDGiGParity(gParity),
91 thePDGiIsospin(iIsospin),
92 thePDGiIsospin3(iIsospin3),
93 thePDGIsospin(iIsospin*0.5),
94 thePDGIsospin3(iIsospin3*0.5),
95 thePDGMagneticMoment(magneticMoment),
96 theLeptonNumber(lepton),
97 theBaryonNumber(baryon),
98 theParticleType(pType),
99 theParticleSubType(subType),
102 fShortLivedFlag(shortlived),
103 thePDGStable(stable),
104 thePDGLifeTime(lifetime),
105 theDecayTable(decaytable)
107 static const G4String nucleus(
"nucleus");
108 static const G4String muAtom(
"MuonicAtom");
110 g4particleDefinitionInstanceID = -1;
111 theProcessManagerShadow = 0;
118 if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
128 G4cout <<
"Particle " << aName
129 <<
" has a strange PDGEncoding " <<
G4endl;
132 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
134 "Strange PDGEncoding ");
141 if ( !fShortLivedFlag && (theParticleType!=nucleus)
147 G4cout <<
"G4ParticleDefinition (other than ions and shortlived)"
148 <<
" should be created in Pre_Init state - "
152 G4Exception(
"G4ParticleDefintion::G4ParticleDefinition()",
154 "G4ParticleDefinition should be created in PreInit state");
171 theParticleTable->
Insert(
this);
177 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition()",
179 "Illegal call of default constructor for G4ParticleDefinition!");
191 G4String msg =
"Request of deletion for ";
193 msg +=
" has No effects because readyToUse is true.";
194 G4Exception(
"G4ParticleDefinition::~G4ParticleDefinition()",
208 delete theDecayTable;
214 return (this->theParticleName == right.theParticleName);
220 return (this->theParticleName != right.theParticleName);
227 return subInstanceManager;
240 if(g4particleDefinitionInstanceID<0)
return nullptr;
247 if(g4particleDefinitionInstanceID<0)
return nullptr;
278 if ((theParticleType ==
"meson")||(theParticleType ==
"baryon"))
284 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
286 "Inconsistent charge against PDG code ");
290 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
291 <<
" illegal charge (" << thePDGCharge/eplus
292 <<
" PDG code=" << thePDGEncoding <<
G4endl;
297 if (checker.
GetSpin() != thePDGiSpin)
300 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
302 "Inconsistent spin against PDG code ");
306 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
307 <<
" illegal SPIN (" << thePDGiSpin <<
"/2"
308 <<
" PDG code=" << thePDGEncoding <<
G4endl;
322 G4cout <<
" Particle Name : " << theParticleName <<
G4endl;
323 G4cout <<
" PDG particle code : " << thePDGEncoding;
325 G4cout <<
" Mass [GeV/c2] : " << thePDGMass/GeV ;
328 G4cout <<
" Charge [e]: " << thePDGCharge/eplus <<
G4endl;
331 G4cout <<
" Charge conjugation : " << thePDGiConjugation <<
G4endl;
332 G4cout <<
" Isospin : (I,Iz): (" << thePDGiIsospin <<
"/2";
333 G4cout <<
" , " << thePDGiIsospin3 <<
"/2 ) " <<
G4endl;
335 if (thePDGMagneticMoment != 0.0)
337 G4cout <<
" MagneticMoment [MeV/T] : "
338 << thePDGMagneticMoment/MeV*tesla <<
G4endl;
352 G4cout <<
" Lepton number : " << theLeptonNumber;
353 G4cout <<
" Baryon number : " << theBaryonNumber <<
G4endl;
354 G4cout <<
" Particle type : " << theParticleType ;
363 if ( fShortLivedFlag )
372 {
G4cout <<
" Stable : No data found -- unknown" <<
G4endl; }
378 <<
"\n Decay table should be consulted to G4RadioactiveDecayProcess."
390 if( theDecayTable !=
nullptr )
405 if (theParticleName==
"gamma"
406 || theParticleName==
"e-"
407 || theParticleName==
"e+"
408 || theParticleName==
"proton")
410 fApplyCutsFlag = flg;
415 <<
"G4ParticleDefinition::SetApplyCutsFlag() for " << theParticleName
418 <<
"becomes obsolete. Production threshold is applied only for "
419 <<
"gamma, e- ,e+ and proton." <<
G4endl;
426 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition",
428 "CalculateAnomaly() method will be removed in future releases");
433 G4double muB = 0.5*CLHEP::eplus*CLHEP::hbar_Planck
434 / (thePDGMass/CLHEP::c_squared);
435 return 0.5*std::fabs(thePDGMagneticMoment/muB
436 - 2.*thePDGCharge/CLHEP::eplus);
455 { g4particleDefinitionInstanceID = id; }
459 ed <<
"ParticleDefinitionID should not be set for the particles <"
460 << theParticleName <<
">.";
461 G4Exception(
"G4ParticleDefintion::SetParticleDefinitionID",
475 ed <<
"ProcessManager is being set to " << theParticleName
476 <<
" without proper initialization of TLS pointer vector.\n"
477 <<
"This operation is thread-unsafe.";
478 G4Exception(
"G4ParticleDefintion::SetProcessManager",
494 ed <<
"TrackingManager is being set to " << theParticleName
495 <<
" without proper initialization of TLS pointer vector.\n"
496 <<
"This operation is thread-unsafe.";
497 G4Exception(
"G4ParticleDefintion::SetTrackingManager",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
static G4bool IsIon(const G4ParticleDefinition *)
static G4bool IsAntiIon(const G4ParticleDefinition *)
G4int CheckPDGCode(G4int code, const G4String &type)
G4int GetQuarkContent(G4int flavor) const
G4bool CheckCharge(G4double charge) const
G4int GetAntiQuarkContent(G4int flavor) const
void SetVerboseLevel(G4int verbose)
G4int CreateSubInstance()
G4ProcessManager * GetProcessManager() const
G4VTrackingManager * GetTrackingManager() const
G4int GetAtomicNumber() const
static const G4PDefManager & GetSubInstanceManager()
G4bool IsGeneralIon() const
G4int GetAntiPDGEncoding() const
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4int GetVerboseLevel() const
void SetParticleDefinitionID(G4int id=-1)
void SetTrackingManager(G4VTrackingManager *aTrackingManager)
G4int GetAtomicMass() const
virtual ~G4ParticleDefinition()
G4double GetPDGCharge() const
G4bool operator==(const G4ParticleDefinition &right) const
void SetApplyCutsFlag(G4bool)
G4int theQuarkContent[NumberOfQuarkFlavor]
void SetAtomicMass(G4int)
G4double GetIonLifeTime() const
G4int GetBaryonNumber() const
G4bool operator!=(const G4ParticleDefinition &right) const
G4double CalculateAnomaly() const
G4int FillQuarkContents()
const G4String & GetParticleName() const
void SetProcessManager(G4ProcessManager *aProcessManager)
void SetAtomicNumber(G4int)
G4IonTable * GetIonTable() const
G4int GetVerboseLevel() const
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * Insert(G4ParticleDefinition *particle)
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()