- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungModel.cc,v 1.4 6 2010/04/28 18:39:40vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4eBremsstrahlungModel.cc,v 1.48 2010/10/26 10:35:22 vnivanch Exp $ 27 // GEANT4 tag $Name: emstand-V09-03-24 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 55 55 // 15-02-07 correct LPMconstant by a factor 2, thanks to G. Depaola (mma) 56 56 // 09-09-08 MigdalConstant increased in (2pi)^2 times (A.Schaelicke) 57 // 13-10-10 Add angular distributon interface (VI) 57 58 // 58 59 // Class Description: … … 75 76 #include "G4DataVector.hh" 76 77 #include "G4ParticleChangeForLoss.hh" 78 #include "G4ModifiedTsai.hh" 77 79 78 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 90 92 isInitialised(false) 91 93 { 92 if(p) SetParticle(p);94 if(p) { SetParticle(p); } 93 95 theGamma = G4Gamma::Gamma(); 94 96 minThreshold = 0.1*keV; 97 SetAngularDistribution(new G4ModifiedTsai()); 98 highKinEnergy = HighEnergyLimit(); 99 lowKinEnergy = LowEnergyLimit(); 95 100 } 96 101 … … 129 134 const G4DataVector& cuts) 130 135 { 131 if(p) SetParticle(p);136 if(p) { SetParticle(p); } 132 137 highKinEnergy = HighEnergyLimit(); 133 138 lowKinEnergy = LowEnergyLimit(); … … 172 177 G4double cutEnergy) 173 178 { 174 if(!particle) SetParticle(p);175 if(kineticEnergy < lowKinEnergy) return 0.0;179 if(!particle) { SetParticle(p); } 180 if(kineticEnergy < lowKinEnergy) { return 0.0; } 176 181 177 182 const G4double thigh = 100.*GeV; … … 272 277 dedx += loss; 273 278 } 274 if(dedx < 0.) dedx = 0.;279 if(dedx < 0.) { dedx = 0.; } 275 280 return dedx; 276 281 } … … 413 418 G4double maxEnergy) 414 419 { 415 if(!particle) SetParticle(p);420 if(!particle) { SetParticle(p); } 416 421 G4double cross = 0.0; 417 422 G4double tmax = min(maxEnergy, kineticEnergy); 418 423 G4double cut = max(cutEnergy, minThreshold); 419 if(cut >= tmax) return cross;424 if(cut >= tmax) { return cross; } 420 425 421 426 const G4ElementVector* theElementVector = material->GetElementVector(); … … 495 500 { 496 501 G4double cross = 0.0 ; 497 if ( kineticEnergy < 1*keV || kineticEnergy < cut) return cross;502 if ( kineticEnergy < 1*keV || kineticEnergy < cut) { return cross; } 498 503 499 504 static const G4double ksi=2.0, alfa=1.00; … … 664 669 G4double kineticEnergy = dp->GetKineticEnergy(); 665 670 G4double tmax = min(maxEnergy, kineticEnergy); 666 if(tmin >= tmax) return;671 if(tmin >= tmax) { return; } 667 672 668 673 // … … 709 714 G4double xmax = tmax/kineticEnergy; 710 715 G4double kappa = 0.0; 711 if(xmax >= 1.) xmax = 1.;712 else kappa = log(xmax)/log(xmin);716 if(xmax >= 1.) { xmax = 1.; } 717 else { kappa = log(xmax)/log(xmin); } 713 718 G4double epsilmin = tmin/totalEnergy; 714 719 G4double epsilmax = tmax/totalEnergy; … … 812 817 } while( greject < G4UniformRand()*grejmax ); 813 818 } 814 /*815 if(x > 0.999) {816 G4cout << "### G4eBremsstrahlungModel Warning: e= " << kineticEnergy817 << " tlow= " << tlow818 << " x= " << x819 << " greject= " << greject820 << " grejmax= " << grejmax821 << " migdal= " << migdal822 << G4endl;823 // if(x >= 1.0) G4Exception("X=1");824 }825 */826 819 gammaEnergy = x*kineticEnergy; 827 820 … … 837 830 838 831 // 839 // angles of the emitted gamma. ( Z - axis along the parent particle) 832 // angles of the emitted gamma. ( Z - axis along the parent particle) 833 // use general interface 840 834 // 841 // universal distribution suggested by L. Urban 842 // (Geant3 manual (1993) Phys211), 843 // derived from Tsai distribution (Rev Mod Phys 49,421(1977)) 844 845 G4double u; 846 const G4double a1 = 0.625 , a2 = 3.*a1 , d = 27. ; 847 848 if (9./(9.+d) > G4UniformRand()) u = - log(G4UniformRand()*G4UniformRand())/a1; 849 else u = - log(G4UniformRand()*G4UniformRand())/a2; 850 851 G4double theta = u*electron_mass_c2/totalEnergy; 835 G4double theta = GetAngularDistribution()->PolarAngle(totalEnergy, 836 totalEnergy-gammaEnergy, 837 (G4int)anElement->GetZ()); 852 838 853 839 G4double sint = sin(theta);
Note: See TracChangeset
for help on using the changeset viewer.