Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4VUserPhysicsList << 27 // 26 // 28 // Class description: << 29 // 27 // 30 // This class is an abstract class for constru << 28 // 31 // User must implement the following two pure << 29 // ------------------------------------------------------------ 32 // class derived from this class: << 30 // GEANT 4 class header file 33 // - G4VUserPhysicsList::ConstructParticle() << 31 // Class Description: 34 // Construct particles << 32 // This class is an abstract class for 35 // - G4VUserPhysicsList::ConstructProcess() << 33 // constructing particles and processes. 36 // Construct procesess and register them t << 34 // User must implement following three virtual methods 37 << 35 // in his/her own concrete class derived from this class. 38 // Original author: H.Kurashige (Kobe Universi << 36 // G4VUserPhysicsList::ConstructParticle() 39 // ------------------------------------------- << 37 // Construct particles 40 #ifndef G4VUserPhysicsList_hh << 38 // G4VUserPhysicsList::ConstructProcess() 41 #define G4VUserPhysicsList_hh 1 << 39 // Construct procesess and register them to particles >> 40 // >> 41 // ------------------------------------------- >> 42 // History >> 43 // first version 09 Jan. 1998 by H.Kurashige >> 44 // modified 24 Jan. 1998 by H.Kurashige >> 45 // rename DumpCutValues/DumpCutValuesTable >> 46 // change SetCuts method >> 47 // add SetCutsWithDefault method >> 48 // modified 06 June 1998 by H.Kurashige >> 49 // add AddProcessManager >> 50 // add BuildPhysicsTable >> 51 // modified 29 June 1998 by H.Kurashige >> 52 // add AddProcessManager >> 53 // modified 05 Dec. 1998 by H.Kurashige >> 54 // add ConstructAllParticles() >> 55 // modified 14, Apr 1999 by H.Kurashige >> 56 // change BuildPhysicsTable as public >> 57 // removed ConstructAllParticles() and related methods >> 58 // changed SetCuts method argument >> 59 // modified 08, Nov 2000 by H.Kurashige >> 60 // added Retrieve/StorePhysicsTable and related methods >> 61 // modified 08, Mar 2001 by H.Kurashige >> 62 // added binary mode for Retrieve/StorePhysicsTable >> 63 // added RetrieveCutValues and related >> 64 // added Set/ResetStoredInAscii() to switch on ascii mode >> 65 // for Retrieve/StorePhysicsTable >> 66 // modified for CUTS per REGION 10, Oct 2002 by H.Kurashige >> 67 // removed following methods >> 68 // void ReCalcCutValue() >> 69 // void SetCutValueForOthers() >> 70 // void SetCutValueForOtherThan() >> 71 // void ReCalcCutValueForOthers() >> 72 // virtual G4bool StoreMaterialInfo() >> 73 // virtual G4bool StoreCutValues() >> 74 // virtual G4bool RetrieveCutValues() >> 75 // virtual G4bool CheckForRetrievePhysicsTable() >> 76 // virtual G4bool CheckMaterialInfo() >> 77 // added void BuildPhysicsTable() >> 78 // Added PhysicsListHelper 29 Apr. 2011 H.Kurashige >> 79 // Added default impelmentation of SetCuts 10 June 2011 H.Kurashige >> 80 // SetCuts is not 'pure virtual' any more >> 81 // Trasnformations for multi-threading 26 Mar. 2013 A. Dotti >> 82 // Added destructions 21 Apr 2017 A. Dotti >> 83 // ------------------------------------------------------------ >> 84 #ifndef G4VUserPhysicsList_h >> 85 #define G4VUserPhysicsList_h 1 >> 86 >> 87 #include "G4ios.hh" >> 88 #include "globals.hh" >> 89 #include "rundefs.hh" >> 90 #include "tls.hh" 42 91 43 #include "G4ParticleDefinition.hh" 92 #include "G4ParticleDefinition.hh" 44 #include "G4ParticleTable.hh" 93 #include "G4ParticleTable.hh" 45 #include "G4PhysicsModelCatalog.hh" << 46 #include "G4ProductionCutsTable.hh" 94 #include "G4ProductionCutsTable.hh" 47 #include "G4Threading.hh" << 48 #include "G4VUPLSplitter.hh" 95 #include "G4VUPLSplitter.hh" 49 #include "G4ios.hh" << 50 #include "globals.hh" << 51 96 52 #include "rundefs.hh" << 97 #include "G4Threading.hh" 53 #include "tls.hh" << 54 98 55 class G4UserPhysicsListMessenger; 99 class G4UserPhysicsListMessenger; 56 class G4PhysicsListHelper; 100 class G4PhysicsListHelper; 57 class G4VProcess; 101 class G4VProcess; 58 102 59 // Encapsulate the fields of class G4VUserPhys << 60 class G4VUPLData 103 class G4VUPLData 61 { 104 { 62 public: << 105 // Encapsulate the fields of class G4VUserPhysicsList 63 void initialize(); << 106 // that are per-thread. 64 << 107 public: 65 G4ParticleTable::G4PTblDicIterator* _thePa << 108 void initialize(); 66 G4UserPhysicsListMessenger* _theMessenger << 109 G4ParticleTable::G4PTblDicIterator* _theParticleIterator; 67 G4PhysicsListHelper* _thePLHelper = nullpt << 110 G4UserPhysicsListMessenger* _theMessenger; 68 G4bool _fIsPhysicsTableBuilt = false; << 111 G4PhysicsListHelper* _thePLHelper; 69 G4int _fDisplayThreshold = 0; << 112 G4bool _fIsPhysicsTableBuilt; >> 113 G4int _fDisplayThreshold; 70 }; 114 }; 71 << 72 // The type G4VUPLManager is introduced to enc 115 // The type G4VUPLManager is introduced to encapsulate the methods used by 73 // both the master thread and worker threads t 116 // both the master thread and worker threads to allocate memory space for 74 // the fields encapsulated by the class G4VUPL 117 // the fields encapsulated by the class G4VUPLData. When each thread 75 // changes the value for these fields, it refe 118 // changes the value for these fields, it refers to them using a macro 76 // definition defined below. For every G4VUser 119 // definition defined below. For every G4VUserPhysicsList instance, 77 // there is a corresponding G4VUPLData instanc 120 // there is a corresponding G4VUPLData instance. All G4VUPLData instances 78 // are organized by the class G4VUPLManager as 121 // are organized by the class G4VUPLManager as an array. 79 // The field "int g4vuplInstanceID" is added t 122 // The field "int g4vuplInstanceID" is added to the class G4VUserPhysicsList. 80 // The value of this field in each G4VUserPhys 123 // The value of this field in each G4VUserPhysicsList instance is the 81 // subscript of the corresponding G44VUPLData 124 // subscript of the corresponding G44VUPLData instance. 82 // In order to use the class G44VUPLManager, w 125 // In order to use the class G44VUPLManager, we add a static member in the class 83 // G4VUserPhysicsList as follows: "static G4VU 126 // G4VUserPhysicsList as follows: "static G4VUPLManager subInstanceManager". 84 // Both the master thread and worker threads c 127 // Both the master thread and worker threads change the length of the array 85 // for G44VUPLData instances mutually along wi 128 // for G44VUPLData instances mutually along with G4VUserPhysicsList 86 // instances are created. For each worker thre 129 // instances are created. For each worker thread, it dynamically creates ions. 87 // Consider any thread A, if there is any othe 130 // Consider any thread A, if there is any other thread which creates an ion. 88 // This ion is shared by the thread A. So the 131 // This ion is shared by the thread A. So the thread A leaves an empty space 89 // in the array of G4PDefData instances for th 132 // in the array of G4PDefData instances for the ion. 90 // 133 // 91 // Important Note: you may wonder why we are i 134 // Important Note: you may wonder why we are introducing this mechanism 92 // since there is only one PL 135 // since there is only one PL for each application. 93 // This is true, in the sense 136 // This is true, in the sense that only one PL is allowed 94 // to be associated to a G4Run 137 // to be associated to a G4RunManager, however user can 95 // instantiate as many PLs are 138 // instantiate as many PLs are needed and at run-time select one 96 // of the PLs to be used we th 139 // of the PLs to be used we thus need this mechanism to 97 // guarantee that the system w 140 // guarantee that the system works without problems in case of 98 // this (unusual) case. This m 141 // this (unusual) case. This may be reviewed in the future >> 142 typedef G4VUPLSplitter<G4VUPLData> G4VUPLManager; >> 143 typedef G4VUPLManager G4VUserPhysicsListSubInstanceManager; >> 144 >> 145 // This macros change the references to fields that are now encapsulated >> 146 // in the class G4VUPLData. 99 // 147 // 100 using G4VUPLManager = G4VUPLSplitter<G4VUPLDat << 148 // Note1: the use of this-> this is needed to avoid compilation errors 101 using G4VUserPhysicsListSubInstanceManager = G << 149 // when using templated class with T=G4VUserPhysicsList. Don't know why. >> 150 // Note2: the name of the first #define is different, because otherwise >> 151 // we need to change its use in all classes that inherits from >> 152 // this base class (all examples). However one should note comment >> 153 // on JIRA task: http://jira-geant4.kek.jp/browse/DEV-27 >> 154 //#define theParticleIterator >> 155 //((this->subInstanceManager.offset[this->g4vuplInstanceID])._theParticleIterator) 102 156 103 class G4VUserPhysicsList 157 class G4VUserPhysicsList 104 { 158 { 105 public: << 159 public: 106 G4VUserPhysicsList(); << 160 G4VUserPhysicsList(); 107 virtual ~G4VUserPhysicsList(); << 161 virtual ~G4VUserPhysicsList(); 108 G4VUserPhysicsList(const G4VUserPhysicsLis << 162 109 G4VUserPhysicsList& operator=(const G4VUse << 163 // copy constructor and assignment operator 110 << 164 G4VUserPhysicsList(const G4VUserPhysicsList&); 111 // Each particle type will be instantiated << 165 G4VUserPhysicsList& operator=(const G4VUserPhysicsList&); 112 // This method is invoked by the RunManger << 166 113 virtual void ConstructParticle() = 0; << 167 public: // with description 114 << 168 // Each particle type will be instantiated 115 // By calling the "Construct" method, << 169 // This method is invoked by the RunManger 116 // process manager and processes are creat << 170 virtual void ConstructParticle() = 0; 117 void Construct(); << 171 118 << 172 // By calling the "Construct" method, 119 // Each physics process will be instantiat << 173 // process manager and processes are created. 120 // registered to the process manager of ea << 174 void Construct(); 121 // Invoked in the Construct() method. << 175 122 virtual void ConstructProcess() = 0; << 176 // Each physics process will be instantiated and 123 << 177 // registered to the process manager of each particle type 124 // Sets a cut value for all particle types << 178 // This method is invoked in Construct method 125 virtual void SetCuts(); << 179 virtual void ConstructProcess() = 0; 126 << 180 127 // Set/get the default cut value. Calling << 181 protected: // with description 128 // re-calcuration of cut values and physic << 182 // User must invoke this method in his ConstructProcess() 129 // next event loop. << 183 // implementation in order to insures particle transportation. 130 void SetDefaultCutValue(G4double newCutVal << 184 void AddTransportation(); 131 G4double GetDefaultCutValue() const; << 185 132 << 186 // Register a process to the particle type 133 // Invoke BuildPhysicsTable for all proces << 187 // according to the ordering parameter table 134 // In case of "Retrieve" flag is ON, Physi << 188 // 'true' is returned if the process is registerd successfully 135 // retrieved from files. << 189 G4bool RegisterProcess(G4VProcess* process, G4ParticleDefinition* particle); 136 void BuildPhysicsTable(); << 190 137 << 191 public: 138 // Prepare the PhysicsTable for specified << 192 void UseCoupledTransportation(G4bool vl = true); 139 void PreparePhysicsTable(G4ParticleDefinit << 193 140 << 194 ///////////////////////////////////////////////////////////////// 141 // Build the PhysicsTable for specified pa << 195 public: // with description 142 void BuildPhysicsTable(G4ParticleDefinitio << 196 // "SetCuts" method sets a cut value for all particle types 143 << 197 // in the particle table 144 // Store PhysicsTable together with both m << 198 virtual void SetCuts(); 145 // information in files under the specifie << 199 146 // Returns "true" if files are successfull << 200 public: // with description 147 G4bool StorePhysicsTable(const G4String& d << 201 // set/get the default cut value 148 << 202 // Calling SetDefaultCutValue causes re-calcuration of cut values 149 // Return true if "Retrieve" flag is ON. << 203 // and physics tables just before the next event loop 150 // (i.e. PhysicsTable will be retrieved fr << 204 void SetDefaultCutValue(G4double newCutValue); 151 G4bool IsPhysicsTableRetrieved() const; << 205 G4double GetDefaultCutValue() const; 152 G4bool IsStoredInAscii() const; << 206 153 << 207 ///////////////////////////////////////////////////////////////////// 154 // Get directory path for physics table fi << 208 public: // with description 155 const G4String& GetPhysicsTableDirectory() << 209 // Invoke BuildPhysicsTable for all processes for all particles 156 << 210 // In case of "Retrieve" flag is ON, PhysicsTable will be 157 // Set "Retrieve" flag. Directory path can << 211 // retrieved from files 158 // Null string (default) means directory i << 212 void BuildPhysicsTable(); 159 // from the current value. << 213 160 void SetPhysicsTableRetrieved(const G4Stri << 214 // do PreparePhysicsTable for specified particle type 161 void SetStoredInAscii(); << 215 void PreparePhysicsTable(G4ParticleDefinition*); 162 << 216 163 // Reset "Retrieve" flag. << 217 // do BuildPhysicsTable for specified particle type 164 void ResetPhysicsTableRetrieved(); << 218 void BuildPhysicsTable(G4ParticleDefinition*); 165 void ResetStoredInAscii(); << 219 166 << 220 // Store PhysicsTable together with both material and cut value 167 // Print out the List of registered partic << 221 // information in files under the specified directory. 168 void DumpList() const; << 222 // (return true if files are successfully created) 169 << 223 G4bool StorePhysicsTable(const G4String& directory = "."); 170 // Request to print out information of cut << 224 171 // Printing will be performed when all tab << 225 // Return true if "Retrieve" flag is ON. 172 void DumpCutValuesTable(G4int flag = 1); << 226 // (i.e. PhysicsTable will be retrieved from files) 173 << 227 G4bool IsPhysicsTableRetrieved() const; 174 // Triggers the print-out requested by the << 228 G4bool IsStoredInAscii() const; 175 // This method must be invoked by RunManag << 229 176 void DumpCutValuesTableIfRequested(); << 230 // Get directory path for physics table files. 177 << 231 const G4String& GetPhysicsTableDirectory() const; 178 // Set/get control flag for output message << 232 179 // 0: Silent << 233 // Set "Retrieve" flag 180 // 1: Warning message << 234 // Directory path can be set together. 181 // 2: More << 235 // Null string (default) means directory is not changed 182 void SetVerboseLevel(G4int value); << 236 // from the current value 183 G4int GetVerboseLevel() const; << 237 void SetPhysicsTableRetrieved(const G4String& directory = ""); 184 << 238 void SetStoredInAscii(); 185 void UseCoupledTransportation(G4bool vl = << 239 186 << 240 // Reset "Retrieve" flag 187 // Invokes default SetCuts() method. << 241 void ResetPhysicsTableRetrieved(); 188 // Note: cut values will not be overwritte << 242 void ResetStoredInAscii(); 189 // Use of default SetCuts() method is reco << 243 190 void SetCutsWithDefault(); << 244 /////////////////////////////////////////////////////////////////////// 191 << 245 public: // with description 192 // Sets a cut value for a particle type fo << 246 // Print out the List of registered particles types 193 void SetCutValue(G4double aCut, const G4St << 247 void DumpList() const; 194 << 248 195 // Gets a cut value for a particle type fo << 249 public: // with description 196 G4double GetCutValue(const G4String& pname << 250 // Request to print out information of cut values 197 << 251 // Printing will be performed when all tables are made 198 // Sets a cut value for a particle type fo << 252 void DumpCutValuesTable(G4int flag = 1); 199 void SetCutValue(G4double aCut, const G4St << 253 200 << 254 // The following method actually trigger the print-out requested 201 // Invoke SetCuts for specified particle f << 255 // by the above method. This method must be invoked by RunManager 202 // If the pointer to the region is NULL, t << 256 // at the proper moment. 203 // In case of "Retrieve" flag is ON, cut v << 257 void DumpCutValuesTableIfRequested(); 204 // from files. << 258 205 void SetParticleCuts(G4double cut, G4Parti << 259 public: // with description 206 void SetParticleCuts(G4double cut, const G << 260 void SetVerboseLevel(G4int value); 207 << 261 G4int GetVerboseLevel() const; 208 // Invoke SetCuts() for all particles in a << 262 // set/get controle flag for output message 209 void SetCutsForRegion(G4double aCut, const << 263 // 0: Silent 210 << 264 // 1: Warning message 211 // Gets/sets the flag for ApplyCuts(). << 265 // 2: More 212 void SetApplyCuts(G4bool value, const G4St << 266 213 G4bool GetApplyCuts(const G4String& name) << 267 /////////////////////////////////////////////////////////////////////////// 214 << 268 public: // with description 215 // Remove and delete ProcessManagers for a << 269 // "SetCutsWithDefault" method invokes default SetCuts method 216 // Particle Table. << 270 // Note: Cut values will not be overwriten with this method 217 void RemoveProcessManager(); << 271 // Using default SetCuts method is recommended 218 << 272 // (i.e You do not need to implement SetCuts method) 219 // Remove and delete TrackingManagers for << 273 void SetCutsWithDefault(); 220 // Particle Table. << 274 221 void RemoveTrackingManager(); << 275 // Following are utility methods for SetCuts 222 << 276 223 // Add process manager for particles creat << 277 // SetCutValue sets a cut value for a particle type for the default region 224 void AddProcessManager(G4ParticleDefinitio << 278 void SetCutValue(G4double aCut, const G4String& pname); 225 G4ProcessManager* n << 279 226 << 280 // GetCutValue sets a cut value for a particle type for the default region 227 // Check consistencies of list of particle << 281 G4double GetCutValue(const G4String& pname) const; 228 void CheckParticleList(); << 282 229 << 283 // SetCutValue sets a cut value for a particle type for a region 230 void DisableCheckParticleList(); << 284 void SetCutValue(G4double aCut, const G4String& pname, const G4String& rname); 231 << 285 232 inline G4int GetInstanceID() const; << 286 // Invoke SetCuts for specified particle for a region 233 static const G4VUPLManager& GetSubInstance << 287 // If the pointer to the region is NULL, the default region is used 234 << 288 // In case of "Retrieve" flag is ON, 235 // Used by Worker threads on the shared in << 289 // Cut values will be retrieved from files 236 // to initialise workers. Derived class re << 290 void SetParticleCuts(G4double cut, G4ParticleDefinition* particle, 237 // must also call this base class method. << 291 G4Region* region = 0); 238 virtual void InitializeWorker(); << 292 void SetParticleCuts(G4double cut, const G4String& particleName, 239 << 293 G4Region* region = 0); 240 // Destroy thread-local data. Note that de << 294 241 // implementing this method should still c << 295 // Invoke SetCuts for all particles in a region 242 virtual void TerminateWorker(); << 296 void SetCutsForRegion(G4double aCut, const G4String& rname); 243 << 297 244 protected: << 298 // Following are utility methods are obsolete 245 // User must invoke this method in his Con << 299 void ResetCuts(); 246 // implementation in order to enable parti << 300 247 void AddTransportation(); << 301 /////////////////////////////////////////////////////////////////// 248 << 302 public: 249 // Register a process to the particle type << 303 // Get/SetApplyCuts gets/sets the flag for ApplyCuts 250 // according to the ordering parameter tab << 304 void SetApplyCuts(G4bool value, const G4String& name); 251 // 'true' is returned if the process is re << 305 G4bool GetApplyCuts(const G4String& name) const; 252 G4bool RegisterProcess(G4VProcess* process << 306 253 << 307 /////////////////////////////////////////////////////////////////////////////// 254 // Build PhysicsTable for making the integ << 308 protected: 255 void BuildIntegralPhysicsTable(G4VProcess* << 309 // do BuildPhysicsTable for make the integral schema 256 << 310 void BuildIntegralPhysicsTable(G4VProcess*, G4ParticleDefinition*); 257 // Retrieve PhysicsTable from files for pr << 311 258 // Normal BuildPhysics procedure of proces << 312 protected: 259 // fails (in case of process's RetrievePhy << 313 // Retrieve PhysicsTable from files for proccess belongng the particle. 260 virtual void RetrievePhysicsTable(G4Partic << 314 // Normal BuildPhysics procedure of processes will be invoked, 261 G4bool a << 315 // if it fails (in case of Process's RetrievePhysicsTable returns false) 262 << 316 virtual void RetrievePhysicsTable(G4ParticleDefinition*, 263 // Adds new ProcessManager to all particle << 317 const G4String& directory, 264 // This function is used in Construct(). << 318 G4bool ascii = false); 265 void InitializeProcessManager(); << 319 266 << 320 ///////////////////////////////////////////////////////////////// 267 G4ParticleTable::G4PTblDicIterator* GetPar << 321 protected: 268 << 322 // adds new ProcessManager to all particles in the Particle Table 269 protected: << 323 // this routine is used in Construct() 270 // The particle table has the complete Lis << 324 void InitializeProcessManager(); 271 G4ParticleTable* theParticleTable = nullpt << 325 272 << 326 public: // with description 273 G4int verboseLevel = 1; << 327 // remove and delete ProcessManagers for all particles in tha Particle Table 274 << 328 // this routine is invoked from RunManager 275 // Default cut value for all particles << 329 void RemoveProcessManager(); 276 G4double defaultCutValue = 1.0; << 330 277 G4bool isSetDefaultCutValue = false; << 331 public: // with description 278 << 332 // add process manager for particles created on-the-fly 279 // Pointer to ProductionCutsTable. << 333 void AddProcessManager(G4ParticleDefinition* newParticle, 280 G4ProductionCutsTable* fCutsTable = nullpt << 334 G4ProcessManager* newManager = 0); 281 << 335 282 // Flag to determine if physics table will << 336 ///////////////////////////////////////////////////////////////// 283 G4bool fRetrievePhysicsTable = false; << 337 public: 284 G4bool fStoredInAscii = true; << 338 // check consistencies of list of particles 285 << 339 286 G4bool fIsCheckedForRetrievePhysicsTable = << 340 void CheckParticleList(); 287 G4bool fIsRestoredCutValues = false; << 341 288 << 342 void DisableCheckParticleList(); 289 // Directory name for physics table files. << 343 290 G4String directoryPhysicsTable = "."; << 344 //////////////////////////////////////////////////////////////////////// 291 << 345 protected: 292 // Flag for CheckParticleList(). << 346 // the particle table has the complete List of existing particle types 293 G4bool fDisableCheckParticleList = false; << 347 G4ParticleTable* theParticleTable; 294 << 348 // G4ParticleTable::G4PTblDicIterator* theParticleIterator; //AND 295 // MT data << 349 296 G4int g4vuplInstanceID = 0; << 350 protected: 297 G4RUN_DLL static G4VUPLManager subInstance << 351 // pointer to G4UserPhysicsListMessenger >> 352 // G4UserPhysicsListMessenger* theMessenger; >> 353 >> 354 protected: >> 355 G4int verboseLevel; >> 356 >> 357 protected: >> 358 // this is the default cut value for all particles >> 359 G4double defaultCutValue; >> 360 G4bool isSetDefaultCutValue; >> 361 >> 362 protected: >> 363 // pointer to ProductionCutsTable >> 364 G4ProductionCutsTable* fCutsTable; >> 365 >> 366 // flag to determine physics table will be build from file or not >> 367 G4bool fRetrievePhysicsTable; >> 368 G4bool fStoredInAscii; >> 369 >> 370 G4bool fIsCheckedForRetrievePhysicsTable; >> 371 G4bool fIsRestoredCutValues; >> 372 >> 373 // directory name for physics table files >> 374 G4String directoryPhysicsTable; >> 375 >> 376 // flag for displaying the range cuts & energy thresholds >> 377 // G4int fDisplayThreshold; >> 378 >> 379 // flag for Physics Table has been built >> 380 // G4bool fIsPhysicsTableBuilt; >> 381 >> 382 // flag for CheckParticleList >> 383 G4bool fDisableCheckParticleList; >> 384 >> 385 // PhysicsListHelper >> 386 // G4PhysicsListHelper* thePLHelper; >> 387 >> 388 private: >> 389 enum >> 390 { >> 391 FixedStringLengthForStore = 32 >> 392 }; >> 393 >> 394 // Changes for MT >> 395 protected: >> 396 G4int g4vuplInstanceID; >> 397 G4RUN_DLL static G4VUPLManager subInstanceManager; >> 398 G4ParticleTable::G4PTblDicIterator* GetParticleIterator() const; >> 399 >> 400 public: >> 401 inline G4int GetInstanceID() const; >> 402 static const G4VUPLManager& GetSubInstanceManager(); >> 403 // Used by Worker threads on the shared instance of >> 404 // PL to initialize workers. Derived class re-implementing this method >> 405 // must also call this base class method >> 406 virtual void InitializeWorker(); >> 407 // Destroy thread-local data. Note that derived classes >> 408 // implementing this method should still call this base class one >> 409 virtual void TerminateWorker(); 298 }; 410 }; 299 411 300 // Inline methods implementations << 301 << 302 inline void G4VUserPhysicsList::Construct() 412 inline void G4VUserPhysicsList::Construct() 303 { 413 { 304 #ifdef G4VERBOSE 414 #ifdef G4VERBOSE 305 if (verboseLevel > 1) G4cout << "G4VUserPhys << 415 if(verboseLevel > 1) >> 416 G4cout << "G4VUserPhysicsList::Construct()" << G4endl; 306 #endif 417 #endif 307 418 308 if (G4Threading::IsMasterThread()) G4Physics << 309 << 310 InitializeProcessManager(); 419 InitializeProcessManager(); 311 420 312 #ifdef G4VERBOSE 421 #ifdef G4VERBOSE 313 if (verboseLevel > 1) G4cout << "Construct p << 422 if(verboseLevel > 1) >> 423 G4cout << "Construct processes " << G4endl; 314 #endif 424 #endif 315 ConstructProcess(); 425 ConstructProcess(); 316 } 426 } 317 427 318 inline G4double G4VUserPhysicsList::GetDefault 428 inline G4double G4VUserPhysicsList::GetDefaultCutValue() const 319 { 429 { 320 return defaultCutValue; 430 return defaultCutValue; 321 } 431 } 322 432 323 inline G4int G4VUserPhysicsList::GetVerboseLev 433 inline G4int G4VUserPhysicsList::GetVerboseLevel() const 324 { 434 { 325 return verboseLevel; 435 return verboseLevel; 326 } 436 } 327 437 328 inline G4bool G4VUserPhysicsList::IsPhysicsTab 438 inline G4bool G4VUserPhysicsList::IsPhysicsTableRetrieved() const 329 { 439 { 330 return fRetrievePhysicsTable; 440 return fRetrievePhysicsTable; 331 } 441 } 332 442 333 inline G4bool G4VUserPhysicsList::IsStoredInAs 443 inline G4bool G4VUserPhysicsList::IsStoredInAscii() const 334 { 444 { 335 return fStoredInAscii; 445 return fStoredInAscii; 336 } 446 } 337 447 338 inline const G4String& G4VUserPhysicsList::Get 448 inline const G4String& G4VUserPhysicsList::GetPhysicsTableDirectory() const 339 { 449 { 340 return directoryPhysicsTable; 450 return directoryPhysicsTable; 341 } 451 } 342 452 343 inline void G4VUserPhysicsList::SetStoredInAsc << 453 inline void G4VUserPhysicsList::SetStoredInAscii() { fStoredInAscii = true; } 344 { << 345 fStoredInAscii = true; << 346 } << 347 454 348 inline void G4VUserPhysicsList::ResetPhysicsTa 455 inline void G4VUserPhysicsList::ResetPhysicsTableRetrieved() 349 { 456 { 350 fRetrievePhysicsTable = false; << 457 fRetrievePhysicsTable = false; 351 fIsRestoredCutValues = false; << 458 fIsRestoredCutValues = false; 352 fIsCheckedForRetrievePhysicsTable = false; 459 fIsCheckedForRetrievePhysicsTable = false; 353 } 460 } 354 461 355 inline void G4VUserPhysicsList::ResetStoredInA << 462 inline void G4VUserPhysicsList::ResetStoredInAscii() { fStoredInAscii = false; } 356 { << 357 fStoredInAscii = false; << 358 } << 359 463 360 inline void G4VUserPhysicsList::DisableCheckPa 464 inline void G4VUserPhysicsList::DisableCheckParticleList() 361 { 465 { 362 fDisableCheckParticleList = true; 466 fDisableCheckParticleList = true; 363 } 467 } 364 468 365 inline G4int G4VUserPhysicsList::GetInstanceID 469 inline G4int G4VUserPhysicsList::GetInstanceID() const 366 { 470 { 367 return g4vuplInstanceID; 471 return g4vuplInstanceID; 368 } 472 } 369 473 370 inline const G4VUPLManager& G4VUserPhysicsList 474 inline const G4VUPLManager& G4VUserPhysicsList::GetSubInstanceManager() 371 { 475 { 372 return subInstanceManager; 476 return subInstanceManager; 373 } 477 } 374 << 375 #endif 478 #endif 376 479