Geant4 10.7.0
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

 G4ParticleTable (const G4ParticleTable &)=delete
 
G4ParticleTableoperator= (const G4ParticleTable &)=delete
 
void WorkerG4ParticleTable ()
 
virtual ~G4ParticleTable ()
 
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 = nullptr
 
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 ( const G4ParticleTable )
delete

◆ ~G4ParticleTable()

G4ParticleTable::~G4ParticleTable ( )
virtual

Definition at line 191 of file G4ParticleTable.cc.

192{
193 readyToUse = false;
194
195 // remove all items from G4ParticleTable
197
198 // delete Ion Table
199 if (fIonTable != nullptr) delete fIonTable;
200 fIonTable = nullptr;
201
202 // delete dictionary for encoding
203 if (fEncodingDictionary != nullptr)
204 {
205 fEncodingDictionary->clear();
206 delete fEncodingDictionary;
207 fEncodingDictionary = nullptr;
208 }
209
210 if( fDictionary != nullptr)
211 {
212 if (fIterator != nullptr ) delete fIterator;
213 fIterator = nullptr;
214
215 fDictionary->clear();
216 delete fDictionary;
217 fDictionary =nullptr;
218 }
219
220 if ( fParticleMessenger != nullptr) delete fParticleMessenger;
221 fParticleMessenger = nullptr;
222
223 fgParticleTable = nullptr;
224
225 G4ParticleDefinition::Clean(); // Delete sub-instance static data
226}
static G4ThreadLocal G4PTblEncodingDictionary * fEncodingDictionary
static G4ParticleTable * fgParticleTable
G4IonTable * fIonTable
G4ParticleMessenger * fParticleMessenger
static G4ThreadLocal G4PTblDicIterator * fIterator
static G4ThreadLocal G4PTblDictionary * fDictionary

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 720 of file G4ParticleTable.cc.

721{
722 G4PTblDictionary::iterator it = fDictionaryShadow->find(particle_name);
723 return (it != fDictionaryShadow->cend());
724}
static G4PTblDictionary * fDictionaryShadow

◆ CreateMessenger()

G4UImessenger * G4ParticleTable::CreateMessenger ( )

Definition at line 254 of file G4ParticleTable.cc.

255{
256 if (fParticleMessenger == nullptr)
257 {
258 // UI messenger
260 }
261 return fParticleMessenger;
262}

Referenced by G4RunManager::G4RunManager().

◆ DeleteAllParticles()

void G4ParticleTable::DeleteAllParticles ( )

Definition at line 265 of file G4ParticleTable.cc.

266{
267 //set readyToUse false
268 readyToUse = false;
269
270#ifdef G4VERBOSE
271 if (verboseLevel>1)
272 {
273 G4cout << "G4ParticleTable::DeleteAllParticles() " << G4endl;
274 }
275#endif
276
277 // delete all particles
279 piter->reset(false);
280 while( (*piter)() ) // Loop checking, 09.08.2015, K.Kurashige
281 {
282#ifdef G4VERBOSE
283 if (verboseLevel>2)
284 {
285 G4cout << "Delete " << (piter->value())->GetParticleName()
286 << " " << (piter->value()) << G4endl;
287 }
288#endif
289 delete (piter->value());
290 }
292}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void reset(G4bool ifSkipIon=true)
G4ParticleTableIterator< G4String, G4ParticleDefinition * > G4PTblDicIterator
const G4String & GetParticleName(G4int index) const

Referenced by G4VUserPhysicsList::~G4VUserPhysicsList().

◆ DestroyWorkerG4ParticleTable()

void G4ParticleTable::DestroyWorkerG4ParticleTable ( )

Definition at line 229 of file G4ParticleTable.cc.

230{
231 // delete Ion Table in worker thread
233
234 // delete dictionary for encoding
235 if (fEncodingDictionary != nullptr)
236 {
237 fEncodingDictionary->clear();
238 delete fEncodingDictionary;
239 fEncodingDictionary = nullptr;
240 }
241
242 if( fDictionary != nullptr)
243 {
244 if (fIterator != nullptr ) delete fIterator;
245 fIterator = nullptr;
246
247 fDictionary->clear();
248 delete fDictionary;
249 fDictionary = nullptr;
250 }
251}
void DestroyWorkerG4IonTable()
Definition: G4IonTable.cc:214

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

