Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc

    r1228 r1340  
    3131
    3232#include "G4ProtonInelasticCrossSection.hh"
     33#include "G4HadTmpUtil.hh"
    3334#include "globals.hh"
    3435
     
    4647    G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
    4748    G4double* abundVector = anEle->GetRelativeAbundanceVector();
    48     G4double ZZ;
    49     G4double AA;
     49    G4int ZZ;
     50    G4int AA;
    5051 
    5152    for (G4int i = 0; i < nIso; i++) {
    52       ZZ = G4double( (*isoVector)[i]->GetZ() );
    53       AA = G4double( (*isoVector)[i]->GetN() );
     53      ZZ = (*isoVector)[i]->GetZ();
     54      AA = (*isoVector)[i]->GetN();
    5455      psig = GetCrossSection(KE, AA, ZZ);
    5556      cross_section += psig*abundVector[i];
     
    5758 
    5859  } else {
    59     cross_section = GetCrossSection(KE, anEle->GetN(), anEle->GetZ());
     60    G4int ZZ = G4lrint(anEle->GetZ());
     61    G4int AA = G4lrint(anEle->GetN());
     62    cross_section = GetCrossSection(KE, AA, ZZ);
    6063  }
    6164
     
    6366}
    6467
    65    
     68
    6669G4double G4ProtonInelasticCrossSection::
    67 GetCrossSection(G4double kineticEnergy, G4double atomicNumber, G4double nOfProtons)
     70GetCrossSection(G4double kineticEnergy, G4int atomicNumber, G4int nOfProtons)
    6871{   
    6972  if (kineticEnergy > 19.9*GeV )
     
    7174    return  GetCrossSection(19.8*GeV,atomicNumber,nOfProtons);
    7275  }
    73   G4double nOfNeutrons = atomicNumber-nOfProtons;
     76  G4int nOfNeutrons = atomicNumber-nOfProtons;
    7477  kineticEnergy /=GeV;
    7578  G4double a = atomicNumber;
     
    8083  G4double fac1=b0*(1-std::pow(a,-0.3333));
    8184  G4double fac2=1.;
    82   if(nOfNeutrons>1.5) fac2=std::log((nOfNeutrons));
     85  if(nOfNeutrons > 1) fac2=std::log((G4double(nOfNeutrons)));
    8386  G4double crossSection = 1E31*fac*fac2*(1+std::pow(a,0.3333)-fac1);
    8487
Note: See TracChangeset for help on using the changeset viewer.