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