- Timestamp:
- Apr 20, 2009, 5:54:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc
r1005 r1007 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 Class32 26 // File name: G4PAIPhotonModel.cc 33 27 // … … 223 217 ////////////////////////////////////////////////////////////////// 224 218 225 void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*)226 {}227 228 //////////////////////////////////////////////////////////////////229 230 219 void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof() 231 220 { … … 498 487 { 499 488 // if ( x1 == x2 ) 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 ; 489 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 502 490 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 503 491 } … … 542 530 { 543 531 // if ( x1 == x2 ) 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 ; 532 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 546 533 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 547 534 } … … 587 574 { 588 575 // if ( x1 == x2 ) 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 ; 576 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 591 577 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 592 578 } … … 631 617 { 632 618 // if ( x1 == x2 ) 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 ; 619 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 635 620 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 636 621 } … … 641 626 ////////////////////////////////////////////////////////////////////////////// 642 627 643 G4double G4PAIPhotonModel::ComputeDEDX PerVolume(const G4Material*,644 645 646 628 G4double G4PAIPhotonModel::ComputeDEDX(const G4MaterialCutsCouple* matCC, 629 const G4ParticleDefinition* p, 630 G4double kineticEnergy, 631 G4double cutEnergy) 647 632 { 648 633 G4int iTkin,iPlace; 649 634 size_t jMat; 650 651 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);652 G4double cut = cutEnergy;653 654 635 G4double particleMass = p->GetPDGMass(); 655 636 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 657 638 G4double charge2 = charge*charge; 658 639 G4double dEdx = 0.; 659 const G4MaterialCutsCouple* matCC = CurrentCouple();660 640 661 641 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 673 653 iPlace = iTkin - 1; 674 654 if(iPlace < 0) iPlace = 0; 675 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut ) ) ;655 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 676 656 677 657 if( dEdx < 0.) dEdx = 0.; … … 681 661 ///////////////////////////////////////////////////////////////////////// 682 662 683 G4double G4PAIPhotonModel::CrossSection PerVolume( const G4Material*,684 685 686 687 663 G4double G4PAIPhotonModel::CrossSection( const G4MaterialCutsCouple* matCC, 664 const G4ParticleDefinition* p, 665 G4double kineticEnergy, 666 G4double cutEnergy, 667 G4double maxEnergy ) 688 668 { 689 669 G4int iTkin,iPlace; 690 670 size_t jMat, jMatCC; 691 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 692 if(cutEnergy >= tmax) return 0.0; 671 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 693 672 G4double particleMass = p->GetPDGMass(); 694 673 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 696 675 G4double charge2 = charge*charge, cross, cross1, cross2; 697 676 G4double photon1, photon2, plasmon1, plasmon2; 698 699 const G4MaterialCutsCouple* matCC = CurrentCouple();700 677 701 678 const G4ProductionCutsTable* theCoupleTable= … … 1248 1225 } 1249 1226 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 1274 1227 1275 1228 //
Note: See TracChangeset
for help on using the changeset viewer.