File indexing completed on 2025-01-18 09:58:53
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 #ifndef G4ParticleHPThermalScattering_h
0030 #define G4ParticleHPThermalScattering_h 1
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 #include "G4HadronicInteraction.hh"
0046 #include "G4ParticleHPThermalScatteringNames.hh"
0047 #include "globals.hh"
0048
0049 class G4ParticleHPThermalScatteringData;
0050 class G4ParticleHPElastic;
0051
0052 struct E_isoAng
0053 {
0054 G4double energy;
0055 G4int n;
0056 std::vector<G4double> isoAngle;
0057 E_isoAng()
0058 {
0059 energy = 0.0;
0060 n = 0;
0061 };
0062 };
0063
0064 struct E_P_E_isoAng
0065 {
0066 G4double energy;
0067 G4int n;
0068 std::vector<G4double> prob;
0069 std::vector<E_isoAng*> vE_isoAngle;
0070 G4double sum_of_probXdEs;
0071 std::vector<G4double> secondary_energy_cdf;
0072 std::vector<G4double> secondary_energy_pdf;
0073 std::vector<G4double> secondary_energy_value;
0074 G4int secondary_energy_cdf_size;
0075 E_P_E_isoAng()
0076 {
0077 energy = 0.0;
0078 n = 0;
0079 sum_of_probXdEs = 0.0;
0080 secondary_energy_cdf_size = 0;
0081 };
0082 };
0083
0084 class G4ParticleHPThermalScattering : public G4HadronicInteraction
0085 {
0086 public:
0087 G4ParticleHPThermalScattering();
0088
0089 ~G4ParticleHPThermalScattering() override;
0090
0091 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
0092 G4Nucleus& aTargetNucleus) override;
0093
0094 const std::pair<G4double, G4double> GetFatalEnergyCheckLevels() const override;
0095
0096
0097
0098 void AddUserThermalScatteringFile(G4String, G4String);
0099
0100 void BuildPhysicsTable(const G4ParticleDefinition&) override;
0101
0102 void ModelDescription(std::ostream& outFile) const override;
0103
0104 private:
0105 void clearCurrentFSData();
0106
0107 G4ParticleHPThermalScatteringNames names;
0108
0109
0110
0111 std::map<G4int, std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>*>* coherentFSs{
0112 nullptr};
0113 std::map<G4double, std::vector<std::pair<G4double, G4double>*>*>* readACoherentFSDATA(G4String);
0114
0115
0116
0117 std::map<G4int, std::map<G4double, std::vector<E_isoAng*>*>*>* incoherentFSs{nullptr};
0118 std::map<G4double, std::vector<E_isoAng*>*>* readAnIncoherentFSDATA(G4String);
0119 E_isoAng* readAnE_isoAng(std::istream*);
0120
0121
0122
0123 std::map<G4int, std::map<G4double, std::vector<E_P_E_isoAng*>*>*>* inelasticFSs{nullptr};
0124 std::map<G4double, std::vector<E_P_E_isoAng*>*>* readAnInelasticFSDATA(G4String);
0125 E_P_E_isoAng* readAnE_P_E_isoAng(std::istream*);
0126
0127 G4ParticleHPThermalScatteringData* theXSection;
0128
0129 G4ParticleHPElastic* theHPElastic;
0130
0131 G4double getMu(E_isoAng*);
0132 G4double getMu(G4double rndm1, G4double rndm2, E_isoAng* anEPM);
0133
0134 std::pair<G4double, G4double> find_LH(G4double, std::vector<G4double>*);
0135 G4double get_linear_interpolated(G4double, std::pair<G4double, G4double>,
0136 std::pair<G4double, G4double>);
0137
0138 E_isoAng create_E_isoAng_from_energy(G4double, std::vector<E_isoAng*>*);
0139
0140 G4double get_secondary_energy_from_E_P_E_isoAng(G4double random, E_P_E_isoAng* anE_P_E_isoAng);
0141
0142 std::pair<G4double, G4double> sample_inelastic_E_mu(G4double pE,
0143 std::vector<E_P_E_isoAng*>* vNEP_EPM);
0144 std::pair<G4double, G4int> sample_inelastic_E(G4double rndm1, G4double rndm2,
0145 E_P_E_isoAng* anE_P_E_isoAng);
0146
0147 std::pair<G4double, E_isoAng>
0148 create_sE_and_EPM_from_pE_and_vE_P_E_isoAng(G4double, G4double, std::vector<E_P_E_isoAng*>*);
0149
0150 std::map<std::pair<const G4Material*, const G4Element*>, G4int> dic;
0151 void buildPhysicsTable();
0152 G4int getTS_ID(const G4Material*, const G4Element*);
0153
0154
0155
0156 G4bool check_E_isoAng(E_isoAng*);
0157
0158
0159 size_t nMaterial;
0160 size_t nElement;
0161 };
0162
0163 #endif