Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc

    r1055 r1196  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MuPairProductionModel.cc,v 1.41 2009/04/12 17:19:01 vnivanch 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 $
    2828//
    2929// -------------------------------------------------------------------
     
    389389
    390390  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);
    394395  if (cut >= tmax) return cross;
    395396
     
    457458//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    458459
    459 void G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
    460                                                 const G4MaterialCutsCouple* couple,
    461                                                 const G4DynamicParticle* aDynamicParticle,
    462                                                 G4double tmin,
    463                                                 G4double tmax)
     460void
     461G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
     462                                           const G4MaterialCutsCouple* couple,
     463                                           const G4DynamicParticle* aDynamicParticle,
     464                                           G4double tmin,
     465                                           G4double tmax)
    464466{
    465467  G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
     
    611613
    612614  G4double sum = 0.0;
     615  G4double dl;
    613616
    614617  size_t i;
     
    618621    G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy);
    619622    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];
    636645    }
    637 
    638     G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);
    639     G4double dl = (sigtot - sigcut)*theAtomNumDensityVector[i];
    640 
    641646    // protection
    642647    if(dl < 0.0) dl = 0.0;
Note: See TracChangeset for help on using the changeset viewer.