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 // G4VProcess << 27 // 26 // 28 // Class description: << 27 // $Id: G4VProcess.hh,v 1.23 2006/06/29 21:07:50 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-01-patch-01 $ 29 // 29 // 30 // This class is the virtual class for physics << 30 // 31 // It defines public methods which describe th << 31 // ------------------------------------------------------------ 32 // a physics process. << 32 // GEANT 4 class header file 33 << 33 // 34 // Authors: << 34 // History: first implementation, based on object model of 35 // - 2 December 1995, G.Cosmo - First implemen << 35 // 2nd December 1995, G.Cosmo 36 // - 18 December 1996, H.Kurashige - New Physi << 36 // 37 // ------------------------------------------- << 37 // Class Description 38 #ifndef G4VProcess_hh << 38 // This class is the virtual class for physics process objects. 39 #define G4VProcess_hh 1 << 39 // It defines public methods which describe the behavior of >> 40 // a physics process. >> 41 // >> 42 // ------------------------------------------------------------ >> 43 // New Physics scheme 18 Dec. 1996 H.Kurahige >> 44 // ------------------------------------------------------------ >> 45 // change DoIt/GetPIL arguments type 20 Mar. 1997 H.Kurashige >> 46 // modified AlongStepGPIL 17 Dec. 1997 H.Kurashige >> 47 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige >> 48 // Add process trype 27 Mar. 1998 H.Kurashige >> 49 // Remove thePhysicsTable 2 Aug. 1998 H.Kurashige >> 50 // Add PILfactor and GPIL 3 Nov. 2000 H.Kurashige >> 51 // Add Store/RetrievePhysicsTable 8 Nov. 2000 H.Kurashige >> 52 // Modify Store/RetrievePhysicsTable methods 9 Mar. 2001 H.Kurashige >> 53 // Added PreparePhysicsTable 20 Aug. 2004 H.Kurashige 40 54 41 #include <cmath> << 55 #ifndef G4VProcess_h >> 56 #define G4VProcess_h 1 42 57 43 #include "globals.hh" 58 #include "globals.hh" >> 59 #include <cmath> 44 #include "G4ios.hh" 60 #include "G4ios.hh" 45 #include "Randomize.hh" << 61 >> 62 class G4ParticleDefinition; >> 63 class G4DynamicParticle; >> 64 class G4Track; >> 65 class G4Step; 46 66 47 #include "G4PhysicsTable.hh" 67 #include "G4PhysicsTable.hh" 48 #include "G4VParticleChange.hh" 68 #include "G4VParticleChange.hh" 49 #include "G4ForceCondition.hh" 69 #include "G4ForceCondition.hh" 50 #include "G4GPILSelection.hh" 70 #include "G4GPILSelection.hh" 51 #include "G4ParticleChange.hh" 71 #include "G4ParticleChange.hh" 52 #include "G4ProcessType.hh" 72 #include "G4ProcessType.hh" 53 73 54 class G4ParticleDefinition; << 55 class G4DynamicParticle; << 56 class G4Track; << 57 class G4Step; << 58 class G4ProcessTable; << 59 << 60 class G4VProcess 74 class G4VProcess 61 { 75 { >> 76 // A virtual class for physics process objects. It defines >> 77 // public methods which describe the behavior of a >> 78 // physics process. 62 79 63 public: << 80 private: 64 << 81 // hide default constructor and assignment operator as private 65 G4VProcess(const G4String& aName = "NoName << 82 // do not hide default constructor for alpha version 66 G4ProcessType aType = fNotDefin << 83 // G4VProcess G4VProcess(); 67 // Constructor requires the process name << 84 G4VProcess & operator=(const G4VProcess &right); 68 << 85 69 G4VProcess(const G4VProcess& right); << 86 public: // with description 70 // Copy constructor copies the name but << 87 // constructor requires the process name and type 71 // physics table (null pointer is assign << 88 G4VProcess(const G4String& aName = "NoName", 72 << 89 G4ProcessType aType = fNotDefined ); 73 virtual ~G4VProcess(); << 90 74 // Destructor << 91 // copy constructor copys the name but does not copy the 75 << 92 // physics table (0 pointer is assigned) 76 G4VProcess& operator=(const G4VProcess&) = << 93 G4VProcess(const G4VProcess &right); 77 << 94 78 G4bool operator==(const G4VProcess& right) << 95 public: 79 G4bool operator!=(const G4VProcess& right) << 96 // destructor 80 // Equality operators << 97 virtual ~G4VProcess(); 81 << 98 82 //////////////////////////// << 99 // equal opperators 83 // DoIt ///////////////// << 100 G4int operator==(const G4VProcess &right) const; 84 //////////////////////////// << 101 G4int operator!=(const G4VProcess &right) const; 85 << 102 86 virtual G4VParticleChange* PostStepDoIt( << 103 public: // with description 87 const G4Track& tr << 104 //////////////////////////// 88 const G4Step& ste << 105 // DoIt ///////////////// 89 ) = 0; << 106 /////////////////////////// 90 << 107 virtual G4VParticleChange* PostStepDoIt( 91 virtual G4VParticleChange* AlongStepDoIt( << 108 const G4Track& track, 92 const G4Track& tr << 109 const G4Step& stepData 93 const G4Step& ste << 110 ) = 0; 94 ) = 0; << 111 95 virtual G4VParticleChange* AtRestDoIt( << 112 virtual G4VParticleChange* AlongStepDoIt( 96 const G4Track& tr << 113 const G4Track& track, 97 const G4Step& ste << 114 const G4Step& stepData 98 ) = 0; << 115 ) = 0; 99 // A virtual base class function that ha << 116 virtual G4VParticleChange* AtRestDoIt( 100 // by any subclass. The DoIt() method ac << 117 const G4Track& track, 101 // physics process and determines either << 118 const G4Step& stepData 102 // of the production of secondaries etc. << 119 ) = 0; 103 // Arguments << 120 // A virtual base class function that has to be overridden 104 // const G4Track& track: << 121 // by any subclass. The DoIt method actually performs the >> 122 // physics process and determines either momentum change >> 123 // of the production of secondaries etc. >> 124 // arguments >> 125 // const G4Track& track: 105 // reference to the current G4Tra 126 // reference to the current G4Track information 106 // const G4Step& stepData: << 127 // const G4Step& stepData: 107 // reference to the current G4Ste 128 // reference to the current G4Step information 108 129 109 ////////////////////////// << 130 ////////////////////////// 110 // GPIL /////////////// << 131 // GPIL ////////////// 111 ////////////////////////// << 132 ///////////////////////// 112 << 133 virtual G4double AlongStepGetPhysicalInteractionLength( 113 virtual G4double AlongStepGetPhysicalInter << 114 const G4Track& tr 134 const G4Track& track, 115 G4double previous << 135 G4double previousStepSize, 116 G4double currentM << 136 G4double currentMinimumStep, 117 G4double& propose << 137 G4double& proposedSafety, 118 G4GPILSelection* 138 G4GPILSelection* selection) = 0; 119 139 120 virtual G4double AtRestGetPhysicalInteract << 140 virtual G4double AtRestGetPhysicalInteractionLength( 121 const G4Track& tr 141 const G4Track& track, 122 G4ForceCondition* << 142 G4ForceCondition* condition >> 143 ) = 0; 123 144 124 virtual G4double PostStepGetPhysicalIntera << 145 virtual G4double PostStepGetPhysicalInteractionLength( 125 const G4Track& tr 146 const G4Track& track, 126 G4double previous << 147 G4double previousStepSize, 127 G4ForceCondition* << 148 G4ForceCondition* condition >> 149 ) = 0; >> 150 128 // Returns the Step-size (actual length 151 // Returns the Step-size (actual length) which is allowed 129 // by "this" process. (for AtRestGetPhy 152 // by "this" process. (for AtRestGetPhysicalInteractionLength, 130 // return value is Step-time) The Numbe 153 // return value is Step-time) The NumberOfInteractionLengthLeft is 131 // recalculated by using previousStepSi 154 // recalculated by using previousStepSize and the Step-size is 132 // calucalted accoding to the resultant 155 // calucalted accoding to the resultant NumberOfInteractionLengthLeft. 133 // using NumberOfInteractionLengthLeft, 156 // using NumberOfInteractionLengthLeft, which is recalculated at 134 // arguments 157 // arguments 135 // const G4Track& track: 158 // const G4Track& track: 136 // reference to the current G4Tra 159 // reference to the current G4Track information 137 // G4double* previousStepS 160 // G4double* previousStepSize: 138 // the Step-size (actual length) 161 // the Step-size (actual length) of the previous Step 139 // of this track. Negative calue 162 // of this track. Negative calue indicates that 140 // NumberOfInteractionLengthLeft 163 // NumberOfInteractionLengthLeft must be reset. 141 // the current physical interacti 164 // the current physical interaction legth of this process 142 // G4ForceCondition* condition: 165 // G4ForceCondition* condition: 143 // the flag indicates DoIt of thi 166 // the flag indicates DoIt of this process is forced 144 // to be called 167 // to be called 145 // Forced: Corresponding DoIt 168 // Forced: Corresponding DoIt is forced 146 // NotForced: Corresponding DoIt 169 // NotForced: Corresponding DoIt is called 147 // if the Step size o 170 // if the Step size of this Step is determined 148 // by this process 171 // by this process 149 // !! AlongStepDoIt is always cal 172 // !! AlongStepDoIt is always called !! 150 // G4double& currentMinimumStep: 173 // G4double& currentMinimumStep: 151 // this value is used for transfo 174 // this value is used for transformation of 152 // true path length to geometrica 175 // true path length to geometrical path length 153 176 154 inline G4double GetCurrentInteractionLengt << 177 G4double GetCurrentInteractionLength() const; 155 // Returns currentInteractionLength 178 // Returns currentInteractionLength 156 179 157 ////////// PIL factor //////// << 180 ////////// PIL factor //////// 158 // << 181 void SetPILfactor(G4double value); 159 inline void SetPILfactor(G4double value); << 182 G4double GetPILfactor() const; 160 inline G4double GetPILfactor() const; << 161 // Set/Get factor for PhysicsInteraction 183 // Set/Get factor for PhysicsInteractionLength 162 // which is passed to G4SteppingManager 184 // which is passed to G4SteppingManager for both AtRest and PostStep 163 185 164 // These three GPIL methods are used by St << 186 // These three GPIL methods are used by Stepping Manager. 165 // They invoke virtual GPIL methods listed << 187 // They invoke virtual GPIL methods listed above. 166 // As for AtRest and PostStep the returned << 188 // As for AtRest and PostStep the returned value is multipled by thePILfactor 167 // thePILfactor << 189 // 168 // << 190 G4double AlongStepGPIL( const G4Track& track, 169 inline G4double AlongStepGPIL( const G4Tra << 191 G4double previousStepSize, 170 G4double pr << 192 G4double currentMinimumStep, 171 G4double cu << 193 G4double& proposedSafety, 172 G4double& p << 194 G4GPILSelection* selection ); 173 G4GPILSelec << 195 174 << 196 G4double AtRestGPIL( const G4Track& track, 175 inline G4double AtRestGPIL( const G4Track& << 197 G4ForceCondition* condition ); 176 G4ForceConditi << 198 177 << 199 G4double PostStepGPIL( const G4Track& track, 178 inline G4double PostStepGPIL( const G4Trac << 200 G4double previousStepSize, 179 G4double pre << 201 G4ForceCondition* condition ); 180 G4ForceCondi << 181 202 182 virtual G4bool IsApplicable(const G4Partic << 203 ////////////////////// >> 204 virtual G4bool IsApplicable(const G4ParticleDefinition&){return true;}; 183 // Returns true if this process object i 205 // Returns true if this process object is applicable to 184 // the particle type. Process will not b << 206 // the particle type 185 // particle if IsApplicable is false << 207 // Process will not be registered to a particle if IsApplicable is false 186 208 187 virtual void BuildPhysicsTable(const G4Par << 209 virtual void BuildPhysicsTable(const G4ParticleDefinition&){}; 188 // Messaged by the Particle definition ( 210 // Messaged by the Particle definition (via the Process manager) 189 // whenever cross-section tables have to << 211 // whenever cross section tables have to be rebuilt (i.e. if new 190 // materials have been defined). 212 // materials have been defined). 191 // It is overloaded by individual proces 213 // It is overloaded by individual processes when they need physics 192 // tables << 214 // tables. 193 215 194 virtual void PreparePhysicsTable(const G4P << 216 virtual void PreparePhysicsTable(const G4ParticleDefinition&){}; 195 // Messaged by the Particle definition ( 217 // Messaged by the Particle definition (via the Process manager) 196 // whenever cross-section tables have to << 218 // whenever cross section tables have to be prepare for rebuilt 197 // (i.e. if new materials have been defi 219 // (i.e. if new materials have been defined). 198 // It is overloaded by individual proces 220 // It is overloaded by individual processes when they need physics 199 // tables << 221 // tables. >> 222 >> 223 // Processes which Build physics tables independent of cuts >> 224 // (for example in their constructors) >> 225 // should preferably use private >> 226 // void BuildThePhysicsTable() and void PreparePhysicsTable(). >> 227 // Not another BuildPhysicsTable, please. 200 228 201 // Processes which Build physics tables in << 202 // (for example in their constructors) sho << 203 // void BuildThePhysicsTable() and void Pr << 204 // *Not* another BuildPhysicsTable << 205 229 206 virtual G4bool StorePhysicsTable(const G4P << 230 virtual G4bool StorePhysicsTable(const G4ParticleDefinition* , 207 const G4S << 231 const G4String&, >> 232 G4bool ascii = false) >> 233 {ascii=false; return true;} 208 // Store PhysicsTable in a file. 234 // Store PhysicsTable in a file. 209 // Return false in case of failure at I/ << 235 // (return false in case of failure at I/O ) 210 236 211 virtual G4bool RetrievePhysicsTable(const << 237 virtual G4bool RetrievePhysicsTable( const G4ParticleDefinition* , 212 const G4 << 238 const G4String&, >> 239 G4bool ascii = false) >> 240 {ascii=false; return false;} 213 // Retrieve Physics from a file. 241 // Retrieve Physics from a file. 214 // Return true if the Physics Table can << 242 // (return true if the Physics Table can be build by using file) 215 // Return false if the process has no fu << 243 // (return false if the process has no functionality or in case of failure) 216 // of failure. File name should be defin << 244 // File name should be defined by each process 217 // file should be placed under the direc << 245 // and the file should be placed under the directory specifed by the argument. 218 << 246 const G4String& GetPhysicsTableFileName(const G4ParticleDefinition* , 219 const G4String& GetPhysicsTableFileName(co << 247 const G4String& directory, 220 co << 248 const G4String& tableName, 221 co << 249 G4bool ascii =false); 222 G4 << 250 // this method is utility for Store/RetreivePhysicsTable 223 // This method is utility for Store/Retr << 251 224 << 252 //////////////////////////// 225 inline const G4String& GetProcessName() co << 253 const G4String& GetProcessName() const; 226 // Returns the name of the process << 254 // Returns the name of the process. 227 << 255 228 inline G4ProcessType GetProcessType() cons << 256 G4ProcessType GetProcessType() const; 229 // Returns the process type << 257 // Returns the process type. 230 << 258 231 inline void SetProcessType(G4ProcessType); << 259 void SetProcessType(G4ProcessType ); 232 // Sets the process type << 260 // Set the process type. 233 << 261 234 inline G4int GetProcessSubType() const; << 262 static const G4String& GetProcessTypeName(G4ProcessType ); 235 // Returns the process sub type << 263 // Returns the process type name 236 << 264 237 inline void SetProcessSubType(G4int); << 265 virtual void StartTracking(G4Track*); 238 // Sets the process sub type << 266 virtual void EndTracking(); 239 << 267 // inform Start/End of tracking for each track to the physics process 240 static const G4String& GetProcessTypeName( << 241 // Returns the process type name << 242 << 243 virtual const G4VProcess* GetCreatorProces << 244 // Returns the process to be used as Cre << 245 // coming from this process << 246 << 247 virtual void StartTracking(G4Track*); << 248 virtual void EndTracking(); << 249 // Inform Start/End of tracking for each << 250 << 251 virtual void SetProcessManager(const G4Pro << 252 // A process manager sets its own pointe << 253 // is registered in the process Manager << 254 virtual const G4ProcessManager* GetProcess << 255 // Get the process manager which the pro << 256 << 257 virtual void ResetNumberOfInteractionLengt << 258 // Reset (determine the value of) Number << 259 268 260 inline G4double GetNumberOfInteractionLeng << 269 public: 261 // Get NumberOfInteractionLengthLeft << 270 virtual void SetProcessManager(const G4ProcessManager*); 262 << 271 // A process manager set its own pointer when the process is registered 263 inline G4double GetTotalNumberOfInteractio << 272 // the process Manager 264 // Get NumberOfInteractionLength after << 273 virtual const G4ProcessManager* GetProcessManager(); 265 // ResetNumberOfInteractionLengthLeft() << 274 // Get the process manager which the process belongs to 266 << 267 inline G4bool isAtRestDoItIsEnabled() cons << 268 inline G4bool isAlongStepDoItIsEnabled() c << 269 inline G4bool isPostStepDoItIsEnabled() co << 270 // These methods indicate which DoIt is << 271 // They are used by G4ProcessManager to << 272 // that ordering parameters are properly << 273 275 274 virtual void DumpInfo() const; << 275 // Dump out process information << 276 << 277 virtual void ProcessDescription(std::ostre << 278 // Write out to html file for automatic << 279 << 280 inline void SetVerboseLevel(G4int value); << 281 inline G4int GetVerboseLevel() const; << 282 // set/get control flag for output messa << 283 // 0: Silent << 284 // 1: Warning message << 285 // 2: More << 286 << 287 virtual void SetMasterProcess(G4VProcess* << 288 // Sets the master thread process instan << 289 inline const G4VProcess* GetMasterProcess( << 290 // Returns the master thread process ins << 291 // Can be used to initialise worker type << 292 // instances from master one (e.g. to sh << 293 // if ( this != GetMasterProcess() ) { / << 294 // else { /* master or sequential */ } << 295 << 296 virtual void BuildWorkerPhysicsTable(const << 297 // Messaged by the Particle definition ( << 298 // in worker threads. See BuildWorkerPhy << 299 // Can be used to share among threads ph << 300 // Use GetMasterProcess() to get pointer << 301 // worker thread. << 302 // By default this method makes a forwar << 303 << 304 virtual void PrepareWorkerPhysicsTable(con << 305 // Messaged by the Particle definition ( << 306 // in worker threads. See Preparephysics << 307 // Can be used to share among threads ph << 308 // Use GetMasterProcess() to get pointer << 309 // worker thread << 310 // By default this method makes a forwar << 311 << 312 protected: 276 protected: 313 << 277 const G4ProcessManager* aProcessManager; 314 inline void SubtractNumberOfInteractionLen << 315 // Subtract NumberOfInteractionLengthLef << 316 // to previousStepSize << 317 278 318 inline void ClearNumberOfInteractionLength << 319 // This method should be at the end of P << 320 << 321 protected: 279 protected: 322 << 280 G4VParticleChange* pParticleChange; 323 const G4ProcessManager* aProcessManager = << 281 // The pointer to G4VParticleChange object >> 282 // which is modified and returned by address by the DoIt() method. >> 283 // This pointer should be set in each physics process >> 284 // after construction of derived class object. >> 285 >> 286 G4ParticleChange aParticleChange; >> 287 // This object is kept for compatibility with old scheme >> 288 // This will be removed in future >> 289 >> 290 G4double theNumberOfInteractionLengthLeft; >> 291 // The flight length left for the current tracking particle >> 292 // in unit of "Interaction length". >> 293 >> 294 G4double currentInteractionLength; >> 295 // The InteractionLength in the current material >> 296 >> 297 public: // with description >> 298 virtual void ResetNumberOfInteractionLengthLeft(); >> 299 // reset (determine the value of)NumberOfInteractionLengthLeft 324 300 325 G4VParticleChange* pParticleChange = nullp << 301 protected: // with description 326 // The pointer to G4VParticleChange obje << 302 virtual void SubtractNumberOfInteractionLengthLeft( 327 // which is modified and returned by add << 303 G4double previousStepSize 328 // This pointer should be set in each ph << 304 ); 329 // after construction of derived class o << 305 // subtract NumberOfInteractionLengthLeft by the value corresponding to 330 << 306 // previousStepSize 331 G4ParticleChange aParticleChange; << 332 // This object is kept for compatibility << 333 // May be removed in future << 334 << 335 G4double theNumberOfInteractionLengthLeft << 336 // The flight length left for the curren << 337 // in unit of "Interaction length" << 338 << 339 G4double currentInteractionLength = -1.0; << 340 // The InteractionLength in the current << 341 << 342 G4double theInitialNumberOfInteractionLeng << 343 // The initial value when ResetNumberOfI << 344 << 345 G4String theProcessName; << 346 // The name of the process << 347 << 348 G4String thePhysicsTableFileName; << 349 << 350 G4ProcessType theProcessType = fNotDefined << 351 // The type of the process << 352 << 353 G4int theProcessSubType = -1; << 354 // The sub type of the process << 355 << 356 G4double thePILfactor = 1.0; << 357 // Factor for PhysicsInteractionLength << 358 // which is passed to G4SteppingManager << 359 307 360 G4int verboseLevel = 0; << 308 virtual void ClearNumberOfInteractionLengthLeft(); 361 // Controle flag for output message << 309 // clear NumberOfInteractionLengthLeft >> 310 // !!! This method should be at the end of PostStepDoIt() >> 311 // !!! and AtRestDoIt >> 312 >> 313 protected: >> 314 G4String theProcessName; >> 315 // The name of the process 362 316 363 G4bool enableAtRestDoIt = true; << 317 G4String thePhysicsTableFileName; 364 G4bool enableAlongStepDoIt = true; << 365 G4bool enablePostStepDoIt = true; << 366 318 367 private: << 319 G4ProcessType theProcessType; 368 << 320 // The type of the process 369 G4VProcess(); << 370 // Hidden default constructor << 371 321 372 private: << 322 G4double thePILfactor; 373 << 323 // factor for PhysicsInteractionLength 374 G4VProcess* masterProcessShadow = nullptr; << 324 // which is passed to G4SteppingManager 375 // For multi-threaded: pointer to the in << 325 376 // for the master thread << 326 public: // with description >> 327 virtual void DumpInfo() const; >> 328 // dump out process information >> 329 >> 330 public: // with description >> 331 void SetVerboseLevel(G4int value); >> 332 G4int GetVerboseLevel() const; >> 333 // set/get controle flag for output message >> 334 // 0: Silent >> 335 // 1: Warning message >> 336 // 2: More >> 337 >> 338 >> 339 protected: >> 340 G4int verboseLevel; >> 341 // controle flag for output message 377 342 378 G4ProcessTable* fProcessTable = nullptr; << 379 }; 343 }; 380 344 381 // ----------------------------------------- 345 // ----------------------------------------- 382 // inlined function members implementation 346 // inlined function members implementation 383 // ----------------------------------------- 347 // ----------------------------------------- >> 348 #include "Randomize.hh" 384 349 385 inline 350 inline 386 const G4String& G4VProcess::GetProcessName() c << 351 const G4String& G4VProcess::GetProcessName() const 387 { 352 { 388 return theProcessName; 353 return theProcessName; 389 } 354 } 390 355 391 inline 356 inline 392 G4ProcessType G4VProcess::GetProcessType() con << 357 G4ProcessType G4VProcess::GetProcessType() const 393 { 358 { 394 return theProcessType; 359 return theProcessType; 395 } 360 } 396 361 397 inline 362 inline 398 void G4VProcess::SetProcessType(G4ProcessType << 363 void G4VProcess::SetProcessType(G4ProcessType aType) 399 { 364 { 400 theProcessType = aType; 365 theProcessType = aType; 401 } 366 } 402 367 403 inline << 368 inline void G4VProcess::SetVerboseLevel(G4int value) 404 G4int G4VProcess::GetProcessSubType() const << 405 { << 406 return theProcessSubType; << 407 } << 408 << 409 inline << 410 void G4VProcess::SetProcessSubType(G4int value << 411 { << 412 theProcessSubType = value; << 413 } << 414 << 415 inline << 416 void G4VProcess::SetVerboseLevel(G4int value) << 417 { 369 { 418 verboseLevel = value; 370 verboseLevel = value; 419 } 371 } 420 372 421 inline << 373 inline G4int G4VProcess::GetVerboseLevel() const 422 G4int G4VProcess::GetVerboseLevel() const << 423 { 374 { 424 return verboseLevel; 375 return verboseLevel; 425 } 376 } 426 377 427 inline << 378 inline void G4VProcess::ResetNumberOfInteractionLengthLeft() 428 void G4VProcess::ClearNumberOfInteractionLengt << 429 { 379 { 430 theInitialNumberOfInteractionLength = -1.0; << 380 theNumberOfInteractionLengthLeft = -std::log( G4UniformRand() ); 431 theNumberOfInteractionLengthLeft = -1.0; << 432 } 381 } 433 382 434 inline << 383 inline void G4VProcess::ClearNumberOfInteractionLengthLeft() 435 G4double G4VProcess::GetNumberOfInteractionLen << 436 { 384 { 437 return theNumberOfInteractionLengthLeft; << 385 theNumberOfInteractionLengthLeft = -1.0; 438 } << 439 << 440 inline << 441 G4double G4VProcess::GetTotalNumberOfInteracti << 442 { << 443 return theInitialNumberOfInteractionLength - << 444 } 386 } 445 387 446 inline << 388 inline G4double G4VProcess::GetCurrentInteractionLength() const 447 G4double G4VProcess::GetCurrentInteractionLeng << 448 { 389 { 449 return currentInteractionLength; 390 return currentInteractionLength; 450 } 391 } 451 392 452 inline << 393 inline void G4VProcess::SetPILfactor(G4double value) 453 void G4VProcess::SetPILfactor(G4double value) << 454 { 394 { 455 if (value>0.) { thePILfactor = value; } << 395 if (value>0.) { >> 396 thePILfactor = value; >> 397 } 456 } 398 } 457 399 458 inline << 400 inline G4double G4VProcess::GetPILfactor() const 459 G4double G4VProcess::GetPILfactor() const << 460 { 401 { 461 return thePILfactor; 402 return thePILfactor; 462 } 403 } 463 404 464 inline << 405 inline G4double G4VProcess::AlongStepGPIL( const G4Track& track, 465 G4double G4VProcess::AlongStepGPIL( const G4Tr << 406 G4double previousStepSize, 466 G4double << 407 G4double currentMinimumStep, 467 G4double << 408 G4double& proposedSafety, 468 G4double& << 409 G4GPILSelection* selection ) 469 G4GPILSele << 410 { 470 { << 411 G4double value 471 return AlongStepGetPhysicalInteractionLength << 412 =AlongStepGetPhysicalInteractionLength(track, previousStepSize, currentMinimumStep, proposedSafety, selection); 472 currentMinimumSte << 413 return value; 473 } 414 } 474 415 475 inline << 416 inline G4double G4VProcess::AtRestGPIL( const G4Track& track, 476 G4double G4VProcess::AtRestGPIL( const G4Track << 477 G4ForceCondit 417 G4ForceCondition* condition ) 478 { 418 { 479 return thePILfactor * AtRestGetPhysicalInter << 419 G4double value >> 420 =AtRestGetPhysicalInteractionLength(track, condition); >> 421 return thePILfactor*value; 480 } 422 } 481 423 482 inline << 424 inline G4double G4VProcess::PostStepGPIL( const G4Track& track, 483 G4double G4VProcess::PostStepGPIL( const G4Tra << 425 G4double previousStepSize, 484 G4double pr << 485 G4ForceCond 426 G4ForceCondition* condition ) 486 { 427 { 487 return thePILfactor * << 428 G4double value 488 PostStepGetPhysicalInteractionLength(tra << 429 =PostStepGetPhysicalInteractionLength(track, previousStepSize, condition); >> 430 return thePILfactor*value; 489 } 431 } 490 432 491 inline 433 inline 492 void G4VProcess::SetProcessManager(const G4Pro << 434 void G4VProcess::SetProcessManager(const G4ProcessManager* procMan) 493 { 435 { 494 aProcessManager = procMan; << 436 aProcessManager = procMan; 495 } 437 } 496 438 497 inline 439 inline 498 const G4ProcessManager* G4VProcess::GetProcess << 440 const G4ProcessManager* G4VProcess::GetProcessManager() 499 { 441 { 500 return aProcessManager; << 442 return aProcessManager; 501 } 443 } >> 444 #endif >> 445 >> 446 >> 447 >> 448 >> 449 >> 450 >> 451 >> 452 >> 453 >> 454 >> 455 >> 456 >> 457 >> 458 502 459 503 inline << 504 G4bool G4VProcess::isAtRestDoItIsEnabled() con << 505 { << 506 return enableAtRestDoIt; << 507 } << 508 460 509 inline << 510 G4bool G4VProcess::isAlongStepDoItIsEnabled() << 511 { << 512 return enableAlongStepDoIt; << 513 } << 514 461 515 inline << 516 G4bool G4VProcess::isPostStepDoItIsEnabled() c << 517 { << 518 return enablePostStepDoIt; << 519 } << 520 462 521 inline << 522 const G4VProcess* G4VProcess::GetMasterProcess << 523 { << 524 return masterProcessShadow; << 525 } << 526 463 527 inline << 528 void G4VProcess::SubtractNumberOfInteractionLe << 529 { << 530 if (currentInteractionLength>0.0) << 531 { << 532 theNumberOfInteractionLengthLeft -= prevSt << 533 if(theNumberOfInteractionLengthLeft<0.) << 534 { << 535 theNumberOfInteractionLengthLeft=CLHEP: << 536 } << 537 } << 538 else << 539 { << 540 #ifdef G4VERBOSE << 541 if (verboseLevel>0) << 542 { << 543 G4cerr << "G4VProcess::SubtractNumberOfI << 544 G4cerr << " [" << theProcessName << "]" << 545 G4cerr << " currentInteractionLength = " << 546 << currentInteractionLength << " << 547 G4cerr << " previousStepSize = " << prev << 548 G4cerr << G4endl; << 549 } << 550 #endif << 551 G4String msg = "Negative currentInteractio << 552 msg += theProcessName; << 553 G4Exception("G4VProcess::SubtractNumberOfI << 554 "ProcMan201", EventMustBeAbort << 555 } << 556 } << 557 464 558 #endif << 559 465