- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MuPairProductionModel.cc,v 1.4 1 2009/04/12 17:19:01vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4MuPairProductionModel.cc,v 1.44 2009/08/11 16:50:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 389 389 390 390 SetCurrentElement(Z); 391 G4double tmax = std::min(maxEnergy, kineticEnergy); 392 G4double cut = std::min(cutEnergy, kineticEnergy); 393 if(cut < minPairEnergy) cut = minPairEnergy; 391 392 G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy); 393 G4double tmax = std::min(maxEnergy, maxPairEnergy); 394 G4double cut = std::max(cutEnergy, minPairEnergy); 394 395 if (cut >= tmax) return cross; 395 396 … … 457 458 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 458 459 459 void G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 460 const G4MaterialCutsCouple* couple, 461 const G4DynamicParticle* aDynamicParticle, 462 G4double tmin, 463 G4double tmax) 460 void 461 G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 462 const G4MaterialCutsCouple* couple, 463 const G4DynamicParticle* aDynamicParticle, 464 G4double tmin, 465 G4double tmax) 464 466 { 465 467 G4double kineticEnergy = aDynamicParticle->GetKineticEnergy(); … … 611 613 612 614 G4double sum = 0.0; 615 G4double dl; 613 616 614 617 size_t i; … … 618 621 G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy); 619 622 G4double minEnergy = std::max(tmin, minPairEnergy); 620 621 G4int iz; 622 for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;} 623 if(iz == nzdat) iz--; 624 G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]); 625 626 G4double sigcut; 627 if(minEnergy <= minPairEnergy) 628 sigcut = 0.; 629 else 630 { 631 G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy); 632 G4int iy = (G4int)((log(xc) - ymin)/dy); 633 if(iy < 0) iy = 0; 634 if(iy >= nbiny) iy = nbiny-1; 635 sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy, Z); 623 dl = 0.0; 624 if(minEnergy < maxPairEnergy) { 625 626 G4int iz; 627 for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;} 628 if(iz == nzdat) iz--; 629 G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]); 630 631 G4double sigcut; 632 if(minEnergy <= minPairEnergy) 633 sigcut = 0.; 634 else 635 { 636 G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy); 637 G4int iy = (G4int)((log(xc) - ymin)/dy); 638 if(iy < 0) iy = 0; 639 if(iy >= nbiny) iy = nbiny-1; 640 sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy, Z); 641 } 642 643 G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z); 644 dl = (sigtot - sigcut)*theAtomNumDensityVector[i]; 636 645 } 637 638 G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);639 G4double dl = (sigtot - sigcut)*theAtomNumDensityVector[i];640 641 646 // protection 642 647 if(dl < 0.0) dl = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.