Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:15:22

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 // G4ParticleHPThermalScatteringData
0028 //
0029 // Class Description:
0030 //
0031 // Cross Sections for a high precision (based on evaluated data
0032 // libraries) description of themal neutron scattering below 4 eV;
0033 // Based on Thermal neutron scattering files
0034 // from the evaluated nuclear data files ENDF/B-VI, Release2
0035 // To be used in your physics list in case you need this physics.
0036 // In this case you want to register an object of this class with
0037 // the corresponding process.
0038 //
0039 // Author: T. Koi (SLAC/SCCS), November-2006 - First implementation.
0040 //         P. Arce (CIEMAT), June-2014 - Conversion neutron_hp to particle_hp
0041 // ---------------------------------------------------------------------
0042 #ifndef G4ParticleHPThermalScatteringData_h
0043 #define G4ParticleHPThermalScatteringData_h 1
0044 
0045 #include "G4DynamicParticle.hh"
0046 #include "G4Element.hh"
0047 #include "G4Material.hh"
0048 #include "G4ParticleDefinition.hh"
0049 #include "G4ParticleHPThermalScatteringNames.hh"
0050 #include "G4ParticleHPVector.hh"
0051 #include "G4VCrossSectionDataSet.hh"
0052 
0053 #include <map>
0054 #include <vector>
0055 
0056 class G4ParticleHPThermalScatteringData : public G4VCrossSectionDataSet
0057 {
0058   public:
0059 
0060     G4ParticleHPThermalScatteringData();
0061 
0062     ~G4ParticleHPThermalScatteringData() override;
0063 
0064     G4bool IsIsoApplicable(const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/,
0065                            const G4Element* /*elm*/, const G4Material* /*mat*/) override;
0066 
0067     G4double GetIsoCrossSection(const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/,
0068                                 const G4Isotope* /*iso*/, const G4Element* /*elm*/,
0069                                 const G4Material* /*mat*/) override;
0070 
0071     G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
0072 
0073     // G4bool IsZAApplicable( const G4DynamicParticle* , G4double /*ZZ*/, G4double /*AA*/)
0074     //{ return false;}
0075 
0076     G4double GetCrossSection(const G4DynamicParticle*, const G4Element*, const G4Material*);
0077     G4double GetInelasticCrossSection(const G4DynamicParticle*, const G4Element*,
0078                                       const G4Material*);
0079     G4double GetCoherentCrossSection(const G4DynamicParticle*, const G4Element*, const G4Material*);
0080     G4double GetIncoherentCrossSection(const G4DynamicParticle*, const G4Element*,
0081                                        const G4Material*);
0082 
0083     void BuildPhysicsTable(const G4ParticleDefinition&) override;
0084 
0085     void DumpPhysicsTable(const G4ParticleDefinition&) override;
0086 
0087     // For user prepared thermal files
0088     // Name of G4Element , Name of NDL file
0089     void AddUserThermalScatteringFile(const G4String&, const G4String&);
0090 
0091     void CrossSectionDescription(std::ostream&) const override;
0092 
0093   private:
0094 
0095     G4double GetX(const G4DynamicParticle*, G4double aT, std::map<G4double, G4ParticleHPVector*>*);
0096 
0097     void clearCurrentXSData();
0098 
0099     std::map<G4double, G4ParticleHPVector*>* readData(const G4String&);
0100 
0101     G4int getTS_ID(const G4Material*, const G4Element*);
0102 
0103   private:
0104 
0105     G4double emax;
0106 
0107     //              element            temp       x section from E
0108     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* coherent{nullptr};
0109     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* incoherent{nullptr};
0110     std::map<G4int, std::map<G4double, G4ParticleHPVector*>*>* inelastic{nullptr};
0111 
0112     std::vector<G4int> indexOfThermalElement;
0113     G4ParticleHPThermalScatteringNames* names;
0114 
0115     G4double ke_cache;
0116     G4double xs_cache;
0117     const G4Element* element_cache;
0118     const G4Material* material_cache;
0119 
0120     std::map<std::pair<const G4Material*, const G4Element*>, G4int> dic;
0121 };
0122 
0123 #endif