Changeset 1340 for trunk/source/processes/hadronic/cross_sections/src/G4ElectroNuclearCrossSection.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/G4ElectroNuclearCrossSection.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ElectroNuclearCrossSection.cc,v 1. 29 2008/10/24 19:15:17dennis Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ElectroNuclearCrossSection.cc,v 1.30 2010/10/14 05:25:22 dennis Exp $ 28 // GEANT4 tag $Name: hadr-cross-V09-03-12 $ 29 29 // 30 30 // … … 33 33 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03 34 34 // 35 //============================================================================ ===================35 //============================================================================ 36 36 37 37 ///#define debug … … 43 43 44 44 #include "G4ElectroNuclearCrossSection.hh" 45 #include "G4HadTmpUtil.hh" 45 46 46 47 // Initialization of statics 47 G4double G4ElectroNuclearCrossSection::lastE=0.; // Last used in the cross section TheEnergy 48 G4int G4ElectroNuclearCrossSection::lastF=0; // Last used in the cross section TheFirstBin 49 G4double G4ElectroNuclearCrossSection::lastG=0.; // Last used in the cross section TheGamma 48 // Last used in the cross section TheEnergy 49 G4double G4ElectroNuclearCrossSection::lastE=0.; 50 51 // Last used in the cross section TheFirstBin 52 G4int G4ElectroNuclearCrossSection::lastF=0; 53 54 // Last used in the cross section TheGamma 55 G4double G4ElectroNuclearCrossSection::lastG=0.; 56 50 57 G4double G4ElectroNuclearCrossSection::lastH=0.; // Last value of the High Energy A-dependence 51 58 G4double* G4ElectroNuclearCrossSection::lastJ1=0; // Pointer to the last array of the J1 function … … 58 65 G4double G4ElectroNuclearCrossSection::lastSig=0.;// Last value of the Cross Section 59 66 60 std::vector<G4double*> G4ElectroNuclearCrossSection::J1; // Vector of pointers to the J1 tabulated functions 61 std::vector<G4double*> G4ElectroNuclearCrossSection::J2; // Vector of pointers to the J2 tabulated functions 62 std::vector<G4double*> G4ElectroNuclearCrossSection::J3; // Vector of pointers to the J3 tabulated functions 67 // Vector of pointers to the J1 tabulated functions 68 std::vector<G4double*> G4ElectroNuclearCrossSection::J1; 69 70 // Vector of pointers to the J2 tabulated functions 71 std::vector<G4double*> G4ElectroNuclearCrossSection::J2; 72 73 // Vector of pointers to the J3 tabulated functions 74 std::vector<G4double*> G4ElectroNuclearCrossSection::J3; 75 63 76 64 77 G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection() 65 { 66 } 78 {} 79 67 80 68 81 G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection() … … 95 108 G4IsotopeVector* isoVector = anEle->GetIsotopeVector(); 96 109 G4double* abundVector = anEle->GetRelativeAbundanceVector(); 97 G4 doubleZZ;98 G4 doubleAA;110 G4int ZZ; 111 G4int AA; 99 112 100 113 for (G4int i = 0; i < nIso; i++) { 101 ZZ = G4double( (*isoVector)[i]->GetZ());102 AA = G4double( (*isoVector)[i]->GetN());103 sig = Get IsoZACrossSection(aPart, ZZ, AA, temperature);114 ZZ = (*isoVector)[i]->GetZ(); 115 AA = (*isoVector)[i]->GetN(); 116 sig = GetZandACrossSection(aPart, ZZ, AA, temperature); 104 117 xsection += sig*abundVector[i]; 105 118 } … … 107 120 } else { 108 121 xsection = 109 GetIsoZACrossSection(aPart, anEle->GetZ(), anEle->GetN(), 122 GetZandACrossSection(aPart, 123 G4lrint(anEle->GetZ()), 124 G4lrint(anEle->GetN()), 110 125 temperature); 111 126 } … … 116 131 117 132 G4double 118 G4ElectroNuclearCrossSection::Get IsoZACrossSection(const G4DynamicParticle* aPart,119 G4double ZZ, G4doubleAA,120 G4double /*temperature*/)133 G4ElectroNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* aPart, 134 G4int ZZ, G4int AA, 135 G4double /*temperature*/) 121 136 { 122 137 static const G4int nE=336; // !! If you change this, change it in GetFunctions() (*.hh) !! 123 138 static const G4int mL=nE-1; 124 static const G4double EMi=2.0612; 125 static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron126 static const G4double lEMi=std::log(EMi); 127 static const G4double lEMa=std::log(EMa); 139 static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron 140 static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron 141 static const G4double lEMi=std::log(EMi); // Minimum tabulated logarithmic Energy of the Electron 142 static const G4double lEMa=std::log(EMa); // Maximum tabulated logarithmic Energy of the Electron 128 143 static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy 129 144 static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.) … … 137 152 static std::vector <G4double> colH; // Vector of HighEnergyCoefficients (functional calculations) 138 153 // *** End of Static Definitions (Associative Memory) *** 154 139 155 const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron 140 const G4int targetAtomicNumber = static_cast<int>(AA+.499); //@@ Nat mixture (?!)141 const G4int targZ = static_cast<int>(ZZ+.001);156 const G4int targetAtomicNumber = AA; 157 const G4int targZ = ZZ; 142 158 const G4int targN = targetAtomicNumber-targZ; // @@ Get isotops (can change initial A) 143 159 if (Energy<=EMi) return 0.; // Energy is below the minimum energy in the table 160 144 161 G4int PDG=aPart->GetDefinition()->GetPDGEncoding(); 145 if (PDG == 11 || PDG == -11) // @@ Now only for electrons, but can be fo muons162 if (PDG == 11 || PDG == -11) // @@ Now only for electrons, but can be fo muons 146 163 { 147 G4double A =targN+targZ;// New A (can differ from G4double targetAtomicNumber)148 if(targN!=lastN || targZ!=lastZ) 164 G4double A = targN + targZ; // New A (can differ from G4double targetAtomicNumber) 165 if(targN!=lastN || targZ!=lastZ) // This nucleus was not the last used isotop 149 166 { 150 167 lastE = 0.; // New history in the electron Energy … … 185 202 } // End of creation of the new set of parameters 186 203 } // End of parameters udate 204 187 205 else if(std::abs((lastE-Energy)/Energy)<.001) return lastSig*millibarn; // Don't calc. same CS twice 188 206 // ============================== NOW Calculate the Cross Section ========================== … … 268 286 } 269 287 270 // Correction function for Be,C @@ Move to header // @@@ !!! NOT used !!!271 //G4double G4ElectroNuclearCrossSection::LinearFit(G4double X, G4int N, const G4double* XN,272 // const G4double* YN)273 //{274 // G4double Xj=XN[0];275 // G4double Xh=XN[N-1];276 // if(X<=Xj) return YN[0]; //-------+ !!! If you correct this, correct upper copy too!!277 // else if(X>=Xh) return YN[N-1];//-|278 // G4double Xp=0.; // |279 // G4int j=0; // |280 // while (X>Xj && j<N)//<-----------+281 // {282 // j++;283 // Xp=Xj;284 // Xj=XN[j];285 // }286 // return YN[j]-(Xj-X)*(YN[j]-YN[j-1])/(Xj-Xp);287 //}288 288 289 289 // Calculate the functions for the std::log(A)
Note: See TracChangeset
for help on using the changeset viewer.