// // ******************************************************************** // * 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. * // ******************************************************************** // // // The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02 // GEANT4 tag $Name: geant4-09-02-ref-02 $ // // // G4 Physics class: G4QProtonNuclearCrossSection for gamma+A cross sections // Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04 // -------------------------------------------------------------------------------- // **************************************************************************************** // ***** This HEADER is a property of the CHIPS hadronic package in Geant4 (M. Kosov) ***** // *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch ********** // **************************************************************************************** // //#define debug //#define pdebug //#define debug3 //#define debugn //#define debugs #include "G4QProtonNuclearCrossSection.hh" // Initialization of the G4double* G4QProtonNuclearCrossSection::lastLEN=0; // Pointer to the lastArray of LowEn CS G4double* G4QProtonNuclearCrossSection::lastHEN=0; // Pointer to the lastArray of HighEn CS G4int G4QProtonNuclearCrossSection::lastN=0; // The last N of calculated nucleus G4int G4QProtonNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus G4double G4QProtonNuclearCrossSection::lastP=0.; // Last used in cross section Momentum G4double G4QProtonNuclearCrossSection::lastTH=0.; // Last threshold momentum G4double G4QProtonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section G4int G4QProtonNuclearCrossSection::lastI=0; // The last position in the DAMDB // Returns Pointer to the G4VQCrossSection class G4VQCrossSection* G4QProtonNuclearCrossSection::GetPointer() { static G4QProtonNuclearCrossSection theCrossSection; //**Static body of Cross Section** return &theCrossSection; } // The main member function giving the collision cross section (P is in IU, CS is in mb) // Make pMom in independent units ! (Now it is MeV) G4double G4QProtonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN, G4int) { static G4int j; // A#0f records found in DB for this projectile 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 ***---*** G4double pEn=pMom; #ifdef pdebug G4cout<<"G4QPrCS::GetCS:>>> f="< New (inDB) Calculated CS="<lastTH) // Correct the threshold { #ifdef pdebug G4cout<<"G4QPrCS::GetCS: New T="< Threshold="<G4QPrCrossSec::GetCrosSec: pPDG=2212, j="< Threshold="< CS=0 } // else if(std::fabs(lastP/pMom-1.) spA; // shadowing coefficients (A-dependent) static std::vector LEN; // Vector of pointers to LowEnProtonCrossSection static std::vector HEN; // Vector of pointers to HighEnProtonCrossSection #ifdef debug G4cout<<"G4QProtonNuclearCS::CalcCS: N="< RETRIEVE { lastLEN=LEN[I]; // Pointer to prepared LowEnergy cross sections lastHEN=HEN[I]; // Pointer to prepared High Energy cross sections } else // This isotope wasn't calculated previously => CREATE { lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections // --- Instead of making a separate function --- G4double P=THmiG; // Table threshold in GeV/c for(G4int m=0; m