00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #ifndef G4MuPairProductionModel_h
00061 #define G4MuPairProductionModel_h 1
00062
00063 #include "G4VEmModel.hh"
00064 #include "G4NistManager.hh"
00065 #include <vector>
00066
00067 class G4Element;
00068 class G4ParticleChangeForLoss;
00069 class G4ParticleChangeForGamma;
00070
00071 class G4MuPairProductionModel : public G4VEmModel
00072 {
00073 public:
00074
00075 G4MuPairProductionModel(const G4ParticleDefinition* p = 0,
00076 const G4String& nam = "muPairProd");
00077
00078 virtual ~G4MuPairProductionModel();
00079
00080 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
00081
00082 virtual G4double ComputeCrossSectionPerAtom(
00083 const G4ParticleDefinition*,
00084 G4double kineticEnergy,
00085 G4double Z, G4double A,
00086 G4double cutEnergy,
00087 G4double maxEnergy);
00088
00089 virtual G4double ComputeDEDXPerVolume(const G4Material*,
00090 const G4ParticleDefinition*,
00091 G4double kineticEnergy,
00092 G4double cutEnergy);
00093
00094 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
00095 const G4MaterialCutsCouple*,
00096 const G4DynamicParticle*,
00097 G4double tmin,
00098 G4double maxEnergy);
00099
00100 virtual G4double MinEnergyCut(const G4ParticleDefinition*,
00101 const G4MaterialCutsCouple*);
00102
00103 inline void SetLowestKineticEnergy(G4double e);
00104
00105 inline void SetParticle(const G4ParticleDefinition*);
00106
00107 protected:
00108
00109 G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut,
00110 G4double tmax);
00111
00112 G4double ComputeMicroscopicCrossSection(G4double tkin,
00113 G4double Z,
00114 G4double cut);
00115
00116 virtual G4double ComputeDMicroscopicCrossSection(G4double tkin,
00117 G4double Z,
00118 G4double pairEnergy);
00119
00120 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
00121 G4double kineticEnergy);
00122
00123 inline void SetCurrentElement(G4double Z);
00124
00125 private:
00126
00127 const G4Element* SelectRandomAtom(G4double kinEnergy,
00128 G4double dt,
00129 G4int it,
00130 const G4MaterialCutsCouple* couple,
00131 G4double tmin);
00132
00133 void MakeSamplingTables();
00134
00135 inline G4double InterpolatedIntegralCrossSection(
00136 G4double dt, G4double dz, G4int iz,
00137 G4int it, G4int iy, G4double z);
00138
00139
00140 G4MuPairProductionModel & operator=(const G4MuPairProductionModel &right);
00141 G4MuPairProductionModel(const G4MuPairProductionModel&);
00142
00143 protected:
00144
00145 const G4ParticleDefinition* particle;
00146 G4NistManager* nist;
00147
00148 G4double factorForCross;
00149 G4double sqrte;
00150 G4double particleMass;
00151 G4double currentZ;
00152 G4double z13;
00153 G4double z23;
00154 G4double lnZ;
00155
00156 static G4double xgi[8],wgi[8];
00157
00158 private:
00159
00160 G4ParticleDefinition* theElectron;
00161 G4ParticleDefinition* thePositron;
00162 G4ParticleChangeForLoss* fParticleChange;
00163
00164 G4double minPairEnergy;
00165 G4double lowestKinEnergy;
00166
00167
00168 G4int nzdat;
00169 G4int ntdat;
00170 G4int nbiny;
00171 size_t nmaxElements;
00172 static G4double zdat[5], adat[5], tdat[8];
00173 G4double ya[1001], proba[5][8][1001];
00174
00175 G4double ymin;
00176 G4double ymax;
00177 G4double dy;
00178
00179 G4bool samplingTablesAreFilled;
00180 std::vector<G4double> partialSum;
00181 };
00182
00183
00184
00185 inline void G4MuPairProductionModel::SetLowestKineticEnergy(G4double e)
00186 {
00187 lowestKinEnergy = e;
00188 }
00189
00190
00191
00192 inline
00193 void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p)
00194 {
00195 if(!particle) {
00196 particle = p;
00197 particleMass = particle->GetPDGMass();
00198 }
00199 }
00200
00201
00202
00203 inline void G4MuPairProductionModel::SetCurrentElement(G4double Z)
00204 {
00205 if(Z != currentZ) {
00206 currentZ = Z;
00207 G4int iz = G4int(Z);
00208 z13 = nist->GetZ13(iz);
00209 z23 = z13*z13;
00210 lnZ = nist->GetLOGZ(iz);
00211 }
00212 }
00213
00214
00215
00216 inline G4double G4MuPairProductionModel::InterpolatedIntegralCrossSection(
00217 G4double dt, G4double dz,
00218 G4int iz, G4int it, G4int iy, G4double z)
00219 {
00220 G4double fac = 1./(zdat[iz] *(zdat[iz] +1.));
00221 G4double fac1 = 1./(zdat[iz-1]*(zdat[iz-1]+1.));
00222 G4double f0 = fac1*proba[iz-1][it-1][iy] +
00223 (fac*proba[iz][it-1][iy]-fac1*proba[iz-1][it-1][iy])*dz;
00224 G4double f1 = fac1*proba[iz-1][it ][iy] +
00225 (fac*proba[iz][it ][iy]-fac1*proba[iz-1][it ][iy])*dz;
00226 return (f0 + (f1-f0)*dt)*z*(z+1.);
00227 }
00228
00229
00230
00231 #endif