Warning, file /include/Geant4/G4ParticleTable.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #ifndef G4ParticleTable_hh
0045 #define G4ParticleTable_hh 1
0046
0047 #include "G4ParticleDefinition.hh"
0048 #include "G4ParticleTableIterator.hh"
0049 #include "G4Threading.hh"
0050 #include "G4ios.hh"
0051 #include "globals.hh"
0052
0053 #include <map>
0054
0055 class G4UImessenger;
0056 class G4ParticleMessenger;
0057 class G4IonTable;
0058
0059 class G4ParticleTable
0060 {
0061 public:
0062 using G4PTblDictionary = G4ParticleTableIterator<G4String, G4ParticleDefinition*>::Map;
0063 using G4PTblDicIterator = G4ParticleTableIterator<G4String, G4ParticleDefinition*>;
0064 using G4PTblEncodingDictionary = G4ParticleTableIterator<G4int, G4ParticleDefinition*>::Map;
0065 using G4PTblEncodingDicIterator = G4ParticleTableIterator<G4int, G4ParticleDefinition*>;
0066
0067 virtual ~G4ParticleTable();
0068
0069
0070 G4ParticleTable(const G4ParticleTable&) = delete;
0071 G4ParticleTable& operator=(const G4ParticleTable&) = delete;
0072
0073
0074
0075 void WorkerG4ParticleTable();
0076
0077
0078
0079 void DestroyWorkerG4ParticleTable();
0080
0081
0082
0083
0084
0085 static G4ParticleTable* GetParticleTable();
0086
0087
0088 inline G4bool contains(const G4ParticleDefinition* particle) const;
0089 G4bool contains(const G4String& particle_name) const;
0090
0091
0092 G4int entries() const;
0093 G4int size() const;
0094
0095
0096
0097 G4ParticleDefinition* GetParticle(G4int index) const;
0098
0099
0100 const G4String& GetParticleName(G4int index) const;
0101
0102
0103 G4ParticleDefinition* FindParticle(G4int PDGEncoding);
0104 G4ParticleDefinition* FindParticle(const G4String& particle_name);
0105 G4ParticleDefinition* FindParticle(const G4ParticleDefinition* particle);
0106
0107
0108 inline G4ParticleDefinition* FindAntiParticle(G4int PDGEncoding);
0109 inline G4ParticleDefinition* FindAntiParticle(const G4String& p_name);
0110 inline G4ParticleDefinition* FindAntiParticle(const G4ParticleDefinition* p);
0111
0112
0113 G4PTblDicIterator* GetIterator() const;
0114
0115
0116 void DumpTable(const G4String& particle_name = "ALL");
0117
0118
0119 G4IonTable* GetIonTable() const;
0120
0121
0122
0123
0124
0125
0126 G4ParticleDefinition* Insert(G4ParticleDefinition* particle);
0127
0128
0129 G4ParticleDefinition* Remove(G4ParticleDefinition* particle);
0130
0131
0132 void RemoveAllParticles();
0133
0134
0135 void DeleteAllParticles();
0136
0137
0138 G4UImessenger* CreateMessenger();
0139
0140 void SelectParticle(const G4String& name);
0141
0142 inline const G4ParticleDefinition* GetSelectedParticle() const;
0143
0144 inline void SetVerboseLevel(G4int value);
0145 inline G4int GetVerboseLevel() const;
0146
0147 inline void SetReadiness(G4bool val = true);
0148 inline G4bool GetReadiness() const;
0149
0150 inline G4ParticleDefinition* GetGenericIon() const;
0151 inline void SetGenericIon(G4ParticleDefinition*);
0152
0153 inline G4ParticleDefinition* GetGenericMuonicAtom() const;
0154 inline void SetGenericMuonicAtom(G4ParticleDefinition*);
0155
0156
0157
0158
0159
0160
0161
0162 G4ParticleMessenger* fParticleMessenger = nullptr;
0163 static G4ThreadLocal G4PTblDictionary* fDictionary;
0164 static G4ThreadLocal G4PTblDicIterator* fIterator;
0165 static G4ThreadLocal G4PTblEncodingDictionary* fEncodingDictionary;
0166
0167
0168 static G4ParticleTable* fgParticleTable;
0169
0170
0171
0172
0173 G4IonTable* fIonTable = nullptr;
0174
0175
0176
0177
0178 static G4PTblDictionary* fDictionaryShadow;
0179 static G4PTblDicIterator* fIteratorShadow;
0180 static G4PTblEncodingDictionary* fEncodingDictionaryShadow;
0181
0182 #ifdef G4MULTITHREADED
0183
0184 static G4GLOB_DLL G4Mutex& particleTableMutex();
0185 static G4GLOB_DLL G4int& lockCount();
0186 #endif
0187
0188 protected:
0189 const G4PTblDictionary* GetDictionary() const;
0190
0191
0192 inline const G4String& GetKey(const G4ParticleDefinition* particle) const;
0193
0194
0195 const G4PTblEncodingDictionary* GetEncodingDictionary() const;
0196
0197 private:
0198
0199 G4ParticleTable();
0200
0201 void CheckReadiness() const;
0202
0203
0204
0205 G4ParticleDefinition* genericIon = nullptr;
0206 G4ParticleDefinition* genericMuonicAtom = nullptr;
0207 const G4ParticleDefinition* selectedParticle = nullptr;
0208
0209 const G4String noName = " ";
0210 G4String selectedName = "undefined";
0211
0212
0213
0214
0215
0216 G4int verboseLevel = 1;
0217
0218 G4bool readyToUse = false;
0219 };
0220
0221 #include "G4ParticleTable.icc"
0222
0223 #endif