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