- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/xrays/src/G4ForwardXrayTR.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4ForwardXrayTR.cc,v 1.1 4 2007/05/11 14:23:04gcosmo Exp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4ForwardXrayTR.cc,v 1.15 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // G4ForwardXrayTR class -- implementation file … … 84 84 85 85 G4double G4ForwardXrayTR::fCofTR = fine_structure_const/pi ; 86 87 using namespace std;88 86 89 87 /* ************************************************************************ … … 411 409 // The high energy small theta approximation is applied. 412 410 // (matter1 -> matter2) 413 // varAngle =2* (1 - cos(Theta)) or approximately = Theta*Theta411 // varAngle =2* (1 - std::cos(Theta)) or approximately = Theta*Theta 414 412 // 415 413 … … 452 450 a4 = a2*a2 ; 453 451 b4 = b2*b2 ; 454 a = s qrt(a2) ;455 b = s qrt(b2) ;456 cof1 = c*c*(0.5/(a2*(x2 +a2)) +0.5* log(x2/(x2 +a2))/a4) ;457 cof3 = d*d*(0.5/(b2*(x2 +b2)) +0.5* log(x2/(x2 +b2))/b4) ;458 cof2 = -c*d*( log(x2/(x2 +b2))/b2 -log(x2/(x2 +a2))/a2)/(a2 - b2) ;452 a = std::sqrt(a2) ; 453 b = std::sqrt(b2) ; 454 cof1 = c*c*(0.5/(a2*(x2 +a2)) +0.5*std::log(x2/(x2 +a2))/a4) ; 455 cof3 = d*d*(0.5/(b2*(x2 +b2)) +0.5*std::log(x2/(x2 +b2))/b4) ; 456 cof2 = -c*d*(std::log(x2/(x2 +b2))/b2 - std::log(x2/(x2 +a2))/a2)/(a2 - b2) ; 459 457 return -varAngle*(cof1 + cof2 + cof3) ; 460 458 } … … 503 501 // 504 502 // Analytical Expression for spectral density of Xray TR photons 505 // x = 2*(1 - cos(Theta)) ~ Theta^2503 // x = 2*(1 - std::cos(Theta)) ~ Theta^2 506 504 // 507 505 … … 514 512 b = 1.0/(fGamma*fGamma) 515 513 + fSigma2/(energy*energy) ; 516 return ( (a + b)* log((x + b)/(x + a))/(a - b)514 return ( (a + b)*std::log((x + b)/(x + a))/(a - b) 517 515 + a/(x + a) + b/(x + b) )/energy ; 518 516 … … 688 686 if(anglePos > (*(*fAngleDistrTable)(iPlace))(iTransfer)) break ; 689 687 } 690 theta = s qrt((*fAngleDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1)) ;688 theta = std::sqrt((*fAngleDistrTable)(iPlace)->GetLowEdgeEnergy(iTransfer-1)) ; 691 689 692 690 // G4cout<<iTransfer<<" : theta = "<<theta<<G4endl ; 693 691 694 692 phi = twopi*G4UniformRand() ; 695 dirX = s in(theta)*cos(phi) ;696 dirY = s in(theta)*sin(phi) ;697 dirZ = cos(theta) ;693 dirX = std::sin(theta)*std::cos(phi) ; 694 dirY = std::sin(theta)*std::sin(phi) ; 695 dirZ = std::cos(theta) ; 698 696 G4ThreeVector directionTR(dirX,dirY,dirZ) ; 699 697 directionTR.rotateUz(particleDir) ; … … 763 761 (*(*fAngleDistrTable)(iPlace + 1))(iTransfer)*W2)) break ; 764 762 } 765 theta = s qrt(((*fAngleDistrTable)(iPlace)->763 theta = std::sqrt(((*fAngleDistrTable)(iPlace)-> 766 764 GetLowEdgeEnergy(iTransfer-1))*W1+ 767 765 ((*fAngleDistrTable)(iPlace + 1)-> … … 771 769 772 770 phi = twopi*G4UniformRand() ; 773 dirX = s in(theta)*cos(phi) ;774 dirY = s in(theta)*sin(phi) ;775 dirZ = cos(theta) ;771 dirX = std::sin(theta)*std::cos(phi) ; 772 dirY = std::sin(theta)*std::sin(phi) ; 773 dirZ = std::cos(theta) ; 776 774 G4ThreeVector directionTR(dirX,dirY,dirZ) ; 777 775 directionTR.rotateUz(particleDir) ;
Note: See TracChangeset
for help on using the changeset viewer.