Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:11

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // GEANT4 physics class: G4ElectroNuclearCrossSection -- header file
0028 // M.V. Kossov, ITEP(Moscow), 24-OCT-01
0029 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 25-Sept-03
0030 
0031 // A. Dotti 2-May-2013: Re-write caching logic and optimizations
0032 
0033 #ifndef G4ElectroNuclearCrossSection_h
0034 #define G4ElectroNuclearCrossSection_h 1
0035 
0036 #include "G4VCrossSectionDataSet.hh"
0037 #include "G4DynamicParticle.hh"
0038 #include "G4Element.hh"
0039 #include "G4ParticleTable.hh"
0040 #include "G4NucleiProperties.hh"
0041 #include "G4NistManager.hh"
0042 #include <vector>
0043 #include "Randomize.hh"
0044 #include "G4Electron.hh"
0045 #include "G4Positron.hh"
0046 #include <map>
0047 
0048 //A cache element
0049 struct cacheEl_t {
0050     G4int F;
0051     G4double* J1;
0052     G4double* J2;
0053     G4double* J3;
0054     G4double H;
0055     G4double TH;
0056 };
0057 
0058 class G4ElectroNuclearCrossSection : public G4VCrossSectionDataSet
0059 {
0060 public:
0061 
0062   G4ElectroNuclearCrossSection();
0063   virtual ~G4ElectroNuclearCrossSection();
0064     
0065   static const char* Default_Name() {return "ElectroNuclearXS";}
0066 
0067   virtual void CrossSectionDescription(std::ostream&) const;
0068 
0069   virtual G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
0070                                      const G4Material*);
0071   virtual G4double GetElementCrossSection(const G4DynamicParticle*, G4int Z,
0072                                     const G4Material* mat);
0073 
0074   G4double GetEquivalentPhotonEnergy();
0075 
0076   G4double GetVirtualFactor(G4double nu, G4double Q2);
0077 
0078   G4double GetEquivalentPhotonQ2(G4double nu);
0079 
0080 private:
0081   G4int    GetFunctions(G4double a, G4double* x, G4double* y, G4double* z);
0082 
0083   G4double ThresholdEnergy(G4int Z, G4int N);
0084   G4double SolveTheEquation(G4double f);
0085   G4double Fun(G4double x);
0086   G4double DFun(G4double x);
0087     
0088   G4double HighEnergyJ1(G4double lE);
0089   G4double HighEnergyJ2(G4double lE, G4double E);
0090   G4double HighEnergyJ3(G4double lE, G4double E2);
0091 
0092 // Body
0093 private:
0094     G4int currentN;
0095     G4int currentZ;
0096     
0097     //Cache structure
0098     G4int lastZ;
0099     std::vector<cacheEl_t*> cache;
0100     cacheEl_t* lastUsedCacheEl;
0101     G4NistManager* nistmngr;
0102         
0103     //Cache values for XS
0104     G4double lastE ; //Last used energy value
0105     G4double lastSig; //Last used XS value
0106     G4double lastG; //Last value of gamma=lnE-ln(me)
0107     G4int    lastL; //Last used in the cross section TheLastBin
0108     
0109     const G4double mNeut;
0110     const G4double mProt;
0111 };
0112 
0113 #endif