- Timestamp:
- Apr 17, 2009, 12:17:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh
r961 r991 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEnergyLossProcess.hh,v 1.8 6 2009/02/19 09:57:36vnivanch Exp $26 // $Id: G4VEnergyLossProcess.hh,v 1.83 2008/09/12 16:19:01 vnivanch Exp $ 27 27 // GEANT4 tag $Name: 28 28 // … … 126 126 virtual ~G4VEnergyLossProcess(); 127 127 128 private:129 // clean vectors and arrays130 void Clean();131 132 128 //------------------------------------------------------------------------ 133 129 // Virtual methods to be implemented in concrete processes 134 130 //------------------------------------------------------------------------ 135 131 136 public:137 132 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; 138 133 … … 148 143 //------------------------------------------------------------------------ 149 144 145 protected: 146 150 147 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 151 148 const G4Material*, G4double cut); 152 149 153 150 //------------------------------------------------------------------------ 154 // Virtual methods implementation common to all EM ContinuousDiscrete155 // processes.Further inheritance is not assumed151 // Virtual methods common to all EM ContinuousDiscrete processes 152 // Further inheritance is not assumed 156 153 //------------------------------------------------------------------------ 157 154 158 155 public: 159 156 160 // prepare all tables 157 void PrintInfoDefinition(); 158 161 159 void PreparePhysicsTable(const G4ParticleDefinition&); 162 160 163 // build all tables164 161 void BuildPhysicsTable(const G4ParticleDefinition&); 165 162 166 // build a table167 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);168 169 // build a table170 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);171 172 // summary printout after initialisation173 void PrintInfoDefinition();174 175 // Add subcutoff option for the region176 void ActivateSubCutoff(G4bool val, const G4Region* region = 0);177 178 // Activate deexcitation code for region179 void ActivateDeexcitation(G4bool, const G4Region* region = 0);180 181 // Step limit from AlongStep182 163 G4double AlongStepGetPhysicalInteractionLength(const G4Track&, 183 164 G4double previousStepSize, … … 186 167 G4GPILSelection* selection); 187 168 188 // Step limit from cross section189 169 G4double PostStepGetPhysicalInteractionLength(const G4Track& track, 190 170 G4double previousStepSize, 191 171 G4ForceCondition* condition); 192 172 193 // AlongStep computations194 173 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); 195 174 196 // Sampling of secondaries in vicinity of geometrical boundary197 void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,198 G4VEmModel* model, G4int matIdx,199 G4double& extraEdep);200 201 // PostStep sampling of secondaries202 175 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 203 176 204 // Store all PhysicsTable in files.205 // Return false in case of any fatal failure at I/O177 // Store PhysicsTable in a file. 178 // Return false in case of failure at I/O 206 179 G4bool StorePhysicsTable(const G4ParticleDefinition*, 207 180 const G4String& directory, 208 181 G4bool ascii = false); 209 182 210 // Retrieve all Physics from a files. 211 // Return true if all the Physics Table are built. 212 // Return false if any fatal failure. 183 // Retrieve Physics from a file. 184 // (return true if the Physics Table can be build by using file) 185 // (return false if the process has no functionality or in case of failure) 186 // File name should is constructed as processName+particleName and the 187 // should be placed under the directory specifed by the argument. 213 188 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 214 189 const G4String& directory, 215 190 G4bool ascii); 216 191 217 private:218 // store a table219 G4bool StoreTable(const G4ParticleDefinition* p,220 G4PhysicsTable*, G4bool ascii,221 const G4String& directory,222 const G4String& tname);223 224 // retrieve a table225 G4bool RetrieveTable(const G4ParticleDefinition* p,226 G4PhysicsTable*, G4bool ascii,227 const G4String& directory,228 const G4String& tname,229 G4bool mandatory);230 231 //------------------------------------------------------------------------232 // Public interface to cross section, mfp and sampling of fluctuations233 // These methods are not used in run time234 //------------------------------------------------------------------------235 236 public:237 // access to dispersion of restricted energy loss238 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,239 const G4DynamicParticle* dp,240 G4double length);241 242 // Access to cross section table243 G4double CrossSectionPerVolume(G4double kineticEnergy,244 const G4MaterialCutsCouple* couple);245 246 // access to cross section247 G4double MeanFreePath(const G4Track& track);248 249 // access to step limit250 G4double ContinuousStepLimit(const G4Track& track,251 G4double previousStepSize,252 G4double currentMinimumStep,253 G4double& currentSafety);254 255 192 protected: 256 193 257 // implementation of the pure virtual method258 194 G4double GetMeanFreePath(const G4Track& track, 259 195 G4double previousStepSize, 260 196 G4ForceCondition* condition); 261 197 262 // implementation of the pure virtual method263 198 G4double GetContinuousStepLimit(const G4Track& track, 264 199 G4double previousStepSize, … … 267 202 268 203 //------------------------------------------------------------------------ 269 // Run time method which may be also used by derived processes 270 //------------------------------------------------------------------------ 271 272 // creeation of an empty vector for cross section 273 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 274 G4double cut); 275 276 inline G4ParticleChangeForLoss* GetParticleChange(); 277 278 inline size_t CurrentMaterialCutsCoupleIndex() const; 279 280 inline G4double GetCurrentRange() const; 281 282 //------------------------------------------------------------------------ 283 // Specific methods to set, access, modify models 284 //------------------------------------------------------------------------ 285 286 // Select model in run time 287 inline void SelectModel(G4double kinEnergy); 204 // Specific methods for along/post step EM processes 205 //------------------------------------------------------------------------ 288 206 289 207 public: 290 // Select model by energy and region index 291 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 292 size_t& idx) const; 293 294 // Add EM model coupled with fluctuation model for region, smaller value 295 // of order defines which pair of models will be selected for a given 296 // energy interval 297 inline void AddEmModel(G4int, G4VEmModel*, 298 G4VEmFluctuationModel* fluc = 0, 299 const G4Region* region = 0); 300 301 // Define new energy range for the model identified by the name 302 inline void UpdateEmModel(const G4String&, G4double, G4double); 303 304 // Assign a model to a process 305 inline void SetEmModel(G4VEmModel*, G4int index=1); 306 307 // return the assigned model 308 inline G4VEmModel* EmModel(G4int index=1); 309 310 // Access to models 311 inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 312 313 inline G4int NumberOfModels(); 314 315 // Assign a fluctuation model to a process 316 inline void SetFluctModel(G4VEmFluctuationModel*); 317 318 // return the assigned fluctuation model 319 inline G4VEmFluctuationModel* FluctModel(); 320 321 //------------------------------------------------------------------------ 322 // Define and access particle type 323 //------------------------------------------------------------------------ 324 325 protected: 326 inline void SetParticle(const G4ParticleDefinition* p); 327 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 328 329 public: 330 inline void SetBaseParticle(const G4ParticleDefinition* p); 331 inline const G4ParticleDefinition* Particle() const; 332 inline const G4ParticleDefinition* BaseParticle() const; 333 inline const G4ParticleDefinition* SecondaryParticle() const; 334 335 //------------------------------------------------------------------------ 336 // Get/set parameters to configure the process at initialisation time 337 //------------------------------------------------------------------------ 338 339 // Add subcutoff process (bremsstrahlung) to sample secondary 340 // particle production in vicinity of the geometry boundary 208 341 209 void AddCollaborativeProcess(G4VEnergyLossProcess*); 342 210 343 inline void SetLossFluctuations(G4bool val); 344 inline void SetRandomStep(G4bool val); 345 346 inline void SetIntegral(G4bool val); 347 inline G4bool IsIntegral() const; 348 349 // Set/Get flag "isIonisation" 350 inline void SetIonisation(G4bool val); 351 inline G4bool IsIonisationProcess() const; 352 353 // Redefine parameteters for stepping control 354 // 355 inline void SetLinearLossLimit(G4double val); 356 inline void SetMinSubRange(G4double val); 357 inline void SetLambdaFactor(G4double val); 358 inline void SetStepFunction(G4double v1, G4double v2); 359 360 inline G4int NumberOfSubCutoffRegions() const; 361 inline G4int NumberOfDERegions() const; 362 363 //------------------------------------------------------------------------ 364 // Specific methods to path Physics Tables to the process 365 //------------------------------------------------------------------------ 211 void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 212 G4VEmModel* model, G4int matIdx, 213 G4double& extraEdep); 214 215 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, 216 const G4DynamicParticle* dp, 217 G4double length); 218 219 //------------------------------------------------------------------------ 220 // Specific methods to build and access Physics Tables 221 //------------------------------------------------------------------------ 222 223 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted); 224 225 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted); 366 226 367 227 void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType); 368 228 void SetCSDARangeTable(G4PhysicsTable* pRange); 369 229 void SetRangeTableForLoss(G4PhysicsTable* p); 230 void SetInverseRangeTable(G4PhysicsTable* p); 370 231 void SetSecondaryRangeTable(G4PhysicsTable* p); 371 void SetInverseRangeTable(G4PhysicsTable* p);372 232 373 233 void SetLambdaTable(G4PhysicsTable* p); … … 391 251 // Max kinetic energy for tables 392 252 inline void SetMaxKinEnergyForCSDARange(G4double e); 393 394 // Return values for given G4MaterialCutsCouple395 inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);396 inline G4double GetDEDXForSubsec(G4double& kineticEnergy,397 const G4MaterialCutsCouple*);398 inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);399 inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);400 inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);401 inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);402 inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);403 404 inline G4bool TablesAreBuilt() const;405 253 406 254 // Access to specific tables … … 416 264 inline G4PhysicsTable* SubLambdaTable(); 417 265 266 // Return values for given G4MaterialCutsCouple 267 inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*); 268 inline G4double GetDEDXForSubsec(G4double& kineticEnergy, 269 const G4MaterialCutsCouple*); 270 inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 271 inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 272 inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*); 273 inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*); 274 inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*); 275 276 inline G4bool TablesAreBuilt() const; 277 278 //------------------------------------------------------------------------ 279 // Define and access particle type 280 //------------------------------------------------------------------------ 281 282 inline void SetBaseParticle(const G4ParticleDefinition* p); 283 inline const G4ParticleDefinition* Particle() const; 284 inline const G4ParticleDefinition* BaseParticle() const; 285 inline const G4ParticleDefinition* SecondaryParticle() const; 286 287 //------------------------------------------------------------------------ 288 // Specific methods to set, access, modify models 289 //------------------------------------------------------------------------ 290 291 // Add EM model coupled with fluctuation model for the region 292 inline void AddEmModel(G4int, G4VEmModel*, 293 G4VEmFluctuationModel* fluc = 0, 294 const G4Region* region = 0); 295 296 // Assign a model to a process 297 inline void SetEmModel(G4VEmModel*, G4int index=1); 298 299 // return the assigned model 300 inline G4VEmModel* EmModel(G4int index=1); 301 302 // Assign a fluctuation model to a process 303 inline void SetFluctModel(G4VEmFluctuationModel*); 304 305 // return the assigned fluctuation model 306 inline G4VEmFluctuationModel* FluctModel(); 307 308 // Define new energy range for the model identified by the name 309 inline void UpdateEmModel(const G4String&, G4double, G4double); 310 311 // Access to models 312 inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 313 314 inline G4int NumberOfModels(); 315 316 //------------------------------------------------------------------------ 317 // Get/set parameters used for simulation of energy loss 318 //------------------------------------------------------------------------ 319 320 inline void SetLossFluctuations(G4bool val); 321 inline void SetRandomStep(G4bool val); 322 inline void SetIntegral(G4bool val); 323 inline G4bool IsIntegral() const; 324 325 // Set/Get flag "isIonisation" 326 inline void SetIonisation(G4bool val); 327 inline G4bool IsIonisationProcess() const; 328 329 // Redefine parameteters for stepping control 330 // 331 inline void SetLinearLossLimit(G4double val); 332 inline void SetMinSubRange(G4double val); 333 inline void SetStepFunction(G4double v1, G4double v2); 334 inline void SetLambdaFactor(G4double val); 335 336 337 // Add subcutoff option for the region 338 void ActivateSubCutoff(G4bool val, const G4Region* region = 0); 339 340 inline G4int NumberOfSubCutoffRegions() const; 341 342 // Activate deexcitation code 343 virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0); 344 345 //------------------------------------------------------------------------ 346 // Public interface to helper functions 347 //------------------------------------------------------------------------ 348 349 inline 350 G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const; 351 352 inline G4double MeanFreePath(const G4Track& track); 353 354 inline G4double ContinuousStepLimit(const G4Track& track, 355 G4double previousStepSize, 356 G4double currentMinimumStep, 357 G4double& currentSafety); 358 418 359 //------------------------------------------------------------------------ 419 360 // Run time method for simulation of ionisation … … 426 367 inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio); 427 368 369 // Access to cross section table 370 G4double CrossSectionPerVolume(G4double kineticEnergy, 371 const G4MaterialCutsCouple* couple); 372 373 protected: 374 375 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 376 G4double cut); 377 378 inline G4ParticleChangeForLoss* GetParticleChange(); 379 380 inline void SetParticle(const G4ParticleDefinition* p); 381 382 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 383 384 inline void SelectModel(G4double kinEnergy); 385 386 inline size_t CurrentMaterialCutsCoupleIndex() const; 387 388 inline G4double GetCurrentRange() const; 389 428 390 private: 391 392 //------------------------------------------------------------------------ 393 // Management of tables 394 //------------------------------------------------------------------------ 395 396 void Clear(); 397 398 G4bool StoreTable(const G4ParticleDefinition* p, 399 G4PhysicsTable*, G4bool ascii, 400 const G4String& directory, 401 const G4String& tname); 402 403 G4bool RetrieveTable(const G4ParticleDefinition* p, 404 G4PhysicsTable*, G4bool ascii, 405 const G4String& directory, 406 const G4String& tname, 407 G4bool mandatory); 429 408 430 409 // define material and indexes 431 410 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 432 411 433 //------------------------------------------------------------------------ 434 // Compute values using scaling relation, mass and charge of based particle 435 //------------------------------------------------------------------------ 436 412 // Returnd values for scaled energy using mass of the base particle 413 // 437 414 inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy); 438 415 inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy); … … 441 418 inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy); 442 419 inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy); 420 inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy); 443 421 inline G4double ScaledKinEnergyForLoss(G4double range); 444 inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);445 422 inline void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy); 446 423 447 424 // hide assignment operator 425 448 426 G4VEnergyLossProcess(G4VEnergyLossProcess &); 449 427 G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right); … … 466 444 G4VEmFluctuationModel* fluctModel; 467 445 std::vector<const G4Region*> scoffRegions; 468 std::vector<const G4Region*> deRegions;469 446 G4int nSCoffRegions; 470 G4int nDERegions; 471 G4bool* idxSCoffRegions; 472 G4bool* idxDERegions; 447 G4int* idxSCoffRegions; 473 448 474 449 std::vector<G4VEnergyLossProcess*> scProcesses; … … 518 493 G4bool isIonisation; 519 494 G4bool useSubCutoff; 520 G4bool useDeexcitation;521 495 522 496 protected: … … 557 531 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 558 532 559 inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange() 560 { 561 return &fParticleChange; 562 } 563 564 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 565 566 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 567 { 568 return currentMaterialIndex; 569 } 570 571 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 572 573 inline G4double G4VEnergyLossProcess::GetCurrentRange() const 574 { 575 return fRange; 576 } 577 578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 579 580 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy) 581 { 582 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 583 currentModel->SetCurrentCouple(currentCouple); 584 } 585 586 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 587 588 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial( 589 G4double kinEnergy, size_t& idx) const 590 { 591 return modelManager->SelectModel(kinEnergy, idx); 592 } 593 594 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 595 596 inline 597 void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, 598 G4VEmFluctuationModel* fluc, 599 const G4Region* region) 600 { 601 modelManager->AddEmModel(order, p, fluc, region); 602 if(p) p->SetParticleChange(pParticleChange, fluc); 603 } 604 605 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 606 607 inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, 608 G4double emin, G4double emax) 609 { 610 modelManager->UpdateEmModel(nam, emin, emax); 611 } 612 613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 614 615 inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index) 616 { 617 G4int n = emModels.size(); 618 if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);} 619 emModels[index] = p; 620 } 621 622 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 623 624 inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index) 625 { 626 G4VEmModel* p = 0; 627 if(index >= 0 && index < G4int(emModels.size())) p = emModels[index]; 628 return p; 629 } 630 631 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 632 633 inline 634 G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver) 635 { 636 return modelManager->GetModel(idx, ver); 637 } 638 639 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 640 641 inline G4int G4VEnergyLossProcess::NumberOfModels() 642 { 643 return modelManager->NumberOfModels(); 644 } 645 646 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 647 648 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p) 649 { 650 fluctModel = p; 651 } 652 653 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 654 655 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel() 656 { 657 return fluctModel; 658 } 659 660 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 661 662 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p) 663 { 664 particle = p; 665 } 666 667 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 668 669 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 670 { 671 secondaryParticle = p; 672 } 673 674 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 675 676 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p) 677 { 678 baseParticle = p; 679 } 680 681 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 682 683 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const 684 { 685 return particle; 686 } 687 688 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 689 690 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const 691 { 692 return baseParticle; 693 } 694 695 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 696 697 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const 698 { 699 return secondaryParticle; 700 } 701 702 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 703 704 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val) 705 { 706 lossFluctuationFlag = val; 707 } 708 709 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 710 711 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val) 712 { 713 rndmStepFlag = val; 714 } 715 716 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 717 718 inline void G4VEnergyLossProcess::SetIntegral(G4bool val) 719 { 720 integral = val; 721 } 722 723 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 724 725 inline G4bool G4VEnergyLossProcess::IsIntegral() const 726 { 727 return integral; 728 } 729 730 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 731 732 inline void G4VEnergyLossProcess::SetIonisation(G4bool val) 733 { 734 isIonisation = val; 735 if(val) aGPILSelection = CandidateForSelection; 736 else aGPILSelection = NotCandidateForSelection; 737 } 738 739 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 740 741 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const 742 { 743 return isIonisation; 744 } 745 746 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 747 748 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val) 749 { 750 linLossLimit = val; 751 } 752 753 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 754 755 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val) 756 { 757 minSubRange = val; 758 } 759 760 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 761 762 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val) 763 { 764 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 765 } 766 767 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 768 769 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2) 770 { 771 dRoverRange = v1; 772 finalRange = v2; 773 if (dRoverRange > 0.999) dRoverRange = 1.0; 774 currentCouple = 0; 775 mfpKinEnergy = DBL_MAX; 776 } 777 778 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 779 780 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 781 { 782 return nSCoffRegions; 783 } 784 785 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 786 787 inline G4int G4VEnergyLossProcess::NumberOfDERegions() const 788 { 789 return nDERegions; 790 } 791 792 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 793 794 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins) 795 { 796 nBins = nbins; 797 } 798 799 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 800 801 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins) 802 { 803 nBins = nbins; 804 } 805 806 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 807 808 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins) 809 { 810 nBinsCSDA = nbins; 811 } 812 813 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 814 815 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e) 816 { 817 minKinEnergy = e; 818 } 819 820 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 821 822 inline G4double G4VEnergyLossProcess::MinKinEnergy() const 823 { 824 return minKinEnergy; 825 } 826 827 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 828 829 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e) 830 { 831 maxKinEnergy = e; 832 if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e; 833 } 834 835 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 836 837 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const 838 { 839 return maxKinEnergy; 840 } 841 842 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 843 844 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e) 845 { 846 maxKinEnergyCSDA = e; 533 inline void G4VEnergyLossProcess::DefineMaterial( 534 const G4MaterialCutsCouple* couple) 535 { 536 if(couple != currentCouple) { 537 currentCouple = couple; 538 currentMaterial = couple->GetMaterial(); 539 currentMaterialIndex = couple->GetIndex(); 540 mfpKinEnergy = DBL_MAX; 541 } 847 542 } 848 543 … … 863 558 DefineMaterial(couple); 864 559 return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio); 560 } 561 562 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 563 564 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e) 565 { 566 G4bool b; 567 G4double x = 568 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 569 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 570 return x; 571 } 572 573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 574 575 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e) 576 { 577 G4bool b; 578 G4double x = 579 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 580 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 581 return x; 582 } 583 584 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 585 586 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e) 587 { 588 G4bool b; 589 G4double x = 0.0; 590 // if(theIonisationTable) { 591 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b)) 592 *chargeSqRatio; 593 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 594 //} 595 return x; 596 } 597 598 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 599 600 inline 601 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e) 602 { 603 G4bool b; 604 G4double x = 0.0; 605 //if(theIonisationSubTable) { 606 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b)) 607 *chargeSqRatio; 608 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 609 //} 610 return x; 865 611 } 866 612 … … 897 643 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 898 644 899 inline G4double G4VEnergyLossProcess::GetRangeForLoss(900 G4double& kineticEnergy,901 const G4MaterialCutsCouple* couple)902 {903 DefineMaterial(couple);904 G4double x = DBL_MAX;905 if(theRangeTableForLoss)906 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;907 // G4cout << "Range from " << GetProcessName()908 // << " e= " << kineticEnergy << " r= " << x << G4endl;909 return x;910 }911 912 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....913 914 inline G4double G4VEnergyLossProcess::GetKineticEnergy(915 G4double& range,916 const G4MaterialCutsCouple* couple)917 {918 DefineMaterial(couple);919 G4double r = range/reduceFactor;920 G4double e = ScaledKinEnergyForLoss(r)/massRatio;921 return e;922 }923 924 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....925 926 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,927 const G4MaterialCutsCouple* couple)928 {929 DefineMaterial(couple);930 G4double x = 0.0;931 if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);932 return x;933 }934 935 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....936 937 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const938 {939 return tablesAreBuilt;940 }941 942 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....943 944 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const945 {946 return theDEDXTable;947 }948 949 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....950 951 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const952 {953 return theDEDXSubTable;954 }955 956 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....957 958 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const959 {960 return theDEDXunRestrictedTable;961 }962 963 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....964 965 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const966 {967 G4PhysicsTable* t = theDEDXTable;968 if(theIonisationTable) t = theIonisationTable;969 return t;970 }971 972 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....973 974 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const975 {976 G4PhysicsTable* t = theDEDXSubTable;977 if(theIonisationSubTable) t = theIonisationSubTable;978 return t;979 }980 981 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....982 983 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const984 {985 return theCSDARangeTable;986 }987 988 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....989 990 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const991 {992 return theRangeTableForLoss;993 }994 995 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....996 997 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const998 {999 return theInverseRangeTable;1000 }1001 1002 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1003 1004 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()1005 {1006 return theLambdaTable;1007 }1008 1009 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1010 1011 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()1012 {1013 return theSubLambdaTable;1014 }1015 1016 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1017 1018 inline G4double G4VEnergyLossProcess::SampleRange()1019 {1020 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();1021 G4bool b;1022 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));1023 G4double x = fRange + G4RandGauss::shoot(0.0,s);1024 if(x > 0.0) fRange = x;1025 return fRange;1026 }1027 1028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1029 1030 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,1031 G4double charge2ratio)1032 {1033 massRatio = massratio;1034 chargeSqRatio = charge2ratio;1035 reduceFactor = 1.0/(chargeSqRatio*massRatio);1036 }1037 1038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1039 1040 inline void G4VEnergyLossProcess::DefineMaterial(1041 const G4MaterialCutsCouple* couple)1042 {1043 if(couple != currentCouple) {1044 currentCouple = couple;1045 currentMaterial = couple->GetMaterial();1046 currentMaterialIndex = couple->GetIndex();1047 mfpKinEnergy = DBL_MAX;1048 }1049 }1050 1051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1052 1053 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)1054 {1055 G4bool b;1056 G4double x =1057 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;1058 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);1059 return x;1060 }1061 1062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1063 1064 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)1065 {1066 G4bool b;1067 G4double x =1068 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;1069 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);1070 return x;1071 }1072 1073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1074 1075 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)1076 {1077 G4bool b;1078 G4double x = 0.0;1079 // if(theIonisationTable) {1080 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))1081 *chargeSqRatio;1082 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);1083 //}1084 return x;1085 }1086 1087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1088 1089 inline1090 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)1091 {1092 G4bool b;1093 G4double x = 0.0;1094 //if(theIonisationSubTable) {1095 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))1096 *chargeSqRatio;1097 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);1098 //}1099 return x;1100 }1101 1102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1103 1104 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)1105 {1106 G4bool b;1107 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);1108 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);1109 return x;1110 }1111 1112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1113 1114 645 inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy( 1115 646 G4double e) … … 1126 657 } 1127 658 return x; 659 } 660 661 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 662 663 inline G4double G4VEnergyLossProcess::GetRangeForLoss( 664 G4double& kineticEnergy, 665 const G4MaterialCutsCouple* couple) 666 { 667 DefineMaterial(couple); 668 G4double x = DBL_MAX; 669 if(theRangeTableForLoss) 670 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor; 671 // G4cout << "Range from " << GetProcessName() 672 // << " e= " << kineticEnergy << " r= " << x << G4endl; 673 return x; 674 } 675 676 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 677 678 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e) 679 { 680 G4bool b; 681 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b); 682 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 683 return x; 684 } 685 686 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 687 688 inline G4double G4VEnergyLossProcess::GetKineticEnergy( 689 G4double& range, 690 const G4MaterialCutsCouple* couple) 691 { 692 DefineMaterial(couple); 693 G4double r = range/reduceFactor; 694 G4double e = ScaledKinEnergyForLoss(r)/massRatio; 695 return e; 1128 696 } 1129 697 … … 1143 711 } 1144 712 return e; 713 } 714 715 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 716 717 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy, 718 const G4MaterialCutsCouple* couple) 719 { 720 DefineMaterial(couple); 721 G4double x = 0.0; 722 if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); 723 return x; 1145 724 } 1146 725 … … 1179 758 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1180 759 760 inline G4double G4VEnergyLossProcess::ContinuousStepLimit( 761 const G4Track& track, G4double x, G4double y, G4double& z) 762 { 763 G4GPILSelection sel; 764 return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel); 765 } 766 767 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 768 769 inline G4double G4VEnergyLossProcess::SampleRange() 770 { 771 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass(); 772 G4bool b; 773 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b)); 774 G4double x = fRange + G4RandGauss::shoot(0.0,s); 775 if(x > 0.0) fRange = x; 776 return fRange; 777 } 778 779 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 780 781 inline G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track) 782 { 783 DefineMaterial(track.GetMaterialCutsCouple()); 784 preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio); 785 G4double x = DBL_MAX; 786 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda; 787 return x; 788 } 789 790 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 791 792 inline G4double G4VEnergyLossProcess::MinPrimaryEnergy( 793 const G4ParticleDefinition*, const G4Material*, G4double cut) 794 { 795 return cut; 796 } 797 798 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 799 800 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy) 801 { 802 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 803 } 804 805 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 806 807 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial( 808 G4double kinEnergy, size_t& idx) const 809 { 810 return modelManager->SelectModel(kinEnergy, idx); 811 } 812 813 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 814 815 inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange() 816 { 817 return &fParticleChange; 818 } 819 820 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 821 822 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const 823 { 824 return particle; 825 } 826 827 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 828 829 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const 830 { 831 return baseParticle; 832 } 833 834 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 835 836 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const 837 { 838 return secondaryParticle; 839 } 840 841 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 842 843 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const 844 { 845 return theDEDXTable; 846 } 847 848 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 849 850 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const 851 { 852 return theDEDXSubTable; 853 } 854 855 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 856 857 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const 858 { 859 return theDEDXunRestrictedTable; 860 } 861 862 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 863 864 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const 865 { 866 G4PhysicsTable* t = theDEDXTable; 867 if(theIonisationTable) t = theIonisationTable; 868 return t; 869 } 870 871 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 872 873 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const 874 { 875 G4PhysicsTable* t = theDEDXSubTable; 876 if(theIonisationSubTable) t = theIonisationSubTable; 877 return t; 878 } 879 880 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 881 882 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const 883 { 884 return theCSDARangeTable; 885 } 886 887 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 888 889 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const 890 { 891 return theRangeTableForLoss; 892 } 893 894 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 895 896 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const 897 { 898 return theInverseRangeTable; 899 } 900 901 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 902 903 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable() 904 { 905 return theLambdaTable; 906 } 907 908 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 909 910 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable() 911 { 912 return theSubLambdaTable; 913 } 914 915 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 916 917 inline G4bool G4VEnergyLossProcess::IsIntegral() const 918 { 919 return integral; 920 } 921 922 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 923 924 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 925 { 926 return currentMaterialIndex; 927 } 928 929 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 930 931 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio, 932 G4double charge2ratio) 933 { 934 massRatio = massratio; 935 chargeSqRatio = charge2ratio; 936 reduceFactor = 1.0/(chargeSqRatio*massRatio); 937 } 938 939 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 940 941 inline G4double G4VEnergyLossProcess::GetCurrentRange() const 942 { 943 return fRange; 944 } 945 946 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 947 948 inline 949 void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, 950 G4VEmFluctuationModel* fluc, 951 const G4Region* region) 952 { 953 modelManager->AddEmModel(order, p, fluc, region); 954 if(p) p->SetParticleChange(pParticleChange, fluc); 955 } 956 957 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 958 959 inline 960 G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver) 961 { 962 return modelManager->GetModel(idx, ver); 963 } 964 965 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 966 967 inline G4int G4VEnergyLossProcess::NumberOfModels() 968 { 969 return modelManager->NumberOfModels(); 970 } 971 972 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 973 974 inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index) 975 { 976 G4int n = emModels.size(); 977 if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);} 978 emModels[index] = p; 979 } 980 981 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 982 983 inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index) 984 { 985 G4VEmModel* p = 0; 986 if(index >= 0 && index < G4int(emModels.size())) p = emModels[index]; 987 return p; 988 } 989 990 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 991 992 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p) 993 { 994 fluctModel = p; 995 } 996 997 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 998 999 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel() 1000 { 1001 return fluctModel; 1002 } 1003 1004 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1005 1006 inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, 1007 G4double emin, G4double emax) 1008 { 1009 modelManager->UpdateEmModel(nam, emin, emax); 1010 } 1011 1012 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1013 1014 inline void G4VEnergyLossProcess::SetIntegral(G4bool val) 1015 { 1016 integral = val; 1017 } 1018 1019 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1020 1021 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p) 1022 { 1023 particle = p; 1024 } 1025 1026 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1027 1028 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p) 1029 { 1030 baseParticle = p; 1031 } 1032 1033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1034 1035 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 1036 { 1037 secondaryParticle = p; 1038 } 1039 1040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1041 1042 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val) 1043 { 1044 linLossLimit = val; 1045 } 1046 1047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1048 1049 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val) 1050 { 1051 lossFluctuationFlag = val; 1052 } 1053 1054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1055 1056 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val) 1057 { 1058 rndmStepFlag = val; 1059 } 1060 1061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1062 1063 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val) 1064 { 1065 minSubRange = val; 1066 } 1067 1068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1069 1070 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const 1071 { 1072 return tablesAreBuilt; 1073 } 1074 1075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1076 1077 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 1078 { 1079 return nSCoffRegions; 1080 } 1081 1082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1083 1084 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins) 1085 { 1086 nBins = nbins; 1087 } 1088 1089 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1090 1091 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins) 1092 { 1093 nBins = nbins; 1094 } 1095 1096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1097 1098 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins) 1099 { 1100 nBinsCSDA = nbins; 1101 } 1102 1103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1104 1105 inline G4double G4VEnergyLossProcess::MinKinEnergy() const 1106 { 1107 return minKinEnergy; 1108 } 1109 1110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1111 1112 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e) 1113 { 1114 minKinEnergy = e; 1115 } 1116 1117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1118 1119 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e) 1120 { 1121 maxKinEnergy = e; 1122 if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e; 1123 } 1124 1125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1126 1127 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e) 1128 { 1129 maxKinEnergyCSDA = e; 1130 } 1131 1132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1133 1134 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const 1135 { 1136 return maxKinEnergy; 1137 } 1138 1139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1140 1141 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val) 1142 { 1143 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 1144 } 1145 1146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1147 1148 inline void G4VEnergyLossProcess::SetIonisation(G4bool val) 1149 { 1150 isIonisation = val; 1151 if(val) aGPILSelection = CandidateForSelection; 1152 else aGPILSelection = NotCandidateForSelection; 1153 } 1154 1155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1156 1157 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const 1158 { 1159 return isIonisation; 1160 } 1161 1162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1163 1164 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2) 1165 { 1166 dRoverRange = v1; 1167 finalRange = v2; 1168 if (dRoverRange > 0.999) dRoverRange = 1.0; 1169 currentCouple = 0; 1170 mfpKinEnergy = DBL_MAX; 1171 } 1172 1173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1174 1181 1175 #endif
Note: See TracChangeset
for help on using the changeset viewer.