File indexing completed on 2025-01-18 09:58:03
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 #ifndef G4ComponentBarNucleonNucleusXsc_h
0037 #define G4ComponentBarNucleonNucleusXsc_h
0038
0039
0040 #include "G4VComponentCrossSection.hh"
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4DynamicParticle.hh"
0043
0044 #include "globals.hh"
0045 #include "G4PiData.hh"
0046 #include "G4Threading.hh"
0047 #include <vector>
0048
0049 class G4ComponentBarNucleonNucleusXsc : public G4VComponentCrossSection
0050 {
0051
0052 public:
0053
0054 explicit G4ComponentBarNucleonNucleusXsc();
0055 ~G4ComponentBarNucleonNucleusXsc() override;
0056
0057 G4double GetTotalIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0058 G4double kinEnergy,
0059 G4int Z, G4int ) final;
0060
0061 G4double GetTotalElementCrossSection(const G4ParticleDefinition* aParticle,
0062 G4double kinEnergy,
0063 G4int Z, G4double ) final;
0064
0065 G4double GetInelasticIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0066 G4double kinEnergy,
0067 G4int Z, G4int ) final;
0068
0069 G4double GetInelasticElementCrossSection(const G4ParticleDefinition* aParticle,
0070 G4double kinEnergy,
0071 G4int Z, G4double ) final;
0072
0073 G4double GetElasticElementCrossSection(const G4ParticleDefinition* aParticle,
0074 G4double kinEnergy,
0075 G4int Z, G4double ) final;
0076
0077 G4double GetElasticIsotopeCrossSection(const G4ParticleDefinition* aParticle,
0078 G4double kinEnergy,
0079 G4int Z, G4int ) final;
0080
0081 void ComputeCrossSections(const G4ParticleDefinition* aParticle,
0082 G4double kinEnergy, G4int Z);
0083
0084 void BuildPhysicsTable(const G4ParticleDefinition&) final;
0085
0086 void Description(std::ostream&) const final;
0087
0088 inline G4double GetElementCrossSection(const G4DynamicParticle* aParticle, G4int Z);
0089 inline G4double GetElasticCrossSection(const G4DynamicParticle* aParticle, G4int Z);
0090
0091 inline G4double GetTotalXsc() { return fTotalXsc; };
0092 inline G4double GetElasticXsc() { return fElasticXsc; };
0093 inline G4double GetInelasticXsc() { return fInelasticXsc; };
0094
0095 private:
0096
0097 G4double Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2) const;
0098
0099 void LoadData();
0100
0101
0102 G4double fTotalXsc;
0103 G4double fInelasticXsc;
0104 G4double fElasticXsc;
0105
0106
0107 const G4ParticleDefinition* theProton;
0108 const G4ParticleDefinition* theNeutron;
0109
0110 G4bool isMaster;
0111
0112 static G4double theA[93];
0113 static G4double A75[93];
0114
0115 static const G4int NZ = 17;
0116 static G4int theZ[NZ];
0117 static std::vector<G4PiData*>* thePData;
0118 static std::vector<G4PiData*>* theNData;
0119
0120 #ifdef G4MULTITHREADED
0121 static G4Mutex barNNXSMutex;
0122 #endif
0123
0124 };
0125
0126 inline
0127 G4double G4ComponentBarNucleonNucleusXsc::GetElementCrossSection(
0128 const G4DynamicParticle* dp, G4int Z)
0129 {
0130 ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(),Z);
0131 return fInelasticXsc;
0132 }
0133
0134 inline
0135 G4double G4ComponentBarNucleonNucleusXsc::GetElasticCrossSection(
0136 const G4DynamicParticle* dp, G4int Z)
0137 {
0138 ComputeCrossSections(dp->GetDefinition(), dp->GetKineticEnergy(),Z);
0139 return fElasticXsc;
0140 }
0141
0142 #endif