83 return subInstanceManager;
109 : theParticleName(aName),
112 thePDGCharge(charge),
114 thePDGSpin(iSpin*0.5),
115 thePDGiParity(iParity),
116 thePDGiConjugation(iConjugation),
117 thePDGiGParity(gParity),
118 thePDGiIsospin(iIsospin),
119 thePDGiIsospin3(iIsospin3),
120 thePDGIsospin(iIsospin*0.5),
121 thePDGIsospin3(iIsospin3*0.5),
122 thePDGMagneticMoment(magneticMoment),
123 theLeptonNumber(lepton),
124 theBaryonNumber(baryon),
125 theParticleType(pType),
126 theParticleSubType(subType),
127 thePDGEncoding(encoding),
128 theAntiPDGEncoding(-1*encoding),
129 fShortLivedFlag(shortlived),
130 thePDGStable(stable),
131 thePDGLifeTime(lifetime),
132 theDecayTable(decaytable),
136 fApplyCutsFlag(false),
141 g4particleDefinitionInstanceID = -1;
142 theProcessManagerShadow = 0;
149 if (anti_encoding !=0) theAntiPDGEncoding = anti_encoding;
154 if (verboseLevel>0) {
156 G4cout <<
"Particle " << aName <<
" has a strange PDGEncoding " <<
G4endl;
159 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
161 "Strange PDGEncoding ");
167 if ( !fShortLivedFlag && (theParticleType!=nucleus) && (currentState!=
G4State_PreInit)){
170 G4cout <<
"G4ParticleDefintion (other than ions and shortlived) should be created in Pre_Init state "
174 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
176 "G4ParticleDefinition should be created in PreInit state");
191 theParticleTable->
Insert(
this);
197 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition()",
199 "Illegal call of copy Constructor for G4ParticleDefinition ");
204 G4Exception(
"G4ParticleDefinition::G4ParticleDefinition()",
206 "Illegal call of default Constructor for G4ParticleDefinition ");
216 G4String msg =
"Request of deletion for ";
218 msg +=
" has No effects because readyToUse is true.";
219 G4Exception(
"G4ParticleDefinition::~G4ParticleDefinition()",
226 <<
" will be deleted " <<
G4endl;
232 if (theDecayTable!= 0)
delete theDecayTable;
238 if (
this != &right) {
245 return (this->theParticleName == right.theParticleName);
250 return (this->theParticleName != right.theParticleName);
277 if ((theParticleType ==
"meson")||(theParticleType ==
"baryon")) {
281 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
283 "Inconsistent charge against PDG code ");
285 if (verboseLevel>0) {
286 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
287 <<
" illegal charge (" << thePDGCharge/
eplus
288 <<
" PDG code=" << thePDGEncoding <<
G4endl;
293 if (checker.
GetSpin() != thePDGiSpin) {
295 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
297 "Inconsistent spin against PDG code ");
299 if (verboseLevel>0) {
300 G4cout <<
"G4ParticleDefinition::FillQuarkContents : "
301 <<
" illegal SPIN (" << thePDGiSpin <<
"/2"
302 <<
" PDG code=" << thePDGEncoding <<
G4endl;
315 G4cout <<
" Particle Name : " << theParticleName <<
G4endl;
316 G4cout <<
" PDG particle code : " << thePDGEncoding;
318 G4cout <<
" Mass [GeV/c2] : " << thePDGMass/
GeV ;
324 G4cout <<
" Charge conjugation : " << thePDGiConjugation <<
G4endl;
325 G4cout <<
" Isospin : (I,Iz): (" << thePDGiIsospin <<
"/2";
326 G4cout <<
" , " << thePDGiIsospin3 <<
"/2 ) " <<
G4endl;
328 if (thePDGMagneticMoment != 0.0) {
332 G4cout <<
", " << theQuarkContent[1];
333 G4cout <<
", " << theQuarkContent[2];
334 G4cout <<
", " << theQuarkContent[3];
335 G4cout <<
", " << theQuarkContent[4];
338 G4cout <<
", " << theAntiQuarkContent[1];
339 G4cout <<
", " << theAntiQuarkContent[2];
340 G4cout <<
", " << theAntiQuarkContent[3];
341 G4cout <<
", " << theAntiQuarkContent[4];
343 G4cout <<
" Lepton number : " << theLeptonNumber;
344 G4cout <<
" Baryon number : " << theBaryonNumber <<
G4endl;
345 G4cout <<
" Particle type : " << theParticleType ;
353 if ( fShortLivedFlag ){
360 if( theDecayTable != 0 ){
371 if(theParticleName==
"gamma"
372 || theParticleName==
"e-"
373 || theParticleName==
"e+"
374 || theParticleName==
"proton")
375 { fApplyCutsFlag = flg; }
379 <<
"G4ParticleDefinition::SetApplyCutsFlag() for " << theParticleName
382 <<
"becomes obsolete. Production threshold is applied only for "
383 <<
"gamma, e- ,e+ and proton." <<
G4endl;
389 G4Exception(
"G4ParticleDefintion::G4ParticleDefintion",
391 "CalculateAnomaly() method will be removed in next release");
394 if (thePDGiSpin==1) {
395 G4double muB = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/(thePDGMass/CLHEP::c_squared);
396 return 0.5*std::fabs(thePDGMagneticMoment/muB - 2.*thePDGCharge/CLHEP::eplus);
412 { g4particleDefinitionInstanceID = id; }
416 ed <<
"ParticleDefinitionID should not be set for the particles <"
417 << theParticleName <<
">.";
418 G4Exception(
"G4ParticleDefintion::SetParticleDefinitionID",
"PART10114",
433 ed <<
"ProcessManager is being set to " << theParticleName
434 <<
" without proper initialization of TLS pointer vector.\n"
435 <<
"This operation is thread-unsafe.";
436 G4Exception(
"G4ParticleDefintion::SetProcessManager",
"PART10116",
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 *)
static const G4PDefManager & GetSubInstanceManager()
const G4String & GetParticleName() const
G4int GetAtomicNumber() const
G4int CheckPDGCode(G4int code, G4String type)
G4int GetAntiPDGEncoding() const
static G4StateManager * GetStateManager()
G4ParticleDefinition * Insert(G4ParticleDefinition *particle)
G4IonTable * GetIonTable() const
virtual ~G4ParticleDefinition()
G4GLOB_DLL std::ostream G4cout
G4double CalculateAnomaly() const
G4int FillQuarkContents()
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)
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
void SetApplyCutsFlag(G4bool)
static G4ParticleTable * GetParticleTable()
void SetVerboseLevel(G4int verbose)
G4int theQuarkContent[NumberOfQuarkFlavor]
G4double GetPDGCharge() const
G4int GetVerboseLevel() const
G4int CreateSubInstance()
void SetAtomicMass(G4int)
G4int GetBaryonNumber() const