Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // ------------------------------------------- 28 // 29 // 21.03.17 V. Grichine based on G4hBremsstrah 30 // 31 // Class Description: 32 // 33 // Implementation of energy loss for LDMPhoton 34 // 35 36 //....oooOO0OOooo........oooOO0OOooo........oo 37 38 #include "G4LDMBremModel.hh" 39 40 #include "TestParameters.hh" 41 42 #include "G4LDMPhoton.hh" 43 #include "G4Log.hh" 44 #include "G4ParticleChangeForLoss.hh" 45 #include "G4PhysicalConstants.hh" 46 #include "G4SystemOfUnits.hh" 47 48 //....oooOO0OOooo........oooOO0OOooo........oo 49 50 using namespace std; 51 52 G4LDMBremModel::G4LDMBremModel(const G4Particl 53 : G4MuBremsstrahlungModel(p, nam) 54 { 55 fEpsilon = TestParameters::GetPointer()->Get 56 theLDMPhoton = G4LDMPhoton::LDMPhoton(); 57 fLDMPhotonMass = theLDMPhoton->GetPDGMass(); 58 minThreshold = 1.2 * fLDMPhotonMass; 59 } 60 61 //....oooOO0OOooo........oooOO0OOooo........oo 62 63 G4LDMBremModel::~G4LDMBremModel() {} 64 65 //....oooOO0OOooo........oooOO0OOooo........oo 66 67 G4double G4LDMBremModel::ComputeDEDXPerVolume( 68 69 { 70 return 0.0; 71 } 72 73 //....oooOO0OOooo........oooOO0OOooo........oo 74 75 G4double G4LDMBremModel::ComputeDMicroscopicCr 76 77 // differential cross section 78 { 79 G4double dxsection = 0.; 80 81 if (gammaEnergy > tkin || tkin < minThreshol 82 /* 83 G4cout << "G4LDMBremModel m= " << mass 84 << " " << particle->GetParticleName( 85 << " Egamma(GeV)= " << gammaEnergy/G 86 << " Ekin(GeV)= " << tkin/GeV << G4e 87 */ 88 G4double E = tkin + mass; 89 G4double v = gammaEnergy / E; 90 G4double delta = 0.5 * mass * mass * v / (E 91 G4double rab0 = delta * sqrte; 92 93 G4int iz = std::max(1, std::min(G4lrint(Z), 94 95 G4double z13 = 1.0 / nist->GetZ13(iz); 96 G4double dn = mass * nist->GetA27(iz) / (70. 97 98 G4double b = btf; 99 if (1 == iz) b = bh; 100 101 // nucleus contribution logarithm 102 G4double rab1 = b * z13; 103 G4double fn = 104 G4Log(rab1 / (dn * (electron_mass_c2 + rab 105 if (fn < 0.) fn = 0.; 106 107 G4double x = 1.0 - v; 108 109 if (particle->GetPDGSpin() != 0) { 110 x += 0.75 * v * v; 111 } 112 113 dxsection = coeff * x * Z * Z * fn / gammaEn 114 return dxsection; 115 } 116 117 //....oooOO0OOooo........oooOO0OOooo........oo 118 119 G4double G4LDMBremModel::ComputeCrossSectionPe 120 121 122 { 123 G4double cross = 0.0; 124 125 if (kineticEnergy <= lowestKinEnergy) return 126 127 G4double tmax = std::min(maxEnergy, kineticE 128 G4double cut = std::min(cutEnergy, kineticEn 129 130 cut = std::max(cut, minThreshold); 131 if (cut >= tmax) return cross; 132 133 cross = ComputeMicroscopicCrossSection(kinet 134 135 if (tmax < kineticEnergy) { 136 cross -= ComputeMicroscopicCrossSection(ki 137 } 138 cross *= fEpsilon * fEpsilon; 139 140 return cross; 141 } 142 143 //....oooOO0OOooo........oooOO0OOooo........oo 144 145 void G4LDMBremModel::SampleSecondaries(std::ve 146 const G 147 const G 148 G4doubl 149 { 150 G4double kineticEnergy = dp->GetKineticEnerg 151 // check against insufficient energy 152 G4double tmax = std::min(kineticEnergy, maxE 153 G4double tmin = std::min(kineticEnergy, minE 154 tmin = std::max(tmin, minThreshold); 155 if (tmin >= tmax) return; 156 157 // ===== sampling of energy transfer ====== 158 159 G4ParticleMomentum partDirection = dp->GetMo 160 161 // select randomly one element constituing t 162 const G4Element* anElement = SelectRandomAto 163 G4double Z = anElement->GetZ(); 164 165 G4double totalEnergy = kineticEnergy + mass; 166 G4double totalMomentum = sqrt(kineticEnergy 167 168 G4double func1 = tmin * ComputeDMicroscopicC 169 170 G4double lnepksi, epksi; 171 G4double func2; 172 173 G4double xmin = G4Log(tmin / MeV); 174 G4double xmax = G4Log(tmax / tmin); 175 176 do { 177 lnepksi = xmin + G4UniformRand() * xmax; 178 epksi = MeV * G4Exp(lnepksi); 179 func2 = epksi * ComputeDMicroscopicCrossSe 180 181 // Loop checking, 03-Aug-2015, Vladimir Iv 182 } while (func2 < func1 * G4UniformRand()); 183 184 G4double gEnergy = std::max(epksi, fLDMPhoto 185 G4double gMomentum = std::sqrt((epksi - fLDM 186 187 // ===== sample angle ===== 188 189 G4double gam = totalEnergy / mass; 190 G4double rmax = gam * std::min(1.0, totalEne 191 G4double rmax2 = rmax * rmax; 192 G4double x = G4UniformRand() * rmax2 / (1.0 193 194 G4double theta = std::sqrt(x / (1.0 - x)) / 195 G4double sint = std::sin(theta); 196 G4double phi = twopi * G4UniformRand(); 197 G4double dirx = sint * cos(phi), diry = sint 198 199 G4ThreeVector gDirection(dirx, diry, dirz); 200 gDirection.rotateUz(partDirection); 201 202 partDirection *= totalMomentum; 203 partDirection -= gMomentum * gDirection; 204 partDirection = partDirection.unit(); 205 206 // primary change 207 208 kineticEnergy -= gEnergy; 209 210 fParticleChange->SetProposedKineticEnergy(ki 211 fParticleChange->SetProposedMomentumDirectio 212 213 // save secondary 214 G4DynamicParticle* aLDMPhoton = new G4Dynami 215 vdp->push_back(aLDMPhoton); 216 } 217 218 //....oooOO0OOooo........oooOO0OOooo........oo 219