// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4ElectroNuclearCrossSection.cc,v 1.30 2010/10/14 05:25:22 dennis Exp $ // GEANT4 tag $Name: hadr-cross-V09-03-12 $ // // // G4 Physics class: G4ElectroNuclearCrossSection for gamma+A cross sections // Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03 // //============================================================================ ///#define debug #define edebug //#define pdebug //#define ppdebug //#define tdebug //#define sdebug #include "G4ElectroNuclearCrossSection.hh" #include "G4HadTmpUtil.hh" // Initialization of statics // Last used in the cross section TheEnergy G4double G4ElectroNuclearCrossSection::lastE=0.; // Last used in the cross section TheFirstBin G4int G4ElectroNuclearCrossSection::lastF=0; // Last used in the cross section TheGamma G4double G4ElectroNuclearCrossSection::lastG=0.; G4double G4ElectroNuclearCrossSection::lastH=0.; // Last value of the High Energy A-dependence G4double* G4ElectroNuclearCrossSection::lastJ1=0; // Pointer to the last array of the J1 function G4double* G4ElectroNuclearCrossSection::lastJ2=0; // Pointer to the last array of the J2 function G4double* G4ElectroNuclearCrossSection::lastJ3=0; // Pointer to the last array of the J3 function G4int G4ElectroNuclearCrossSection::lastL=0; // Last used in the cross section TheLastBin G4int G4ElectroNuclearCrossSection::lastN=0; // The last N of calculated nucleus G4int G4ElectroNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus G4double G4ElectroNuclearCrossSection::lastTH=0.; // Last energy threshold G4double G4ElectroNuclearCrossSection::lastSig=0.;// Last value of the Cross Section // Vector of pointers to the J1 tabulated functions std::vector G4ElectroNuclearCrossSection::J1; // Vector of pointers to the J2 tabulated functions std::vector G4ElectroNuclearCrossSection::J2; // Vector of pointers to the J3 tabulated functions std::vector G4ElectroNuclearCrossSection::J3; G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection() {} G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection() { std::vector::iterator pos; for(pos=J1.begin(); posGetNumberOfIsotopes(); G4double xsection = 0; if (nIso) { G4double sig; G4IsotopeVector* isoVector = anEle->GetIsotopeVector(); G4double* abundVector = anEle->GetRelativeAbundanceVector(); G4int ZZ; G4int AA; for (G4int i = 0; i < nIso; i++) { ZZ = (*isoVector)[i]->GetZ(); AA = (*isoVector)[i]->GetN(); sig = GetZandACrossSection(aPart, ZZ, AA, temperature); xsection += sig*abundVector[i]; } } else { xsection = GetZandACrossSection(aPart, G4lrint(anEle->GetZ()), G4lrint(anEle->GetN()), temperature); } return xsection; } G4double G4ElectroNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* aPart, G4int ZZ, G4int AA, G4double /*temperature*/) { static const G4int nE=336; // !! If you change this, change it in GetFunctions() (*.hh) !! static const G4int mL=nE-1; static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron static const G4double lEMi=std::log(EMi); // Minimum tabulated logarithmic Energy of the Electron static const G4double lEMa=std::log(EMa); // Maximum tabulated logarithmic Energy of the Electron static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.) static const G4double mel=0.5109989; // Mass of the electron in MeV static const G4double lmel=std::log(mel); // Log of the electron mass // *** Begin of the Associative memory for acceleration of the cross section calculations static std::vector colN; // Vector of N for calculated nucleus (isotop) static std::vector colZ; // Vector of Z for calculated nucleus (isotop) static std::vector colF; // Vector of Last StartPosition in the Ji-function tables static std::vector colTH; // Vector of the energy thresholds for the eA->eX reactions static std::vector colH; // Vector of HighEnergyCoefficients (functional calculations) // *** End of Static Definitions (Associative Memory) *** const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron const G4int targetAtomicNumber = AA; const G4int targZ = ZZ; const G4int targN = targetAtomicNumber-targZ; // @@ Get isotops (can change initial A) if (Energy<=EMi) return 0.; // Energy is below the minimum energy in the table G4int PDG=aPart->GetDefinition()->GetPDGEncoding(); if (PDG == 11 || PDG == -11) // @@ Now only for electrons, but can be fo muons { G4double A = targN + targZ; // New A (can differ from G4double targetAtomicNumber) if(targN!=lastN || targZ!=lastZ) // This nucleus was not the last used isotop { lastE = 0.; // New history in the electron Energy lastG = 0.; // New history in the photon Energy lastN = targN; // The last N of calculated nucleus lastZ = targZ; // The last Z of calculated nucleus G4int n=colN.size(); // Size of the Associative Memory DB in the heap G4bool in=false; // "Found in AMDB" flag if(n) for(G4int i=0; i238.49) // Plutonium 244 is forbidden { G4cout<<"***G4ElectroNuclearCrossSection::GetFunctions: A="<(a+.499); // Make the round integer of the atomic number G4double ai=iA; if(a!=ai) a=ai; for(G4int i=0; i get from Tab { for(G4int k=0; k must be calculated { G4int k=0; // !! To be good for different compilers !! for(k=1; k=nN) k=nN-1; // Extrapolation from the last bin (U) G4int k1=k-1; G4double xi=A[k1]; G4double b=(a-xi)/(A[k]-xi); for(G4int m=0; m Make them general. static const G4int nE=336; // !! If you change this, change it in GetFunctions() (*.hh) !! static const G4int mL=nE-1; static const G4double EMi=2.0612; // Minimum Energy static const G4double EMa=50000.; // Maximum Energy static const G4double lEMi=std::log(EMi); // Minimum logarithmic Energy static const G4double lEMa=std::log(EMa); // Maximum logarithmic Energy static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in Energy static const G4double mel=0.5109989; // Mass of electron in MeV static const G4double lmel=std::log(mel); // Log of electron mass G4double phLE=0.; // Prototype of the std::log(nu=E_gamma) G4double Y[nE]; // Prepare the array for randomization #ifdef debug G4cout<<"G4ElectroNuclearCrossSection::GetEguPhotE:B="<"<"< Y[lastL=mL], then it is in the funct. region #ifdef debug G4cout<<"G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy: "<Yj && jleE"<lE="<eE"); } if(std::abs(d)=imax) G4cerr<<"*G4ElNucCS::SolveTheEq:"<"<Use bigger max. ln(eE)=" < Q2max="<