71 #define G4MT_pmanager ((subInstanceManager.offset[g4particleDefinitionInstanceID]).theProcessManager)
77 return subInstanceManager;
103 : theParticleName(aName),
106 thePDGCharge(charge),
108 thePDGSpin(iSpin*0.5),
109 thePDGiParity(iParity),
110 thePDGiConjugation(iConjugation),
111 thePDGiGParity(gParity),
112 thePDGiIsospin(iIsospin),
113 thePDGiIsospin3(iIsospin3),
114 thePDGIsospin(iIsospin*0.5),
115 thePDGIsospin3(iIsospin3*0.5),
116 thePDGMagneticMoment(magneticMoment),
117 theLeptonNumber(lepton),
118 theBaryonNumber(baryon),
119 theParticleType(pType),
120 theParticleSubType(subType),
121 thePDGEncoding(encoding),
122 theAntiPDGEncoding(-1*encoding),
123 fShortLivedFlag(shortlived),
124 thePDGStable(stable),
125 thePDGLifeTime(lifetime),
126 theDecayTable(decaytable),
130 fApplyCutsFlag(false),
135 g4particleDefinitionInstanceID = -1;
136 theProcessManagerShadow = 0;
143 if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
148 if (verboseLevel>0) {
150 G4cout <<
"Particle " << aName <<
" has a strange PDGEncoding " <<
G4endl;
153 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
155 "Strange PDGEncoding ");
161 if ( !fShortLivedFlag && (theParticleType!=nucleus) && (currentState!=
G4State_PreInit)){
164 G4cout <<
"G4ParticleDefintion (other than ions and shortlived) should be created in Pre_Init state "
168 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
170 "G4ParticleDefinition should be created in PreInit state");
185 theParticleTable->
Insert(
this);
191 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition()",
193 "Illegal call of copy Constructor for G4ParticleDefinition ");
198 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition()",
200 "Illegal call of default Constructor for G4ParticleDefinition ");
210 G4String msg =
"Request of deletion for ";
212 msg +=
" has No effects because readyToUse is true.";
213 G4Exception(
"G4ParticleDefinition::~G4ParticleDefinition()",
220 <<
" will be deleted " <<
G4endl;
226 if (theDecayTable!= 0)
delete theDecayTable;
232 if (
this != &right) {
239 return (this->theParticleName == right.theParticleName);
244 return (this->theParticleName != right.theParticleName);
249 if(g4particleDefinitionInstanceID<0)
return 0;
275 if ((theParticleType ==
"meson")||(theParticleType ==
"baryon")) {
279 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
281 "Inconsistent charge against PDG code ");
283 if (verboseLevel>0) {
284 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
285 <<
" illegal charge (" << thePDGCharge/
eplus
286 <<
" PDG code=" << thePDGEncoding <<
G4endl;
291 if (checker.
GetSpin() != thePDGiSpin) {
293 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
295 "Inconsistent spin against PDG code ");
297 if (verboseLevel>0) {
298 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
299 <<
" illegal SPIN (" << thePDGiSpin <<
"/2"
300 <<
" PDG code=" << thePDGEncoding <<
G4endl;
324 G4cout <<
" Particle Name : " << theParticleName <<
G4endl;
325 G4cout <<
" PDG particle code : " << thePDGEncoding;
327 G4cout <<
" Mass [GeV/c2] : " << thePDGMass/
GeV ;
333 G4cout <<
" Charge conjugation : " << thePDGiConjugation <<
G4endl;
334 G4cout <<
" Isospin : (I,Iz): (" << thePDGiIsospin <<
"/2";
335 G4cout <<
" , " << thePDGiIsospin3 <<
"/2 ) " <<
G4endl;
337 if (thePDGMagneticMoment != 0.0) {
341 G4cout <<
", " << theQuarkContent[1];
342 G4cout <<
", " << theQuarkContent[2];
343 G4cout <<
", " << theQuarkContent[3];
344 G4cout <<
", " << theQuarkContent[4];
347 G4cout <<
", " << theAntiQuarkContent[1];
348 G4cout <<
", " << theAntiQuarkContent[2];
349 G4cout <<
", " << theAntiQuarkContent[3];
350 G4cout <<
", " << theAntiQuarkContent[4];
352 G4cout <<
" Lepton number : " << theLeptonNumber;
353 G4cout <<
" Baryon number : " << theBaryonNumber <<
G4endl;
354 G4cout <<
" Particle type : " << theParticleType ;
362 if ( fShortLivedFlag ){
369 {
G4cout <<
" Stable : No data found -- unknown" <<
G4endl; }
375 <<
"\n Decay table should be consulted to G4RadioactiveDecayProcess."
384 if( theDecayTable != 0 ){
395 if(theParticleName==
"gamma"
396 || theParticleName==
"e-"
397 || theParticleName==
"e+"
398 || theParticleName==
"proton")
399 { fApplyCutsFlag = flg; }
403 <<
"G4ParticleDefinition::SetApplyCutsFlag() for " << theParticleName
406 <<
"becomes obsolete. Production threshold is applied only for "
407 <<
"gamma, e- ,e+ and proton." <<
G4endl;
413 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
415 "CalculateAnomaly() method will be removed in next release");
418 if (thePDGiSpin==1) {
420 return 0.5*std::fabs(thePDGMagneticMoment/muB - 2.*thePDGCharge/
CLHEP::eplus);
436 { g4particleDefinitionInstanceID = id; }
440 ed <<
"ParticleDefinitionID should not be set for the particles <"
441 << theParticleName <<
">.";
442 G4Exception(
"G4ParticleDefintion::SetParticleDefinitionID",
"PART10114",
457 ed <<
"ProcessManager is being set to " << theParticleName
458 <<
" without proper initialization of TLS pointer vector.\n"
459 <<
"This operation is thread-unsafe.";
460 G4Exception(
"G4ParticleDefintion::SetProcessManager",
"PART10116",
static constexpr double tesla
void SetAtomicNumber(G4int)
void SetParticleDefinitionID(G4int id=-1)
void SetProcessManager(G4ProcessManager *aProcessManager)
std::ostringstream G4ExceptionDescription
G4bool CheckCharge(G4double charge) const
G4int GetQuarkContent(G4int flavor) const
G4int operator!=(const G4ParticleDefinition &right) const
G4int GetVerboseLevel() const
static G4bool IsIon(const G4ParticleDefinition *)
static G4bool IsAntiIon(const G4ParticleDefinition *)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static const G4PDefManager & GetSubInstanceManager()
const G4String & GetParticleName() const
G4int GetAtomicNumber() const
G4bool IsGeneralIon() const
G4int CheckPDGCode(G4int code, G4String type)
G4int GetAntiPDGEncoding() const
G4double GetIonLifeTime() const
static G4StateManager * GetStateManager()
G4ParticleDefinition * Insert(G4ParticleDefinition *particle)
G4IonTable * GetIonTable() const
virtual ~G4ParticleDefinition()
G4GLOB_DLL std::ostream G4cout
G4double CalculateAnomaly() const
static constexpr double eplus
G4int FillQuarkContents()
static constexpr double eplus
G4int GetAntiQuarkContent(G4int flavor) const
G4ApplicationState GetCurrentState() const
G4int GetAtomicMass() const
G4int operator==(const G4ParticleDefinition &right) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static constexpr double c_squared
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
void SetApplyCutsFlag(G4bool)
static G4ParticleTable * GetParticleTable()
G4ProcessManager * GetProcessManager() const
void SetVerboseLevel(G4int verbose)
G4int theQuarkContent[NumberOfQuarkFlavor]
static constexpr double GeV
G4int CreateSubInstance()
static constexpr double MeV
G4double GetPDGCharge() const
static constexpr double hbar_Planck
G4int GetVerboseLevel() const
void SetAtomicMass(G4int)
G4int GetBaryonNumber() const