- Timestamp:
- May 28, 2009, 4:26:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEnergyLossProcess.hh,v 1.8 3 2008/09/12 16:19:01vnivanch Exp $26 // $Id: G4VEnergyLossProcess.hh,v 1.87 2009/04/07 18:39:47 vnivanch Exp $ 27 27 // GEANT4 tag $Name: 28 28 // … … 126 126 virtual ~G4VEnergyLossProcess(); 127 127 128 private: 129 // clean vectors and arrays 130 void Clean(); 131 128 132 //------------------------------------------------------------------------ 129 133 // Virtual methods to be implemented in concrete processes 130 134 //------------------------------------------------------------------------ 131 135 136 public: 132 137 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; 133 138 … … 143 148 //------------------------------------------------------------------------ 144 149 145 protected:146 147 150 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 148 151 const G4Material*, G4double cut); 149 152 150 153 //------------------------------------------------------------------------ 151 // Virtual methods common to all EM ContinuousDiscrete processes152 // Further inheritance is not assumed154 // Virtual methods implementation common to all EM ContinuousDiscrete 155 // processes. Further inheritance is not assumed 153 156 //------------------------------------------------------------------------ 154 157 155 158 public: 156 159 160 // prepare all tables 161 void PreparePhysicsTable(const G4ParticleDefinition&); 162 163 // build all tables 164 void BuildPhysicsTable(const G4ParticleDefinition&); 165 166 // build a table 167 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted); 168 169 // build a table 170 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted); 171 172 // summary printout after initialisation 157 173 void PrintInfoDefinition(); 158 174 159 void PreparePhysicsTable(const G4ParticleDefinition&); 160 161 void BuildPhysicsTable(const G4ParticleDefinition&); 162 175 // Add subcutoff option for the region 176 void ActivateSubCutoff(G4bool val, const G4Region* region = 0); 177 178 // Activate deexcitation code for region 179 void ActivateDeexcitation(G4bool, const G4Region* region = 0); 180 181 // Step limit from AlongStep 163 182 G4double AlongStepGetPhysicalInteractionLength(const G4Track&, 164 183 G4double previousStepSize, … … 167 186 G4GPILSelection* selection); 168 187 188 // Step limit from cross section 169 189 G4double PostStepGetPhysicalInteractionLength(const G4Track& track, 170 190 G4double previousStepSize, 171 191 G4ForceCondition* condition); 172 192 193 // AlongStep computations 173 194 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); 174 195 196 // Sampling of secondaries in vicinity of geometrical boundary 197 void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 198 G4VEmModel* model, G4int matIdx, 199 G4double& extraEdep); 200 201 // PostStep sampling of secondaries 175 202 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 176 203 177 // Store PhysicsTable in a file.178 // Return false in case of failure at I/O204 // Store all PhysicsTable in files. 205 // Return false in case of any fatal failure at I/O 179 206 G4bool StorePhysicsTable(const G4ParticleDefinition*, 180 207 const G4String& directory, 181 208 G4bool ascii = false); 182 209 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. 210 // Retrieve all Physics from a files. 211 // Return true if all the Physics Table are built. 212 // Return false if any fatal failure. 188 213 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 189 214 const G4String& directory, 190 215 G4bool ascii); 191 216 217 private: 218 // store a table 219 G4bool StoreTable(const G4ParticleDefinition* p, 220 G4PhysicsTable*, G4bool ascii, 221 const G4String& directory, 222 const G4String& tname); 223 224 // retrieve a table 225 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 fluctuations 233 // These methods are not used in run time 234 //------------------------------------------------------------------------ 235 236 public: 237 // access to dispersion of restricted energy loss 238 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, 239 const G4DynamicParticle* dp, 240 G4double length); 241 242 // Access to cross section table 243 G4double CrossSectionPerVolume(G4double kineticEnergy, 244 const G4MaterialCutsCouple* couple); 245 246 // access to cross section 247 G4double MeanFreePath(const G4Track& track); 248 249 // access to step limit 250 G4double ContinuousStepLimit(const G4Track& track, 251 G4double previousStepSize, 252 G4double currentMinimumStep, 253 G4double& currentSafety); 254 192 255 protected: 193 256 257 // implementation of the pure virtual method 194 258 G4double GetMeanFreePath(const G4Track& track, 195 259 G4double previousStepSize, 196 260 G4ForceCondition* condition); 197 261 262 // implementation of the pure virtual method 198 263 G4double GetContinuousStepLimit(const G4Track& track, 199 264 G4double previousStepSize, … … 202 267 203 268 //------------------------------------------------------------------------ 204 // Specific methods for along/post step EM processes 205 //------------------------------------------------------------------------ 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 size_t CurrentMaterialCutsCoupleIndex() const; 277 278 inline G4double GetCurrentRange() const; 279 280 //------------------------------------------------------------------------ 281 // Specific methods to set, access, modify models 282 //------------------------------------------------------------------------ 283 284 // Select model in run time 285 inline void SelectModel(G4double kinEnergy); 206 286 207 287 public: 208 288 // Select model by energy and region index 289 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 290 size_t& idx) const; 291 292 // Add EM model coupled with fluctuation model for region, smaller value 293 // of order defines which pair of models will be selected for a given 294 // energy interval 295 void AddEmModel(G4int, G4VEmModel*, 296 G4VEmFluctuationModel* fluc = 0, 297 const G4Region* region = 0); 298 299 // Define new energy range for the model identified by the name 300 void UpdateEmModel(const G4String&, G4double, G4double); 301 302 // Assign a model to a process 303 void SetEmModel(G4VEmModel*, G4int index=1); 304 305 // return the assigned model 306 G4VEmModel* EmModel(G4int index=1); 307 308 // Access to models 309 G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false); 310 311 G4int NumberOfModels(); 312 313 // Assign a fluctuation model to a process 314 void SetFluctModel(G4VEmFluctuationModel*); 315 316 // return the assigned fluctuation model 317 inline G4VEmFluctuationModel* FluctModel(); 318 319 //------------------------------------------------------------------------ 320 // Define and access particle type 321 //------------------------------------------------------------------------ 322 323 protected: 324 inline void SetParticle(const G4ParticleDefinition* p); 325 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 326 327 public: 328 inline void SetBaseParticle(const G4ParticleDefinition* p); 329 inline const G4ParticleDefinition* Particle() const; 330 inline const G4ParticleDefinition* BaseParticle() const; 331 inline const G4ParticleDefinition* SecondaryParticle() const; 332 333 //------------------------------------------------------------------------ 334 // Get/set parameters to configure the process at initialisation time 335 //------------------------------------------------------------------------ 336 337 // Add subcutoff process (bremsstrahlung) to sample secondary 338 // particle production in vicinity of the geometry boundary 209 339 void AddCollaborativeProcess(G4VEnergyLossProcess*); 210 340 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); 341 inline void SetLossFluctuations(G4bool val); 342 inline void SetRandomStep(G4bool val); 343 344 inline void SetIntegral(G4bool val); 345 inline G4bool IsIntegral() const; 346 347 // Set/Get flag "isIonisation" 348 inline void SetIonisation(G4bool val); 349 inline G4bool IsIonisationProcess() const; 350 351 // Redefine parameteters for stepping control 352 // 353 inline void SetLinearLossLimit(G4double val); 354 inline void SetMinSubRange(G4double val); 355 inline void SetLambdaFactor(G4double val); 356 inline void SetStepFunction(G4double v1, G4double v2); 357 358 inline G4int NumberOfSubCutoffRegions() const; 359 inline G4int NumberOfDERegions() const; 360 361 //------------------------------------------------------------------------ 362 // Specific methods to path Physics Tables to the process 363 //------------------------------------------------------------------------ 226 364 227 365 void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType); 228 366 void SetCSDARangeTable(G4PhysicsTable* pRange); 229 367 void SetRangeTableForLoss(G4PhysicsTable* p); 368 void SetSecondaryRangeTable(G4PhysicsTable* p); 230 369 void SetInverseRangeTable(G4PhysicsTable* p); 231 void SetSecondaryRangeTable(G4PhysicsTable* p);232 370 233 371 void SetLambdaTable(G4PhysicsTable* p); … … 251 389 // Max kinetic energy for tables 252 390 inline void SetMaxKinEnergyForCSDARange(G4double e); 391 392 // Return values for given G4MaterialCutsCouple 393 inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*); 394 inline G4double GetDEDXForSubsec(G4double& kineticEnergy, 395 const G4MaterialCutsCouple*); 396 inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 397 inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*); 398 inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*); 399 inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*); 400 inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*); 401 402 inline G4bool TablesAreBuilt() const; 253 403 254 404 // Access to specific tables … … 264 414 inline G4PhysicsTable* SubLambdaTable(); 265 415 266 // Return values for given G4MaterialCutsCouple267 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 type280 //------------------------------------------------------------------------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 models289 //------------------------------------------------------------------------290 291 // Add EM model coupled with fluctuation model for the region292 inline void AddEmModel(G4int, G4VEmModel*,293 G4VEmFluctuationModel* fluc = 0,294 const G4Region* region = 0);295 296 // Assign a model to a process297 inline void SetEmModel(G4VEmModel*, G4int index=1);298 299 // return the assigned model300 inline G4VEmModel* EmModel(G4int index=1);301 302 // Assign a fluctuation model to a process303 inline void SetFluctModel(G4VEmFluctuationModel*);304 305 // return the assigned fluctuation model306 inline G4VEmFluctuationModel* FluctModel();307 308 // Define new energy range for the model identified by the name309 inline void UpdateEmModel(const G4String&, G4double, G4double);310 311 // Access to models312 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 loss318 //------------------------------------------------------------------------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 control330 //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 region338 void ActivateSubCutoff(G4bool val, const G4Region* region = 0);339 340 inline G4int NumberOfSubCutoffRegions() const;341 342 // Activate deexcitation code343 virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);344 345 //------------------------------------------------------------------------346 // Public interface to helper functions347 //------------------------------------------------------------------------348 349 inline350 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 359 416 //------------------------------------------------------------------------ 360 417 // Run time method for simulation of ionisation … … 367 424 inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio); 368 425 369 // Access to cross section table370 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 390 426 private: 391 392 //------------------------------------------------------------------------393 // Management of tables394 //------------------------------------------------------------------------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);408 427 409 428 // define material and indexes 410 429 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 411 430 412 // Returnd values for scaled energy using mass of the base particle 413 // 431 //------------------------------------------------------------------------ 432 // Compute values using scaling relation, mass and charge of based particle 433 //------------------------------------------------------------------------ 434 414 435 inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy); 415 436 inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy); … … 418 439 inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy); 419 440 inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy); 441 inline G4double ScaledKinEnergyForLoss(G4double range); 420 442 inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy); 421 inline G4double ScaledKinEnergyForLoss(G4double range);422 443 inline void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy); 423 444 424 445 // hide assignment operator 425 426 446 G4VEnergyLossProcess(G4VEnergyLossProcess &); 427 447 G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right); … … 444 464 G4VEmFluctuationModel* fluctModel; 445 465 std::vector<const G4Region*> scoffRegions; 466 std::vector<const G4Region*> deRegions; 446 467 G4int nSCoffRegions; 447 G4int* idxSCoffRegions; 468 G4int nDERegions; 469 G4bool* idxSCoffRegions; 470 G4bool* idxDERegions; 448 471 449 472 std::vector<G4VEnergyLossProcess*> scProcesses; … … 493 516 G4bool isIonisation; 494 517 G4bool useSubCutoff; 518 G4bool useDeexcitation; 495 519 496 520 protected: … … 531 555 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 532 556 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 } 557 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 558 { 559 return currentMaterialIndex; 560 } 561 562 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 563 564 inline G4double G4VEnergyLossProcess::GetCurrentRange() const 565 { 566 return fRange; 567 } 568 569 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 570 571 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy) 572 { 573 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 574 currentModel->SetCurrentCouple(currentCouple); 575 } 576 577 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 578 579 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial( 580 G4double kinEnergy, size_t& idx) const 581 { 582 return modelManager->SelectModel(kinEnergy, idx); 583 } 584 585 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 586 587 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p) 588 { 589 fluctModel = p; 590 } 591 592 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 593 594 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel() 595 { 596 return fluctModel; 597 } 598 599 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 600 601 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p) 602 { 603 particle = p; 604 } 605 606 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 607 608 inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 609 { 610 secondaryParticle = p; 611 } 612 613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 614 615 inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p) 616 { 617 baseParticle = p; 618 } 619 620 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 621 622 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const 623 { 624 return particle; 625 } 626 627 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 628 629 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const 630 { 631 return baseParticle; 632 } 633 634 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 635 636 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const 637 { 638 return secondaryParticle; 639 } 640 641 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 642 643 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val) 644 { 645 lossFluctuationFlag = val; 646 } 647 648 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 649 650 inline void G4VEnergyLossProcess::SetRandomStep(G4bool val) 651 { 652 rndmStepFlag = val; 653 } 654 655 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 656 657 inline void G4VEnergyLossProcess::SetIntegral(G4bool val) 658 { 659 integral = val; 660 } 661 662 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 663 664 inline G4bool G4VEnergyLossProcess::IsIntegral() const 665 { 666 return integral; 667 } 668 669 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 670 671 inline void G4VEnergyLossProcess::SetIonisation(G4bool val) 672 { 673 isIonisation = val; 674 if(val) aGPILSelection = CandidateForSelection; 675 else aGPILSelection = NotCandidateForSelection; 676 } 677 678 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 679 680 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const 681 { 682 return isIonisation; 683 } 684 685 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 686 687 inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val) 688 { 689 linLossLimit = val; 690 } 691 692 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 693 694 inline void G4VEnergyLossProcess::SetMinSubRange(G4double val) 695 { 696 minSubRange = val; 697 } 698 699 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 700 701 inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val) 702 { 703 if(val > 0.0 && val <= 1.0) lambdaFactor = val; 704 } 705 706 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 707 708 void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2) 709 { 710 dRoverRange = v1; 711 finalRange = v2; 712 if (dRoverRange > 0.999) dRoverRange = 1.0; 713 currentCouple = 0; 714 mfpKinEnergy = DBL_MAX; 715 } 716 717 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 718 719 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 720 { 721 return nSCoffRegions; 722 } 723 724 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 725 726 inline G4int G4VEnergyLossProcess::NumberOfDERegions() const 727 { 728 return nDERegions; 729 } 730 731 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 732 733 inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins) 734 { 735 nBins = nbins; 736 } 737 738 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 739 740 inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins) 741 { 742 nBins = nbins; 743 } 744 745 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 746 747 inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins) 748 { 749 nBinsCSDA = nbins; 750 } 751 752 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 753 754 inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e) 755 { 756 minKinEnergy = e; 757 } 758 759 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 760 761 inline G4double G4VEnergyLossProcess::MinKinEnergy() const 762 { 763 return minKinEnergy; 764 } 765 766 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 767 768 inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e) 769 { 770 maxKinEnergy = e; 771 if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e; 772 } 773 774 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 775 776 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const 777 { 778 return maxKinEnergy; 779 } 780 781 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 782 783 inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e) 784 { 785 maxKinEnergyCSDA = e; 542 786 } 543 787 … … 558 802 DefineMaterial(couple); 559 803 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 inline601 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;611 804 } 612 805 … … 643 836 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 644 837 838 inline G4double G4VEnergyLossProcess::GetRangeForLoss( 839 G4double& kineticEnergy, 840 const G4MaterialCutsCouple* couple) 841 { 842 DefineMaterial(couple); 843 G4double x = DBL_MAX; 844 if(theRangeTableForLoss) 845 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor; 846 // G4cout << "Range from " << GetProcessName() 847 // << " e= " << kineticEnergy << " r= " << x << G4endl; 848 return x; 849 } 850 851 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 852 853 inline G4double G4VEnergyLossProcess::GetKineticEnergy( 854 G4double& range, 855 const G4MaterialCutsCouple* couple) 856 { 857 DefineMaterial(couple); 858 G4double r = range/reduceFactor; 859 G4double e = ScaledKinEnergyForLoss(r)/massRatio; 860 return e; 861 } 862 863 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 864 865 inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy, 866 const G4MaterialCutsCouple* couple) 867 { 868 DefineMaterial(couple); 869 G4double x = 0.0; 870 if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); 871 return x; 872 } 873 874 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 875 876 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const 877 { 878 return tablesAreBuilt; 879 } 880 881 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 882 883 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const 884 { 885 return theDEDXTable; 886 } 887 888 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 889 890 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const 891 { 892 return theDEDXSubTable; 893 } 894 895 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 896 897 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const 898 { 899 return theDEDXunRestrictedTable; 900 } 901 902 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 903 904 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const 905 { 906 G4PhysicsTable* t = theDEDXTable; 907 if(theIonisationTable) t = theIonisationTable; 908 return t; 909 } 910 911 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 912 913 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const 914 { 915 G4PhysicsTable* t = theDEDXSubTable; 916 if(theIonisationSubTable) t = theIonisationSubTable; 917 return t; 918 } 919 920 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 921 922 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const 923 { 924 return theCSDARangeTable; 925 } 926 927 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 928 929 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const 930 { 931 return theRangeTableForLoss; 932 } 933 934 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 935 936 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const 937 { 938 return theInverseRangeTable; 939 } 940 941 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 942 943 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable() 944 { 945 return theLambdaTable; 946 } 947 948 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 949 950 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable() 951 { 952 return theSubLambdaTable; 953 } 954 955 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 956 957 inline G4double G4VEnergyLossProcess::SampleRange() 958 { 959 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass(); 960 G4bool b; 961 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b)); 962 G4double x = fRange + G4RandGauss::shoot(0.0,s); 963 if(x > 0.0) fRange = x; 964 return fRange; 965 } 966 967 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 968 969 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio, 970 G4double charge2ratio) 971 { 972 massRatio = massratio; 973 chargeSqRatio = charge2ratio; 974 reduceFactor = 1.0/(chargeSqRatio*massRatio); 975 } 976 977 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 978 979 inline void G4VEnergyLossProcess::DefineMaterial( 980 const G4MaterialCutsCouple* couple) 981 { 982 if(couple != currentCouple) { 983 currentCouple = couple; 984 currentMaterial = couple->GetMaterial(); 985 currentMaterialIndex = couple->GetIndex(); 986 mfpKinEnergy = DBL_MAX; 987 } 988 } 989 990 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 991 992 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e) 993 { 994 G4bool b; 995 G4double x = 996 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 997 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 998 return x; 999 } 1000 1001 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1002 1003 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e) 1004 { 1005 G4bool b; 1006 G4double x = 1007 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 1008 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1009 return x; 1010 } 1011 1012 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1013 1014 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e) 1015 { 1016 G4bool b; 1017 G4double x = 0.0; 1018 // if(theIonisationTable) { 1019 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b)) 1020 *chargeSqRatio; 1021 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1022 //} 1023 return x; 1024 } 1025 1026 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1027 1028 inline 1029 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e) 1030 { 1031 G4bool b; 1032 G4double x = 0.0; 1033 //if(theIonisationSubTable) { 1034 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b)) 1035 *chargeSqRatio; 1036 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1037 //} 1038 return x; 1039 } 1040 1041 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1042 1043 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e) 1044 { 1045 G4bool b; 1046 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b); 1047 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1048 return x; 1049 } 1050 1051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1052 645 1053 inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy( 646 1054 G4double e) … … 657 1065 } 658 1066 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;696 1067 } 697 1068 … … 711 1082 } 712 1083 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;724 1084 } 725 1085 … … 758 1118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 759 1119 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) const809 {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() const823 {824 return particle;825 }826 827 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....828 829 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const830 {831 return baseParticle;832 }833 834 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....835 836 inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const837 {838 return secondaryParticle;839 }840 841 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....842 843 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const844 {845 return theDEDXTable;846 }847 848 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....849 850 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const851 {852 return theDEDXSubTable;853 }854 855 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....856 857 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const858 {859 return theDEDXunRestrictedTable;860 }861 862 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....863 864 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const865 {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() const874 {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() const883 {884 return theCSDARangeTable;885 }886 887 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....888 889 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const890 {891 return theRangeTableForLoss;892 }893 894 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....895 896 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const897 {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() const918 {919 return integral;920 }921 922 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....923 924 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const925 {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() const942 {943 return fRange;944 }945 946 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....947 948 inline949 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 inline960 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() const1071 {1072 return tablesAreBuilt;1073 }1074 1075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....1076 1077 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const1078 {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() const1106 {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() const1135 {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() const1158 {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 1175 1120 #endif
Note: See TracChangeset
for help on using the changeset viewer.