Changeset 1340 for trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc
r1228 r1340 31 31 32 32 #include "G4ProtonInelasticCrossSection.hh" 33 #include "G4HadTmpUtil.hh" 33 34 #include "globals.hh" 34 35 … … 46 47 G4IsotopeVector* isoVector = anEle->GetIsotopeVector(); 47 48 G4double* abundVector = anEle->GetRelativeAbundanceVector(); 48 G4 doubleZZ;49 G4 doubleAA;49 G4int ZZ; 50 G4int AA; 50 51 51 52 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(); 54 55 psig = GetCrossSection(KE, AA, ZZ); 55 56 cross_section += psig*abundVector[i]; … … 57 58 58 59 } 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); 60 63 } 61 64 … … 63 66 } 64 67 65 68 66 69 G4double G4ProtonInelasticCrossSection:: 67 GetCrossSection(G4double kineticEnergy, G4 double atomicNumber, G4doublenOfProtons)70 GetCrossSection(G4double kineticEnergy, G4int atomicNumber, G4int nOfProtons) 68 71 { 69 72 if (kineticEnergy > 19.9*GeV ) … … 71 74 return GetCrossSection(19.8*GeV,atomicNumber,nOfProtons); 72 75 } 73 G4 doublenOfNeutrons = atomicNumber-nOfProtons;76 G4int nOfNeutrons = atomicNumber-nOfProtons; 74 77 kineticEnergy /=GeV; 75 78 G4double a = atomicNumber; … … 80 83 G4double fac1=b0*(1-std::pow(a,-0.3333)); 81 84 G4double fac2=1.; 82 if(nOfNeutrons >1.5) fac2=std::log((nOfNeutrons));85 if(nOfNeutrons > 1) fac2=std::log((G4double(nOfNeutrons))); 83 86 G4double crossSection = 1E31*fac*fac2*(1+std::pow(a,0.3333)-fac1); 84 87
Note: See TracChangeset
for help on using the changeset viewer.