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