File indexing completed on 2025-01-18 09:58:58
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 #ifndef G4ProcessTable_hh
0036 #define G4ProcessTable_hh 1
0037
0038 #include <vector>
0039
0040 #include "globals.hh"
0041 #include "G4ProcTblElement.hh"
0042 #include "G4ProcessVector.hh"
0043 #include "G4ThreadLocalSingleton.hh"
0044
0045 class G4UImessenger;
0046 class G4ProcessTableMessenger;
0047
0048 class G4ProcessTable
0049 {
0050 friend class G4ThreadLocalSingleton<G4ProcessTable>;
0051
0052 public:
0053
0054 using G4ProcTableVector = std::vector<G4ProcTblElement*>;
0055 using G4ProcNameVector = std::vector<G4String>;
0056
0057 ~G4ProcessTable();
0058
0059
0060 G4ProcessTable(const G4ProcessTable&) = delete;
0061 G4ProcessTable& operator=(const G4ProcessTable&) = delete;
0062 G4bool operator==(const G4ProcessTable &right) const = delete;
0063 G4bool operator!=(const G4ProcessTable &right) const = delete;
0064
0065
0066 static G4ProcessTable* GetProcessTable();
0067
0068
0069
0070 inline G4int Length() const;
0071
0072
0073 G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
0074 G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr);
0075
0076
0077
0078 G4VProcess* FindProcess(const G4String& processName,
0079 const G4String& particleName) const;
0080 inline G4VProcess* FindProcess(const G4String& processName,
0081 const G4ParticleDefinition* particle) const;
0082 G4VProcess* FindProcess(const G4String& processName,
0083 const G4ProcessManager* processManager) const;
0084 G4VProcess* FindProcess(G4ProcessType processType,
0085 const G4ParticleDefinition* particle) const;
0086 G4VProcess* FindProcess(G4int processSubType,
0087 const G4ParticleDefinition* particle) const;
0088
0089
0090 void RegisterProcess(G4VProcess*);
0091 void DeRegisterProcess(G4VProcess*);
0092
0093
0094 inline G4ProcessVector* FindProcesses();
0095 inline G4ProcessVector* FindProcesses( const G4ProcessManager* pManager );
0096 inline G4ProcessVector* FindProcesses( const G4String& processName );
0097 inline G4ProcessVector* FindProcesses( G4ProcessType processType );
0098
0099
0100
0101 void SetProcessActivation( const G4String& processName,
0102 G4bool fActive );
0103 void SetProcessActivation( const G4String& processName,
0104 const G4String& particleName,
0105 G4bool fActive );
0106 inline void SetProcessActivation( const G4String& processName,
0107 const G4ParticleDefinition* particle,
0108 G4bool fActive );
0109 void SetProcessActivation( const G4String& processName,
0110 G4ProcessManager* processManager,
0111 G4bool fActive );
0112 void SetProcessActivation( G4ProcessType processType,
0113 G4bool fActive );
0114 void SetProcessActivation( G4ProcessType processType,
0115 const G4String& particleName,
0116 G4bool fActive );
0117 inline void SetProcessActivation( G4ProcessType processType,
0118 const G4ParticleDefinition* particle,
0119 G4bool fActive );
0120 void SetProcessActivation( G4ProcessType processType,
0121 G4ProcessManager* processManager,
0122 G4bool fActive );
0123
0124
0125 inline G4ProcNameVector* GetNameList();
0126
0127
0128 inline G4ProcTableVector* GetProcTableVector();
0129
0130
0131 void DumpInfo(G4VProcess* process,
0132 const G4ParticleDefinition* particle = nullptr);
0133
0134
0135
0136 inline void SetVerboseLevel(G4int value);
0137 inline G4int GetVerboseLevel() const;
0138
0139
0140
0141
0142
0143 private:
0144
0145 G4ProcessTable();
0146
0147
0148 G4ProcTableVector* Find(const G4String& processName );
0149 G4ProcTableVector* Find(G4ProcessType processType );
0150
0151
0152
0153 G4ProcessVector* ExtractProcesses(G4ProcTableVector*) const;
0154
0155
0156 private:
0157
0158 static G4ThreadLocal G4ProcessTable* fProcessTable;
0159 G4ProcessTableMessenger* fProcTblMessenger = nullptr;
0160
0161 G4ProcTableVector* fProcTblVector = nullptr;
0162 G4ProcNameVector* fProcNameVector = nullptr;
0163
0164 G4ProcTableVector* tmpTblVector = nullptr;
0165
0166
0167 std::vector<G4VProcess*> fListProcesses;
0168
0169
0170 G4int verboseLevel = 1;
0171
0172 };
0173
0174 #include "G4ProcessTable.icc"
0175
0176 #endif