Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4ProcessTable << 23 >> 24 // >> 25 // $Id: G4ProcessTable.hh,v 1.8 2003/06/16 17:12:29 gunter Exp $ >> 26 // GEANT4 tag $Name: geant4-06-00 $ >> 27 // >> 28 // >> 29 // ------------------------------------------------------------ >> 30 // GEANT 4 class header file 27 // 31 // 28 // Class description: << 32 // History: first implementation, based on object model of >> 33 // 4th Aug 1998, H.Kurashige 29 // 34 // 30 // This class is used for "book keeping" of al << 35 // Class Description 31 // which are registered for all particles << 36 // This class is used for "book keeping" of all processes >> 37 // which are registered in all particles >> 38 // >> 39 // History: >> 40 // Added G4ProcessTableMesseneger 16 Aug. 1998, H.Kurashige >> 41 // Use STL vector instead of RW vector 1. Mar 00 H.Kurashige >> 42 // >> 43 // ------------------------------------------------------------ 32 44 33 // Author: H.Kurashige, 4 August 1998 << 45 #ifndef G4ProcessTable_h 34 // ------------------------------------------- << 46 #define G4ProcessTable_h 1 35 #ifndef G4ProcessTable_hh << 36 #define G4ProcessTable_hh 1 << 37 47 >> 48 #include "globals.hh" >> 49 #include "G4ios.hh" 38 #include <vector> 50 #include <vector> 39 51 40 #include "globals.hh" << 41 #include "G4ProcTblElement.hh" 52 #include "G4ProcTblElement.hh" 42 #include "G4ProcessVector.hh" 53 #include "G4ProcessVector.hh" 43 #include "G4ThreadLocalSingleton.hh" << 44 << 45 class G4UImessenger; << 46 class G4ProcessTableMessenger; 54 class G4ProcessTableMessenger; 47 55 48 class G4ProcessTable 56 class G4ProcessTable 49 { 57 { 50 friend class G4ThreadLocalSingleton<G4Proces << 58 public: 51 << 59 G4ProcessTable(); 52 public: << 60 // Constructors 53 << 61 54 using G4ProcTableVector = std::vector<G4Pr << 62 ~G4ProcessTable(); 55 using G4ProcNameVector = std::vector<G4Str << 63 // Destructor 56 << 64 57 ~G4ProcessTable(); << 65 private: 58 // Destructor << 66 G4ProcessTable(const G4ProcessTable &right); >> 67 G4ProcessTable & operator=(const G4ProcessTable &right); >> 68 // Assignment operator >> 69 G4int operator==(const G4ProcessTable &right) const; >> 70 G4int operator!=(const G4ProcessTable &right) const; >> 71 // equal / unequal operator 59 72 60 G4ProcessTable(const G4ProcessTable&) = de << 61 G4ProcessTable& operator=(const G4ProcessT << 62 G4bool operator==(const G4ProcessTable &ri << 63 G4bool operator!=(const G4ProcessTable &ri << 64 // Copy constructor and operators not al << 65 << 66 static G4ProcessTable* GetProcessTable(); << 67 // Return the pointer to the G4ProcessTa << 68 // As "singleton" one can get the instan << 69 << 70 inline G4int Length() const; << 71 // Return the number of processes in the << 72 << 73 G4int Insert(G4VProcess* aProcess, G4Proce << 74 G4int Remove(G4VProcess* aProcess, G4Proce << 75 // Each process object is registered wit << 76 // managers that use it << 77 << 78 G4VProcess* FindProcess(const G4String& pr << 79 const G4String& pa << 80 inline G4VProcess* FindProcess(const G4Str << 81 const G4Par << 82 G4VProcess* FindProcess(const G4String& pr << 83 const G4ProcessMan << 84 G4VProcess* FindProcess(G4ProcessType proc << 85 const G4ParticleDe << 86 G4VProcess* FindProcess(G4int processSubTy << 87 const G4ParticleDe << 88 // Return the process pointer << 89 << 90 void RegisterProcess(G4VProcess*); << 91 void DeRegisterProcess(G4VProcess*); << 92 // Implementation of registration mechan << 93 << 94 inline G4ProcessVector* FindProcesses(); << 95 inline G4ProcessVector* FindProcesses( con << 96 inline G4ProcessVector* FindProcesses( con << 97 inline G4ProcessVector* FindProcesses( G4P << 98 // Return pointer of a process vector wh << 99 // Note: user is responsible to delete t << 100 << 101 void SetProcessActivation( const G4String& << 102 G4bool << 103 void SetProcessActivation( const G4String& << 104 const G4String& << 105 G4bool << 106 inline void SetProcessActivation( const G4 << 107 const G4 << 108 G4bool << 109 void SetProcessActivation( const G4String& << 110 G4ProcessManage << 111 G4bool << 112 void SetProcessActivation( G4ProcessType << 113 G4bool << 114 void SetProcessActivation( G4ProcessType << 115 const G4String& << 116 G4bool << 117 inline void SetProcessActivation( G4Proces << 118 const G4 << 119 G4bool << 120 void SetProcessActivation( G4ProcessType << 121 G4ProcessManage << 122 G4bool << 123 // These methods are provided to activat << 124 << 125 inline G4ProcNameVector* GetNameList(); << 126 // Return pointer of the list of process << 127 << 128 inline G4ProcTableVector* GetProcTableVect << 129 // Return pointer of the vector of G4Pro << 130 << 131 void DumpInfo(G4VProcess* process, << 132 const G4ParticleDefinition* << 133 // Dump out information of the process t << 134 // is used to specify processes designat << 135 << 136 inline void SetVerboseLevel(G4int value); << 137 inline G4int GetVerboseLevel() const; << 138 // Set/Get control flag for output messa << 139 // 0: Silent << 140 // 1: Warning message << 141 // 2: More << 142 << 143 private: << 144 << 145 G4ProcessTable(); << 146 // Private default constructor << 147 << 148 G4ProcTableVector* Find(const G4String& pr << 149 G4ProcTableVector* Find(G4ProcessType pr << 150 // Return pointer of a ProcTableVector w << 151 // ProcTbleElement specified << 152 << 153 G4ProcessVector* ExtractProcesses(G4ProcTa << 154 // Extract all process objects from the << 155 73 156 private: << 74 public: // with description >> 75 static G4ProcessTable* GetProcessTable(); >> 76 // return the pointer to G4ProcessTable object >> 77 // G4ProcessTable is a "singleton" and can get its pointer by this function >> 78 >> 79 G4int Length() const; >> 80 // return the number of processes in the table >> 81 >> 82 G4int Insert(G4VProcess* aProcess, G4ProcessManager* aProcMgr); >> 83 G4int Remove(G4VProcess* aProcess, G4ProcessManager* aProcMgr); >> 84 // insert and remove methods >> 85 // each process object is registered with information of process managers >> 86 // that use it. >> 87 >> 88 G4VProcess* FindProcess(const G4String& processName, >> 89 const G4String& particleName) const; >> 90 G4VProcess* FindProcess(const G4String& processName, >> 91 const G4ParticleDefinition* particle) const; >> 92 G4VProcess* FindProcess(const G4String& processName, >> 93 const G4ProcessManager* processManager) const; >> 94 // return the process pointer >> 95 >> 96 G4ProcessVector* FindProcesses(); >> 97 G4ProcessVector* FindProcesses( const G4ProcessManager* processManager ); >> 98 G4ProcessVector* FindProcesses( const G4String& processName ); >> 99 G4ProcessVector* FindProcesses( G4ProcessType processType ); >> 100 // return pointer of a process vector >> 101 // which includes processes specified >> 102 // Note:: User is responsible to delete this process vector object >> 103 >> 104 void SetProcessActivation( const G4String& processName, >> 105 G4bool fActive); >> 106 void SetProcessActivation( const G4String& processName, >> 107 const G4String& particleName, >> 108 G4bool fActive ); >> 109 void SetProcessActivation( const G4String& processName, >> 110 G4ParticleDefinition* particle, >> 111 G4bool fActive ); >> 112 void SetProcessActivation( const G4String& processName, >> 113 G4ProcessManager* processManager, >> 114 G4bool fActive ); >> 115 void SetProcessActivation( G4ProcessType processType, >> 116 G4bool fActive ); >> 117 void SetProcessActivation( G4ProcessType processType, >> 118 const G4String& particleName, >> 119 G4bool fActive ); >> 120 void SetProcessActivation( G4ProcessType processType, >> 121 G4ParticleDefinition* particle, >> 122 G4bool fActive ); >> 123 void SetProcessActivation( G4ProcessType processType, >> 124 G4ProcessManager* processManager, >> 125 G4bool fActive ); >> 126 // These methods are provided to activate or inactivate processes >> 127 >> 128 public: >> 129 typedef std::vector<G4ProcTblElement*> G4ProcTableVector; >> 130 typedef std::vector<G4String> G4ProcNameVector; >> 131 >> 132 public: // with description >> 133 G4ProcNameVector* GetNameList(); >> 134 // return pointer of the list of process name 157 135 158 static G4ThreadLocal G4ProcessTable* fProc << 136 G4ProcTableVector* GetProcTableVector(); 159 G4ProcessTableMessenger* fProcTblMessenger << 137 // return pointer of the vector of G4ProcTblElement >> 138 >> 139 private: >> 140 G4ProcTableVector* Find( G4ProcTableVector* procTableVector, >> 141 const G4String& processName ); >> 142 G4ProcTableVector* Find( G4ProcTableVector* procTableVector, >> 143 G4ProcessType processType ); >> 144 // return pointer of a ProcTableVector >> 145 // which includes ProcTbleElement specified 160 146 161 G4ProcTableVector* fProcTblVector = nullpt << 147 G4ProcessVector* ExtractProcesses( G4ProcTableVector* procTableVector); 162 G4ProcNameVector* fProcNameVector = nullpt << 148 // extract all process objects from the process table >> 149 >> 150 public: // with description >> 151 void DumpInfo(G4VProcess* process, G4ParticleDefinition* particle=0); >> 152 // dump out information of the process table >> 153 // second argument is used to specify processes designated by a particle >> 154 >> 155 public: // with description >> 156 G4UImessenger* CreateMessenger(); >> 157 void DeleteMessenger(); >> 158 // These methods are used by RunManager to let the process table >> 159 // know the timing of creation/destructuion of messengers 163 160 164 G4ProcTableVector* tmpTblVector = nullptr; << 161 public: // with description 165 // Used only internally as temporary buf << 162 void SetVerboseLevel(G4int value); >> 163 G4int GetVerboseLevel() const; >> 164 // Set/Get controle flag for output message >> 165 // 0: Silent >> 166 // 1: Warning message >> 167 // 2: More >> 168 >> 169 >> 170 private: >> 171 static G4ProcessTable* fProcessTable; >> 172 G4ProcessTableMessenger* fProcTblMessenger; >> 173 >> 174 private: >> 175 G4ProcTableVector* fProcTblVector; >> 176 G4ProcNameVector* fProcNameVector; >> 177 // list of G4ProcTblElement >> 178 >> 179 G4ProcTableVector* tmpTblVector; >> 180 // used only internaly for temporary buffer. 166 181 167 std::vector<G4VProcess*> fListProcesses; << 182 private: 168 // Used for registration of process inst << 183 G4int verboseLevel; >> 184 // controle flag for output message 169 185 170 G4int verboseLevel = 1; << 171 // Control flag for output message << 172 }; 186 }; 173 187 174 #include "G4ProcessTable.icc" 188 #include "G4ProcessTable.icc" 175 << 176 #endif 189 #endif 177 190