Back to home page

EIC code displayed by LXR

 
 

    


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

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