[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1007] | 26 | // $Id: G4MuPairProductionModel.hh,v 1.27 2008/07/22 16:11:34 vnivanch Exp $ |
---|
| 27 | // GEANT4 tag $Name: geant4-09-02 $ |
---|
[819] | 28 | // |
---|
| 29 | // ------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // GEANT4 Class header file |
---|
| 32 | // |
---|
| 33 | // |
---|
| 34 | // File name: G4MuPairProductionModel |
---|
| 35 | // |
---|
| 36 | // Author: Vladimir Ivanchenko on base of Laszlo Urban code |
---|
| 37 | // |
---|
| 38 | // Creation date: 18.05.2002 |
---|
| 39 | // |
---|
| 40 | // Modifications: |
---|
| 41 | // |
---|
| 42 | // 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko) |
---|
| 43 | // 27-01-03 Make models region aware (V.Ivanchenko) |
---|
| 44 | // 13-02-03 Add name (V.Ivanchenko) |
---|
| 45 | // 10-02-04 Update parameterisation using R.Kokoulin model (V.Ivanchenko) |
---|
| 46 | // 10-02-04 Add lowestKinEnergy (V.Ivanchenko) |
---|
| 47 | // 13-02-06 Add ComputeCrossSectionPerAtom (mma) |
---|
| 48 | // 12-05-06 Add parameter to SelectRandomAtom (A.Bogdanov) |
---|
| 49 | // 11-10-07 Add ignoreCut flag (V.Ivanchenko) |
---|
[961] | 50 | // 28-02-08 Reorganized protected methods and members (V.Ivanchenko) |
---|
[819] | 51 | |
---|
| 52 | // |
---|
| 53 | // Class Description: |
---|
| 54 | // |
---|
| 55 | // Implementation of e+e- pair production by muons |
---|
| 56 | // |
---|
| 57 | |
---|
| 58 | // ------------------------------------------------------------------- |
---|
| 59 | // |
---|
| 60 | |
---|
| 61 | #ifndef G4MuPairProductionModel_h |
---|
| 62 | #define G4MuPairProductionModel_h 1 |
---|
| 63 | |
---|
| 64 | #include "G4VEmModel.hh" |
---|
[961] | 65 | #include "G4NistManager.hh" |
---|
[819] | 66 | #include <vector> |
---|
| 67 | |
---|
| 68 | class G4Element; |
---|
| 69 | class G4ParticleChangeForLoss; |
---|
| 70 | class G4ParticleChangeForGamma; |
---|
| 71 | |
---|
| 72 | class G4MuPairProductionModel : public G4VEmModel |
---|
| 73 | { |
---|
| 74 | public: |
---|
| 75 | |
---|
| 76 | G4MuPairProductionModel(const G4ParticleDefinition* p = 0, |
---|
| 77 | const G4String& nam = "muPairProd"); |
---|
| 78 | |
---|
| 79 | virtual ~G4MuPairProductionModel(); |
---|
| 80 | |
---|
[1007] | 81 | void Initialise(const G4ParticleDefinition*, const G4DataVector&); |
---|
[819] | 82 | |
---|
| 83 | |
---|
| 84 | virtual G4double ComputeCrossSectionPerAtom( |
---|
| 85 | const G4ParticleDefinition*, |
---|
| 86 | G4double kineticEnergy, |
---|
| 87 | G4double Z, G4double A, |
---|
| 88 | G4double cutEnergy, |
---|
| 89 | G4double maxEnergy); |
---|
| 90 | |
---|
| 91 | virtual G4double ComputeDEDXPerVolume(const G4Material*, |
---|
| 92 | const G4ParticleDefinition*, |
---|
| 93 | G4double kineticEnergy, |
---|
| 94 | G4double cutEnergy); |
---|
| 95 | |
---|
[961] | 96 | virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, |
---|
| 97 | const G4MaterialCutsCouple*, |
---|
| 98 | const G4DynamicParticle*, |
---|
| 99 | G4double tmin, |
---|
| 100 | G4double maxEnergy); |
---|
[819] | 101 | |
---|
[1007] | 102 | inline void SetLowestKineticEnergy(G4double e); |
---|
| 103 | |
---|
| 104 | inline G4double MinEnergyCut(const G4ParticleDefinition*, |
---|
[1005] | 105 | const G4MaterialCutsCouple*); |
---|
| 106 | |
---|
[961] | 107 | inline void SetParticle(const G4ParticleDefinition*); |
---|
[819] | 108 | |
---|
[961] | 109 | protected: |
---|
[819] | 110 | |
---|
| 111 | G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut, |
---|
| 112 | G4double tmax); |
---|
| 113 | |
---|
| 114 | G4double ComputeMicroscopicCrossSection(G4double tkin, |
---|
| 115 | G4double Z, |
---|
| 116 | G4double cut); |
---|
| 117 | |
---|
[961] | 118 | virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, |
---|
| 119 | G4double Z, |
---|
| 120 | G4double pairEnergy); |
---|
[819] | 121 | |
---|
[1007] | 122 | inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*, |
---|
| 123 | G4double kineticEnergy); |
---|
[819] | 124 | |
---|
[961] | 125 | inline void SetCurrentElement(G4double Z); |
---|
[819] | 126 | |
---|
| 127 | private: |
---|
| 128 | |
---|
| 129 | const G4Element* SelectRandomAtom(G4double kinEnergy, |
---|
| 130 | G4double dt, |
---|
| 131 | G4int it, |
---|
| 132 | const G4MaterialCutsCouple* couple, |
---|
| 133 | G4double tmin); |
---|
| 134 | |
---|
| 135 | void MakeSamplingTables(); |
---|
| 136 | |
---|
| 137 | inline G4double InterpolatedIntegralCrossSection( |
---|
| 138 | G4double dt, G4double dz, G4int iz, |
---|
| 139 | G4int it, G4int iy, G4double z); |
---|
| 140 | |
---|
| 141 | // hide assignment operator |
---|
| 142 | G4MuPairProductionModel & operator=(const G4MuPairProductionModel &right); |
---|
| 143 | G4MuPairProductionModel(const G4MuPairProductionModel&); |
---|
| 144 | |
---|
[961] | 145 | protected: |
---|
[819] | 146 | |
---|
[961] | 147 | const G4ParticleDefinition* particle; |
---|
| 148 | G4NistManager* nist; |
---|
[819] | 149 | |
---|
| 150 | G4double factorForCross; |
---|
| 151 | G4double sqrte; |
---|
| 152 | G4double particleMass; |
---|
| 153 | G4double currentZ; |
---|
| 154 | G4double z13; |
---|
| 155 | G4double z23; |
---|
| 156 | G4double lnZ; |
---|
| 157 | |
---|
[961] | 158 | static G4double xgi[8],wgi[8]; |
---|
[819] | 159 | |
---|
[961] | 160 | private: |
---|
| 161 | |
---|
| 162 | G4ParticleDefinition* theElectron; |
---|
| 163 | G4ParticleDefinition* thePositron; |
---|
| 164 | G4ParticleChangeForLoss* fParticleChange; |
---|
| 165 | |
---|
| 166 | G4double minPairEnergy; |
---|
| 167 | G4double lowestKinEnergy; |
---|
| 168 | |
---|
[819] | 169 | // tables for sampling |
---|
| 170 | G4int nzdat; |
---|
| 171 | G4int ntdat; |
---|
| 172 | G4int nbiny; |
---|
| 173 | size_t nmaxElements; |
---|
[961] | 174 | static G4double zdat[5],adat[5],tdat[8]; |
---|
[819] | 175 | G4double ya[1001],proba[5][8][1001]; |
---|
| 176 | |
---|
| 177 | G4double ymin; |
---|
| 178 | G4double ymax; |
---|
| 179 | G4double dy; |
---|
| 180 | |
---|
| 181 | G4bool samplingTablesAreFilled; |
---|
| 182 | std::vector<G4double> partialSum; |
---|
| 183 | }; |
---|
| 184 | |
---|
| 185 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 186 | |
---|
[961] | 187 | inline void G4MuPairProductionModel::SetLowestKineticEnergy(G4double e) |
---|
[819] | 188 | { |
---|
[961] | 189 | lowestKinEnergy = e; |
---|
[819] | 190 | } |
---|
| 191 | |
---|
| 192 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 193 | |
---|
[961] | 194 | inline |
---|
[1007] | 195 | G4double G4MuPairProductionModel::MinEnergyCut(const G4ParticleDefinition*, |
---|
| 196 | const G4MaterialCutsCouple* ) |
---|
| 197 | { |
---|
| 198 | return minPairEnergy; |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 202 | |
---|
| 203 | inline |
---|
[961] | 204 | void G4MuPairProductionModel::SetParticle(const G4ParticleDefinition* p) |
---|
| 205 | { |
---|
| 206 | if(!particle) { |
---|
| 207 | particle = p; |
---|
| 208 | particleMass = particle->GetPDGMass(); |
---|
| 209 | } |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 213 | |
---|
[1007] | 214 | inline G4double G4MuPairProductionModel::MaxSecondaryEnergy( |
---|
| 215 | const G4ParticleDefinition*, |
---|
| 216 | G4double kineticEnergy) |
---|
| 217 | { |
---|
| 218 | G4double maxPairEnergy = kineticEnergy + particleMass*(1.0 - 0.75*sqrte*z13); |
---|
| 219 | return maxPairEnergy; |
---|
| 220 | } |
---|
| 221 | |
---|
| 222 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 223 | |
---|
[819] | 224 | inline void G4MuPairProductionModel::SetCurrentElement(G4double Z) |
---|
| 225 | { |
---|
| 226 | if(Z != currentZ) { |
---|
| 227 | currentZ = Z; |
---|
[961] | 228 | G4int iz = G4int(Z); |
---|
| 229 | z13 = nist->GetZ13(iz); |
---|
[819] | 230 | z23 = z13*z13; |
---|
[961] | 231 | lnZ = nist->GetLOGZ(iz); |
---|
[819] | 232 | } |
---|
| 233 | } |
---|
| 234 | |
---|
| 235 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 236 | |
---|
| 237 | inline G4double G4MuPairProductionModel::InterpolatedIntegralCrossSection( |
---|
| 238 | G4double dt, G4double dz, |
---|
| 239 | G4int iz, G4int it, G4int iy, G4double z) |
---|
| 240 | { |
---|
| 241 | G4double fac = 1./(zdat[iz] *(zdat[iz] +1.)); |
---|
| 242 | G4double fac1 = 1./(zdat[iz-1]*(zdat[iz-1]+1.)); |
---|
| 243 | G4double f0 = fac1*proba[iz-1][it-1][iy] + |
---|
| 244 | (fac*proba[iz][it-1][iy]-fac1*proba[iz-1][it-1][iy])*dz; |
---|
| 245 | G4double f1 = fac1*proba[iz-1][it ][iy] + |
---|
| 246 | (fac*proba[iz][it ][iy]-fac1*proba[iz-1][it ][iy])*dz; |
---|
| 247 | return (f0 + (f1-f0)*dt)*z*(z+1.); |
---|
| 248 | } |
---|
| 249 | |
---|
| 250 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 251 | |
---|
| 252 | #endif |
---|