File indexing completed on 2026-08-19 09:08:51
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
0044
0045
0046
0047
0048
0049
0050
0051 #ifndef G4CHARGEEXCHANGEXS_HH
0052 #define G4CHARGEEXCHANGEXS_HH
0053
0054 #include "G4VCrossSectionDataSet.hh"
0055 #include "globals.hh"
0056 #include <vector>
0057
0058 class G4DynamicParticle;
0059 class G4ParticleDefinition;
0060 class G4Isotope;
0061 class G4Element;
0062 class G4Material;
0063 class G4Pow;
0064
0065 class G4ChargeExchangeXS final : public G4VCrossSectionDataSet
0066 {
0067 public:
0068
0069 G4ChargeExchangeXS();
0070
0071 ~G4ChargeExchangeXS() override = default;
0072
0073 G4bool IsElementApplicable(const G4DynamicParticle*, G4int Z,
0074 const G4Material*) final;
0075
0076 G4double GetElementCrossSection(const G4DynamicParticle*, G4int Z,
0077 const G4Material*) final;
0078
0079 void CrossSectionDescription(std::ostream&) const final;
0080
0081 const G4ParticleDefinition*
0082 SampleSecondaryType(const G4ParticleDefinition*, const G4Material*,
0083 G4int Z, G4int A, G4double etot);
0084
0085 G4double GetPartialPionXS(G4int idx) const;
0086
0087 void SetEnergyLimit(G4double val) { fEnergyLimit = val; };
0088
0089 void SetPionCrossSectionFactor(G4double val) { fFactorPi = val; };
0090
0091 void SetKaonCrossSectionFactor(G4double val) { fFactorK = val; };
0092
0093 G4double GetCrossSectionFactor() const { return fFactor; };
0094
0095 G4bool isPion() const { return findex >= 0; };
0096
0097 G4double SampleTforPion(const G4double etot,
0098 const G4double tmax) const;
0099
0100 G4ChargeExchangeXS & operator=(const G4ChargeExchangeXS &right) = delete;
0101 G4ChargeExchangeXS(const G4ChargeExchangeXS&) = delete;
0102
0103 private:
0104
0105 G4double GetCrossSection(const G4ParticleDefinition*, const G4Material*,
0106 G4int Z, G4double etot);
0107
0108 G4double ComputeDeuteronFraction(const G4Material*) const;
0109
0110 G4Pow* g4calc;
0111 G4int findex{-1};
0112 const G4ParticleDefinition* fPionSecPD[5];
0113 G4double fXSecPion[5] = {0.0, 0.0, 0.0, 0.0, 0.0};
0114 G4double fEnergyLimit{0.0};
0115 G4double fFactorPi{1.0};
0116 G4double fFactorK{1.0};
0117 G4double fFactor{1.0};
0118 G4double fMassPi;
0119 };
0120
0121 #endif