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

#include <G4ParticleTable.hh>

Public Types

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

Public Member Functions

virtual ~G4ParticleTable ()
 
 G4ParticleTable (const G4ParticleTable &)=delete
 
G4ParticleTableoperator= (const G4ParticleTable &)=delete
 
void WorkerG4ParticleTable ()
 
void DestroyWorkerG4ParticleTable ()
 
G4bool contains (const G4ParticleDefinition *particle) const
 
G4bool contains (const G4String &particle_name) const
 
G4int entries () const
 
G4int size () const
 
G4ParticleDefinitionGetParticle (G4int index) const
 
const G4StringGetParticleName (G4int index) const
 
G4ParticleDefinitionFindParticle (G4int PDGEncoding)
 
G4ParticleDefinitionFindParticle (const G4String &particle_name)
 
G4ParticleDefinitionFindParticle (const G4ParticleDefinition *particle)
 
G4ParticleDefinitionFindAntiParticle (G4int PDGEncoding)
 
G4ParticleDefinitionFindAntiParticle (const G4String &p_name)
 
G4ParticleDefinitionFindAntiParticle (const G4ParticleDefinition *p)
 
G4PTblDicIteratorGetIterator () const
 
void DumpTable (const G4String &particle_name="ALL")
 
G4IonTableGetIonTable () const
 
G4ParticleDefinitionInsert (G4ParticleDefinition *particle)
 
G4ParticleDefinitionRemove (G4ParticleDefinition *particle)
 
void RemoveAllParticles ()
 
void DeleteAllParticles ()
 
G4UImessengerCreateMessenger ()
 
void SelectParticle (const G4String &name)
 
const G4ParticleDefinitionGetSelectedParticle () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void SetReadiness (G4bool val=true)
 
G4bool GetReadiness () const
 
G4ParticleDefinitionGetGenericIon () const
 
void SetGenericIon (G4ParticleDefinition *)
 
G4ParticleDefinitionGetGenericMuonicAtom () const
 
void SetGenericMuonicAtom (G4ParticleDefinition *)
 

Static Public Member Functions

static G4ParticleTableGetParticleTable ()
 

Public Attributes

G4ParticleMessengerfParticleMessenger = nullptr
 
G4IonTablefIonTable = nullptr
 

Static Public Attributes

static G4ThreadLocal G4PTblDictionaryfDictionary = nullptr
 
static G4ThreadLocal G4PTblDicIteratorfIterator = nullptr
 
static G4ThreadLocal G4PTblEncodingDictionaryfEncodingDictionary
 
static G4ParticleTablefgParticleTable = nullptr
 
static G4PTblDictionaryfDictionaryShadow = nullptr
 
static G4PTblDicIteratorfIteratorShadow = nullptr
 
static G4PTblEncodingDictionaryfEncodingDictionaryShadow = nullptr
 

Protected Member Functions

const G4PTblDictionaryGetDictionary () const
 
const G4StringGetKey (const G4ParticleDefinition *particle) const
 
const G4PTblEncodingDictionaryGetEncodingDictionary () const
 

Detailed Description

Definition at line 59 of file G4ParticleTable.hh.

Member Typedef Documentation

◆ G4PTblDicIterator

◆ G4PTblDictionary

◆ G4PTblEncodingDicIterator

◆ G4PTblEncodingDictionary

Constructor & Destructor Documentation

◆ ~G4ParticleTable()

G4ParticleTable::~G4ParticleTable ( )
virtual

Definition at line 171 of file G4ParticleTable.cc.

172{
173 readyToUse = false;
174
175 // remove all items from G4ParticleTable
177
178 // delete Ion Table
179 delete fIonTable;
180 fIonTable = nullptr;
181
182 // delete dictionary for encoding
183 if (fEncodingDictionary != nullptr) {
184 fEncodingDictionary->clear();
185 delete fEncodingDictionary;
186 fEncodingDictionary = nullptr;
187 }
188
189 if (fDictionary != nullptr) {
190 delete fIterator;
191 fIterator = nullptr;
192
193 fDictionary->clear();
194 delete fDictionary;
195 fDictionary = nullptr;
196 }
197
198 delete fParticleMessenger;
199 fParticleMessenger = nullptr;
200
201 fgParticleTable = nullptr;
202
203 G4ParticleDefinition::Clean(); // Delete sub-instance static data
204}
static G4ThreadLocal G4PTblEncodingDictionary * fEncodingDictionary
static G4ParticleTable * fgParticleTable
G4IonTable * fIonTable
G4ParticleMessenger * fParticleMessenger
static G4ThreadLocal G4PTblDicIterator * fIterator
static G4ThreadLocal G4PTblDictionary * fDictionary

◆ G4ParticleTable()

G4ParticleTable::G4ParticleTable ( const G4ParticleTable & )
delete

Member Function Documentation

◆ contains() [1/2]

G4bool G4ParticleTable::contains ( const G4ParticleDefinition * particle) const
inline

◆ contains() [2/2]

G4bool G4ParticleTable::contains ( const G4String & particle_name) const

Definition at line 608 of file G4ParticleTable.cc.

609{
610 auto it = fDictionaryShadow->find(particle_name);
611 return (it != fDictionaryShadow->cend());
612}
static G4PTblDictionary * fDictionaryShadow

◆ CreateMessenger()

G4UImessenger * G4ParticleTable::CreateMessenger ( )

Definition at line 228 of file G4ParticleTable.cc.

229{
230 if (fParticleMessenger == nullptr) {
231 // UI messenger
233 }
234 return fParticleMessenger;
235}

Referenced by G4RunManager::G4RunManager(), and G4RunManager::G4RunManager().

◆ DeleteAllParticles()

void G4ParticleTable::DeleteAllParticles ( )

Definition at line 237 of file G4ParticleTable.cc.

