// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * 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. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4ElectroNuclearCrossSection.cc,v 1.15 2002/12/12 19:16:50 gunter Exp $ // GEANT4 tag $Name: geant4-05-00 $ // // // 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-May-02 // //=============================================================================================== //#define debug #define edebug //#define pdebug //#define ppdebug //#define tdebug //#define sdebug #include "G4ElectroNuclearCrossSection.hh" // Initialization of the G4double G4ElectroNuclearCrossSection::lastE=0.; // Last used in the cross section TheEnergy G4int G4ElectroNuclearCrossSection::lastF=0; // Last used in the cross section TheFirstBin G4double G4ElectroNuclearCrossSection::lastG=0.; // Last used in the cross section TheGamma 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 // The main member function giving the gamma-A cross section (E in GeV, CS in mb) G4double G4ElectroNuclearCrossSection::GetCrossSection(const G4DynamicParticle* aPart, const G4Element* anEle, G4double T) { 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=log(EMi); // Minimum logarithmic Energy static const G4double lEMa=log(EMa); // Maximum logarithmic Energy static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in Energy static const G4double alop=1./137.036/3.14159265; //for the calculated functions (E>50000.) static const G4double mel=0.5109989; // Mass of electron in MeV static const G4double lmel=log(mel); // Log of electron mass // Associative memory for acceleration static G4std::vector colN; // Vector of N for calculated nucleus static G4std::vector colZ; // Vector of Z for calculated nucleus static G4std::vector colF; // Vector of LastZeroPosition in the J-functions static G4std::vector colTH; // Vector of energy thresholds static G4std::vector colH; // Vector of high energy coefficient static G4std::vector J1; // Vector of pointers to the J1 functions static G4std::vector J2; // Vector of pointers to the J2 functions static G4std::vector J3; // Vector of pointers to the J3 functions // *** End of Static Definitions (Associative Memory) *** const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron const G4int targetAtomicNumber = static_cast(anEle->GetN()+.499); //@@ Nat mixture (?!) const G4int targZ = static_cast(anEle->GetZ()); const G4int targN = targetAtomicNumber-targZ; // @@ Get minimum isotop (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 Energy lastG = 0.; // New history in 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; i=Xh) return YN[N-1];//-| // G4double Xp=0.; // | // G4int j=0; // | // while (X>Xj && j=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=log(EMi); // Minimum logarithmic Energy static const G4double lEMa=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=log(mel); // Log of electron mass G4double phLE=0.; // Prototype of the 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 func. region #ifdef debug G4cout<<"G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy: "<Yj && j"< Q2max="<