Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleTable Class Reference

#include <G4ParticleTable.hh>

Public Types

typedef G4ParticleTableIterator< G4String, G4ParticleDefinition * >::Map G4PTblDictionary
 
typedef G4ParticleTableIterator< G4String, G4ParticleDefinition * > G4PTblDicIterator
 
typedef G4ParticleTableIterator< G4int, G4ParticleDefinition * >::Map G4PTblEncodingDictionary
 
typedef G4ParticleTableIterator< G4int, G4ParticleDefinition * > G4PTblEncodingDicIterator
 

Public Member Functions

virtual ~G4ParticleTable ()
 
G4bool contains (const G4ParticleDefinition *particle)
 
G4bool contains (const G4String &particle_name)
 
G4int entries () const
 
G4int size () const
 
G4ParticleDefinitionGetParticle (G4int index)
 
const G4StringGetParticleName (G4int index)
 
G4ParticleDefinitionFindParticle (G4int PDGEncoding)
 
G4ParticleDefinitionFindParticle (const G4String &particle_name)
 
G4ParticleDefinitionFindParticle (const G4ParticleDefinition *particle)
 
G4ParticleDefinitionFindAntiParticle (G4int PDGEncoding)
 
G4ParticleDefinitionFindAntiParticle (const G4String &particle_name)
 
G4ParticleDefinitionFindAntiParticle (const G4ParticleDefinition *particle)
 
