// // ******************************************************************** // * 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: G4QElasticCrossSection.cc,v 1.1 2009/11/16 18:15:43 mkossov Exp $ // GEANT4 tag $Name: geant4-09-03 $ // // // G4 Physics class: G4QElasticCrossSection for N+A elastic cross sections // Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-06 // //================================================================================ // Short description: Interaction cross-sections for the G4QElastic process // ------------------------------------------------------------------------------- //#define debug //#define isodebug //#define pdebug //#define ppdebug //#define tdebug //#define sdebug #include "G4QElasticCrossSection.hh" // Initialization of the static parameters const G4int G4QElasticCrossSection::nPoints=128;//#of points in the AMDB tables(>anyPar)(D) const G4int G4QElasticCrossSection::nLast=nPoints-1; // the Last element in the table (D) G4double G4QElasticCrossSection::lPMin=-8.; // Min tabulated logarithmic Momentum (D) G4double G4QElasticCrossSection::lPMax= 8.; // Max tabulated logarithmic Momentum (D) G4double G4QElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// Log step in the table (D) G4bool G4QElasticCrossSection::onlyCS=true;// Flag to calculate only CS (not Si/Bi) (L) G4double G4QElasticCrossSection::lastSIG=0.; // Last calculated cross section (L) G4double G4QElasticCrossSection::lastLP=-10.;// Last log(mom_of_the_incident_hadron) (L) G4double G4QElasticCrossSection::lastTM=0.; // Last t_maximum (L) G4double G4QElasticCrossSection::theSS=0.; // The Last sq.slope of first difruction (L) G4double G4QElasticCrossSection::theS1=0.; // The Last mantissa of first difruction (L) G4double G4QElasticCrossSection::theB1=0.; // The Last slope of first difruction (L) G4double G4QElasticCrossSection::theS2=0.; // The Last mantissa of second difruction (L) G4double G4QElasticCrossSection::theB2=0.; // The Last slope of second difruction (L) G4double G4QElasticCrossSection::theS3=0.; // The Last mantissa of third difruction (L) G4double G4QElasticCrossSection::theB3=0.; // The Last slope of third difruction (L) G4double G4QElasticCrossSection::theS4=0.; // The Last mantissa of 4-th difruction (L) G4double G4QElasticCrossSection::theB4=0.; // The Last slope of 4-th difruction (L) G4int G4QElasticCrossSection::lastTZ=0; // Last atomic number of the target G4int G4QElasticCrossSection::lastTN=0; // Last number of neutrons of the target G4double G4QElasticCrossSection::lastPIN=0.; // Last initialized max momentum G4double* G4QElasticCrossSection::lastCST=0; // Elastic cross-section table G4double* G4QElasticCrossSection::lastPAR=0; // Parameters for functional calculation G4double* G4QElasticCrossSection::lastSST=0; // E-dep of sq.slope of the first difruction G4double* G4QElasticCrossSection::lastS1T=0; // E-dep of mantissa of the first difruction G4double* G4QElasticCrossSection::lastB1T=0; // E-dep of the slope of the first difruction G4double* G4QElasticCrossSection::lastS2T=0; // E-dep of mantissa of the second difruction G4double* G4QElasticCrossSection::lastB2T=0; // E-dep of the slope of theSecond difruction G4double* G4QElasticCrossSection::lastS3T=0; // E-dep of mantissa of the third difruction G4double* G4QElasticCrossSection::lastB3T=0; // E-dep of the slope of the third difruction G4double* G4QElasticCrossSection::lastS4T=0; // E-dep of mantissa of the 4-th difruction G4double* G4QElasticCrossSection::lastB4T=0; // E-dep of the slope of the 4-th difruction G4int G4QElasticCrossSection::lastPDG=0; // The last PDG code of the projectile G4int G4QElasticCrossSection::lastN=0; // The last N of calculated nucleus G4int G4QElasticCrossSection::lastZ=0; // The last Z of calculated nucleus G4double G4QElasticCrossSection::lastP=0.; // Last used in cross section Momentum G4double G4QElasticCrossSection::lastTH=0.; // Last threshold momentum G4double G4QElasticCrossSection::lastCS=0.; // Last value of the Cross Section G4int G4QElasticCrossSection::lastI=0; // The last position in the DAMDB std::vector G4QElasticCrossSection::PAR; // Vector of parameters for functCalcul std::vector G4QElasticCrossSection::CST; // Vector of cross-section table std::vector G4QElasticCrossSection::SST; // Vector of the first squared slope std::vector G4QElasticCrossSection::S1T; // Vector of the first mantissa std::vector G4QElasticCrossSection::B1T; // Vector of the first slope std::vector G4QElasticCrossSection::S2T; // Vector of the secon mantissa std::vector G4QElasticCrossSection::B2T; // Vector of the second slope std::vector G4QElasticCrossSection::S3T; // Vector of the third mantissa std::vector G4QElasticCrossSection::B3T; // Vector of the third slope std::vector G4QElasticCrossSection::S4T; // Vector of the 4-th mantissa (gloria) std::vector G4QElasticCrossSection::B4T; // Vector of the 4-th slope (gloria) G4QElasticCrossSection::G4QElasticCrossSection() { } G4QElasticCrossSection::~G4QElasticCrossSection() { std::vector::iterator pos; for (pos=CST.begin(); pos colPDG;// Vector of the projectile PDG code static std::vector colN; // Vector of N for calculated nuclei (isotops) static std::vector colZ; // Vector of Z for calculated nuclei (isotops) static std::vector colP; // Vector of last momenta for the reaction static std::vector colTH; // Vector of energy thresholds for the reaction static std::vector colCS; // Vector of last cross sections for the reaction // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---*** if(tgZ==0 && tgN==1) // Temporary change for Quasi-Elastic { tgZ=1; tgN=1; if (pPDG==2212) pPDG=2112; else if(pPDG==2112) pPDG=2212; } G4double pEn=pMom; onlyCS=fCS; #ifdef pdebug G4cout<<"G4QElCS::GetCS:>>> f="< CS=0"< New (inDB) Calculated CS="<lastTH) // Correct the threshold { #ifdef pdebug G4cout<<"G4QElCS::GetCS: New T="< Threshold="< Threshold="< CS=0 // } // // else if(std::fabs(lastP/pMom-1.)onlyCS="<RETRIEVE/UPDATE { if(F<0) // the AMDB must be loded { lastPIN = PIN[I]; // Max log(P) initialised for this table set lastPAR = PAR[I]; // Pointer to the parameter set lastCST = CST[I]; // Pointer to the total sross-section table lastSST = SST[I]; // Pointer to the first squared slope lastS1T = S1T[I]; // Pointer to the first mantissa lastB1T = B1T[I]; // Pointer to the first slope lastS2T = S2T[I]; // Pointer to the second mantissa lastB2T = B2T[I]; // Pointer to the second slope lastS3T = S3T[I]; // Pointer to the third mantissa lastB3T = B3T[I]; // Pointer to the rhird slope lastS4T = S4T[I]; // Pointer to the 4-th mantissa lastB4T = B4T[I]; // Pointer to the 4-th slope #ifdef pdebug G4cout<<"G4QElasticCS::CalcCS: DB is updated for I="< fin="< ILP="<= max="< ILP=" < n+p=n+p { #ifdef tdebug G4cout<<"G4QElasticCS::GetExchangeT: TM="<=-1.||q2<=1.)) G4cout<<"*NAN*G4QElasticCrossSect::GetExchangeT: -t="<lastTM) { #ifdef tdebug G4cout<<"*Warning*G4QElasticCrossSect::GetExT:-t="<"<=-1.||theB1<=1.))G4cout<<"*NAN*G4QElasticCrossSect::Getslope:"<92) { G4cout<<"*Warning*G4QElasticCS::GetTabValue: (1-92) No isotopes for Z="<0, N>0"< nA { G4double mt=mProt; // Target mass in GeV if(tgN||tgZ>1) mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass GeV G4double dmt=mt+mt; G4double s=dmt*std::sqrt(pP2+mNeut2)+mNeut2+mt*mt; // Mondelstam s (in GeV^2) return dmt*dmt*pP2/s; } else if(PDG==2212 && (tgZ || tgN)) // ---> pA { G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV G4double dmt=mt+mt; G4double s=dmt*std::sqrt(pP2+mProt2)+mProt2+mt*mt; // Mondelstam s return dmt*dmt*pP2/s; } else { G4cout<<"*Error*G4QElasticCrossSection::GetQ2max: PDG="<0"<