- Timestamp:
- Apr 20, 2009, 5:54:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh
r1005 r1007 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmModel.hh,v 1. 66 2009/02/19 09:57:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 -ref-02$26 // $Id: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 65 65 // 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio, 66 66 // CorrectionsAlongStep, ActivateNuclearStopping (VI) 67 // 16-02-09 Move implementations of virtual methods to source (VI)68 67 // 69 68 // Class Description: … … 121 120 //------------------------------------------------------------------------ 122 121 122 // dEdx per unit length 123 virtual G4double ComputeDEDX(const G4MaterialCutsCouple*, 124 const G4ParticleDefinition*, 125 G4double kineticEnergy, 126 G4double cutEnergy = DBL_MAX); 127 123 128 // main method to compute dEdx 124 129 virtual G4double ComputeDEDXPerVolume(const G4Material*, … … 126 131 G4double kineticEnergy, 127 132 G4double cutEnergy = DBL_MAX); 133 134 // cross section per volume 135 virtual G4double CrossSection(const G4MaterialCutsCouple*, 136 const G4ParticleDefinition*, 137 G4double kineticEnergy, 138 G4double cutEnergy = 0.0, 139 G4double maxEnergy = DBL_MAX); 128 140 129 141 // main method to compute cross section per Volume … … 163 175 G4double length); 164 176 165 // sample PIXE deexcitation166 virtual void SampleDeexcitationAlongStep(const G4Material*,167 const G4Track&,168 G4double& eloss);169 170 177 protected: 171 178 … … 205 212 const G4DataVector&); 206 213 207 // dEdx per unit length208 inline G4double ComputeDEDX(const G4MaterialCutsCouple*,209 const G4ParticleDefinition*,210 G4double kineticEnergy,211 G4double cutEnergy = DBL_MAX);212 213 // cross section per volume214 inline G4double CrossSection(const G4MaterialCutsCouple*,215 const G4ParticleDefinition*,216 G4double kineticEnergy,217 G4double cutEnergy = 0.0,218 G4double maxEnergy = DBL_MAX);219 220 214 // compute mean free path via cross section per volume 221 inlineG4double ComputeMeanFreePath(const G4ParticleDefinition*,222 223 224 225 215 G4double ComputeMeanFreePath(const G4ParticleDefinition*, 216 G4double kineticEnergy, 217 const G4Material*, 218 G4double cutEnergy = 0.0, 219 G4double maxEnergy = DBL_MAX); 226 220 227 221 // generic cross section per element … … 239 233 G4double maxEnergy = DBL_MAX); 240 234 241 // to select atom cross section per volume is recomputed for each element 235 // this method can be used only in the case if generic method to compute 236 // cross section per volume is used and not overwritten in derived class 242 237 inline const G4Element* SelectRandomAtom(const G4Material*, 243 238 const G4ParticleDefinition*, … … 265 260 inline G4bool LPMFlag() const; 266 261 267 inline G4bool DeexcitationFlag() const;268 269 262 inline void SetHighEnergyLimit(G4double); 270 263 … … 277 270 inline void SetLPMFlag(G4bool val); 278 271 279 inline void SetDeexcitationFlag(G4bool val);280 281 272 inline void ActivateNuclearStopping(G4bool); 282 273 … … 287 278 inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*); 288 279 289 inline void SetCurrentCouple(const G4MaterialCutsCouple*);290 291 280 protected: 292 281 293 inline const G4 MaterialCutsCouple* CurrentCouple() const;282 inline const G4Element* GetCurrentElement() const; 294 283 295 284 inline void SetCurrentElement(const G4Element*); 296 297 inline const G4Element* GetCurrentElement() const;298 285 299 286 private: … … 328 315 private: 329 316 330 const G4MaterialCutsCouple* currentCouple; 331 const G4Element* currentElement; 332 317 const G4Element* currentElement; 333 318 G4int nsec; 334 G4bool flagDeexcitation;335 319 std::vector<G4double> xsec; 336 320 … … 340 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 341 325 342 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c, 343 const G4ParticleDefinition* p, 344 G4double kinEnergy, 345 G4double cutEnergy) 346 { 347 currentCouple = c; 348 return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy); 349 } 350 351 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 352 353 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c, 354 const G4ParticleDefinition* p, 355 G4double kinEnergy, 356 G4double cutEnergy, 357 G4double maxEnergy) 358 { 359 currentCouple = c; 360 return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy); 361 } 362 363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 364 365 inline G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p, 366 G4double ekin, 367 const G4Material* material, 368 G4double emin, 369 G4double emax) 370 { 371 G4double mfp = DBL_MAX; 372 G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax); 373 if (cross > DBL_MIN) mfp = 1./cross; 374 return mfp; 326 inline G4double G4VEmModel::HighEnergyLimit() const 327 { 328 return highLimit; 329 } 330 331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 332 333 inline G4double G4VEmModel::LowEnergyLimit() const 334 { 335 return lowLimit; 336 } 337 338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 339 340 inline G4double G4VEmModel::PolarAngleLimit() const 341 { 342 return polarAngleLimit; 343 } 344 345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 346 347 inline G4double G4VEmModel::SecondaryThreshold() const 348 { 349 return secondaryThreshold; 350 } 351 352 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 353 354 inline G4bool G4VEmModel::LPMFlag() const 355 { 356 return theLPMflag; 357 } 358 359 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 360 361 inline void G4VEmModel::SetHighEnergyLimit(G4double val) 362 { 363 highLimit = val; 364 } 365 366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 367 368 inline void G4VEmModel::SetLowEnergyLimit(G4double val) 369 { 370 lowLimit = val; 371 } 372 373 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 374 375 inline void G4VEmModel::SetPolarAngleLimit(G4double val) 376 { 377 polarAngleLimit = val; 378 } 379 380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 381 382 inline void G4VEmModel::SetSecondaryThreshold(G4double val) 383 { 384 secondaryThreshold = val; 385 } 386 387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 388 389 inline void G4VEmModel::SetLPMFlag(G4bool val) 390 { 391 theLPMflag = val; 392 } 393 394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 395 396 inline void G4VEmModel::ActivateNuclearStopping(G4bool val) 397 { 398 nuclearStopping = val; 375 399 } 376 400 … … 391 415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 392 416 417 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 418 G4VEmFluctuationModel* f = 0) 419 { 420 if(p && pParticleChange != p) pParticleChange = p; 421 fluc = f; 422 } 423 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 425 426 427 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations() 428 { 429 return fluc; 430 } 431 432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 433 434 inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*, 435 const G4MaterialCutsCouple*) 436 { 437 return 0.0; 438 } 439 440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 441 442 inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p, 443 const G4Material*, G4double) 444 { 445 G4double q = p->GetPDGCharge()/CLHEP::eplus; 446 return q*q; 447 } 448 449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 450 451 inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p, 452 const G4Material*, G4double) 453 { 454 return p->GetPDGCharge(); 455 } 456 457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 458 459 inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*, 460 const G4DynamicParticle*, 461 G4double&,G4double&,G4double) 462 {} 463 464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 465 466 inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*, 467 const G4ParticleDefinition*, 468 G4double,G4double) 469 { 470 return 0.0; 471 } 472 473 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 474 475 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c, 476 const G4ParticleDefinition* p, 477 G4double kinEnergy, 478 G4double cutEnergy) 479 { 480 return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy); 481 } 482 483 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 484 485 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c, 486 const G4ParticleDefinition* p, 487 G4double kinEnergy, 488 G4double cutEnergy, 489 G4double maxEnergy) 490 { 491 return CrossSectionPerVolume(c->GetMaterial(),p, 492 kinEnergy,cutEnergy,maxEnergy); 493 } 494 495 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 496 497 inline G4double G4VEmModel::ComputeCrossSectionPerAtom( 498 const G4ParticleDefinition*, 499 G4double, G4double, G4double, 500 G4double, G4double) 501 { 502 return 0.0; 503 } 504 505 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 506 393 507 inline 394 508 const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple, … … 398 512 G4double maxEnergy) 399 513 { 400 currentCouple = couple;401 514 if(nSelectors > 0) { 402 515 currentElement = … … 458 571 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 459 572 460 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations() 461 { 462 return fluc; 463 } 464 465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 466 467 inline G4double G4VEmModel::HighEnergyLimit() const 468 { 469 return highLimit; 470 } 471 472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 473 474 inline G4double G4VEmModel::LowEnergyLimit() const 475 { 476 return lowLimit; 477 } 478 479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 480 481 inline G4double G4VEmModel::PolarAngleLimit() const 482 { 483 return polarAngleLimit; 484 } 485 486 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 487 488 inline G4double G4VEmModel::SecondaryThreshold() const 489 { 490 return secondaryThreshold; 491 } 492 493 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 494 495 inline G4bool G4VEmModel::LPMFlag() const 496 { 497 return theLPMflag; 498 } 499 500 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 501 502 inline G4bool G4VEmModel::DeexcitationFlag() const 503 { 504 return flagDeexcitation; 505 } 506 507 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 508 509 inline void G4VEmModel::SetHighEnergyLimit(G4double val) 510 { 511 highLimit = val; 512 } 513 514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 515 516 inline void G4VEmModel::SetLowEnergyLimit(G4double val) 517 { 518 lowLimit = val; 519 } 520 521 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 522 523 inline void G4VEmModel::SetPolarAngleLimit(G4double val) 524 { 525 polarAngleLimit = val; 526 } 527 528 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 529 530 inline void G4VEmModel::SetSecondaryThreshold(G4double val) 531 { 532 secondaryThreshold = val; 533 } 534 535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 536 537 inline void G4VEmModel::SetLPMFlag(G4bool val) 538 { 539 theLPMflag = val; 540 } 541 542 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 543 544 inline void G4VEmModel::SetDeexcitationFlag(G4bool val) 545 { 546 flagDeexcitation = val; 547 } 548 549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 550 551 inline void G4VEmModel::ActivateNuclearStopping(G4bool val) 552 { 553 nuclearStopping = val; 573 inline const G4Element* G4VEmModel::GetCurrentElement() const 574 { 575 return currentElement; 576 } 577 578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 579 580 inline void G4VEmModel::SetCurrentElement(const G4Element* elm) 581 { 582 currentElement = elm; 554 583 } 555 584 … … 565 594 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 566 595 596 inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 597 G4double kineticEnergy) 598 { 599 return kineticEnergy; 600 } 601 602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 603 567 604 inline const G4String& G4VEmModel::GetName() const 568 605 { … … 571 608 572 609 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 573 574 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p, 575 G4VEmFluctuationModel* f = 0) 576 { 577 if(p && pParticleChange != p) pParticleChange = p; 578 fluc = f; 579 } 580 581 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 582 583 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p) 584 { 585 currentCouple = p; 586 } 587 588 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 589 590 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const 591 { 592 return currentCouple; 593 } 594 595 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 596 597 inline void G4VEmModel::SetCurrentElement(const G4Element* elm) 598 { 599 currentElement = elm; 600 } 601 602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 603 604 inline const G4Element* G4VEmModel::GetCurrentElement() const 605 { 606 return currentElement; 607 } 610 // Methods for msc simulation 611 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 612 613 inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double) 614 {} 615 616 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 617 618 inline G4double G4VEmModel::ComputeTruePathLengthLimit( 619 const G4Track&, 620 G4PhysicsTable*, 621 G4double) 622 { 623 return DBL_MAX; 624 } 625 626 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 627 628 inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength) 629 { 630 return truePathLength; 631 } 632 633 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 634 635 inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength) 636 { 637 return geomPathLength; 638 } 639 640 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 641 642 inline void G4VEmModel::DefineForRegion(const G4Region*) 643 {} 644 645 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 646 647 inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*, 648 const G4Material*, G4double) 649 {} 608 650 609 651 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracChangeset
for help on using the changeset viewer.