Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:15: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 // author: Vladimir.Grichine@cern.ch
0027 //
0028 // Implements data from: Barashenkov V.S., Nucleon-Nucleus Cross Section,
0029 // Preprint JINR P2-89-770, p. 12, Dubna 1989 (scanned version from KEK)
0030 // Based on G. Folger version of G4PiNuclearCrossSection class
0031 //
0032 // Modified:
0033 // 05.03.2024 V.Ivanchenko removed obsolete methods and calls
0034 //
0035 
0036 #ifndef G4NucleonNuclearCrossSection_h
0037 #define G4NucleonNuclearCrossSection_h
0038 
0039 #include "G4VCrossSectionDataSet.hh"
0040 #include "G4ParticleDefinition.hh"
0041 #include "globals.hh"
0042 
0043 class G4ComponentBarNucleonNucleusXsc;
0044 class G4ParticleDefinition;
0045 
0046 class G4NucleonNuclearCrossSection : public G4VCrossSectionDataSet
0047 {
0048 public:
0049   
0050   G4NucleonNuclearCrossSection();
0051   ~G4NucleonNuclearCrossSection() override = default;
0052     
0053   static const char* Default_Name() { return "BarashenkovNucleonXS"; }
0054 
0055   G4bool IsElementApplicable(const G4DynamicParticle* aParticle,
0056                  G4int Z, const G4Material* mat) final;
0057 
0058   // return inelastic x-section
0059   G4double GetElementCrossSection(const G4DynamicParticle* aParticle, 
0060                                   G4int Z, const G4Material* mat=nullptr) final;
0061 
0062   void CrossSectionDescription(std::ostream&) const final;
0063 
0064   // return elastic x-section
0065   inline G4double GetElasticCrossSection(const G4DynamicParticle* aParticle,
0066                      G4int Z);
0067 
0068   // access methods should be called after ComputeCrossSection(...)
0069   inline G4double GetTotalXsc()     { return fTotalXsc; };
0070   inline G4double GetInelasticXsc() { return fInelasticXsc; };
0071   inline G4double GetElasticXsc()   { return fElasticXsc; };
0072 
0073   G4NucleonNuclearCrossSection& operator=
0074   (const G4NucleonNuclearCrossSection &right) = delete;
0075   G4NucleonNuclearCrossSection(const G4NucleonNuclearCrossSection&) = delete;
0076 
0077 private:
0078 
0079   void ComputeCrossSections(const G4ParticleDefinition*, 
0080                             G4double kinEnergy, G4int Z);
0081 
0082   G4ComponentBarNucleonNucleusXsc* fBarash;
0083 
0084   G4double fTotalXsc{0.0};
0085   G4double fInelasticXsc{0.0};
0086   G4double fElasticXsc{0.0};
0087 };
0088 
0089 inline
0090 G4double G4NucleonNuclearCrossSection::GetElasticCrossSection(
0091          const G4DynamicParticle* dp, G4int Z)
0092 {
0093   ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(), Z);
0094   return fElasticXsc;
0095 }
0096 
0097 #endif