- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIPhotonModel.cc,v 1.21 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class 26 32 // File name: G4PAIPhotonModel.cc 27 33 // … … 217 223 ////////////////////////////////////////////////////////////////// 218 224 225 void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*) 226 {} 227 228 ////////////////////////////////////////////////////////////////// 229 219 230 void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof() 220 231 { … … 487 498 { 488 499 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 489 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 500 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 501 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 490 502 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 491 503 } … … 530 542 { 531 543 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 532 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 544 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 545 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 533 546 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 534 547 } … … 574 587 { 575 588 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 576 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 589 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 590 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 577 591 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 578 592 } … … 617 631 { 618 632 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 619 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 633 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 634 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 620 635 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 621 636 } … … 626 641 ////////////////////////////////////////////////////////////////////////////// 627 642 628 G4double G4PAIPhotonModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,629 630 631 643 G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*, 644 const G4ParticleDefinition* p, 645 G4double kineticEnergy, 646 G4double cutEnergy) 632 647 { 633 648 G4int iTkin,iPlace; 634 649 size_t jMat; 650 651 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 652 G4double cut = cutEnergy; 653 635 654 G4double particleMass = p->GetPDGMass(); 636 655 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 638 657 G4double charge2 = charge*charge; 639 658 G4double dEdx = 0.; 659 const G4MaterialCutsCouple* matCC = CurrentCouple(); 640 660 641 661 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 653 673 iPlace = iTkin - 1; 654 674 if(iPlace < 0) iPlace = 0; 655 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut Energy) ) ;675 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 656 676 657 677 if( dEdx < 0.) dEdx = 0.; … … 661 681 ///////////////////////////////////////////////////////////////////////// 662 682 663 G4double G4PAIPhotonModel::CrossSection ( const G4MaterialCutsCouple* matCC,664 665 666 667 683 G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*, 684 const G4ParticleDefinition* p, 685 G4double kineticEnergy, 686 G4double cutEnergy, 687 G4double maxEnergy ) 668 688 { 669 689 G4int iTkin,iPlace; 670 690 size_t jMat, jMatCC; 671 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 691 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 692 if(cutEnergy >= tmax) return 0.0; 672 693 G4double particleMass = p->GetPDGMass(); 673 694 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 675 696 G4double charge2 = charge*charge, cross, cross1, cross2; 676 697 G4double photon1, photon2, plasmon1, plasmon2; 698 699 const G4MaterialCutsCouple* matCC = CurrentCouple(); 677 700 678 701 const G4ProductionCutsTable* theCoupleTable= … … 1225 1248 } 1226 1249 1250 ///////////////////////////////////////////////////////////////////// 1251 1252 G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 1253 G4double kinEnergy) 1254 { 1255 G4double tmax = kinEnergy; 1256 if(p == fElectron) tmax *= 0.5; 1257 else if(p != fPositron) { 1258 G4double mass = p->GetPDGMass(); 1259 G4double ratio= electron_mass_c2/mass; 1260 G4double gamma= kinEnergy/mass + 1.0; 1261 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 1262 (1. + 2.0*gamma*ratio + ratio*ratio); 1263 } 1264 return tmax; 1265 } 1266 1267 /////////////////////////////////////////////////////////////// 1268 1269 void G4PAIPhotonModel::DefineForRegion(const G4Region* r) 1270 { 1271 fPAIRegionVector.push_back(r); 1272 } 1273 1227 1274 1228 1275 //
Note: See TracChangeset
for help on using the changeset viewer.