File indexing completed on 2025-01-18 09:58:43
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
0052
0053
0054
0055
0056
0057
0058
0059 #ifndef G4MuPairProductionModel_h
0060 #define G4MuPairProductionModel_h 1
0061
0062 #include "G4VEmModel.hh"
0063 #include "G4NistManager.hh"
0064 #include "G4ElementData.hh"
0065 #include "G4Physics2DVector.hh"
0066 #include <vector>
0067
0068 class G4Element;
0069 class G4ParticleChangeForLoss;
0070 class G4ParticleChangeForGamma;
0071
0072 class G4MuPairProductionModel : public G4VEmModel
0073 {
0074 public:
0075
0076 explicit G4MuPairProductionModel(const G4ParticleDefinition* p = nullptr,
0077 const G4String& nam = "muPairProd");
0078
0079 ~G4MuPairProductionModel() = default;
0080
0081 void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0082
0083 void InitialiseLocal(const G4ParticleDefinition*,
0084 G4VEmModel* masterModel) override;
0085
0086 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
0087 G4double kineticEnergy,
0088 G4double Z, G4double A,
0089 G4double cutEnergy,
0090 G4double maxEnergy) override;
0091
0092 G4double ComputeDEDXPerVolume(const G4Material*,
0093 const G4ParticleDefinition*,
0094 G4double kineticEnergy,
0095 G4double cutEnergy) override;
0096
0097 void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0098 const G4MaterialCutsCouple*,
0099 const G4DynamicParticle*,
0100 G4double tmin,
0101 G4double maxEnergy) override;
0102
0103 G4double MinPrimaryEnergy(const G4Material*,
0104 const G4ParticleDefinition*,
0105 G4double) override;
0106
0107 virtual G4double
0108 ComputeDMicroscopicCrossSection(G4double tkin, G4double Z,
0109 G4double pairEnergy);
0110
0111 inline void SetLowestKineticEnergy(G4double e);
0112
0113 inline void SetParticle(const G4ParticleDefinition*);
0114
0115
0116 G4MuPairProductionModel & operator=
0117 (const G4MuPairProductionModel &right) = delete;
0118 G4MuPairProductionModel(const G4MuPairProductionModel&) = delete;
0119
0120 protected:
0121
0122 G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut,
0123 G4double tmax);
0124
0125 G4double ComputeMicroscopicCrossSection(G4double tkin,
0126 G4double Z,
0127 G4double cut);
0128
0129 G4double FindScaledEnergy(G4int Z, G4double rand, G4double logTkin,
0130 G4double yymin, G4double yymax);
0131
0132 inline G4double MaxSecondaryEnergyForElement(G4double kineticEnergy,
0133 G4double Z);
0134
0135 void MakeSamplingTables();
0136
0137 void StoreTables() const;
0138
0139 G4bool RetrieveTables();
0140
0141 virtual void DataCorrupted(G4int Z, G4double logTkin) const;
0142
0143 G4ParticleChangeForLoss* fParticleChange = nullptr;
0144 const G4ParticleDefinition* particle = nullptr;
0145 G4NistManager* nist = nullptr;
0146
0147 G4double factorForCross;
0148 G4double sqrte;
0149 G4double particleMass = 0.0;
0150 G4double z13 = 0.0;
0151 G4double z23 = 0.0;
0152 G4double lnZ = 0.0;
0153
0154 G4double minPairEnergy;
0155 G4double lowestKinEnergy;
0156
0157 G4double emin;
0158 G4double emax;
0159 G4double ymin = -5.0;
0160 G4double dy = 0.005;
0161
0162 G4int currentZ = 0;
0163 G4int nYBinPerDecade = 4;
0164 std::size_t nbiny = 1000;
0165 std::size_t nbine = 0;
0166
0167 G4bool fTableToFile = false;
0168
0169
0170 static const G4int NZDATPAIR = 5;
0171 static const G4int NINTPAIR = 8;
0172 static const G4int ZDATPAIR[NZDATPAIR];
0173 static const G4double xgi[NINTPAIR];
0174 static const G4double wgi[NINTPAIR];
0175
0176 private:
0177
0178 G4ParticleDefinition* theElectron;
0179 G4ParticleDefinition* thePositron;
0180 G4String dataName{""};
0181 };
0182
0183
0184
0185 inline void G4MuPairProductionModel::SetLowestKineticEnergy(G4double e)
0186 {
0187 lowestKinEnergy = e;
0188 }
0189
0190
0191
0192 inline
0193 void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p)
0194 {
0195 if(nullptr == particle) {
0196 particle = p;
0197 particleMass = particle->GetPDGMass();
0198 }
0199 }
0200
0201
0202
0203 inline G4double
0204 G4MuPairProductionModel::MaxSecondaryEnergyForElement(G4double kineticEnergy,
0205 G4double ZZ)
0206 {
0207 G4int Z = G4lrint(ZZ);
0208 if(Z != currentZ) {
0209 currentZ = Z;
0210 z13 = nist->GetZ13(Z);
0211 z23 = z13*z13;
0212 lnZ = nist->GetLOGZ(Z);
0213 }
0214 return kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13);
0215 }
0216
0217
0218
0219 #endif