G4ParticleDefinitionFindIon (G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
 
G4ParticleDefinitionFindIon (G4int atomicNumber, G4int atomicMass, G4int numberOfLambda, G4double excitationEnergy)
 
G4ParticleDefinitionGetIon (G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
 
G4ParticleDefinitionGetIon (G4int atomicNumber, G4int atomicMass, G4int numberOfLambda, G4double excitationEnergy)
 
G4ParticleDefinitionFindIon (G4int atomicNumber, G4int atomicMass, G4int dummy1, G4int dummy2)
 
G4PTblDicIteratorGetIterator ()
 
void DumpTable (const G4String &particle_name="ALL")
 
G4IonTableGetIonTable ()
 
const G4ShortLivedTableGetShortLivedTable ()
 
G4ParticleDefinitionInsert (G4ParticleDefinition *particle)
 
G4ParticleDefinitionRemove (G4ParticleDefinition *particle)
 
void RemoveAllParticles ()
 
void DeleteAllParticles ()
 
G4UImessengerCreateMessenger ()
 
void DeleteMessenger ()
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void SetReadiness (G4bool val=true)
 
G4bool GetReadiness () const
 

Static Public Member Functions

static G4ParticleTableGetParticleTable ()
 

Protected Member Functions

 G4ParticleTable ()
 
 G4ParticleTable (const G4ParticleTable &right)
 
G4ParticleTableoperator= (const G4ParticleTable &)
 
G4PTblDictionaryGetDictionary ()
 
const G4StringGetKey (const G4ParticleDefinition *particle) const
 
const G4PTblEncodingDictionaryGetEncodingDictionary ()
 

Detailed Description

Definition at line 64 of file G4ParticleTable.hh.

Member Typedef Documentation

◆ G4PTblDicIterator

◆ G4PTblDictionary

◆ G4PTblEncodingDicIterator

◆ G4PTblEncodingDictionary

Constructor & Destructor Documentation

◆ G4ParticleTable() [1/2]

G4ParticleTable::G4ParticleTable ( )
protected

Definition at line 73 of file G4ParticleTable.cc.

74 :verboseLevel(1),fParticleMessenger(0),
75 noName(" "),
76 readyToUse(false)
77{
78 fDictionary = new G4PTblDictionary();
79 fIterator = new G4PTblDicIterator( *fDictionary );
80 fEncodingDictionary = new G4PTblEncodingDictionary();
81
82 // Ion Table
83 fIonTable = new G4IonTable();
84
85 // short lived table
86 fShortLivedTable = new G4ShortLivedTable();
87}
G4ParticleTableIterator< G4String, G4ParticleDefinition * > G4PTblDicIterator
G4ParticleTableIterator< G4String, G4ParticleDefinition * >::Map G4PTblDictionary
G4ParticleTableIterator< G4int, G4ParticleDefinition * >::Map G4PTblEncodingDictionary

◆ G4ParticleTable() [2/2]

G4ParticleTable::G4ParticleTable ( const G4ParticleTable right)
protected

Definition at line 130 of file G4ParticleTable.cc.

131 :verboseLevel(1),fParticleMessenger(0),
132 noName(" "),
133 readyToUse(false)
134{
135 G4Exception("G4ParticleTable::G4ParticleTable()",
136 "PART001", FatalException,
137 "Illegal call of copy constructor for G4ParticleTable");
138 fDictionary = new G4PTblDictionary(*(right.fDictionary));
139 fIterator = new G4PTblDicIterator(*fDictionary);
140}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4ParticleTable()

G4ParticleTable::~G4ParticleTable ( )
virtual

Definition at line 90 of file G4ParticleTable.cc.

91{
92 readyToUse = false;
93
94 // remove all items from G4ParticleTable
96
97 // delete Short Lived table
98 if (fShortLivedTable!=0) delete fShortLivedTable;
99 fShortLivedTable =0;
100
101
102 //delete Ion Table
103 if (fIonTable!=0) delete fIonTable;
104 fIonTable =0;
105
106 // delete dictionary for encoding
107 if (fEncodingDictionary!=0){
108 fEncodingDictionary -> clear();
109 delete fEncodingDictionary;
110 fEncodingDictionary =0;
111 }
112
113 if(fDictionary){
114 if (fIterator!=0 )delete fIterator;
115 fIterator =0;
116
117 fDictionary->clear();
118 delete fDictionary;
119 fDictionary =0;
120 }
121
122 if (fParticleMessenger!=0) delete fParticleMessenger;
123 fParticleMessenger =0;
124
125 fgParticleTable =0;
126
127}

Member Function Documentation

◆ contains() [1/2]

G4bool G4ParticleTable::contains ( const G4ParticleDefinition particle)

◆ contains() [2/2]

G4bool G4ParticleTable::contains ( const G4String particle_name)

◆ CreateMessenger()

G4UImessenger * G4ParticleTable::CreateMessenger ( )

Definition at line 156 of file G4ParticleTable.cc.

157{
158 if (fParticleMessenger== 0) {
159 //UI messenger
160 fParticleMessenger = new G4ParticleMessenger(this);
161 }
162 return fParticleMessenger;
163}

Referenced by G4RunManager::G4RunManager().

◆ DeleteAllParticles()

void G4ParticleTable::DeleteAllParticles ( )

Definition at line 177 of file G4ParticleTable.cc.

178{
179 //set readyToUse false
180 readyToUse = false;
181
182 //G4StateManager* pStateManager = G4StateManager::GetStateManager();
183 //G4ApplicationState currentState = pStateManager->GetCurrentState();
184 //if (currentState != G4State_Quit) {
185 // G4Exception("G4ParticleTable::DeleteAllParticle()",
186 // "PART114", JustWarning,
187 // "Try to delete particles in state other than State_Quit");
188 //}
189
190#ifdef G4VERBOSE
191 if (verboseLevel>1){
192 G4cout << "G4ParticleTable::DeleteAllParticles() " << G4endl;
193 }
194#endif
195
196 // delete all particles
197 G4PTblDicIterator *piter = fIterator;
198 piter -> reset();
199 while( (*piter)() ){
200#ifdef G4VERBOSE
201 if (verboseLevel>2){
202 G4cout << "Delete " << (piter->value())->GetParticleName()
203 << " " << (piter->value()) << G4endl;
204 }
205#endif
206 delete (piter->value());
207 }
209}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4String & GetParticleName(G4int index)

Referenced by G4VUserPhysicsList::~G4VUserPhysicsList().

◆ DeleteMessenger()

void G4ParticleTable::DeleteMessenger ( )

Definition at line 166 of file G4ParticleTable.cc.

167{
168 if (fParticleMessenger!= 0) {
169 //UI messenger
170 delete fParticleMessenger;
171 fParticleMessenger= 0;
172 }
173
174}

Referenced by G4RunManager::~G4RunManager().

◆ DumpTable()

void G4ParticleTable::DumpTable ( const G4String particle_name = "ALL")

Definition at line 502 of file G4ParticleTable.cc.

503{
504 CheckReadiness();
505 if (( particle_name == "ALL" ) || (particle_name == "all")){
506 // dump all particles
507 G4PTblDicIterator *piter = fIterator;
508 piter -> reset();
509 while( (*piter)() ){
510 (piter->value())->DumpTable();
511 }
512 } else {
513 // dump only particle with name of particle_name
515 ptr = FindParticle(particle_name);
516 if ( ptr != 0) {
517 ptr->DumpTable();
518 } else {
519 G4cerr << " G4ParticleTable::DumpTable : "
520 << particle_name << " does not exist in ParticleTable " <<G4endl;
521 }
522 }
523}
G4DLLIMPORT std::ostream G4cerr
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void DumpTable(const G4String &particle_name="ALL")

Referenced by DumpTable(), Insert(), G4GeneralParticleSourceMessenger::SetNewValue(), G4ParticleGunMessenger::SetNewValue(), and G4RunManagerKernel::SetPhysics().

◆ entries()

◆ FindAntiParticle() [1/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( const G4ParticleDefinition particle)

◆ FindAntiParticle() [2/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( const G4String particle_name)

◆ FindAntiParticle() [3/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( G4int  PDGEncoding)

◆ FindIon() [1/3]

G4ParticleDefinition * G4ParticleTable::FindIon ( G4int  atomicNumber,
G4int  atomicMass,
G4double  excitationEnergy 
)

◆ FindIon() [2/3]

G4ParticleDefinition * G4ParticleTable::FindIon ( G4int  atomicNumber,
G4int  atomicMass,
G4int  dummy1,
G4int  dummy2 
)

Definition at line 369 of file G4ParticleTable.cc.

370{
371 CheckReadiness();
372 if (Z<=0) return 0;
373 if (A<Z) return 0;
374 return fIonTable->GetIon(Z, A);
375}
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int J=0)
Definition: G4IonTable.cc:267

◆ FindIon() [3/3]

G4ParticleDefinition * G4ParticleTable::FindIon ( G4int  atomicNumber,
G4int  atomicMass,
G4int  numberOfLambda,
G4double  excitationEnergy 
)

Definition at line 409 of file G4ParticleTable.cc.

410{
411 CheckReadiness();
412 if (Z<=0) return 0;
413 if (A-L<Z) return 0;
414 if (L<0) return 0;
415 if (E<0.) return 0;
416 return fIonTable->FindIon(Z, A, L, E);
417}

◆ FindParticle() [1/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( const G4ParticleDefinition particle)

Definition at line 464 of file G4ParticleTable.cc.

465{
466 CheckReadiness();
467 G4String key = GetKey(particle);
468 return FindParticle(key);
469}
const G4String & GetKey(const G4ParticleDefinition *particle) const

◆ FindParticle() [2/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( const G4String particle_name)

Definition at line 453 of file G4ParticleTable.cc.

454{
455 G4PTblDictionary::iterator it = fDictionary->find(particle_name);
456 if (it != fDictionary->end()) {
457 return (*it).second;
458 } else {
459 return 0;
460 }
461}

◆ FindParticle() [3/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( G4int  PDGEncoding)

Definition at line 472 of file G4ParticleTable.cc.

473{
474 CheckReadiness();
475 // check aPDGEncoding is valid
476 if (aPDGEncoding == 0){
477#ifdef G4VERBOSE
478 if (verboseLevel>1){
479 G4cerr << "PDGEncoding [" << aPDGEncoding << "] is not valid " << G4endl;
480 }
481#endif
482 return 0;
483 }
484
485 G4PTblEncodingDictionary *pedic = fEncodingDictionary;
486 G4ParticleDefinition* particle =0;
487
488 G4PTblEncodingDictionary::iterator it = pedic->find(aPDGEncoding );
489 if (it != pedic->end()) {
490 particle = (*it).second;
491 }
492
493#ifdef G4VERBOSE
494 if ((particle == 0) && (verboseLevel>1) ){
495 G4cerr << "CODE:" << aPDGEncoding << " does not exist in ParticleTable " << G4endl;
496 }
497#endif
498 return particle;
499}

Referenced by G4SDParticleFilter::add(), G4VHadronPhysics::AddElasticCrossSection(), G4VHadronPhysics::AddInelasticCrossSection(), G4ITTransportation::AlongStepDoIt(), G4ChiralInvariantPhaseSpace::ApplyYourself(), G4ErrorTrajState::BuildCharge(), G4VUserPhysicsList::BuildPhysicsTable(), G4PrimaryTransformer::CheckUnknown(), G4PionDecayMakeSpin::DaughterPolarization(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4ChargedGeantino::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4OpticalPhoton::Definition(), G4UnknownParticle::Definition(), G4AntiLambda::Definition(), G4AntiLambdab::Definition(), G4AntiLambdacPlus::Definition(), G4AntiNeutron::Definition(), G4AntiOmegabMinus::Definition(), G4AntiOmegacZero::Definition(), G4AntiOmegaMinus::Definition(), G4AntiProton::Definition(), G4AntiSigmabMinus::Definition(), G4AntiSigmabPlus::Definition(), G4AntiSigmabZero::Definition(), G4AntiSigmacPlus::Definition(), G4AntiSigmacPlusPlus::Definition(), G4AntiSigmacZero::Definition(), G4AntiSigmaMinus::Definition(), G4AntiSigmaPlus::Definition(), G4AntiSigmaZero::Definition(), G4AntiXibMinus::Definition(), G4AntiXibZero::Definition(), G4AntiXicPlus::Definition(), G4AntiXicZero::Definition(), G4AntiXiMinus::Definition(), G4AntiXiZero::Definition(), G4Lambda::Definition(), G4Lambdab::Definition(), G4LambdacPlus::Definition(), G4Neutron::Definition(), G4OmegabMinus::Definition(), G4OmegacZero::Definition(), G4OmegaMinus::Definition(), G4Proton::Definition(), G4SigmabMinus::Definition(), G4SigmabPlus::Definition(), G4SigmabZero::Definition(), G4SigmacPlus::Definition(), G4SigmacPlusPlus::Definition(), G4SigmacZero::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4SigmaZero::Definition(), G4XibMinus::Definition(), G4XibZero::Definition(), G4XicPlus::Definition(), G4XicZero::Definition(), G4XiMinus::Definition(), G4XiZero::Definition(), G4Alpha::Definition(), G4AntiAlpha::Definition(), G4AntiDeuteron::Definition(), G4AntiHe3::Definition(), G4AntiTriton::Definition(), G4Deuteron::Definition(), G4GenericIon::Definition(), G4He3::Definition(), G4Triton::Definition(), G4AntiBMesonZero::Definition(), G4AntiBsMesonZero::Definition(), G4AntiDMesonZero::Definition(), G4AntiKaonZero::Definition(), G4BcMesonMinus::Definition(), G4BcMesonPlus::Definition(), G4BMesonMinus::Definition(), G4BMesonPlus::Definition(), G4BMesonZero::Definition(), G4BsMesonZero::Definition(), G4DMesonMinus::Definition(), G4DMesonPlus::Definition(), G4DMesonZero::Definition(), G4DsMesonMinus::Definition(), G4DsMesonPlus::Definition(), G4Eta::Definition(), G4Etac::Definition(), G4EtaPrime::Definition(), G4JPsi::Definition(), G4KaonMinus::Definition(), G4KaonPlus::Definition(), G4KaonZero::Definition(), G4KaonZeroLong::Definition(), G4KaonZeroShort::Definition(), G4PionMinus::Definition(), G4PionPlus::Definition(), G4PionZero::Definition(), G4Upsiron::Definition(), G4AntiNeutrinoE::Definition(), G4AntiNeutrinoMu::Definition(), G4AntiNeutrinoTau::Definition(), G4Electron::Definition(), G4MuonMinus::Definition(), G4MuonPlus::Definition(), G4NeutrinoE::Definition(), G4NeutrinoMu::Definition(), G4NeutrinoTau::Definition(), G4Positron::Definition(), G4TauMinus::Definition(), G4TauPlus::Definition(), G4Electron_aq::Definition(), G4H2::Definition(), G4H2O::Definition(), G4H2O2::Definition(), G4H3O::Definition(), G4Hydrogen::Definition(), G4OH::Definition(), DumpTable(), G4DiffractiveExcitation::ExciteParticipants(), G4VDecayChannel::FillDaughters(), G4VDecayChannel::FillParent(), G4HEInelastic::FillParticleChange(), G4VHadronPhysics::FindElasticProcess(), G4VHadronPhysics::FindInelasticProcess(), FindParticle(), G4EmCalculator::FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4SDParticleFilter::G4SDParticleFilter(), G4Track::G4Track(), G4PrimaryTransformer::GenerateSingleTrack(), G4VUserPhysicsList::GetApplyCuts(), G4PrimaryTransformer::GetDefinition(), G4DynamicParticle::GetElectronMass(), G4IonTable::GetLightAntiIon(), G4IonTable::GetLightIon(), G4NucleiProperties::GetNuclearMass(), G4HyperNucleiProperties::GetNuclearMass(), G4ParticlePropertyTable::GetParticleProperty(), G4ErrorPropagator::InitG4Track(), G4INCL::ParticleTable::initialize(), Insert(), G4ResonanceNames::MinMass(), G4CollisionComposite::Resolve::operator()(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4QStringChipsParticleLevelInterface::Propagate(), G4StringChipsInterface::Propagate(), G4StringChipsParticleLevelInterface::Propagate(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4ProjectileDiffractiveChannel::Scatter(), G4VUserPhysicsList::SetApplyCuts(), G4VisCommandSceneAddGhosts::SetNewValue(), G4GeneralParticleSourceMessenger::SetNewValue(), G4ParticleGunMessenger::SetNewValue(), G4ParticleMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4PSNofSecondary::SetParticle(), G4ParticlePropertyTable::SetParticleProperty(), G4PrimaryParticle::SetPDGcode(), G4RayShooter::Shoot(), and G4AdjointPrimaryGeneratorAction::UpdateListOfPrimaryParticles().

◆ GetDictionary()

G4PTblDictionary * G4ParticleTable::GetDictionary ( )
protected

◆ GetEncodingDictionary()

const G4PTblEncodingDictionary * G4ParticleTable::GetEncodingDictionary ( )
protected

◆ GetIon() [1/2]

◆ GetIon() [2/2]

G4ParticleDefinition * G4ParticleTable::GetIon ( G4int  atomicNumber,
G4int  atomicMass,
G4int  numberOfLambda,
G4double  excitationEnergy 
)

Definition at line 388 of file G4ParticleTable.cc.

389{
390 CheckReadiness();
391 if (Z<=0) return 0;
392 if (A-L<Z) return 0;
393 if (L<0) return 0;
394 if (E<0.) return 0;
395 return fIonTable->GetIon(Z, A, L, E);
396}

◆ GetIonTable()

◆ GetIterator()

◆ GetKey()

const G4String & G4ParticleTable::GetKey ( const G4ParticleDefinition particle) const
protected

Referenced by FindParticle(), Insert(), and Remove().

◆ GetParticle()

G4ParticleDefinition * G4ParticleTable::GetParticle ( G4int  index)

Definition at line 420 of file G4ParticleTable.cc.

421{
422 CheckReadiness();
423 if ( (index >=0) && (index < entries()) ) {
424 G4PTblDicIterator *piter = fIterator;
425 piter -> reset();
426 G4int counter = 0;
427 while( (*piter)() ){
428 if ( counter == index ) return piter->value();
429 counter++;
430 }
431 }
432#ifdef G4VERBOSE
433 if (verboseLevel>1){
434 G4cerr << " G4ParticleTable::GetParticle"
435 << " invalid index (=" << index << ")" << G4endl;
436 }
437#endif
438 return 0;
439}
int G4int
Definition: G4Types.hh:66
G4int entries() const

Referenced by G4ParticleGunMessenger::G4ParticleGunMessenger(), G4RunManagerKernel::G4RunManagerKernel(), GetParticleName(), G4VisCommandSceneAddGhosts::SetNewValue(), G4RunManagerKernel::SetPhysics(), and G4GlobalFastSimulationManager::ShowSetup().

◆ GetParticleName()

const G4String & G4ParticleTable::GetParticleName ( G4int  index)

Definition at line 442 of file G4ParticleTable.cc.

443{
444 G4ParticleDefinition* aParticle =GetParticle(index);
445 if (aParticle != 0) {
446 return aParticle->GetParticleName();
447 } else {
448 return noName;
449 }
450}
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticle(G4int index)

Referenced by DeleteAllParticles(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), and G4FastSimulationManager::ListModels().

◆ GetParticleTable()

G4ParticleTable * G4ParticleTable::GetParticleTable ( )
static

Definition at line 63 of file G4ParticleTable.cc.

64{
65 static G4ParticleTable theParticleTable;
66 if (!fgParticleTable){
67 fgParticleTable = &theParticleTable;
68 }
69 return fgParticleTable;
70}

Referenced by G4ITStepProcessor::ActiveOnlyITProcess(), G4SDParticleFilter::add(), G4RadioactiveDecay::AddDecayRateTable(), G4VHadronPhysics::AddElasticCrossSection(), G4VHadronPhysics::AddInelasticCrossSection(), G4VUserPhysicsList::AddProcessManager(), G4NeutronHPFinalState::adjust_final_state(), G4ITTransportation::AlongStepDoIt(), G4NeutronHPChannelList::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4LENDCapture::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDFission::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4ChiralInvariantPhaseSpace::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4LElastic::ApplyYourself(), G4QMDReaction::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPElasticFS::ApplyYourself(), G4NeutronHPFissionFS::ApplyYourself(), G4QCaptureAtRest::AtRestDoIt(), G4NeutronHPInelasticBaseFS::BaseApply(), G4AblaEvaporation::BreakItUp(), G4WilsonAblationModel::BreakItUp(), G4CompetitiveFission::BreakUp(), G4ErrorTrajState::BuildCharge(), G4IonTable::clear(), G4ShortLivedTable::clear(), G4NeutronHPInelasticCompFS::CompositeApply(), G4ExcitedBaryonConstructor::Construct(), G4ExcitedMesonConstructor::Construct(), G4RunManager::ConstructScoringWorlds(), G4PionDecayMakeSpin::DaughterPolarization(), G4RadioactiveDecay::DecayIt(), G4NuclearDecayChannel::DecayIt(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4ChargedGeantino::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4OpticalPhoton::Definition(), G4UnknownParticle::Definition(), G4AntiLambda::Definition(), G4AntiLambdab::Definition(), G4AntiLambdacPlus::Definition(), G4AntiNeutron::Definition(), G4AntiOmegabMinus::Definition(), G4AntiOmegacZero::Definition(), G4AntiOmegaMinus::Definition(), G4AntiProton::Definition(), G4AntiSigmabMinus::Definition(), G4AntiSigmabPlus::Definition(), G4AntiSigmabZero::Definition(), G4AntiSigmacPlus::Definition(), G4AntiSigmacPlusPlus::Definition(), G4AntiSigmacZero::Definition(), G4AntiSigmaMinus::Definition(), G4AntiSigmaPlus::Definition(), G4AntiSigmaZero::Definition(), G4AntiXibMinus::Definition(), G4AntiXibZero::Definition(), G4AntiXicPlus::Definition(), G4AntiXicZero::Definition(), G4AntiXiMinus::Definition(), G4AntiXiZero::Definition(), G4Lambda::Definition(), G4Lambdab::Definition(), G4LambdacPlus::Definition(), G4Neutron::Definition(), G4OmegabMinus::Definition(), G4OmegacZero::Definition(), G4OmegaMinus::Definition(), G4Proton::Definition(), G4SigmabMinus::Definition(), G4SigmabPlus::Definition(), G4SigmabZero::Definition(), G4SigmacPlus::Definition(), G4SigmacPlusPlus::Definition(), G4SigmacZero::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4SigmaZero::Definition(), G4XibMinus::Definition(), G4XibZero::Definition(), G4XicPlus::Definition(), G4XicZero::Definition(), G4XiMinus::Definition(), G4XiZero::Definition(), G4Alpha::Definition(), G4AntiAlpha::Definition(), G4AntiDeuteron::Definition(), G4AntiHe3::Definition(), G4AntiTriton::Definition(), G4Deuteron::Definition(), G4GenericIon::Definition(), G4He3::Definition(), G4Triton::Definition(), G4AntiBMesonZero::Definition(), G4AntiBsMesonZero::Definition(), G4AntiDMesonZero::Definition(), G4AntiKaonZero::Definition(), G4BcMesonMinus::Definition(), G4BcMesonPlus::Definition(), G4BMesonMinus::Definition(), G4BMesonPlus::Definition(), G4BMesonZero::Definition(), G4BsMesonZero::Definition(), G4DMesonMinus::Definition(), G4DMesonPlus::Definition(), G4DMesonZero::Definition(), G4DsMesonMinus::Definition(), G4DsMesonPlus::Definition(), G4Eta::Definition(), G4Etac::Definition(), G4EtaPrime::Definition(), G4JPsi::Definition(), G4KaonMinus::Definition(), G4KaonPlus::Definition(), G4KaonZero::Definition(), G4KaonZeroLong::Definition(), G4KaonZeroShort::Definition(), G4PionMinus::Definition(), G4PionPlus::Definition(), G4PionZero::Definition(), G4Upsiron::Definition(), G4AntiNeutrinoE::Definition(), G4AntiNeutrinoMu::Definition(), G4AntiNeutrinoTau::Definition(), G4Electron::Definition(), G4MuonMinus::Definition(), G4MuonPlus::Definition(), G4NeutrinoE::Definition(), G4NeutrinoMu::Definition(), G4NeutrinoTau::Definition(), G4Positron::Definition(), G4TauMinus::Definition(), G4TauPlus::Definition(), G4Electron_aq::Definition(), G4H2::Definition(), G4H2O::Definition(), G4H2O2::Definition(), G4H3O::Definition(), G4Hydrogen::Definition(), G4OH::Definition(), G4Dineutron::Definition(), G4Diproton::Definition(), G4UnboundPN::Definition(), G4DiffractiveExcitation::ExciteParticipants(), G4VParticlePropertyReporter::FillList(), G4HEInelastic::FillParticleChange(), G4BaryonSplitter::FindDiquark(), G4VHadronPhysics::FindElasticProcess(), G4VHadronPhysics::FindInelasticProcess(), G4EmCalculator::FindIon(), G4EmCalculator::FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4BaryonSplitter::G4BaryonSplitter(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4DecayTableMessenger::G4DecayTableMessenger(), G4eCoulombScatteringModel::G4eCoulombScatteringModel(), G4EmCorrections::G4EmCorrections(), G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(), G4ExcitationHandler::G4ExcitationHandler(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), G4hCoulombScatteringModel::G4hCoulombScatteringModel(), G4HyperonCHIPSBuilder::G4HyperonCHIPSBuilder(), G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(), G4MiscCHIPSBuilder::G4MiscCHIPSBuilder(), G4MiscQGSCBuilder::G4MiscQGSCBuilder(), G4ParticleDefinition::G4ParticleDefinition(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4ParticlePropertyTable::G4ParticlePropertyTable(), G4ParticleTypeConverter::G4ParticleTypeConverter(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryTransformer::G4PrimaryTransformer(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4QInelasticCHIPS_HPBuilder::G4QInelasticCHIPS_HPBuilder(), G4QInelasticCHIPSBuilder::G4QInelasticCHIPSBuilder(), G4RadioactiveDecay::G4RadioactiveDecay(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4RunManager::G4RunManager(), G4RunManagerKernel::G4RunManagerKernel(), G4SDParticleFilter::G4SDParticleFilter(), G4SPBaryon::G4SPBaryon(), G4Track::G4Track(), G4UserEventAction::G4UserEventAction(), G4UserRunAction::G4UserRunAction(), G4UserStackingAction::G4UserStackingAction(), G4UserSteppingAction::G4UserSteppingAction(), G4UserTrackingAction::G4UserTrackingAction(), G4VDecayChannel::G4VDecayChannel(), G4VPhysicsConstructor::G4VPhysicsConstructor(), G4VUserPhysicsList::G4VUserPhysicsList(), G4VUserPrimaryGeneratorAction::G4VUserPrimaryGeneratorAction(), G4HyperNucleiProperties::GetAtomicMass(), G4NucleiProperties::GetBindingEnergy(), G4ComponentGGNuclNuclXsc::GetCoulombBarier(), G4GGNuclNuclCrossSection::GetCoulombBarier(), G4ProcessTableMessenger::GetCurrentValue(), G4UserPhysicsListMessenger::GetCurrentValue(), G4DynamicParticle::GetElectronMass(), G4TripathiCrossSection::GetElementCrossSection(), G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(), G4GGNuclNuclCrossSection::GetHadronNucleonXsc(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(), G4GlauberGribovCrossSection::GetHadronNucleonXscNS(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(), G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4IonTable::GetLightAntiIon(), G4IonTable::GetLightIon(), G4NucleiProperties::GetMassExcess(), G4NucleiProperties::GetNuclearMass(), G4HyperNucleiProperties::GetNuclearMass(), G4StatMFFragment::GetNuclearMass(), G4SmoothTrajectory::GetParticleDefinition(), G4Trajectory::GetParticleDefinition(), G4BaryonSplitter::GetSPBaryon(), G4IonTable::GetVerboseLevel(), G4ShortLivedTable::GetVerboseLevel(), G4ErrorPropagator::InitG4Track(), G4INCL::ParticleTable::initialize(), G4EMDissociationCrossSection::IsElementApplicable(), G4NucleiProperties::IsInStableTable(), G4FastSimulationManager::ListModels(), G4InuclNuclei::makeDefinition(), G4ResonanceNames::MinMass(), G4CollisionComposite::Resolve::operator()(), G4VDecayChannel::operator=(), G4QAtomicElectronScattering::PostStepDoIt(), G4QCoherentChargeExchange::PostStepDoIt(), G4QDiffraction::PostStepDoIt(), G4QElastic::PostStepDoIt(), G4QInelastic::PostStepDoIt(), G4QIonIonElastic::PostStepDoIt(), G4QLowEnergy::PostStepDoIt(), G4QNGamma::PostStepDoIt(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4GeneratorPrecompoundInterface::Propagate(), G4QStringChipsParticleLevelInterface::Propagate(), G4StringChipsInterface::Propagate(), G4StringChipsParticleLevelInterface::Propagate(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4IonTable::Remove(), G4ShortLivedTable::Remove(), G4TextPPRetriever::Retrieve(), G4NeutronHPIsotropic::Sample(), G4NeutronHPContAngularPar::Sample(), G4VPartonStringModel::Scatter(), G4ProjectileDiffractiveChannel::Scatter(), G4QuasiElasticChannel::Scatter(), G4VisCommandSceneAddGhosts::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4FastSimulationMessenger::SetNewValue(), G4UserPhysicsListMessenger::SetNewValue(), G4PSNofSecondary::SetParticle(), G4PrimaryParticle::SetPDGcode(), G4RunManagerKernel::SetPhysics(), G4RayShooter::Shoot(), G4GlobalFastSimulationManager::ShowSetup(), G4BaryonSplitter::SplitBarion(), G4ProductionCutsTable::UpdateCoupleTable(), G4AdjointPrimaryGeneratorAction::UpdateListOfPrimaryParticles(), G4ParticleDefinition::~G4ParticleDefinition(), and G4RunManager::~G4RunManager().

◆ GetReadiness()

G4bool G4ParticleTable::GetReadiness ( ) const

◆ GetShortLivedTable()

const G4ShortLivedTable * G4ParticleTable::GetShortLivedTable ( )

◆ GetVerboseLevel()

◆ Insert()

G4ParticleDefinition * G4ParticleTable::Insert ( G4ParticleDefinition particle)

Definition at line 249 of file G4ParticleTable.cc.

250{
251
252 // check particle name
253 if ((particle == 0) || (GetKey(particle).isNull())) {
254#ifdef G4VERBOSE
255 if (verboseLevel>0){
256 G4cerr << "The particle[Addr:" << particle << "] has no name "<< G4endl;
257 }
258#endif
259 return 0;
260
261 }else {
262
263 if (contains(particle)) {
264#ifdef G4VERBOSE
265 if (verboseLevel>0){
266 G4cerr << "The particle " << particle->GetParticleName()
267 << "has been already registered in the Particle Table "<< G4endl;
268 }
269 if (verboseLevel>1){
270 FindParticle(particle) -> DumpTable();
271 }
272#endif
273 return FindParticle(particle);
274
275 } else {
276 G4PTblDictionary *pdic = fDictionary;
277 G4PTblEncodingDictionary *pedic = fEncodingDictionary;
278
279 // insert into Dictionary
280 pdic->insert( std::pair<G4String, G4ParticleDefinition*>(GetKey(particle), particle) );
281
282 // insert into EncodingDictionary
283 G4int code = particle->GetPDGEncoding();
284 if (code !=0 ) {
285 pedic->insert( std::pair<G4int, G4ParticleDefinition*>(code ,particle) );
286 }
287
288 // insert it in IonTable if "nucleus"
289 if (fIonTable->IsIon(particle) ){
290 fIonTable->Insert(particle);
291 }
292
293 // insert it in ShortLivedTable if "shortlived"
294 if (particle->IsShortLived() ){
295 fShortLivedTable->Insert(particle);
296 }
297
298 // set Verbose Level same as ParticleTable
299 particle->SetVerboseLevel(verboseLevel);
300
301#ifdef G4VERBOSE
302 if (verboseLevel>3){
303 G4cout << "The particle "<< particle->GetParticleName()
304 << " is inserted in the ParticleTable " << G4endl;
305 }
306#endif
307
308 return particle;
309 }
310 }
311}
static G4bool IsIon(const G4ParticleDefinition *)
Definition: G4IonTable.cc:594
void Insert(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:802
void SetVerboseLevel(G4int value)
G4bool contains(const G4ParticleDefinition *particle)
void Insert(const G4ParticleDefinition *particle)

Referenced by G4ParticleDefinition::G4ParticleDefinition().

◆ operator=()

G4ParticleTable & G4ParticleTable::operator= ( const G4ParticleTable right)
protected

Definition at line 143 of file G4ParticleTable.cc.

144{
145 if (this != &right) {
146 G4Exception("G4ParticleTable::G4ParticleTable()",
147 "PART001", FatalException,
148 "Illegal call of assignment operator for G4ParticleTable");
149 fDictionary = new G4PTblDictionary(*(right.fDictionary));
150 fIterator = new G4PTblDicIterator(*fDictionary);
151 }
152 return *this;
153}

◆ Remove()

G4ParticleDefinition * G4ParticleTable::Remove ( G4ParticleDefinition particle)

Definition at line 314 of file G4ParticleTable.cc.

315{
316 if (readyToUse) {
318 G4ApplicationState currentState = pStateManager->GetCurrentState();
319 if (currentState != G4State_PreInit) {
320 G4String msg = "Request of removing ";
321 msg += particle->GetParticleName();
322 msg += " has No effects other than Pre_Init";
323 G4Exception("G4ParticleTable::Remove()",
324 "PART117", JustWarning, msg);
325 return 0;
326 } else {
327#ifdef G4VERBOSE
328 if (verboseLevel>0){
329 G4cout << particle->GetParticleName()
330 << " will be removed from the ParticleTable " << G4endl;
331 }
332#endif
333 }
334 }
335
336 G4PTblDictionary::iterator it = fDictionary->find(GetKey(particle));
337 if (it != fDictionary->end()) {
338 fDictionary->erase(it);
339 // remove from EncodingDictionary
340 G4int code = particle->GetPDGEncoding();
341 if (code !=0 ) {
342 fEncodingDictionary->erase(fEncodingDictionary->find(code));
343 }
344 } else {
345 return 0;
346 }
347
348 // remove it from IonTable if "nucleus"
349 if (fIonTable->IsIon(particle) ){
350 fIonTable->Remove(particle);
351 }
352
353 // Remove it from ShortLivedTable if "shortlived"
354 if (particle->IsShortLived() ){
355 fShortLivedTable->Remove(particle);
356 }
357
358#ifdef G4VERBOSE
359 if (verboseLevel>3){
360 G4cout << "The particle "<< particle->GetParticleName()
361 << " is removed from the ParticleTable " << G4endl;
362 }
363#endif
364
365 return particle;
366}
G4ApplicationState
@ G4State_PreInit
@ JustWarning
void Remove(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:817
void Remove(const G4ParticleDefinition *particle)
G4ApplicationState GetCurrentState() const
static G4StateManager * GetStateManager()

Referenced by G4Dineutron::Definition(), G4Diproton::Definition(), and G4UnboundPN::Definition().

◆ RemoveAllParticles()

void G4ParticleTable::RemoveAllParticles ( )

Definition at line 212 of file G4ParticleTable.cc.

213{
214 if (readyToUse) {
215 G4Exception("G4ParticleTable::RemoveAllParticle()",
216 "PART115", JustWarning,
217 "No effects because readyToUse is true.");
218 return;
219 }
220
221#ifdef G4VERBOSE
222 if (verboseLevel>1){
223 G4cout << "G4ParticleTable::RemoveAllParticles() " << G4endl;
224 }
225#endif
226
227 //remove all contnts in Ion Table
228 if (fIonTable!=0) {
229 fIonTable->clear();
230 }
231
232 // remomve all contents in hort Lived table
233 if (fShortLivedTable!=0) {
234 fShortLivedTable->clear();
235 }
236
237 // clear dictionary for encoding
238 if (fEncodingDictionary) {
239 fEncodingDictionary->clear();
240 }
241
242 // clear dictionary
243 if (fDictionary) {
244 fDictionary->clear();
245 }
246}
void clear()
Definition: G4IonTable.cc:784

Referenced by DeleteAllParticles(), and ~G4ParticleTable().

◆ SetReadiness()

void G4ParticleTable::SetReadiness ( G4bool  val = true)

◆ SetVerboseLevel()

void G4ParticleTable::SetVerboseLevel ( G4int  value)

◆ size()

G4int G4ParticleTable::size ( ) const

The documentation for this class was generated from the following files: