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