Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:58:24

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 // author: Vladimir.Grichine@cern.ch
0028 //
0029 // Implements data from: Barashenkov V.S., Nucleon-Nucleus Cross Section,
0030 // Preprint JINR P2-89-770, p. 12, Dubna 1989 (scanned version from KEK)
0031 // Based on G4NucleonNuclearCrossSection class
0032 //
0033 // Modifications: 16.08.2018 V.Ivanchenko major revision
0034 //
0035 
0036 #ifndef G4ComponentBarNucleonNucleusXsc_h
0037 #define G4ComponentBarNucleonNucleusXsc_h
0038 
0039 
0040 #include "G4VComponentCrossSection.hh"
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4DynamicParticle.hh"
0043 
0044 #include "globals.hh"
0045 #include "G4PiData.hh"
0046 #include <vector>
0047 
0048 class G4ComponentBarNucleonNucleusXsc : public G4VComponentCrossSection
0049 {
0050 
0051 public:
0052   
0053   G4ComponentBarNucleonNucleusXsc();
0054   ~G4ComponentBarNucleonNucleusXsc() override = default;
0055 
0056   G4double GetTotalIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0057                        G4double kinEnergy,
0058                        G4int Z, G4int ) final;
0059 
0060   G4double GetTotalElementCrossSection(const G4ParticleDefinition* aParticle,
0061                        G4double kinEnergy, 
0062                        G4int Z, G4double ) final;
0063 
0064   G4double GetInelasticIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0065                        G4double kinEnergy, 
0066                        G4int Z, G4int ) final;
0067 
0068   G4double GetInelasticElementCrossSection(const G4ParticleDefinition* aParticle,
0069                        G4double kinEnergy, 
0070                        G4int Z, G4double ) final;
0071 
0072   G4double GetElasticElementCrossSection(const G4ParticleDefinition* aParticle,
0073                      G4double kinEnergy, 
0074                      G4int Z, G4double ) final;
0075 
0076   G4double GetElasticIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0077                      G4double kinEnergy, 
0078                      G4int Z, G4int ) final;
0079 
0080   void ComputeCrossSections(const G4ParticleDefinition* aParticle,
0081                 G4double kinEnergy, G4int Z);
0082  
0083   void Description(std::ostream&) const final;
0084 
0085   inline G4double GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z); 
0086   inline G4double GetElasticCrossSection(const G4DynamicParticle* aParticle, G4int Z);
0087 
0088   inline G4double GetTotalXsc()     { return fTotalXsc;   };
0089   inline G4double GetElasticXsc()   { return fElasticXsc; };
0090   inline G4double GetInelasticXsc() { return fInelasticXsc; };
0091 
0092   G4ComponentBarNucleonNucleusXsc& operator=
0093   (const G4ComponentBarNucleonNucleusXsc &right) = delete;
0094   G4ComponentBarNucleonNucleusXsc(const G4ComponentBarNucleonNucleusXsc&) = delete;
0095 
0096 private:
0097 
0098   G4double Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2) const;
0099 
0100   void LoadData();
0101 
0102   // cross sections
0103   G4double fTotalXsc{0.0};
0104   G4double fInelasticXsc{0.0};
0105   G4double fElasticXsc{0.0};
0106 
0107   // particles
0108   const G4ParticleDefinition* theProton;
0109   const G4ParticleDefinition* theNeutron;
0110 
0111   static G4double A75[93];
0112   static const G4int NZ = 17;
0113   static G4int theZ[NZ];
0114   static std::vector<G4PiData*>* thePData;
0115   static std::vector<G4PiData*>* theNData;
0116 };
0117 
0118 inline
0119 G4double G4ComponentBarNucleonNucleusXsc::GetElementCrossSection(
0120          const G4DynamicParticle* dp, G4int Z)
0121 {
0122   ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(), Z);
0123   return fInelasticXsc;
0124 }
0125 
0126 inline
0127 G4double G4ComponentBarNucleonNucleusXsc::GetElasticCrossSection(
0128          const G4DynamicParticle* dp, G4int Z)
0129 {
0130   ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(), Z);
0131   return fElasticXsc;
0132 }
0133 
0134 #endif