238{
239 // set readyToUse false
240 readyToUse = false;
241
242#ifdef G4VERBOSE
243 if (verboseLevel > 1) {
244 G4cout << "G4ParticleTable::DeleteAllParticles() " << G4endl;
245 }
246#endif
247
248 // delete all particles
250 piter->reset(false);
251 while ((*piter)()) // Loop checking, 09.08.2015, K.Kurashige
252 {
253#ifdef G4VERBOSE
254 if (verboseLevel > 2) {
255 G4cout << "Delete " << (piter->value())->GetParticleName() << " " << (piter->value())
256 << G4endl;
257 }
258#endif
259 delete (piter->value());
260 }
262}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void reset(G4bool ifSkipIon=true)
G4ParticleTableIterator< G4String, G4ParticleDefinition * > G4PTblDicIterator

Referenced by G4VUserPhysicsList::~G4VUserPhysicsList().

◆ DestroyWorkerG4ParticleTable()

void G4ParticleTable::DestroyWorkerG4ParticleTable ( )

Definition at line 206 of file G4ParticleTable.cc.

207{
208 // delete Ion Table in worker thread
210
211 // delete dictionary for encoding
212 if (fEncodingDictionary != nullptr) {
213 fEncodingDictionary->clear();
214 delete fEncodingDictionary;
215 fEncodingDictionary = nullptr;
216 }
217
218 if (fDictionary != nullptr) {
219 delete fIterator;
220 fIterator = nullptr;
221
222 fDictionary->clear();
223 delete fDictionary;
224 fDictionary = nullptr;
225 }
226}
void DestroyWorkerG4IonTable()

Referenced by G4WorkerRunManagerKernel::~G4WorkerRunManagerKernel(), and G4WorkerTaskRunManagerKernel::~G4WorkerTaskRunManagerKernel().

◆ DumpTable()

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

Definition at line 543 of file G4ParticleTable.cc.

544{
545 CheckReadiness();
546 if ((particle_name == "ALL") || (particle_name == "all")) {
547 // dump all particles
549 piter->reset();
550 while ((*piter)()) // Loop checking, 09.08.2015, K.Kurashige
551 {
552 (piter->value())->DumpTable();
553 }
554 }
555 else {
556 // dump only particle with name of particle_name
557 G4ParticleDefinition* ptr = FindParticle(particle_name);
558 if (ptr != nullptr) {
559 ptr->DumpTable();
560 }
561 else {
562#ifdef G4VERBOSE
563 if (verboseLevel > 1) {
564 G4cout << " G4ParticleTable::DumpTable : " << particle_name
565 << " does not exist in ParticleTable " << G4endl;
566 }
567#endif
568 }
569 }
570}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)

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

◆ entries()

