File indexing completed on 2025-01-18 09:58:44
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
0042
0043 #ifndef G4NeutronCaptureXS_h
0044 #define G4NeutronCaptureXS_h 1
0045
0046 #include "G4VCrossSectionDataSet.hh"
0047 #include "globals.hh"
0048 #include "G4ElementData.hh"
0049 #include "G4PhysicsVector.hh"
0050 #include <vector>
0051 #include <iostream>
0052
0053 class G4DynamicParticle;
0054 class G4ParticleDefinition;
0055 class G4Element;
0056
0057 class G4NeutronCaptureXS final : public G4VCrossSectionDataSet
0058 {
0059 public:
0060
0061 G4NeutronCaptureXS();
0062
0063 ~G4NeutronCaptureXS() override = default;
0064
0065 static const char* Default_Name() {return "G4NeutronCaptureXS";}
0066
0067 G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
0068 const G4Material*) final;
0069
0070 G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A,
0071 const G4Element*, const G4Material*) final;
0072
0073 G4double GetElementCrossSection(const G4DynamicParticle*,
0074 G4int Z, const G4Material*) final;
0075
0076 G4double ComputeCrossSectionPerElement(G4double kinEnergy, G4double loge,
0077 const G4ParticleDefinition*,
0078 const G4Element*,
0079 const G4Material*) final;
0080
0081 G4double ComputeIsoCrossSection(G4double kinEnergy, G4double loge,
0082 const G4ParticleDefinition*,
0083 G4int Z, G4int A,
0084 const G4Isotope* iso,
0085 const G4Element* elm,
0086 const G4Material* mat) final;
0087
0088 G4double GetIsoCrossSection(const G4DynamicParticle*, G4int Z, G4int A,
0089 const G4Isotope* iso,
0090 const G4Element* elm,
0091 const G4Material* mat) final;
0092
0093 const G4Isotope* SelectIsotope(const G4Element*, G4double kinEnergy,
0094 G4double logE) final;
0095
0096 void BuildPhysicsTable(const G4ParticleDefinition&) final;
0097
0098 void CrossSectionDescription(std::ostream&) const final;
0099
0100 G4double ElementCrossSection(G4double kinEnergy, G4double loge, G4int Z);
0101
0102 G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A);
0103
0104 G4NeutronCaptureXS & operator=(const G4NeutronCaptureXS &right) = delete;
0105 G4NeutronCaptureXS(const G4NeutronCaptureXS&) = delete;
0106
0107 private:
0108
0109 void Initialise(G4int Z);
0110
0111 void InitialiseOnFly(G4int Z);
0112
0113 const G4String& FindDirectoryPath();
0114
0115 inline const G4PhysicsVector* GetPhysicsVector(G4int Z);
0116
0117 G4PhysicsVector* RetrieveVector(std::ostringstream& in, G4bool warn);
0118
0119 G4double emax;
0120 G4double elimit;
0121 G4double logElimit;
0122
0123 std::vector<G4double> temp;
0124
0125 G4bool isInitializer{false};
0126
0127 static const G4int MAXZCAPTURE = 93;
0128 static G4ElementData* data;
0129 static G4String gDataDirectory;
0130 };
0131
0132 inline
0133 const G4PhysicsVector* G4NeutronCaptureXS::GetPhysicsVector(G4int Z)
0134 {
0135 const G4PhysicsVector* pv = data->GetElementData(Z);
0136 if(pv == nullptr) {
0137 InitialiseOnFly(Z);
0138 pv = data->GetElementData(Z);
0139 }
0140 return pv;
0141 }
0142
0143 #endif