- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIModel.cc,v 1.46 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: G4PAIModel.cc 27 33 // … … 177 183 fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial, 178 184 curReg->GetProductionCuts() ); 185 //G4cout << "Reg <" <<curReg->GetName() << "> mat <" 186 // << fMaterial->GetName() << "> fCouple= " 187 // << fCutCouple<<G4endl; 179 188 if( fCutCouple ) { 180 189 fMaterialCutsCoupleVector.push_back(fCutCouple); … … 197 206 } 198 207 } 208 209 ////////////////////////////////////////////////////////////////// 210 211 void G4PAIModel::InitialiseMe(const G4ParticleDefinition*) 212 {} 199 213 200 214 ////////////////////////////////////////////////////////////////// … … 393 407 { 394 408 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 395 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 409 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 410 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 396 411 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 397 412 } … … 435 450 { 436 451 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 437 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 452 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 453 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 438 454 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 439 455 } … … 444 460 ////////////////////////////////////////////////////////////////////////////// 445 461 446 G4double G4PAIModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,447 448 449 462 G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*, 463 const G4ParticleDefinition* p, 464 G4double kineticEnergy, 465 G4double cutEnergy) 450 466 { 451 467 G4int iTkin,iPlace; 452 468 size_t jMat; 469 470 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 471 G4double cut = cutEnergy; 472 453 473 G4double massRatio = fMass/p->GetPDGMass(); 454 474 G4double scaledTkin = kineticEnergy*massRatio; 455 475 G4double charge = p->GetPDGCharge(); 456 G4double charge2 = charge*charge, dEdx; 476 G4double charge2 = charge*charge; 477 const G4MaterialCutsCouple* matCC = CurrentCouple(); 457 478 458 479 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 470 491 iPlace = iTkin - 1; 471 492 if(iPlace < 0) iPlace = 0; 472 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 473 493 G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ); 474 494 if( dEdx < 0.) dEdx = 0.; 475 495 return dEdx; … … 478 498 ///////////////////////////////////////////////////////////////////////// 479 499 480 G4double G4PAIModel::CrossSection ( const G4MaterialCutsCouple* matCC,481 482 483 484 500 G4double G4PAIModel::CrossSectionPerVolume( const G4Material*, 501 const G4ParticleDefinition* p, 502 G4double kineticEnergy, 503 G4double cutEnergy, 504 G4double maxEnergy ) 485 505 { 486 506 G4int iTkin,iPlace; 487 507 size_t jMat; 488 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 508 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 509 if(tmax <= cutEnergy) return 0.0; 489 510 G4double massRatio = fMass/p->GetPDGMass(); 490 511 G4double scaledTkin = kineticEnergy*massRatio; 491 512 G4double charge = p->GetPDGCharge(); 492 513 G4double charge2 = charge*charge, cross, cross1, cross2; 514 const G4MaterialCutsCouple* matCC = CurrentCouple(); 493 515 494 516 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 935 957 } 936 958 959 ///////////////////////////////////////////////////////////////////// 960 961 G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 962 G4double kinEnergy) 963 { 964 G4double tmax = kinEnergy; 965 if(p == fElectron) tmax *= 0.5; 966 else if(p != fPositron) { 967 G4double mass = p->GetPDGMass(); 968 G4double ratio= electron_mass_c2/mass; 969 G4double gamma= kinEnergy/mass + 1.0; 970 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 971 (1. + 2.0*gamma*ratio + ratio*ratio); 972 } 973 return tmax; 974 } 975 976 /////////////////////////////////////////////////////////////// 977 978 void G4PAIModel::DefineForRegion(const G4Region* r) 979 { 980 fPAIRegionVector.push_back(r); 981 } 937 982 938 983 //
Note: See TracChangeset
for help on using the changeset viewer.