File indexing completed on 2025-09-18 09:15:55
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 #ifndef G4UPiNuclearCrossSection_h
0035 #define G4UPiNuclearCrossSection_h
0036
0037 #include "G4VCrossSectionDataSet.hh"
0038 #include "G4DynamicParticle.hh"
0039 #include "G4ParticleDefinition.hh"
0040 #include "globals.hh"
0041
0042 class G4PhysicsTable;
0043
0044 class G4UPiNuclearCrossSection : public G4VCrossSectionDataSet
0045 {
0046 public:
0047
0048 explicit G4UPiNuclearCrossSection();
0049
0050 ~G4UPiNuclearCrossSection() override = default;
0051
0052 G4bool IsElementApplicable(const G4DynamicParticle* aParticle,
0053 G4int Z, const G4Material*) final;
0054
0055 inline
0056 G4double GetElasticCrossSection(const G4DynamicParticle* aParticle,
0057 G4int Z, G4int A) const;
0058
0059 inline
0060 G4double GetInelasticCrossSection(const G4DynamicParticle* aParticle,
0061 G4int Z, G4int A) const;
0062
0063 void BuildPhysicsTable(const G4ParticleDefinition&) final;
0064
0065 void DumpPhysicsTable(const G4ParticleDefinition&) final;
0066
0067 void CrossSectionDescription(std::ostream&) const final;
0068
0069 private:
0070
0071 G4double Interpolate(G4int Z, G4int A, G4double ekin,
0072 const G4PhysicsTable*) const;
0073
0074 void AddDataSet(const G4String& p, const G4double* tot,
0075 const G4double* in, const G4double* e, G4int n);
0076
0077 void LoadData();
0078
0079 const G4ParticleDefinition* piPlus;
0080 const G4ParticleDefinition* piMinus;
0081
0082 static const G4int NZ = 16;
0083 static G4int theZ[NZ];
0084 static G4int idxZ[93];
0085
0086 static G4double theA[NZ];
0087 static G4double APower[93];
0088
0089 static G4PhysicsTable* piPlusElastic;
0090 static G4PhysicsTable* piPlusInelastic;
0091 static G4PhysicsTable* piMinusElastic;
0092 static G4PhysicsTable* piMinusInelastic;
0093
0094 G4double aPower{0.75};
0095 G4double elow;
0096
0097 G4bool spline{false};
0098 };
0099
0100 inline G4double
0101 G4UPiNuclearCrossSection::GetElasticCrossSection(
0102 const G4DynamicParticle* dp, G4int Z, G4int A) const
0103 {
0104 const G4PhysicsTable* table =
0105 (dp->GetDefinition() == piPlus) ? piPlusElastic : piMinusElastic;
0106 return Interpolate(Z, A, dp->GetKineticEnergy(), table);
0107 }
0108
0109 inline G4double
0110 G4UPiNuclearCrossSection::GetInelasticCrossSection(
0111 const G4DynamicParticle* dp, G4int Z, G4int A) const
0112 {
0113 const G4PhysicsTable* table =
0114 (dp->GetDefinition() == piPlus) ? piPlusInelastic : piMinusInelastic;
0115 return Interpolate(Z, A, dp->GetKineticEnergy(), table);
0116 }
0117
0118 #endif