File indexing completed on 2026-09-04 09:12:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifndef G4NeutronInelasticXS_h
0042 #define G4NeutronInelasticXS_h 1
0043
0044 #include "G4VCrossSectionDataSet.hh"
0045 #include "globals.hh"
0046 #include "G4ElementData.hh"
0047 #include "G4PhysicsVector.hh"
0048 #include <vector>
0049
0050 class G4DynamicParticle;
0051 class G4ParticleDefinition;
0052 class G4Element;
0053 class G4VComponentCrossSection;
0054
0055 class G4NeutronInelasticXS final : public G4VCrossSectionDataSet
0056 {
0057 public:
0058
0059 G4NeutronInelasticXS();
0060
0061 ~G4NeutronInelasticXS() override = default;
0062
0063 static const char* Default_Name() { return "G4NeutronInelasticXS"; }
0064
0065 G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
0066 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 ComputeCrossSectionPerElement(G4double kinEnergy, G4double loge,
0075 const G4ParticleDefinition*,
0076 const G4Element*,
0077 const G4Material*) final;
0078
0079 G4double ComputeIsoCrossSection(G4double kinEnergy, G4double loge,
0080 const G4ParticleDefinition*,
0081 G4int Z, G4int A,
0082 const G4Isotope* iso,
0083 const G4Element* elm,
0084 const G4Material* mat) final;
0085
0086 G4double GetIsoCrossSection(const G4DynamicParticle*, 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 G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A);
0101
0102 G4NeutronInelasticXS & operator=(const G4NeutronInelasticXS &right) = delete;
0103 G4NeutronInelasticXS(const G4NeutronInelasticXS&) = delete;
0104
0105 private:
0106
0107 void Initialise(G4int Z);
0108
0109 void InitialiseOnFly(G4int Z);
0110
0111 const G4String& FindDirectoryPath();
0112
0113 inline const G4PhysicsVector* GetPhysicsVector(G4int Z);
0114
0115 inline const G4PhysicsVector* GetPhysicsVectorR(G4int Z);
0116
0117 G4PhysicsVector* RetrieveVector(std::ostringstream& in, G4bool warn);
0118
0119 G4VComponentCrossSection* ggXsection = nullptr;
0120
0121 const G4ParticleDefinition* neutron;
0122
0123 std::vector<G4double> temp;
0124
0125 G4double lowElimit;
0126 G4double loglowElimit;
0127
0128 G4bool isInitializer{false};
0129 G4bool fRfilesEnabled{false};
0130
0131 static const G4int MAXZINEL = 93;
0132 static G4ElementData* data;
0133 static G4ElementData* dataR;
0134 static G4double coeff[MAXZINEL];
0135 static G4double lowcoeff[MAXZINEL];
0136 static G4String gDataDirectory;
0137 };
0138
0139 inline
0140 const G4PhysicsVector* G4NeutronInelasticXS::GetPhysicsVector(G4int Z)
0141 {
0142 const G4PhysicsVector* pv = data->GetElementData(Z);
0143 if (pv == nullptr) {
0144 InitialiseOnFly(Z);
0145 pv = data->GetElementData(Z);
0146 }
0147 return pv;
0148 }
0149
0150 inline
0151 const G4PhysicsVector* G4NeutronInelasticXS::GetPhysicsVectorR(G4int Z)
0152 {
0153 const G4PhysicsVector* pv = dataR->GetElementData(Z);
0154 if (pv == nullptr) {
0155 InitialiseOnFly(Z);
0156 pv = dataR->GetElementData(Z);
0157 }
0158 return pv;
0159 }
0160
0161 #endif