- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.1 5 2010/04/06 17:02:23vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.18 2010/11/04 17:30:32 vnivanch Exp $ 27 // GEANT4 tag $Name: emstand-V09-03-25 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 42 42 // 13.11.08 add SetLPMflag and SetLPMconstant methods 43 43 // 13.11.08 change default LPMconstant value 44 // 13.10.10 add angular distributon interface (VI) 44 45 // 45 46 // Main References: … … 65 66 #include "G4ParticleChangeForLoss.hh" 66 67 #include "G4LossTableManager.hh" 67 68 #include "G4ModifiedTsai.hh" 68 69 69 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 90 91 use_completescreening(true),isInitialised(false) 91 92 { 92 if(p) SetParticle(p);93 93 theGamma = G4Gamma::Gamma(); 94 94 95 95 minThreshold = 0.1*keV; 96 SetLowEnergyLimit(GeV); 96 lowKinEnergy = GeV; 97 SetLowEnergyLimit(lowKinEnergy); 97 98 98 99 nist = G4NistManager::Instance(); 100 101 SetLPMFlag(true); 102 SetAngularDistribution(new G4ModifiedTsai()); 103 104 particleMass = kinEnergy = totalEnergy = currentZ = z13 = z23 = lnZ = Fel 105 = Finel = fCoulomb = fMax = densityFactor = densityCorr = lpmEnergy 106 = xiLPM = phiLPM = gLPM = klpm = kp = 0.0; 107 108 energyThresholdLPM = 1.e39; 109 99 110 InitialiseConstants(); 100 101 SetLPMFlag(true); 111 if(p) { SetParticle(p); } 102 112 } 103 113 … … 125 135 particle = p; 126 136 particleMass = p->GetPDGMass(); 127 if(p == G4Electron::Electron()) isElectron = true;128 else isElectron = false;137 if(p == G4Electron::Electron()) { isElectron = true; } 138 else { isElectron = false;} 129 139 } 130 140 … … 140 150 141 151 void G4eBremsstrahlungRelModel::SetupForMaterial(const G4ParticleDefinition*, 142 const G4Material* mat, G4double kineticEnergy) 152 const G4Material* mat, 153 G4double kineticEnergy) 143 154 { 144 155 densityFactor = mat->GetElectronDensity()*fMigdalConstant; … … 146 157 147 158 // Threshold for LPM effect (i.e. below which LPM hidden by density effect) 148 if (LPMFlag()) 159 if (LPMFlag()) { 149 160 energyThresholdLPM=sqrt(densityFactor)*lpmEnergy; 150 else161 } else { 151 162 energyThresholdLPM=1.e39; // i.e. do not use LPM effect 152 163 } 153 164 // calculate threshold for density effect 154 165 kinEnergy = kineticEnergy; … … 168 179 const G4DataVector& cuts) 169 180 { 170 if(p) SetParticle(p); 171 172 highKinEnergy = HighEnergyLimit(); 181 if(p) { SetParticle(p); } 182 173 183 lowKinEnergy = LowEnergyLimit(); 174 184 … … 177 187 InitialiseElementSelectors(p, cuts); 178 188 179 if(isInitialised) return;189 if(isInitialised) { return; } 180 190 fParticleChange = GetParticleChangeForLoss(); 181 191 isInitialised = true; … … 190 200 G4double cutEnergy) 191 201 { 192 if(!particle) SetParticle(p);193 if(kineticEnergy < lowKinEnergy) return 0.0;202 if(!particle) { SetParticle(p); } 203 if(kineticEnergy < lowKinEnergy) { return 0.0; } 194 204 G4double cut = std::min(cutEnergy, kineticEnergy); 195 if(cut == 0.0) return 0.0;205 if(cut == 0.0) { return 0.0; } 196 206 197 207 SetupForMaterial(particle, material,kineticEnergy); … … 261 271 G4double maxEnergy) 262 272 { 263 if(!particle) SetParticle(p);264 if(kineticEnergy < lowKinEnergy) return 0.0;273 if(!particle) { SetParticle(p); } 274 if(kineticEnergy < lowKinEnergy) { return 0.0; } 265 275 G4double cut = std::min(cutEnergy, kineticEnergy); 266 276 G4double tmax = std::min(maxEnergy, kineticEnergy); 267 277 268 if(cut >= tmax) return 0.0;278 if(cut >= tmax) { return 0.0; } 269 279 270 280 SetCurrentElement(Z); … … 273 283 274 284 // allow partial integration 275 if(tmax < kinEnergy) cross -= ComputeXSectionPerAtom(tmax);285 if(tmax < kinEnergy) { cross -= ComputeXSectionPerAtom(tmax); } 276 286 277 287 cross *= Z*Z*bremFactor; … … 390 400 // *** make sure suppression is smaller than 1 *** 391 401 // *** caused by Migdal approximation in xi *** 392 if (xiLPM*phiLPM>1. || s>0.57) xiLPM=1./phiLPM;402 if (xiLPM*phiLPM>1. || s>0.57) { xiLPM=1./phiLPM; } 393 403 } 394 404 … … 401 411 // * complete screening 402 412 { 403 if(gammaEnergy < 0.0) return 0.0;413 if(gammaEnergy < 0.0) { return 0.0; } 404 414 405 415 G4double y = gammaEnergy/totalEnergy; … … 429 439 { 430 440 431 if(gammaEnergy < 0.0) return 0.0;441 if(gammaEnergy < 0.0) { return 0.0; } 432 442 433 443 G4double y = gammaEnergy/totalEnergy; … … 465 475 { 466 476 G4double kineticEnergy = dp->GetKineticEnergy(); 467 if(kineticEnergy < lowKinEnergy) return;477 if(kineticEnergy < lowKinEnergy) { return; } 468 478 G4double cut = std::min(cutEnergy, kineticEnergy); 469 479 G4double emax = std::min(maxEnergy, kineticEnergy); 470 if(cut >= emax) return;480 if(cut >= emax) { return; } 471 481 472 482 SetupForMaterial(particle, couple->GetMaterial(),kineticEnergy); … … 483 493 // G4double fmax= fMax; 484 494 G4bool highe = true; 485 if(totalEnergy < energyThresholdLPM) highe = false;495 if(totalEnergy < energyThresholdLPM) { highe = false; } 486 496 487 497 G4double xmin = log(cut*cut + densityCorr); … … 507 517 508 518 // 509 // angles of the emitted gamma. ( Z - axis along the parent particle) 519 // angles of the emitted gamma. ( Z - axis along the parent particle) 520 // use general interface 510 521 // 511 // universal distribution suggested by L. Urban 512 // (Geant3 manual (1993) Phys211), 513 // derived from Tsai distribution (Rev Mod Phys 49,421(1977)) 514 515 G4double u; 516 const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ; 517 518 if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1; 519 else u = - log(G4UniformRand()*G4UniformRand())/a2; 520 521 G4double theta = u*particleMass/totalEnergy; 522 G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy, 523 totalEnergy-gammaEnergy, 524 (G4int)currentZ); 525 522 526 G4double sint = sin(theta); 523 527 G4double phi = twopi * G4UniformRand();
Note: See TracChangeset
for help on using the changeset viewer.