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