- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/xrays/src/G4VXTRenergyLoss.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4VXTRenergyLoss.cc,v 1.4 4 2007/09/29 17:49:34 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4VXTRenergyLoss.cc,v 1.45 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // History: … … 54 54 #include "G4PhysicsFreeVector.hh" 55 55 #include "G4PhysicsLinearVector.hh" 56 57 using namespace std;58 56 59 57 //////////////////////////////////////////////////////////////////////////// … … 142 140 // fSigma1 = (20.9*eV)*(20.9*eV) ; 143 141 if(verboseLevel > 0) 144 G4cout<<"plate plasma energy = "<<s qrt(fSigma1)/eV<<" eV"<<G4endl ;142 G4cout<<"plate plasma energy = "<<std::sqrt(fSigma1)/eV<<" eV"<<G4endl ; 145 143 146 144 // plasma energy squared for gas material … … 148 146 fSigma2 = fPlasmaCof*gasMat->GetElectronDensity() ; 149 147 if(verboseLevel > 0) 150 G4cout<<"gas plasma energy = "<<s qrt(fSigma2)/eV<<" eV"<<G4endl ;148 G4cout<<"gas plasma energy = "<<std::sqrt(fSigma2)/eV<<" eV"<<G4endl ; 151 149 152 150 // Compute cofs for preparation of linear photo absorption … … 203 201 } 204 202 205 if ( fabs( gamma - fGamma ) < 0.05*gamma ) lambda = fLambda;203 if ( std::fabs( gamma - fGamma ) < 0.05*gamma ) lambda = fLambda; 206 204 else 207 205 { … … 495 493 result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2); 496 494 497 tmp = s in(tmp)*sin(tmp)*abs(k-cofMin)/result;495 tmp = std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 498 496 499 497 if( k == kMin && kMin == G4int(cofMin) ) 500 498 { 501 angleSum += 0.5*tmp; // 0.5*s in(tmp)*sin(tmp)*abs(k-cofMin)/result;499 angleSum += 0.5*tmp; // 0.5*std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 502 500 } 503 501 else 504 502 { 505 angleSum += tmp; // s in(tmp)*sin(tmp)*abs(k-cofMin)/result;506 } 507 theta = abs(k-cofMin)*cofPHC/energy/(fPlateThick + fGasThick);503 angleSum += tmp; // std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 504 } 505 theta = std::abs(k-cofMin)*cofPHC/energy/(fPlateThick + fGasThick); 508 506 if(verboseLevel > 2) 509 507 { 510 508 G4cout<<"iTheta = "<<iTheta<<"; k = "<<k<<"; theta = " 511 509 <<std::sqrt(theta)*fGamma<<"; tmp = " 512 <<tmp // s in(tmp)*sin(tmp)*abs(k-cofMin)/result510 <<tmp // std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result 513 511 <<"; angleSum = "<<angleSum<<G4endl; 514 512 } … … 697 695 if (fAngleRadDistr) 698 696 { 699 // theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));697 // theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma)); 700 698 theta2 = GetRandomAngle(energyTR,iTkin); 701 699 if(theta2 > 0.) theta = std::sqrt(theta2); 702 700 else theta = theta2; 703 701 } 704 else theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));702 else theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma)); 705 703 706 704 if( theta >= 0.1 ) theta = 0.1; … … 710 708 phi = twopi*G4UniformRand(); 711 709 712 dirX = s in(theta)*cos(phi);713 dirY = s in(theta)*sin(phi);714 dirZ = cos(theta);710 dirX = std::sin(theta)*std::cos(phi); 711 dirY = std::sin(theta)*std::sin(phi); 712 dirZ = std::cos(theta); 715 713 716 714 G4ThreeVector directionTR(dirX,dirY,dirZ); … … 762 760 // The high energy small theta approximation is applied. 763 761 // (matter1 -> matter2, or 2->1) 764 // varAngle =2* (1 - cos(theta)) or approximately = theta*theta762 // varAngle =2* (1 - std::cos(theta)) or approximately = theta*theta 765 763 // 766 764 … … 850 848 // G4cout<<"cof1 = "<<cof1<<"; cof2 = "<<cof2<<"; cofPHC = "<<cofPHC<<G4endl; 851 849 852 cofMin = s qrt(cof1*cof2);850 cofMin = std::sqrt(cof1*cof2); 853 851 cofMin /= cofPHC; 854 852 … … 863 861 { 864 862 tmp1 = cofPHC*k; 865 tmp2 = s qrt(tmp1*tmp1-cof1*cof2);863 tmp2 = std::sqrt(tmp1*tmp1-cof1*cof2); 866 864 energy1 = (tmp1+tmp2)/cof1; 867 865 energy2 = (tmp1-tmp2)/cof1; … … 874 872 tmp1 = ( energy1*energy1*(1./fGamma/fGamma + varAngle) + fSigma1 ) 875 873 * fPlateThick/(4*hbarc*energy1); 876 tmp2 = s in(tmp1);874 tmp2 = std::sin(tmp1); 877 875 tmp = energy1*tmp2*tmp2; 878 876 tmp2 = fPlateThick/(4*tmp1); … … 880 878 tmp *= (tmp1-tmp2)*(tmp1-tmp2); 881 879 tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy1*energy1); 882 tmp2 = abs(tmp1);880 tmp2 = std::abs(tmp1); 883 881 if(tmp2 > 0.) tmp /= tmp2; 884 882 else continue; … … 889 887 tmp1 = ( energy2*energy2*(1./fGamma/fGamma + varAngle) + fSigma1 ) 890 888 * fPlateThick/(4*hbarc*energy2); 891 tmp2 = s in(tmp1);889 tmp2 = std::sin(tmp1); 892 890 tmp = energy2*tmp2*tmp2; 893 891 tmp2 = fPlateThick/(4*tmp1); … … 895 893 tmp *= (tmp1-tmp2)*(tmp1-tmp2); 896 894 tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy2*energy2); 897 tmp2 = abs(tmp1);895 tmp2 = std::abs(tmp1); 898 896 if(tmp2 > 0.) tmp /= tmp2; 899 897 else continue; … … 940 938 G4double varAngle ) 941 939 { 942 G4double cof, length,delta, real , image;940 G4double cof, length,delta, real_v, image_v ; 943 941 944 942 length = 0.5*GetPlateFormationZone(omega,gamma,varAngle) ; … … 946 944 cof = 1.0/(1.0 + delta*delta) ; 947 945 948 real 949 image = real*delta ;950 951 G4complex zone(real ,image);946 real_v = length*cof ; 947 image_v = real_v*delta ; 948 949 G4complex zone(real_v,image_v); 952 950 return zone ; 953 951 } … … 1013 1011 G4double varAngle ) 1014 1012 { 1015 G4double cof, length,delta, real , image;1013 G4double cof, length,delta, real_v, image_v ; 1016 1014 1017 1015 length = 0.5*GetGasFormationZone(omega,gamma,varAngle) ; … … 1019 1017 cof = 1.0/(1.0 + delta*delta) ; 1020 1018 1021 real = length*cof ;1022 image = real*delta ;1023 1024 G4complex zone(real ,image);1019 real_v = length*cof ; 1020 image_v = real_v*delta ; 1021 1022 G4complex zone(real_v,image_v); 1025 1023 return zone ; 1026 1024 } … … 1080 1078 void G4VXTRenergyLoss::GetPlateZmuProduct() 1081 1079 { 1082 ofstream outPlate("plateZmu.dat",ios::out ) ;1083 outPlate.setf( ios::scientific,ios::floatfield );1080 std::ofstream outPlate("plateZmu.dat", std::ios::out ) ; 1081 outPlate.setf( std::ios::scientific, std::ios::floatfield ); 1084 1082 1085 1083 G4int i ; … … 1118 1116 void G4VXTRenergyLoss::GetGasZmuProduct() 1119 1117 { 1120 ofstream outGas("gasZmu.dat",ios::out ) ;1121 outGas.setf( ios::scientific,ios::floatfield );1118 std::ofstream outGas("gasZmu.dat", std::ios::out ) ; 1119 outGas.setf( std::ios::scientific, std::ios::floatfield ); 1122 1120 G4int i ; 1123 1121 G4double omega, varAngle, gamma ; … … 1209 1207 if (Z < 1.5) T0 = 40.0*keV; 1210 1208 1211 G4double X = max(GammaEnergy, T0) / electron_mass_c2;1209 G4double X = std::max(GammaEnergy, T0) / electron_mass_c2; 1212 1210 CrossSection = p1Z*std::log(1.+2.*X)/X 1213 1211 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X); … … 1219 1217 G4double dT0 = 1.*keV; 1220 1218 X = (T0+dT0) / electron_mass_c2 ; 1221 G4double sigma = p1Z* log(1.+2*X)/X1219 G4double sigma = p1Z*std::log(1.+2*X)/X 1222 1220 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X); 1223 1221 G4double c1 = -T0*(sigma-CrossSection)/(CrossSection*dT0); 1224 1222 G4double c2 = 0.150; 1225 if (Z > 1.5) c2 = 0.375-0.0556* log(Z);1226 G4double y = log(GammaEnergy/T0);1227 CrossSection *= exp(-y*(c1+c2*y));1223 if (Z > 1.5) c2 = 0.375-0.0556*std::log(Z); 1224 G4double y = std::log(GammaEnergy/T0); 1225 CrossSection *= std::exp(-y*(c1+c2*y)); 1228 1226 } 1229 1227 // G4cout << "e= " << GammaEnergy << " Z= " << Z << " cross= " << CrossSection << G4endl; … … 1239 1237 // The high energy small theta approximation is applied. 1240 1238 // (matter1 -> matter2, or 2->1) 1241 // varAngle =2* (1 - cos(theta)) or approximately = theta*theta1239 // varAngle =2* (1 - std::cos(theta)) or approximately = theta*theta 1242 1240 // 1243 1241 … … 1326 1324 G4double gamma, numberE ; 1327 1325 1328 ofstream outEn("numberE.dat",ios::out ) ;1329 outEn.setf( ios::scientific,ios::floatfield );1330 1331 ofstream outAng("numberAng.dat",ios::out ) ;1332 outAng.setf( ios::scientific,ios::floatfield );1326 std::ofstream outEn("numberE.dat", std::ios::out ) ; 1327 outEn.setf( std::ios::scientific, std::ios::floatfield ); 1328 1329 std::ofstream outAng("numberAng.dat", std::ios::out ) ; 1330 outAng.setf( std::ios::scientific, std::ios::floatfield ); 1333 1331 1334 1332 for(iTkin=0;iTkin<fTotBin;iTkin++) // Lorentz factor loop
Note: See TracChangeset
for help on using the changeset viewer.