◆ FindAntiParticle() [1/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( const G4ParticleDefinition * p)
inline

◆ FindAntiParticle() [2/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( const G4String & p_name)
inline

◆ FindAntiParticle() [3/3]

G4ParticleDefinition * G4ParticleTable::FindAntiParticle ( G4int PDGEncoding)
inline

◆ FindParticle() [1/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( const G4ParticleDefinition * particle)

Definition at line 491 of file G4ParticleTable.cc.

492{
493 CheckReadiness();
494 G4String key = GetKey(particle);
495 return FindParticle(key);
496}
const G4String & GetKey(const G4ParticleDefinition *particle) const

◆ FindParticle() [2/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( const G4String & particle_name)

Definition at line 447 of file G4ParticleTable.cc.

448{
449 auto it = fDictionary->find(particle_name);
450 if (it != fDictionary->end()) {
451 return (*it).second;
452 }
453
454#ifdef G4MULTITHREADED
455 G4ParticleDefinition* ptcl = nullptr;
457 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
458 auto its = fDictionaryShadow->find(particle_name);
459 if (its != fDictionaryShadow->end()) {
460 fDictionary->insert(*its);
461 ptcl = (*its).second;
462 G4int code = ptcl->GetPDGEncoding();
463 if (code != 0)
464 fEncodingDictionary->insert(std::pair<G4int, G4ParticleDefinition*>(code, ptcl));
465 }
466 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
467 }
468 return ptcl;
469#else
470 return nullptr;
471#endif
472}
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4bool IsWorkerThread()

◆ FindParticle() [3/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( G4int PDGEncoding)

Definition at line 498 of file G4ParticleTable.cc.

499{
500 CheckReadiness();
501 // check aPDGEncoding is valid
502 if (aPDGEncoding == 0) {
503#ifdef G4VERBOSE
504 if (verboseLevel > 1) {
505 G4cout << "PDGEncoding [" << aPDGEncoding << "] is not valid " << G4endl;
506 }
507#endif
508 return nullptr;
509 }
510
512 G4ParticleDefinition* particle = nullptr;
513
514 if (pedic != nullptr) {
515 auto it = pedic->find(aPDGEncoding);
516 if (it != pedic->end()) {
517 particle = (*it).second;
518 }
519 }
520
521#ifdef G4MULTITHREADED
522 if (particle == nullptr && G4Threading::IsWorkerThread()) {
523 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
524 auto its = fEncodingDictionaryShadow->find(aPDGEncoding);
525 if (its != fEncodingDictionaryShadow->end()) {
526 particle = (*its).second;
527 fEncodingDictionary->insert(*its);
528 G4String key = GetKey(particle);
529 fDictionary->insert(std::pair<G4String, G4ParticleDefinition*>(key, particle));
530 }
531 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
532 }
533#endif
534
535#ifdef G4VERBOSE
536 if ((particle == nullptr) && (verboseLevel > 1)) {
537 G4cout << "CODE:" << aPDGEncoding << " does not exist in ParticleTable " << G4endl;
538 }
539#endif
540 return particle;
541}
static G4PTblEncodingDictionary * fEncodingDictionaryShadow
G4ParticleTableIterator< G4int, G4ParticleDefinition * >::Map G4PTblEncodingDictionary

Referenced by G4SDParticleFilter::add(), G4ChannelingOptrMultiParticleChangeCrossSection::AddParticle(), G4ITTransportation::AlongStepDoIt(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4ANuTauNucleusCcModel::ApplyYourself(), G4ANuTauNucleusNcModel::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4NuTauNucleusCcModel::ApplyYourself(), G4NuTauNucleusNcModel::ApplyYourself(), G4ExcitationHandler::BreakItUp(), G4ErrorTrajState::BuildCharge(), G4HadronicBuilder::BuildDecayTableForBCHadrons(), G4HadronicBuilder::BuildElastic(), G4HadronicBuilder::BuildFTFP_INCLXX(), G4VUserPhysicsList::BuildPhysicsTable(), G4PrimaryTransformer::CheckUnknown(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4EmBuilder::ConstructBasicEmPhysics(), G4MuonicAtomHelper::ConstructMuonicAtom(), G4HadronDElasticPhysics::ConstructProcess(), G4HadronElasticPhysics::ConstructProcess(), G4HadronHElasticPhysics::ConstructProcess(), G4PionDecayMakeSpin::DaughterPolarization(), G4Adenine::Definition(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointElectronFI::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4Alpha::Definition(), G4AntiAlpha::Definition(), G4AntiBMesonZero::Definition(), G4AntiBsMesonZero::Definition(), G4AntiDeuteron::Definition(), G4AntiDMesonZero::Definition(), G4AntiDoubleHyperDoubleNeutron::Definition(), G4AntiDoubleHyperH4::Definition(), G4AntiHe3::Definition(), G4AntiHyperAlpha::Definition(), G4AntiHyperH4::Definition(), G4AntiHyperHe5::Definition(), G4AntiHyperTriton::Definition(), G4AntiKaonZero::Definition(), G4AntiLambda::Definition(), G4AntiLambdab::Definition(), G4AntiLambdacPlus::Definition(), G4AntiNeutrinoE::Definition(), G4AntiNeutrinoMu::Definition(), G4AntiNeutrinoTau::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(), G4AntiTriton::Definition(), G4AntiXibMinus::Definition(), G4AntiXibZero::Definition(), G4AntiXicPlus::Definition(), G4AntiXicZero::Definition(), G4AntiXiMinus::Definition(), G4AntiXiZero::Definition(), G4BcMesonMinus::Definition(), G4BcMesonPlus::Definition(), G4BMesonMinus::Definition(), G4BMesonPlus::Definition(), G4BMesonZero::Definition(), G4BsMesonZero::Definition(), G4ChargedGeantino::Definition(), G4Cytosine::Definition(), G4DamagedAdenine::Definition(), G4DamagedCytosine::Definition(), G4DamagedDeoxyribose::Definition(), G4DamagedGuanine::Definition(), G4DamagedThymine::Definition(), G4Deoxyribose::Definition(), G4Deuteron::Definition(), G4DMesonMinus::Definition(), G4DMesonPlus::Definition(), G4DMesonZero::Definition(), G4DoubleHyperDoubleNeutron::Definition(), G4DoubleHyperH4::Definition(), G4DsMesonMinus::Definition(), G4DsMesonPlus::Definition(), G4Electron::Definition(), G4Electron_aq::Definition(), G4Eta::Definition(), G4Etac::Definition(), G4EtaPrime::Definition(), G4FakeMolecule::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4GenericIon::Definition(), G4GenericMuonicAtom::Definition(), G4Guanine::Definition(), G4H2::Definition(), G4H2O2::Definition(), G4H2O::Definition(), G4H3O::Definition(), G4He3::Definition(), G4Histone::Definition(), G4HO2::Definition(), G4Hydrogen::Definition(), G4HyperAlpha::Definition(), G4HyperH4::Definition(), G4HyperHe5::Definition(), G4HyperTriton::Definition(), G4JPsi::Definition(), G4KaonMinus::Definition(), G4KaonPlus::Definition(), G4KaonZero::Definition(), G4KaonZeroLong::Definition(), G4KaonZeroShort::Definition(), G4Lambda::Definition(), G4Lambdab::Definition(), G4LambdacPlus::Definition(), G4ModifiedHistone::Definition(), G4MuonMinus::Definition(), G4MuonPlus::Definition(), G4NeutrinoE::Definition(), G4NeutrinoMu::Definition(), G4NeutrinoTau::Definition(), G4Neutron::Definition(), G4O2::Definition(), G4O3::Definition(), G4OH::Definition(), G4OmegabMinus::Definition(), G4OmegacZero::Definition(), G4OmegaMinus::Definition(), G4OpticalPhoton::Definition(), G4Oxygen::Definition(), G4PhononLong::Definition(), G4PhononTransFast::Definition(), G4PhononTransSlow::Definition(), G4Phosphate::Definition(), G4PionMinus::Definition(), G4PionPlus::Definition(), G4PionZero::Definition(), G4Positron::Definition(), G4Proton::Definition(), G4SigmabMinus::Definition(), G4SigmabPlus::Definition(), G4SigmabZero::Definition(), G4SigmacPlus::Definition(), G4SigmacPlusPlus::Definition(), G4SigmacZero::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4SigmaZero::Definition(), G4TauMinus::Definition(), G4TauPlus::Definition(), G4Thymine::Definition(), G4Triton::Definition(), G4UnknownParticle::Definition(), G4Upsilon::Definition(), G4XibMinus::Definition(), G4XibZero::Definition(), G4XicPlus::Definition(), G4XicZero::Definition(), G4XiMinus::Definition(), G4XiZero::Definition(), DumpTable(), G4QuarkExchange::ExciteParticipants(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMeson(), G4EmCalculator::FindParticle(), G4HadProcesses::FindParticle(), FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4BOptrForceCollision::G4BOptrForceCollision(), G4ChannelingOptrChangeCrossSection::G4ChannelingOptrChangeCrossSection(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryParticle::G4PrimaryParticle(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4SDParticleFilter::G4SDParticleFilter(), G4SDParticleFilter::G4SDParticleFilter(), G4CRCoalescence::GenerateDeuterons(), G4VUserPhysicsList::GetApplyCuts(), G4PrimaryTransformer::GetDefinition(), G4NucleiProperties::GetNuclearMass(), G4ParticlePropertyTable::GetParticleProperty(), antilightions::Init(), lightions::Init(), G4ErrorPropagator::InitG4Track(), G4DNAIonElasticModel::Initialise(), G4INCL::ParticleTable::initialize(), Insert(), G4HadronPhysicsFTF_BIC::Kaon(), G4HadronPhysicsFTFP_BERT::Kaon(), G4HadronPhysicsINCLXX::Kaon(), G4NeutrinoNucleusModel::MesonDecay(), G4ResonanceNames::MinMass(), G4CollisionComposite::Resolve::operator()(), G4HadronPhysicsQGS_BIC::Pion(), G4HadronPhysicsQGSP_BERT::Pion(), G4HadronPhysicsQGSP_BIC::Pion(), G4AdjointTrackingAction::PostUserTrackingAction(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4LMsdGenerator::SampleMx(), SelectParticle(), G4VUserPhysicsList::SetApplyCuts(), G4ChannelingFastSimModel::SetLindhardAngleNumberHighLimit(), G4ChannelingFastSimModel::SetLowKineticEnergyLimit(), G4VLongitudinalStringDecay::SetMinMasses(), G4GeneralParticleSourceMessenger::SetNewValue(), G4MoleculeTableMessenger::SetNewValue(), G4ParticleGunMessenger::SetNewValue(), G4ParticleMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4PSNofSecondary::SetParticle(), G4ParticlePropertyTable::SetParticleProperty(), G4PrimaryParticle::SetPDGcode(), G4RTPrimaryGeneratorAction::SetUp(), G4RayShooter::Shoot(), and G4AdjointPrimaryGeneratorAction::UpdateListOfPrimaryParticles().

◆ GetDictionary()

const G4ParticleTable::G4PTblDictionary * G4ParticleTable::GetDictionary ( ) const
protected

Definition at line 593 of file G4ParticleTable.cc.

594{
595 return fDictionary;
596}

◆ GetEncodingDictionary()

const G4ParticleTable::G4PTblEncodingDictionary * G4ParticleTable::GetEncodingDictionary ( ) const
protected

Definition at line 603 of file G4ParticleTable.cc.

604{
605 return fEncodingDictionary;
606}

◆ GetGenericIon()

◆ GetGenericMuonicAtom()

G4ParticleDefinition * G4ParticleTable::GetGenericMuonicAtom ( ) const
inline

◆ GetIonTable()

G4IonTable * G4ParticleTable::GetIonTable ( ) const

Definition at line 588 of file G4ParticleTable.cc.

589{
590 return fIonTable;
591}

Referenced by G4BinaryLightIonReaction::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4WilsonAblationModel::BreakItUp(), G4Radioactivation::CalculateChainsFromParent(), LBE::ConstructGeneral(), G4ITDecay::DecayIt(), G4ParticleDefinition::DumpTable(), G4BetaMinusDecay::G4BetaMinusDecay(), G4BetaPlusDecay::G4BetaPlusDecay(), G4eCoulombScatteringModel::G4eCoulombScatteringModel(), G4EmCalculator::G4EmCalculator(), G4EmCorrections::G4EmCorrections(), G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(), G4Evaporation::G4Evaporation(), G4ExcitationHandler::G4ExcitationHandler(), G4hCoulombScatteringModel::G4hCoulombScatteringModel(), G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(), G4NeutronFissionVI::G4NeutronFissionVI(), G4NeutronRadCapture::G4NeutronRadCapture(), G4NeutronRadCaptureHP::G4NeutronRadCaptureHP(), G4ParticleDefinition::G4ParticleDefinition(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4IonTable::GetIonTable(), G4StatMFFragment::GetNuclearMass(), G4FTFModel::Init(), G4INCL::ParticleTable::initialize(), G4InuclNuclei::makeDefinition(), G4QuasiElasticChannel::Scatter(), G4ParticleMessenger::SetNewValue(), and G4RunManagerKernel::SetupPhysics().

◆ GetIterator()

◆ GetKey()

const G4String & G4ParticleTable::GetKey ( const G4ParticleDefinition * particle) const
inlineprotected

◆ GetParticle()

G4ParticleDefinition * G4ParticleTable::GetParticle ( G4int index) const

Definition at line 415 of file G4ParticleTable.cc.

416{
417 CheckReadiness();
418 if ((index >= 0) && (index < entries())) {
420 piter->reset(false);
421 G4int counter = 0;
422 while ((*piter)()) // Loop checking, 09.08.2015, K.Kurashige
423 {
424 if (counter == index) return piter->value();
425 ++counter;
426 }
427 }
428#ifdef G4VERBOSE
429 if (verboseLevel > 1) {
430 G4cout << " G4ParticleTable::GetParticle"
431 << " invalid index (=" << index << ")" << G4endl;
432 }
433#endif
434 return nullptr;
435}
G4int entries() const

Referenced by G4RunManagerKernel::G4RunManagerKernel(), GetParticleName(), G4FastSimulationManager::ListModels(), G4RunManagerKernel::SetPhysics(), and G4GlobalFastSimulationManager::ShowSetup().

◆ GetParticleName()

const G4String & G4ParticleTable::GetParticleName ( G4int index) const

Definition at line 437 of file G4ParticleTable.cc.

438{
439 G4ParticleDefinition* aParticle = GetParticle(index);
440 if (aParticle != nullptr) {
441 return aParticle->GetParticleName();
442 }
443
444 return noName;
445}
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticle(G4int index) const

◆ GetParticleTable()

G4ParticleTable * G4ParticleTable::GetParticleTable ( )
static

Definition at line 82 of file G4ParticleTable.cc.

83{
84 if (fgParticleTable == nullptr) {
85 static G4ParticleTable theParticleTable;
86 fgParticleTable = &theParticleTable;
87 }
88
89 // Here we initialize all thread private data members.
90 //
92
93 return fgParticleTable;
94}

Referenced by G4ITStepProcessor::ActiveOnlyITProcess(), G4SDParticleFilter::add(), G4ChannelingOptrMultiParticleChangeCrossSection::AddChargedParticles(), G4ChannelingOptrMultiParticleChangeCrossSection::AddParticle(), G4IonTable::AddProcessManager(), LBE::AddTransportation(), G4ITTransportation::AlongStepDoIt(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4ANuTauNucleusCcModel::ApplyYourself(), G4ANuTauNucleusNcModel::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4NuTauNucleusCcModel::ApplyYourself(), G4NuTauNucleusNcModel::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4WilsonAblationModel::BreakItUp(), G4ErrorTrajState::BuildCharge(), G4HadronicBuilder::BuildDecayTableForBCHadrons(), G4HadronicBuilder::BuildElastic(), G4HadronicBuilder::BuildFTFP_INCLXX(), G4Radioactivation::CalculateChainsFromParent(), G4IonTable::clear(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4ExcitedBaryonConstructor::Construct(), G4ExcitedMesonConstructor::Construct(), G4EmBuilder::ConstructBasicEmPhysics(), LBE::ConstructEM(), LBE::ConstructGeneral(), LBE::ConstructHad(), G4MuonicAtomHelper::ConstructMuonicAtom(), LBE::ConstructOp(), G4HadronDElasticPhysics::ConstructProcess(), G4HadronElasticPhysics::ConstructProcess(), G4HadronHElasticPhysics::ConstructProcess(), G4RunManager::ConstructScoringWorlds(), G4WorkerRunManager::ConstructScoringWorlds(), G4IonTable::CreateIon(), G4IonTable::CreateIon(), G4PionDecayMakeSpin::DaughterPolarization(), G4ITDecay::DecayIt(), G4Radioactivation::DecayIt(), G4Adenine::Definition(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointElectronFI::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4Alpha::Definition(), G4AntiAlpha::Definition(), G4AntiBMesonZero::Definition(), G4AntiBsMesonZero::Definition(), G4AntiDeuteron::Definition(), G4AntiDMesonZero::Definition(), G4AntiDoubleHyperDoubleNeutron::Definition(), G4AntiDoubleHyperH4::Definition(), G4AntiHe3::Definition(), G4AntiHyperAlpha::Definition(), G4AntiHyperH4::Definition(), G4AntiHyperHe5::Definition(), G4AntiHyperTriton::Definition(), G4AntiKaonZero::Definition(), G4AntiLambda::Definition(), G4AntiLambdab::Definition(), G4AntiLambdacPlus::Definition(), G4AntiNeutrinoE::Definition(), G4AntiNeutrinoMu::Definition(), G4AntiNeutrinoTau::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(), G4AntiTriton::Definition(), G4AntiXibMinus::Definition(), G4AntiXibZero::Definition(), G4AntiXicPlus::Definition(), G4AntiXicZero::Definition(), G4AntiXiMinus::Definition(), G4AntiXiZero::Definition(), G4BcMesonMinus::Definition(), G4BcMesonPlus::Definition(), G4BMesonMinus::Definition(), G4BMesonPlus::Definition(), G4BMesonZero::Definition(), G4BsMesonZero::Definition(), G4ChargedGeantino::Definition(), G4Cytosine::Definition(), G4DamagedAdenine::Definition(), G4DamagedCytosine::Definition(), G4DamagedDeoxyribose::Definition(), G4DamagedGuanine::Definition(), G4DamagedThymine::Definition(), G4Deoxyribose::Definition(), G4Deuteron::Definition(), G4Dineutron::Definition(), G4Diproton::Definition(), G4DMesonMinus::Definition(), G4DMesonPlus::Definition(), G4DMesonZero::Definition(), G4DoubleHyperDoubleNeutron::Definition(), G4DoubleHyperH4::Definition(), G4DsMesonMinus::Definition(), G4DsMesonPlus::Definition(), G4Electron::Definition(), G4Electron_aq::Definition(), G4Eta::Definition(), G4Etac::Definition(), G4EtaPrime::Definition(), G4FakeMolecule::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4GenericIon::Definition(), G4GenericMuonicAtom::Definition(), G4Guanine::Definition(), G4H2::Definition(), G4H2O2::Definition(), G4H2O::Definition(), G4H3O::Definition(), G4He3::Definition(), G4Histone::Definition(), G4HO2::Definition(), G4Hydrogen::Definition(), G4HyperAlpha::Definition(), G4HyperH4::Definition(), G4HyperHe5::Definition(), G4HyperTriton::Definition(), G4JPsi::Definition(), G4KaonMinus::Definition(), G4KaonPlus::Definition(), G4KaonZero::Definition(), G4KaonZeroLong::Definition(), G4KaonZeroShort::Definition(), G4Lambda::Definition(), G4Lambdab::Definition(), G4LambdacPlus::Definition(), G4ModifiedHistone::Definition(), G4MuonMinus::Definition(), G4MuonPlus::Definition(), G4NeutrinoE::Definition(), G4NeutrinoMu::Definition(), G4NeutrinoTau::Definition(), G4Neutron::Definition(), G4O2::Definition(), G4O3::Definition(), G4OH::Definition(), G4OmegabMinus::Definition(), G4OmegacZero::Definition(), G4OmegaMinus::Definition(), G4OpticalPhoton::Definition(), G4Oxygen::Definition(), G4PhononLong::Definition(), G4PhononTransFast::Definition(), G4PhononTransSlow::Definition(), G4Phosphate::Definition(), G4PionMinus::Definition(), G4PionPlus::Definition(), G4PionZero::Definition(), G4Positron::Definition(), G4Proton::Definition(), G4SigmabMinus::Definition(), G4SigmabPlus::Definition(), G4SigmabZero::Definition(), G4SigmacPlus::Definition(), G4SigmacPlusPlus::Definition(), G4SigmacZero::Definition(), G4SigmaMinus::Definition(), G4SigmaPlus::Definition(), G4SigmaZero::Definition(), G4TauMinus::Definition(), G4TauPlus::Definition(), G4Thymine::Definition(), G4Triton::Definition(), G4UnboundPN::Definition(), G4UnknownParticle::Definition(), G4Upsilon::Definition(), G4XibMinus::Definition(), G4XibZero::Definition(), G4XicPlus::Definition(), G4XicZero::Definition(), G4XiMinus::Definition(), G4XiZero::Definition(), G4QuarkExchange::ExciteParticipants(), G4VParticlePropertyReporter::FillList(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMeson(), G4BaryonSplitter::FindDiquark(), G4EmCalculator::FindParticle(), G4HadProcesses::FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4ProcessTable::FindProcess(), G4AlphaDecay::G4AlphaDecay(), G4BaryonSplitter::G4BaryonSplitter(), G4BetaMinusDecay::G4BetaMinusDecay(), G4BetaPlusDecay::G4BetaPlusDecay(), G4BOptrForceCollision::G4BOptrForceCollision(), G4ChannelingOptrChangeCrossSection::G4ChannelingOptrChangeCrossSection(), G4ChargeExchangeXS::G4ChargeExchangeXS(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4DecayTableMessenger::G4DecayTableMessenger(), G4ECDecay::G4ECDecay(), G4eCoulombScatteringModel::G4eCoulombScatteringModel(), G4EmCalculator::G4EmCalculator(), G4EmCorrections::G4EmCorrections(), G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(), G4Evaporation::G4Evaporation(), G4ExcitationHandler::G4ExcitationHandler(), G4hCoulombScatteringModel::G4hCoulombScatteringModel(), G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(), G4NeutronDecay::G4NeutronDecay(), G4NeutronFissionVI::G4NeutronFissionVI(), G4NeutronRadCapture::G4NeutronRadCapture(), G4NeutronRadCaptureHP::G4NeutronRadCaptureHP(), G4ParticleDefinition::G4ParticleDefinition(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4ParticlePropertyTable::G4ParticlePropertyTable(), G4ParticleTypeConverter::G4ParticleTypeConverter(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryTransformer::G4PrimaryTransformer(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProtonDecay::G4ProtonDecay(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4RunManager::G4RunManager(), G4RunManager::G4RunManager(), G4RunManagerKernel::G4RunManagerKernel(), G4SDParticleFilter::G4SDParticleFilter(), G4SDParticleFilter::G4SDParticleFilter(), G4SFDecay::G4SFDecay(), G4SPBaryon::G4SPBaryon(), G4TritonDecay::G4TritonDecay(), G4UserEventAction::G4UserEventAction(), G4UserRunAction::G4UserRunAction(), G4UserStackingAction::G4UserStackingAction(), G4UserSteppingAction::G4UserSteppingAction(), G4UserTrackingAction::G4UserTrackingAction(), G4VDecayChannel::G4VDecayChannel(), G4VDecayChannel::G4VDecayChannel(), G4VDecayChannel::G4VDecayChannel(), G4VDecayChannel::G4VDecayChannel(), G4VPhysicsConstructor::G4VPhysicsConstructor(), G4VPhysicsConstructor::G4VPhysicsConstructor(), G4VUserPhysicsList::G4VUserPhysicsList(), G4VUserPhysicsList::G4VUserPhysicsList(), G4VUserPrimaryGeneratorAction::G4VUserPrimaryGeneratorAction(), G4CRCoalescence::GenerateDeuterons(), G4NucleiProperties::GetBindingEnergy(), G4UserPhysicsListMessenger::GetCurrentValue(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4IonTable::GetIonTable(), G4NucleiProperties::GetMassExcess(), G4HyperNucleiProperties::GetNuclearMass(), G4NucleiProperties::GetNuclearMass(), G4StatMFFragment::GetNuclearMass(), G4SmoothTrajectory::GetParticleDefinition(), G4Trajectory::GetParticleDefinition(), G4BaryonSplitter::GetSPBaryon(), G4IonTable::GetVerboseLevel(), antilightions::Init(), G4FTFModel::Init(), lightions::Init(), G4ErrorPropagator::InitG4Track(), G4DNAIonElasticModel::Initialise(), G4INCL::ParticleTable::initialize(), G4VPCData::initialize(), G4VUPLData::initialize(), G4VUserPhysicsList::InitializeProcessManager(), G4EMDissociationCrossSection::IsElementApplicable(), G4NucleiProperties::IsInStableTable(), G4HadronPhysicsFTF_BIC::Kaon(), G4HadronPhysicsFTFP_BERT::Kaon(), G4HadronPhysicsINCLXX::Kaon(), G4FastSimulationManager::ListModels(), G4InuclNuclei::makeDefinition(), G4NeutrinoNucleusModel::MesonDecay(), G4ResonanceNames::MinMass(), G4CollisionComposite::Resolve::operator()(), G4VDecayChannel::operator=(), G4HadronPhysicsQGS_BIC::Pion(), G4HadronPhysicsQGSP_BERT::Pion(), G4HadronPhysicsQGSP_BIC::Pion(), G4AdjointTrackingAction::PostUserTrackingAction(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4RunManagerKernel::PropagateGenericIonID(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4IonTable::Remove(), G4TextPPRetriever::Retrieve(), G4LMsdGenerator::SampleMx(), G4QuasiElasticChannel::Scatter(), G4VLongitudinalStringDecay::SetMinMasses(), G4FastSimulationMessenger::SetNewValue(), G4MoleculeTableMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4UserPhysicsListMessenger::SetNewValue(), G4PSNofSecondary::SetParticle(), G4PrimaryParticle::SetPDGcode(), G4RunManagerKernel::SetPhysics(), G4ProcessTable::SetProcessActivation(), G4ProcessTable::SetProcessActivation(), G4RTPrimaryGeneratorAction::SetUp(), G4MTRunManagerKernel::SetUpDecayChannels(), G4TaskRunManagerKernel::SetUpDecayChannels(), G4RunManagerKernel::SetupPhysics(), G4RunManagerKernel::SetupShadowProcess(), G4WorkerRunManagerKernel::SetupShadowProcess(), G4WorkerTaskRunManagerKernel::SetupShadowProcess(), G4RayShooter::Shoot(), G4GlobalFastSimulationManager::ShowSetup(), G4BaryonSplitter::SplitBarion(), G4ProductionCutsTable::UpdateCoupleTable(), G4AdjointPrimaryGeneratorAction::UpdateListOfPrimaryParticles(), G4ParticleDefinition::~G4ParticleDefinition(), G4WorkerRunManagerKernel::~G4WorkerRunManagerKernel(), and G4WorkerTaskRunManagerKernel::~G4WorkerTaskRunManagerKernel().

◆ GetReadiness()

G4bool G4ParticleTable::GetReadiness ( ) const
inline

◆ GetSelectedParticle()

const G4ParticleDefinition * G4ParticleTable::GetSelectedParticle ( ) const
inline

◆ GetVerboseLevel()

◆ Insert()

G4ParticleDefinition * G4ParticleTable::Insert ( G4ParticleDefinition * particle)

Definition at line 289 of file G4ParticleTable.cc.

290{
291 // check particle name
292 if ((particle == nullptr) || (GetKey(particle).empty())) {
293 G4Exception("G4ParticleTable::Insert()", "PART121", FatalException,
294 "Particle witnout name can not be registered.");
295#ifdef G4VERBOSE
296 if (verboseLevel > 1) {
297 G4cout << "The particle[Addr:" << particle << "] has no name " << G4endl;
298 }
299#endif
300 return nullptr;
301 }
302
303 if (contains(particle)) {
304#ifdef G4VERBOSE
305 if (verboseLevel > 2) {
306 FindParticle(particle)->DumpTable();
307 }
308#endif
309 G4String msg = "The particle ";
310 msg += particle->GetParticleName();
311 msg += " has already been registered in the Particle Table ";
312 G4Exception("G4ParticleTable::Insert()", "PART122", FatalException, msg);
313
314 return particle;
315 }
316
318
319 // insert into Dictionary
320 pdic->insert(std::pair<G4String, G4ParticleDefinition*>(GetKey(particle), particle));
321#ifdef G4MULTITHREADED
323 fDictionary->insert(std::pair<G4String, G4ParticleDefinition*>(GetKey(particle), particle));
324 }
325#endif
326
328
329 // insert into EncodingDictionary
330 G4int code = particle->GetPDGEncoding();
331 if (code != 0) {
332 pedic->insert(std::pair<G4int, G4ParticleDefinition*>(code, particle));
333#ifdef G4MULTITHREADED
335 fEncodingDictionary->insert(std::pair<G4int, G4ParticleDefinition*>(code, particle));
336 }
337#endif
338 }
339
340 // insert it in IonTable if "nucleus"
341 if (fIonTable->IsIon(particle)) {
342 fIonTable->Insert(particle);
343 }
344
345 // set Verbose Level same as ParticleTable
346 particle->SetVerboseLevel(verboseLevel);
347
348#ifdef G4VERBOSE
349 if (verboseLevel > 3) {
350 G4cout << "The particle " << particle->GetParticleName() << " is inserted in the ParticleTable "
351 << G4endl;
352 }
353#endif
354 return particle;
355}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4bool IsIon(const G4ParticleDefinition *)
void Insert(const G4ParticleDefinition *particle)
void SetVerboseLevel(G4int value)
G4bool contains(const G4ParticleDefinition *particle) const
G4ParticleTableIterator< G4String, G4ParticleDefinition * >::Map G4PTblDictionary

Referenced by G4ParticleDefinition::G4ParticleDefinition().

◆ operator=()

G4ParticleTable & G4ParticleTable::operator= ( const G4ParticleTable & )
delete

◆ Remove()

G4ParticleDefinition * G4ParticleTable::Remove ( G4ParticleDefinition * particle)

Definition at line 357 of file G4ParticleTable.cc.

358{
359 if (particle == nullptr) return nullptr;
360#ifdef G4MULTITHREADED
363 ed << "Request of removing " << particle->GetParticleName()
364 << " is ignored as it is invoked from a worker thread.";
365 G4Exception("G4ParticleTable::Remove()", "PART10117", JustWarning, ed);
366 return nullptr;
367 }
368#endif
369 if (readyToUse) {
371 G4ApplicationState currentState = pStateManager->GetCurrentState();
372 if (currentState != G4State_PreInit) {
373 G4String msg = "Request of removing ";
374 msg += particle->GetParticleName();
375 msg += " has No effects other than Pre_Init";
376 G4Exception("G4ParticleTable::Remove()", "PART117", JustWarning, msg);
377 return nullptr;
378 }
379
380#ifdef G4VERBOSE
381 if (verboseLevel > 0) {
382 G4cout << particle->GetParticleName() << " will be removed from the ParticleTable " << G4endl;
383 }
384#endif
385 }
386
387 auto it = fDictionaryShadow->find(GetKey(particle));
388 if (it != fDictionaryShadow->end()) {
389 fDictionaryShadow->erase(it);
390 // remove from EncodingDictionary
391 G4int code = particle->GetPDGEncoding();
392 if (code != 0) {
394 }
395 }
396 else {
397 return nullptr;
398 }
399
400 // remove it from IonTable if "nucleus"
401 if (fIonTable->IsIon(particle)) {
402 fIonTable->Remove(particle);
403 }
404
405#ifdef G4VERBOSE
406 if (verboseLevel > 3) {
407 G4cout << "The particle " << particle->GetParticleName()
408 << " is removed from the ParticleTable " << G4endl;
409 }
410#endif
411
412 return particle;
413}
G4ApplicationState
@ G4State_PreInit
@ JustWarning
std::ostringstream G4ExceptionDescription
void Remove(const G4ParticleDefinition *particle)
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

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

◆ RemoveAllParticles()

void G4ParticleTable::RemoveAllParticles ( )

Definition at line 264 of file G4ParticleTable.cc.

265{
266 if (readyToUse) {
267 G4Exception("G4ParticleTable::RemoveAllParticle()", "PART115", JustWarning,
268 "No effects because readyToUse is true.");
269 return;
270 }
271
272#ifdef G4VERBOSE
273 if (verboseLevel > 1) {
274 G4cout << "G4ParticleTable::RemoveAllParticles() " << G4endl;
275 }
276#endif
277
278 // remove all contents in Ion Table
279 if (fIonTable != nullptr) {
280 fIonTable->clear();
281 }
282
283 // clear dictionary
284 if (fDictionary != nullptr) {
285 fDictionary->clear();
286 }
287}

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

◆ SelectParticle()

void G4ParticleTable::SelectParticle ( const G4String & name)

Definition at line 474 of file G4ParticleTable.cc.

475{
476 if (name != selectedName) {
477 const G4ParticleDefinition* part = FindParticle(name);
478 if (part != nullptr) {
479#ifdef G4MULTITHREADED
480 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
481#endif
482 selectedParticle = part;
483 selectedName = name;
484#ifdef G4MULTITHREADED
485 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
486#endif
487 }
488 }
489}
const char * name(G4int ptype)

Referenced by G4ParticleMessenger::SetNewValue().

◆ SetGenericIon()

void G4ParticleTable::SetGenericIon ( G4ParticleDefinition * )
inline

◆ SetGenericMuonicAtom()

void G4ParticleTable::SetGenericMuonicAtom ( G4ParticleDefinition * )
inline

◆ SetReadiness()

void G4ParticleTable::SetReadiness ( G4bool val = true)
inline

◆ SetVerboseLevel()

void G4ParticleTable::SetVerboseLevel ( G4int value)
inline

◆ size()

G4int G4ParticleTable::size ( ) const

Definition at line 619 of file G4ParticleTable.cc.

620{
621 return (G4int)fDictionary->size();
622}

◆ WorkerG4ParticleTable()

void G4ParticleTable::WorkerG4ParticleTable ( )

Definition at line 130 of file G4ParticleTable.cc.

131{
132 // The iterator for the shadow particle table is not sharable.
133 //
134#ifdef G4MULTITHREADED
135 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
136 G4ParticleTable::lockCount()++;
137#endif
138 if (fDictionary == nullptr) {
140 }
141 else {
142 fDictionary->clear();
143 }
144
145 if (fEncodingDictionary == nullptr) {
147 }
148 else {
149 fEncodingDictionary->clear();
150 }
151
152 fIteratorShadow->reset(false);
153 while ((*fIteratorShadow)()) // Loop checking, 09.08.2015, K.Kurashige
154 {
156 fDictionary->insert(std::pair<G4String, G4ParticleDefinition*>(GetKey(particle), particle));
157 G4int code = particle->GetPDGEncoding();
158 if (code != 0) {
159 fEncodingDictionary->insert(std::pair<G4int, G4ParticleDefinition*>(code, particle));
160 }
161 }
163
164#ifdef G4MULTITHREADED
165 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
166#endif
167
169}
void WorkerG4IonTable()
static G4PTblDicIterator * fIteratorShadow

Referenced by GetParticleTable().

Member Data Documentation

◆ fDictionary

◆ fDictionaryShadow

G4ParticleTable::G4PTblDictionary * G4ParticleTable::fDictionaryShadow = nullptr
static

Definition at line 178 of file G4ParticleTable.hh.

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

◆ fEncodingDictionary

◆ fEncodingDictionaryShadow

G4ParticleTable::G4PTblEncodingDictionary * G4ParticleTable::fEncodingDictionaryShadow = nullptr
static

Definition at line 180 of file G4ParticleTable.hh.

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

◆ fgParticleTable

G4ParticleTable * G4ParticleTable::fgParticleTable = nullptr
static

Definition at line 168 of file G4ParticleTable.hh.

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

◆ fIonTable

G4IonTable* G4ParticleTable::fIonTable = nullptr

◆ fIterator

◆ fIteratorShadow

G4ParticleTable::G4PTblDicIterator * G4ParticleTable::fIteratorShadow = nullptr
static

Definition at line 179 of file G4ParticleTable.hh.

Referenced by WorkerG4ParticleTable().

◆ fParticleMessenger

G4ParticleMessenger* G4ParticleTable::fParticleMessenger = nullptr

Definition at line 162 of file G4ParticleTable.hh.

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


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