Back to home page

EIC code displayed by LXR

 
 

    


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

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 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:    G4NeutronElasticXS
0033 //
0034 // Author  Ivantchenko, Geant4, 3-AUG-09
0035 //
0036  
0037 // Class Description:
0038 // This is a base class for neutron elastic hadronic cross section based on
0039 // data files from G4PARTICLEXSDATA data set 
0040 // Class Description - End
0041 
0042 #ifndef G4NeutronElasticXS_h
0043 #define G4NeutronElasticXS_h 1
0044 
0045 #include "G4VCrossSectionDataSet.hh"
0046 #include "globals.hh"
0047 #include "G4PhysicsVector.hh"
0048 #include <vector>
0049 
0050 class G4DynamicParticle;
0051 class G4ParticleDefinition;
0052 class G4Element;
0053 class G4VComponentCrossSection;
0054 
0055 class G4NeutronElasticXS final : public G4VCrossSectionDataSet
0056 {
0057 public: 
0058 
0059   G4NeutronElasticXS();
0060 
0061   ~G4NeutronElasticXS() final;
0062     
0063   static const char* Default_Name() {return "G4NeutronElasticXS";}
0064 
0065   G4bool IsElementApplicable(const G4DynamicParticle*, 
0066                  G4int Z, const G4Material*) final;
0067 
0068   G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A,
0069              const G4Element*, const G4Material*) final;
0070 
0071   G4double GetElementCrossSection(const G4DynamicParticle*, 
0072                       G4int Z, const G4Material*) final; 
0073 
0074   G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
0075                               const G4Isotope* iso,
0076                               const G4Element* elm,
0077                               const G4Material* mat) final;
0078 
0079   G4double ComputeCrossSectionPerElement(G4double kinEnergy, G4double loge,
0080                                          const G4ParticleDefinition*,
0081                                          const G4Element*,
0082                                          const G4Material*) final;
0083   
0084   G4double ComputeIsoCrossSection(G4double kinEnergy, G4double loge,
0085                                   const G4ParticleDefinition*,
0086                                   G4int Z, G4int A,
0087                                   const G4Isotope* iso,
0088                                   const G4Element* elm,
0089                                   const G4Material* mat) final;
0090 
0091   const G4Isotope* SelectIsotope(const G4Element*, 
0092                                  G4double kinEnergy, G4double logE) final;
0093 
0094   void BuildPhysicsTable(const G4ParticleDefinition&) final;
0095 
0096   void CrossSectionDescription(std::ostream&) const final;
0097 
0098   G4double ElementCrossSection(G4double kinEnergy, G4double loge, G4int Z);
0099 
0100   G4NeutronElasticXS & operator=(const G4NeutronElasticXS &right) = delete;
0101   G4NeutronElasticXS(const G4NeutronElasticXS&) = delete;
0102   
0103 private: 
0104 
0105   void Initialise(G4int Z);
0106 
0107   void InitialiseOnFly(G4int Z);
0108 
0109   const G4String& FindDirectoryPath();
0110 
0111   inline G4PhysicsVector* GetPhysicsVector(G4int Z);
0112 
0113   G4VComponentCrossSection* ggXsection = nullptr;
0114   const G4ParticleDefinition* neutron;
0115 
0116   G4bool isFirst = false;
0117 
0118   static const G4int MAXZEL = 93;
0119   static G4PhysicsVector* data[MAXZEL];
0120   static G4double coeff[MAXZEL];
0121   static G4String gDataDirectory;
0122   static G4bool fLock;
0123 };
0124 
0125 inline
0126 G4PhysicsVector* G4NeutronElasticXS::GetPhysicsVector(G4int Z)
0127 {
0128   if(nullptr == data[Z]) { InitialiseOnFly(Z); }
0129   return data[Z];
0130 }
0131 
0132 #endif