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