◆ DumpTable()

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

Definition at line 640 of file G4ParticleTable.cc.

641{
642 CheckReadiness();
643 if (( particle_name == "ALL" ) || (particle_name == "all"))
644 {
645 // dump all particles
647 piter -> reset();
648 while( (*piter)() ) // Loop checking, 09.08.2015, K.Kurashige
649 {
650 (piter->value())->DumpTable();
651 }
652 }
653 else
654 {
655 // dump only particle with name of particle_name
656 G4ParticleDefinition *ptr = FindParticle(particle_name);
657 if ( ptr != nullptr)
658 {
659 ptr->DumpTable();
660 }
661 else
662 {
663#ifdef G4VERBOSE
664 if (verboseLevel>1)
665 {
666 G4cout << " G4ParticleTable::DumpTable : "
667 << particle_name << " does not exist in ParticleTable "
668 << G4endl;
669 }
670#endif
671 }
672 }
673}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void DumpTable(const G4String &particle_name="ALL")

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

◆ entries()

G4int G4ParticleTable::entries ( ) const

◆ 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 578 of file G4ParticleTable.cc.

579{
580 CheckReadiness();
581 G4String key = GetKey(particle);
582 return FindParticle(key);
583}
const G4String & GetKey(const G4ParticleDefinition *particle) const

◆ FindParticle() [2/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( const G4String particle_name)

Definition at line 524 of file G4ParticleTable.cc.

525{
526 G4PTblDictionary::iterator it = fDictionary->find(particle_name);
527 if (it != fDictionary->end())
528 {
529 return (*it).second;
530 }
531 else
532 {
533#ifdef G4MULTITHREADED
534 G4ParticleDefinition* ptcl = nullptr;
536 {
537 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
538 G4PTblDictionary::iterator its = fDictionaryShadow->find(particle_name);
539 if(its != fDictionaryShadow->end())
540 {
541 fDictionary->insert(*its);
542 ptcl = (*its).second;
543 G4int code = ptcl->GetPDGEncoding();
544 if(code!=0) fEncodingDictionary->insert(std::pair<G4int,
545 G4ParticleDefinition*>(code,ptcl) );
546 }
547 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
548 }
549 return ptcl;
550#else
551 return nullptr;
552#endif
553 }
554}
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
G4bool IsWorkerThread()
Definition: G4Threading.cc:123
Definition: inftrees.h:24

◆ FindParticle() [3/3]

G4ParticleDefinition * G4ParticleTable::FindParticle ( G4int  PDGEncoding)

Definition at line 586 of file G4ParticleTable.cc.

587{
588 CheckReadiness();
589 // check aPDGEncoding is valid
590 if (aPDGEncoding == 0)
591 {
592#ifdef G4VERBOSE
593 if (verboseLevel>1)
594 {
595 G4cout << "PDGEncoding [" << aPDGEncoding << "] is not valid "
596 << G4endl;
597 }
598#endif
599 return nullptr;
600 }
601
603 G4ParticleDefinition* particle = nullptr;
604
605 G4PTblEncodingDictionary::iterator it = pedic->find(aPDGEncoding );
606 if (it != pedic->end())
607 {
608 particle = (*it).second;
609 }
610
611#ifdef G4MULTITHREADED
612 if(particle == nullptr && G4Threading::IsWorkerThread())
613 {
614 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
615 G4PTblEncodingDictionary::iterator its
616 = fEncodingDictionaryShadow->find(aPDGEncoding);
617 if(its!=fEncodingDictionaryShadow->end())
618 {
619 particle = (*its).second;
620 fEncodingDictionary->insert(*its);
621 G4String key = GetKey(particle);
622 fDictionary->insert( std::pair<G4String,
623 G4ParticleDefinition*>(key,particle) );
624 }
625 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
626 }
627#endif
628
629#ifdef G4VERBOSE
630 if ((particle == nullptr) && (verboseLevel>1) )
631 {
632 G4cout << "CODE:" << aPDGEncoding << " does not exist in ParticleTable "
633 << G4endl;
634 }
635#endif
636 return particle;
637}
static G4PTblEncodingDictionary * fEncodingDictionaryShadow
G4ParticleTableIterator< G4int, G4ParticleDefinition * >::Map G4PTblEncodingDictionary

Referenced by G4SDParticleFilter::add(), G4ChannelingOptrMultiParticleChangeCrossSection::AddParticle(), G4ITTransportation::AlongStepDoIt(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4ErrorTrajState::BuildCharge(), G4HadronicBuilder::BuildDecayTableForBCHadrons(), G4HadronicBuilder::BuildElastic(), G4VUserPhysicsList::BuildPhysicsTable(), G4PrimaryTransformer::CheckUnknown(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4EmBuilder::ConstructBasicEmPhysics(), G4MuonicAtomHelper::ConstructMuonicAtom(), G4EmStandardPhysicsSS::ConstructProcess(), G4HadronElasticPhysics::ConstructProcess(), G4PionDecayMakeSpin::DaughterPolarization(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointElectronFI::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4ChargedGeantino::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4OpticalPhoton::Definition(), G4PhononLong::Definition(), G4PhononTransFast::Definition(), G4PhononTransSlow::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(), G4GenericMuonicAtom::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(), G4Upsilon::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(), G4DamagedDeoxyribose::Definition(), G4DamagedAdenine::Definition(), G4DamagedGuanine::Definition(), G4DamagedThymine::Definition(), G4DamagedCytosine::Definition(), G4Deoxyribose::Definition(), G4Phosphate::Definition(), G4Adenine::Definition(), G4Guanine::Definition(), G4Thymine::Definition(), G4Cytosine::Definition(), G4ModifiedHistone::Definition(), G4Histone::Definition(), G4Electron_aq::Definition(), G4FakeMolecule::Definition(), G4H2::Definition(), G4H2O::Definition(), G4H2O2::Definition(), G4H3O::Definition(), G4HO2::Definition(), G4Hydrogen::Definition(), G4O2::Definition(), G4O3::Definition(), G4OH::Definition(), G4Oxygen::Definition(), DumpTable(), G4QuarkExchange::ExciteParticipants(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMeson(), FindParticle(), G4HadProcesses::FindParticle(), G4EmCalculator::FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4BOptrForceCollision::G4BOptrForceCollision(), G4ChannelingOptrChangeCrossSection::G4ChannelingOptrChangeCrossSection(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4SDParticleFilter::G4SDParticleFilter(), G4CRCoalescence::GenerateDeuterons(), G4VUserPhysicsList::GetApplyCuts(), G4PrimaryTransformer::GetDefinition(), G4NucleiProperties::GetNuclearMass(), G4HyperNucleiProperties::GetNuclearMass(), G4ParticlePropertyTable::GetParticleProperty(), lightions::Init(), antilightions::Init(), G4ErrorPropagator::InitG4Track(), G4DNAIonElasticModel::Initialise(), G4INCL::ParticleTable::initialize(), Insert(), G4HadronPhysicsFTFP_BERT::Kaon(), G4HadronPhysicsFTF_BIC::Kaon(), G4HadronPhysicsINCLXX::Kaon(), G4NeutrinoNucleusModel::MesonDecay(), G4ResonanceNames::MinMass(), G4CollisionComposite::Resolve::operator()(), G4HadronPhysicsQGS_BIC::Pion(), G4HadronPhysicsQGSP_BERT::Pion(), G4HadronPhysicsQGSP_BIC::Pion(), G4AdjointTrackingAction::PostUserTrackingAction(), G4VEnergyLossProcess::PreparePhysicsTable(), G4VMultipleScattering::PreparePhysicsTable(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4LMsdGenerator::SampleMx(), SelectParticle(), G4VUserPhysicsList::SetApplyCuts(), G4VLongitudinalStringDecay::SetMinMasses(), G4GeneralParticleSourceMessenger::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 701 of file G4ParticleTable.cc.

702{
703 return fDictionary;
704}

◆ GetEncodingDictionary()

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

Definition at line 714 of file G4ParticleTable.cc.

715{
716 return fEncodingDictionary;
717}

◆ GetGenericIon()

◆ GetGenericMuonicAtom()

G4ParticleDefinition * G4ParticleTable::GetGenericMuonicAtom ( ) const
inline

◆ GetIonTable()

G4IonTable * G4ParticleTable::GetIonTable ( ) const

Definition at line 695 of file G4ParticleTable.cc.

696{
697 return fIonTable;
698}

Referenced by G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4WilsonAblationModel::BreakItUp(), G4Radioactivation::CalculateChainsFromParent(), G4RadioactiveDecay::CalculateChainsFromParent(), LBE::ConstructGeneral(), G4Radioactivation::DecayIt(), G4RadioactiveDecay::DecayIt(), G4ITDecay::DecayIt(), G4ParticleDefinition::DumpTable(), G4AlphaDecay::G4AlphaDecay(), G4BetaMinusDecay::G4BetaMinusDecay(), G4BetaPlusDecay::G4BetaPlusDecay(), G4ECDecay::G4ECDecay(), G4eCoulombScatteringModel::G4eCoulombScatteringModel(), G4EmCalculator::G4EmCalculator(), G4EmCorrections::G4EmCorrections(), G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(), G4Evaporation::G4Evaporation(), G4ExcitationHandler::G4ExcitationHandler(), G4hCoulombScatteringModel::G4hCoulombScatteringModel(), G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(), G4ITDecay::G4ITDecay(), G4NeutronDecay::G4NeutronDecay(), G4NeutronRadCapture::G4NeutronRadCapture(), G4ParticleDefinition::G4ParticleDefinition(), G4ProtonDecay::G4ProtonDecay(), G4SFDecay::G4SFDecay(), G4TritonDecay::G4TritonDecay(), G4TripathiCrossSection::GetElementCrossSection(), 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 484 of file G4ParticleTable.cc.

485{
486 CheckReadiness();
487 if ( (index >=0) && (index < entries()) )
488 {
490 piter -> reset(false);
491 G4int counter = 0;
492 while( (*piter)() ) // Loop checking, 09.08.2015, K.Kurashige
493 {
494 if ( counter == index ) return piter->value();
495 ++counter;
496 }
497 }
498#ifdef G4VERBOSE
499 if (verboseLevel>1)
500 {
501 G4cout << " G4ParticleTable::GetParticle"
502 << " invalid index (=" << index << ")" << G4endl;
503 }
504#endif
505 return nullptr;
506}
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 509 of file G4ParticleTable.cc.

510{
511 G4ParticleDefinition* aParticle =GetParticle(index);
512 if (aParticle != nullptr)
513 {
514 return aParticle->GetParticleName();
515 }
516 else
517 {
518 return noName;
519 }
520}
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticle(G4int index) const

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

◆ GetParticleTable()

G4ParticleTable * G4ParticleTable::GetParticleTable ( )
static

Definition at line 87 of file G4ParticleTable.cc.

88{
89 if ( fgParticleTable == nullptr )
90 {
91 static G4ParticleTable theParticleTable;
92 fgParticleTable = &theParticleTable;
93 }
94
95 // Here we initialize all thread private data members.
96 //
98
99 return fgParticleTable;
100}
void WorkerG4ParticleTable()

Referenced by G4ITStepProcessor::ActiveOnlyITProcess(), G4SDParticleFilter::add(), G4ChannelingOptrMultiParticleChangeCrossSection::AddChargedParticles(), G4ChannelingOptrMultiParticleChangeCrossSection::AddParticle(), G4IonTable::AddProcessManager(), LBE::AddTransportation(), G4ITTransportation::AlongStepDoIt(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4WilsonAblationModel::BreakItUp(), G4ErrorTrajState::BuildCharge(), G4HadronicBuilder::BuildDecayTableForBCHadrons(), G4HadronicBuilder::BuildElastic(), G4Radioactivation::CalculateChainsFromParent(), G4RadioactiveDecay::CalculateChainsFromParent(), G4IonTable::clear(), G4NeutrinoNucleusModel::ClusterDecay(), G4NeutrinoNucleusModel::CoherentPion(), G4ExcitedBaryonConstructor::Construct(), G4ExcitedMesonConstructor::Construct(), G4EmBuilder::ConstructBasicEmPhysics(), LBE::ConstructEM(), LBE::ConstructGeneral(), LBE::ConstructHad(), G4MuonicAtomHelper::ConstructMuonicAtom(), LBE::ConstructOp(), G4EmStandardPhysicsSS::ConstructProcess(), G4HadronElasticPhysics::ConstructProcess(), G4RunManager::ConstructScoringWorlds(), G4WorkerRunManager::ConstructScoringWorlds(), G4IonTable::CreateIon(), G4PionDecayMakeSpin::DaughterPolarization(), G4Radioactivation::DecayIt(), G4RadioactiveDecay::DecayIt(), G4ITDecay::DecayIt(), G4AdjointAlpha::Definition(), G4AdjointDeuteron::Definition(), G4AdjointElectron::Definition(), G4AdjointElectronFI::Definition(), G4AdjointGamma::Definition(), G4AdjointGenericIon::Definition(), G4AdjointHe3::Definition(), G4AdjointPositron::Definition(), G4AdjointProton::Definition(), G4AdjointTriton::Definition(), G4ChargedGeantino::Definition(), G4Gamma::Definition(), G4Geantino::Definition(), G4OpticalPhoton::Definition(), G4PhononLong::Definition(), G4PhononTransFast::Definition(), G4PhononTransSlow::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(), G4GenericMuonicAtom::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(), G4Upsilon::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(), G4DamagedDeoxyribose::Definition(), G4DamagedAdenine::Definition(), G4DamagedGuanine::Definition(), G4DamagedThymine::Definition(), G4DamagedCytosine::Definition(), G4Deoxyribose::Definition(), G4Phosphate::Definition(), G4Adenine::Definition(), G4Guanine::Definition(), G4Thymine::Definition(), G4Cytosine::Definition(), G4ModifiedHistone::Definition(), G4Histone::Definition(), G4Electron_aq::Definition(), G4FakeMolecule::Definition(), G4H2::Definition(), G4H2O::Definition(), G4H2O2::Definition(), G4H3O::Definition(), G4HO2::Definition(), G4Hydrogen::Definition(), G4O2::Definition(), G4O3::Definition(), G4OH::Definition(), G4Oxygen::Definition(), G4Dineutron::Definition(), G4Diproton::Definition(), G4UnboundPN::Definition(), G4QuarkExchange::ExciteParticipants(), G4VParticlePropertyReporter::FillList(), G4NeutrinoNucleusModel::FinalBarion(), G4NeutrinoNucleusModel::FinalMeson(), G4BaryonSplitter::FindDiquark(), G4HadProcesses::FindParticle(), G4EmCalculator::FindParticle(), G4VLongitudinalStringDecay::FindParticle(), G4ProcessTable::FindProcess(), G4AlphaDecay::G4AlphaDecay(), G4BaryonSplitter::G4BaryonSplitter(), G4BetaMinusDecay::G4BetaMinusDecay(), G4BetaPlusDecay::G4BetaPlusDecay(), G4BOptrForceCollision::G4BOptrForceCollision(), G4ChannelingOptrChangeCrossSection::G4ChannelingOptrChangeCrossSection(), G4CollisionMesonBaryonToResonance::G4CollisionMesonBaryonToResonance(), G4DecayTableMessenger::G4DecayTableMessenger(), G4ECDecay::G4ECDecay(), G4eCoulombScatteringModel::G4eCoulombScatteringModel(), G4EmCalculator::G4EmCalculator(), G4EmCorrections::G4EmCorrections(), G4ErrorTrackLengthTarget::G4ErrorTrackLengthTarget(), G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(), G4Evaporation::G4Evaporation(), G4ExcitationHandler::G4ExcitationHandler(), G4hCoulombScatteringModel::G4hCoulombScatteringModel(), G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(), G4ITDecay::G4ITDecay(), G4NeutronDecay::G4NeutronDecay(), G4NeutronRadCapture::G4NeutronRadCapture(), G4ParticleDefinition::G4ParticleDefinition(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4ParticlePropertyTable::G4ParticlePropertyTable(), G4ParticleTypeConverter::G4ParticleTypeConverter(), G4Parton::G4Parton(), G4PrimaryParticle::G4PrimaryParticle(), G4PrimaryTransformer::G4PrimaryTransformer(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProtonDecay::G4ProtonDecay(), G4ResonanceNames::G4ResonanceNames(), G4RToEConvForElectron::G4RToEConvForElectron(), G4RToEConvForGamma::G4RToEConvForGamma(), G4RToEConvForPositron::G4RToEConvForPositron(), G4RToEConvForProton::G4RToEConvForProton(), G4RunManager::G4RunManager(), G4RunManagerKernel::G4RunManagerKernel(), G4SDParticleFilter::G4SDParticleFilter(), G4SFDecay::G4SFDecay(), G4SPBaryon::G4SPBaryon(), G4TritonDecay::G4TritonDecay(), G4UserEventAction::G4UserEventAction(), G4UserRunAction::G4UserRunAction(), G4UserStackingAction::G4UserStackingAction(), G4UserSteppingAction::G4UserSteppingAction(), G4UserTrackingAction::G4UserTrackingAction(), G4VDecayChannel::G4VDecayChannel(), G4VPhysicsConstructor::G4VPhysicsConstructor(), G4VUserPhysicsList::G4VUserPhysicsList(), G4VUserPrimaryGeneratorAction::G4VUserPrimaryGeneratorAction(), G4WorkerRunManager::G4WorkerRunManager(), G4CRCoalescence::GenerateDeuterons(), G4HyperNucleiProperties::GetAtomicMass(), G4NucleiProperties::GetBindingEnergy(), G4UserPhysicsListMessenger::GetCurrentValue(), G4TripathiCrossSection::GetElementCrossSection(), G4DiffuseElastic::GetInvCoulombElasticXsc(), G4NuclNuclDiffuseElastic::GetInvCoulombElasticXsc(), G4DiffuseElastic::GetInvElasticSumXsc(), G4NuclNuclDiffuseElastic::GetInvElasticSumXsc(), G4DiffuseElastic::GetInvElasticXsc(), G4NuclNuclDiffuseElastic::GetInvElasticXsc(), G4IonTable::GetIonTable(), G4NucleiProperties::GetMassExcess(), G4NucleiProperties::GetNuclearMass(), G4HyperNucleiProperties::GetNuclearMass(), G4StatMFFragment::GetNuclearMass(), G4SmoothTrajectory::GetParticleDefinition(), G4Trajectory::GetParticleDefinition(), G4BaryonSplitter::GetSPBaryon(), G4IonTable::GetVerboseLevel(), lightions::Init(), antilightions::Init(), G4FTFModel::Init(), G4ErrorPropagator::InitG4Track(), G4DNAIonElasticModel::Initialise(), G4VPCData::initialize(), G4VUPLData::initialize(), G4INCL::ParticleTable::initialize(), G4VUserPhysicsList::InitializeProcessManager(), G4EMDissociationCrossSection::IsElementApplicable(), G4NucleiProperties::IsInStableTable(), G4HadronPhysicsFTFP_BERT::Kaon(), G4HadronPhysicsFTF_BIC::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(), G4VEnergyLossProcess::PreparePhysicsTable(), G4VMultipleScattering::PreparePhysicsTable(), G4HtmlPPReporter::Print(), G4TextPPReporter::Print(), G4RunManagerKernel::PropagateGenericIonID(), G4AdjointSimManager::RegisterAtEndOfAdjointTrack(), G4IonTable::Remove(), G4TextPPRetriever::Retrieve(), G4LMsdGenerator::SampleMx(), G4QuasiElasticChannel::Scatter(), G4VLongitudinalStringDecay::SetMinMasses(), G4ProcessTableMessenger::SetNewValue(), G4FastSimulationMessenger::SetNewValue(), G4UserPhysicsListMessenger::SetNewValue(), G4PSNofSecondary::SetParticle(), G4PrimaryParticle::SetPDGcode(), G4RunManagerKernel::SetPhysics(), 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 326 of file G4ParticleTable.cc.

327{
328 // check particle name
329 if ((particle == nullptr) || (GetKey(particle).isNull()))
330 {
331 G4Exception("G4ParticleTable::Insert()",
332 "PART121", FatalException,
333 "Particle witnout name can not be registered.");
334#ifdef G4VERBOSE
335 if (verboseLevel>1)
336 {
337 G4cout << "The particle[Addr:" << particle << "] has no name "<< G4endl;
338 }
339#endif
340 return nullptr;
341 }
342 else
343 {
344 if (contains(particle))
345 {
346#ifdef G4VERBOSE
347 if (verboseLevel>2)
348 {
349 FindParticle(particle) -> DumpTable();
350 }
351#endif
352 G4String msg = "The particle ";
353 msg += particle->GetParticleName();
354 msg += " has already been registered in the Particle Table ";
355 G4Exception("G4ParticleTable::Insert()", "PART122", FatalException, msg);
356
357 return particle;
358 }
359 else
360 {
362
363 // insert into Dictionary
364 pdic->insert( std::pair<G4String,
365 G4ParticleDefinition*>(GetKey(particle), particle) );
366#ifdef G4MULTITHREADED
368 {
369 fDictionary->insert( std::pair<G4String,
370 G4ParticleDefinition*>(GetKey(particle), particle) );
371 }
372#endif
373
375
376 // insert into EncodingDictionary
377 G4int code = particle->GetPDGEncoding();
378 if (code != 0 )
379 {
380 pedic->insert( std::pair<G4int,
381 G4ParticleDefinition*>(code ,particle) );
382#ifdef G4MULTITHREADED
384 {
385 fEncodingDictionary->insert( std::pair<G4int,
386 G4ParticleDefinition*>(code ,particle) );
387 }
388#endif
389 }
390
391 // insert it in IonTable if "nucleus"
392 if (fIonTable->IsIon(particle) )
393 {
394 fIonTable->Insert(particle);
395 }
396
397 // set Verbose Level same as ParticleTable
398 particle->SetVerboseLevel(verboseLevel);
399
400#ifdef G4VERBOSE
401 if (verboseLevel>3)
402 {
403 G4cout << "The particle "<< particle->GetParticleName()
404 << " is inserted in the ParticleTable " << G4endl;
405 }
406#endif
407 return particle;
408 }
409 }
410}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static G4bool IsIon(const G4ParticleDefinition *)
Definition: G4IonTable.cc:1302
void Insert(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:1548
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 413 of file G4ParticleTable.cc.

414{
415 if( particle == nullptr) return nullptr;
416#ifdef G4MULTITHREADED
418 {
420 ed << "Request of removing " << particle->GetParticleName()
421 << " is ignored as it is invoked from a worker thread.";
422 G4Exception("G4ParticleTable::Remove()", "PART10117", JustWarning, ed);
423 return nullptr;
424 }
425#endif
426 if (readyToUse)
427 {
429 G4ApplicationState currentState = pStateManager->GetCurrentState();
430 if (currentState != G4State_PreInit)
431 {
432 G4String msg = "Request of removing ";
433 msg += particle->GetParticleName();
434 msg += " has No effects other than Pre_Init";
435 G4Exception("G4ParticleTable::Remove()", "PART117", JustWarning, msg);
436 return nullptr;
437 }
438 else
439 {
440#ifdef G4VERBOSE
441 if (verboseLevel>0)
442 {
443 G4cout << particle->GetParticleName()
444 << " will be removed from the ParticleTable " << G4endl;
445 }
446#endif
447 }
448 }
449
450 G4PTblDictionary::iterator it = fDictionaryShadow->find(GetKey(particle));
451 if (it != fDictionaryShadow->end())
452 {
453 fDictionaryShadow->erase(it);
454 // remove from EncodingDictionary
455 G4int code = particle->GetPDGEncoding();
456 if (code != 0 )
457 {
459 }
460 }
461 else
462 {
463 return nullptr;
464 }
465
466 // remove it from IonTable if "nucleus"
467 if (fIonTable->IsIon(particle) )
468 {
469 fIonTable->Remove(particle);
470 }
471
472#ifdef G4VERBOSE
473 if (verboseLevel>3)
474 {
475 G4cout << "The particle "<< particle->GetParticleName()
476 << " is removed from the ParticleTable " << G4endl;
477 }
478#endif
479
480 return particle;
481}
G4ApplicationState
@ G4State_PreInit
@ JustWarning
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
void Remove(const G4ParticleDefinition *particle)
Definition: G4IonTable.cc:1594
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

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

◆ RemoveAllParticles()

void G4ParticleTable::RemoveAllParticles ( )

Definition at line 295 of file G4ParticleTable.cc.

296{
297 if (readyToUse)
298 {
299 G4Exception("G4ParticleTable::RemoveAllParticle()",
300 "PART115", JustWarning,
301 "No effects because readyToUse is true.");
302 return;
303 }
304
305#ifdef G4VERBOSE
306 if (verboseLevel>1)
307 {
308 G4cout << "G4ParticleTable::RemoveAllParticles() " << G4endl;
309 }
310#endif
311
312 // remove all contents in Ion Table
313 if (fIonTable != nullptr)
314 {
315 fIonTable->clear();
316 }
317
318 // clear dictionary
319 if (fDictionary != nullptr)
320 {
321 fDictionary->clear();
322 }
323}
void clear()
Definition: G4IonTable.cc:1526

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

◆ SelectParticle()

void G4ParticleTable::SelectParticle ( const G4String name)

Definition at line 557 of file G4ParticleTable.cc.

558{
559 if(name != selectedName)
560 {
561 const G4ParticleDefinition* part = FindParticle(name);
562 if(part)
563 {
564#ifdef G4MULTITHREADED
565 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
566#endif
567 selectedParticle = part;
568 selectedName = name;
569#ifdef G4MULTITHREADED
570 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
571#endif
572 }
573 }
574}
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 733 of file G4ParticleTable.cc.

734{
735 return (G4int)fDictionary->size();
736}

◆ WorkerG4ParticleTable()

void G4ParticleTable::WorkerG4ParticleTable ( )

Definition at line 142 of file G4ParticleTable.cc.

143{
144 // The iterator for the shadow particle table is not sharable.
145 //
146#ifdef G4MULTITHREADED
147 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
148 G4ParticleTable::lockCount()++;
149#endif
150 if(fDictionary == nullptr)
151 {
153 }
154 else
155 {
156 fDictionary->clear();
157 }
158
159 if(fEncodingDictionary == nullptr)
160 {
162 }
163 else
164 {
165 fEncodingDictionary->clear();
166 }
167
168 fIteratorShadow->reset(false);
169 while( (*fIteratorShadow)() ) // Loop checking, 09.08.2015, K.Kurashige
170 {
172 fDictionary->insert( std::pair<G4String,
173 G4ParticleDefinition*>(GetKey(particle), particle) );
174 G4int code = particle->GetPDGEncoding();
175 if (code !=0 )
176 {
177 fEncodingDictionary->insert( std::pair<G4int,
178 G4ParticleDefinition*>(code ,particle) );
179 }
180 }
182
183#ifdef G4MULTITHREADED
184 G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex());
185#endif
186
188}
void WorkerG4IonTable()
Definition: G4IonTable.cc:180
static G4PTblDicIterator * fIteratorShadow

Referenced by G4WorkerRunManager::G4WorkerRunManager(), and GetParticleTable().

Member Data Documentation

◆ fDictionary

◆ fDictionaryShadow

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

Definition at line 182 of file G4ParticleTable.hh.

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

◆ fEncodingDictionary

◆ fEncodingDictionaryShadow

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

Definition at line 184 of file G4ParticleTable.hh.

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

◆ fgParticleTable

G4ParticleTable * G4ParticleTable::fgParticleTable = nullptr
static

Definition at line 171 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 183 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: