Changeset 1337 for trunk/source/processes/electromagnetic/xrays/src
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/source/processes/electromagnetic/xrays/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/xrays/src/G4Cerenkov.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4Cerenkov.cc,v 1.2 6 2008/11/14 20:16:51 gumExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4Cerenkov.cc,v 1.27 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 73 73 #include "G4Cerenkov.hh" 74 74 75 using namespace std;76 77 75 ///////////////////////// 78 76 // Class Implementation … … 267 265 268 266 G4double phi = twopi*rand; 269 G4double sinPhi = s in(phi);270 G4double cosPhi = cos(phi);267 G4double sinPhi = std::sin(phi); 268 G4double cosPhi = std::cos(phi); 271 269 272 270 // calculate x,y, and z components of photon energy … … 274 272 // aligned with the z axis) 275 273 276 G4double sinTheta = s qrt(sin2Theta);274 G4double sinTheta = std::sqrt(sin2Theta); 277 275 G4double px = sinTheta*cosPhi; 278 276 G4double py = sinTheta*sinPhi; -
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) ; -
trunk/source/processes/electromagnetic/xrays/src/G4GammaXTRadiator.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4GammaXTRadiator.cc,v 1. 5 2006/06/29 19:56:07 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4GammaXTRadiator.cc,v 1.6 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 … … 35 35 36 36 #include "G4Gamma.hh" 37 38 using namespace std;39 37 40 38 //////////////////////////////////////////////////////////////////////////// … … 95 93 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas) ; 96 94 97 G4complex Ha = pow(Ca,-fAlphaPlate) ;98 G4complex Hb = pow(Cb,-fAlphaGas) ;95 G4complex Ha = std::pow(Ca,-fAlphaPlate) ; 96 G4complex Hb = std::pow(Cb,-fAlphaGas) ; 99 97 G4complex H = Ha*Hb ; 100 98 … … 103 101 104 102 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H) 105 * (1.0 - pow(H,fPlateNumber)) ;103 * (1.0 - std::pow(H,fPlateNumber)) ; 106 104 107 105 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle) ; 108 106 109 result = 2.0* real(R) ;107 result = 2.0*std::real(R) ; 110 108 111 109 return result ; -
trunk/source/processes/electromagnetic/xrays/src/G4RegularXTRadiator.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4RegularXTRadiator.cc,v 1. 9 2006/06/29 19:56:09 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4RegularXTRadiator.cc,v 1.10 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 … … 35 35 36 36 #include "G4Gamma.hh" 37 38 using namespace std;39 37 40 38 //////////////////////////////////////////////////////////////////////////// … … 96 94 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas); 97 95 98 G4complex Ha = pow(Ca,-fAlphaPlate);99 G4complex Hb = pow(Cb,-fAlphaGas);96 G4complex Ha = std::pow(Ca,-fAlphaPlate); 97 G4complex Hb = std::pow(Cb,-fAlphaGas); 100 98 G4complex H = Ha*Hb; 101 99 … … 104 102 105 103 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H) 106 * (1.0 - pow(H,fPlateNumber));104 * (1.0 - std::pow(H,fPlateNumber)); 107 105 108 106 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 109 107 110 result = 2.0* real(R);108 result = 2.0*std::real(R); 111 109 112 110 return result; … … 121 119 aMa = fPlateThick*GetPlateLinearPhotoAbs(energy); 122 120 bMb = fGasThick*GetGasLinearPhotoAbs(energy); 123 Qa = exp(-aMa);124 Qb = exp(-bMb);121 Qa = std::exp(-aMa); 122 Qb = std::exp(-bMb); 125 123 Q = Qa*Qb; 126 G4complex Ha( exp(-0.5*aMa)*cos(aZa),127 - exp(-0.5*aMa)*sin(aZa) );128 G4complex Hb( exp(-0.5*bMb)*cos(bZb),129 - exp(-0.5*bMb)*sin(bZb) );124 G4complex Ha( std::exp(-0.5*aMa)*std::cos(aZa), 125 -std::exp(-0.5*aMa)*std::sin(aZa) ); 126 G4complex Hb( std::exp(-0.5*bMb)*std::cos(bZb), 127 -std::exp(-0.5*bMb)*std::sin(bZb) ); 130 128 G4complex H = Ha*Hb; 131 129 132 130 G4complex Hs = conj(H); 133 D = 1.0 /( (1 - s qrt(Q))*(1 -sqrt(Q)) +134 4*s qrt(Q)*sin(0.5*(aZa+bZb))*sin(0.5*(aZa+bZb)) );131 D = 1.0 /( (1 - std::sqrt(Q))*(1 - std::sqrt(Q)) + 132 4*std::sqrt(Q)*std::sin(0.5*(aZa+bZb))*std::sin(0.5*(aZa+bZb)) ); 135 133 G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs) 136 134 * G4double(fPlateNumber)*D; 137 135 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb*(1.0-Hs)*(1.0-Hs) 138 * (1.0 - pow(H,fPlateNumber)) * D*D;136 * (1.0 - std::pow(H,fPlateNumber)) * D*D; 139 137 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 140 138 … … 149 147 G4complex R = (2.- Ha - 1./Ha)*S + (1. - Ha)*G4double(fPlateNumber); 150 148 R *= OneInterfaceXTRdEdx(energy,gamma,varAngle); 151 result = 2.0* real(R);149 result = 2.0*std::real(R); 152 150 return result; 153 151 */ -
trunk/source/processes/electromagnetic/xrays/src/G4Scintillation.cc
r1315 r1337 25 25 // 26 26 // 27 // $Id: G4Scintillation.cc,v 1.3 1 2010/05/27 20:49:40 gumExp $28 // GEANT4 tag $Name: geant4-09-04-beta- cand-01 $27 // $Id: G4Scintillation.cc,v 1.32 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 71 71 #include "G4Scintillation.hh" 72 72 73 using namespace std;74 75 73 ///////////////////////// 76 74 // Class Implementation … … 214 212 if (MeanNumberOfPhotons > 10.) 215 213 { 216 G4double sigma = ResolutionScale * s qrt(MeanNumberOfPhotons);214 G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons); 217 215 NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5); 218 216 } … … 281 279 GetConstProperty("YIELDRATIO"); 282 280 if ( ExcitationRatio == 1.0 ) { 283 Num = G4int ( min(YieldRatio,1.0) * NumPhotons);281 Num = G4int (std::min(YieldRatio,1.0) * NumPhotons); 284 282 } 285 283 else { 286 Num = G4int ( min(ExcitationRatio,1.0) * NumPhotons);284 Num = G4int (std::min(ExcitationRatio,1.0) * NumPhotons); 287 285 } 288 286 ScintillationTime = aMaterialPropertiesTable-> … … 330 328 331 329 G4double cost = 1. - 2.*G4UniformRand(); 332 G4double sint = s qrt((1.-cost)*(1.+cost));330 G4double sint = std::sqrt((1.-cost)*(1.+cost)); 333 331 334 332 G4double phi = twopi*G4UniformRand(); 335 G4double sinp = s in(phi);336 G4double cosp = cos(phi);333 G4double sinp = std::sin(phi); 334 G4double cosp = std::cos(phi); 337 335 338 336 G4double px = sint*cosp; … … 355 353 356 354 phi = twopi*G4UniformRand(); 357 sinp = s in(phi);358 cosp = cos(phi);355 sinp = std::sin(phi); 356 cosp = std::cos(phi); 359 357 360 358 photonPolarization = cosp * photonPolarization + sinp * perp; … … 392 390 if (ScintillationRiseTime==0.0) { 393 391 deltaTime = deltaTime - 394 ScintillationTime * log( G4UniformRand() );392 ScintillationTime * std::log( G4UniformRand() ); 395 393 } else { 396 394 deltaTime = deltaTime + … … 633 631 // make sure the envelope function is 634 632 // always larger than the bi-exponential 635 G4double t = -1.0*tau2* log(1-ran1);633 G4double t = -1.0*tau2*std::log(1-ran1); 636 634 G4double g = d*single_exp(t,tau2); 637 635 if (ran2 <= bi_exp(t,tau1,tau2)/g) return t; -
trunk/source/processes/electromagnetic/xrays/src/G4StrawTubeXTRadiator.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4StrawTubeXTRadiator.cc,v 1. 6 2007/09/29 17:49:34 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4StrawTubeXTRadiator.cc,v 1.7 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 … … 32 32 #include "Randomize.hh" 33 33 #include "G4Gamma.hh" 34 35 using namespace std;36 34 37 35 //////////////////////////////////////////////////////////////////////////// … … 78 76 fSigma3 = fPlasmaCof*mediumMat->GetElectronDensity(); 79 77 if(verboseLevel > 0) 80 G4cout<<"medium plasma energy = "<<s qrt(fSigma3)/eV<<" eV"<<G4endl;78 G4cout<<"medium plasma energy = "<<std::sqrt(fSigma3)/eV<<" eV"<<G4endl; 81 79 82 80 // Compute cofs for preparation of linear photo absorption in external medium … … 121 119 G4complex C3(1.0 + 0.5*fGasThick*M3/fAlphaGas, fGasThick/L3/fAlphaGas); 122 120 123 G4complex H2 = pow(C2,-fAlphaPlate);124 G4complex H3 = pow(C3,-fAlphaGas);121 G4complex H2 = std::pow(C2,-fAlphaPlate); 122 G4complex H3 = std::pow(C3,-fAlphaGas); 125 123 G4complex H = H2*H3; 126 124 … … 134 132 2.*( Z1 - Z2 )*( Z2 - Z3 )*H2*( 1. - H3 ) ; 135 133 136 result = 2.0* real(R)*(varAngle*energy/hbarc/hbarc);134 result = 2.0*std::real(R)*(varAngle*energy/hbarc/hbarc); 137 135 138 136 return result; … … 165 163 G4double varAngle ) 166 164 { 167 G4double cof, length,delta, real , image;165 G4double cof, length,delta, real_v, image_v; 168 166 169 167 length = 0.5*GetMediumFormationZone(omega,gamma,varAngle); … … 171 169 cof = 1.0/(1.0 + delta*delta); 172 170 173 real = length*cof;174 image = real*delta;175 176 G4complex zone(real ,image);171 real_v = length*cof; 172 image_v = real_v*delta; 173 174 G4complex zone(real_v,image_v); 177 175 return zone; 178 176 } -
trunk/source/processes/electromagnetic/xrays/src/G4SynchrotronRadiation.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4SynchrotronRadiation.cc,v 1. 5 2006/06/29 19:56:15 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4SynchrotronRadiation.cc,v 1.6 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // -------------------------------------------------------------- … … 44 44 45 45 #include "G4SynchrotronRadiation.hh" 46 // #include "G4Integrator.hh"47 46 #include "G4UnitsTable.hh" 48 49 using namespace std;50 47 51 48 /////////////////////////////////////////////////////////////////////// … … 65 62 fFieldPropagator = transportMgr->GetPropagatorInField(); 66 63 67 fLambdaConst = s qrt(3.0)*electron_mass_c2/64 fLambdaConst = std::sqrt(3.0)*electron_mass_c2/ 68 65 (2.5*fine_structure_const*eplus*c_light) ; 69 66 fEnergyConst = 1.5*c_light*c_light*eplus*hbar_Planck/electron_mass_c2 ; … … 169 166 << " B = " << Btot/tesla << " Tesla" 170 167 << " perpB = " << perpB/tesla << " Tesla" 171 << " Theta = " << Theta << " s in(Theta)=" <<sin(Theta) << '\n'168 << " Theta = " << Theta << " std::sin(Theta)=" << std::sin(Theta) << '\n' 172 169 << " ptot = " << G4BestUnit(ptot,"Energy") 173 170 << " rho = " << G4BestUnit(rho,"Length") … … 262 259 G4double Phi = twopi * G4UniformRand() ; 263 260 264 G4double dirx = s in(Teta)*cos(Phi) ,265 diry = s in(Teta)*sin(Phi) ,266 dirz = cos(Teta) ;261 G4double dirx = std::sin(Teta)*std::cos(Phi) , 262 diry = std::sin(Teta)*std::sin(Phi) , 263 dirz = std::cos(Teta) ; 267 264 268 265 G4ThreeVector gammaDirection ( dirx, diry, dirz); … … 271 268 // polarization of new gamma 272 269 273 // G4double sx = cos(Teta)*cos(Phi);274 // G4double sy = cos(Teta)*sin(Phi);275 // G4double sz = -s in(Teta);270 // G4double sx = std::cos(Teta)*std::cos(Phi); 271 // G4double sy = std::cos(Teta)*std::sin(Phi); 272 // G4double sz = -std::sin(Teta); 276 273 277 274 G4ThreeVector gammaPolarization = FieldValue.cross(gammaDirection); … … 368 365 else if(x<aa3) return Chebyshev(aa2,aa3,cheb2,ncheb2,x); 369 366 else if(x<1-0.0000841363) 370 { G4double y=- log(1-x);367 { G4double y=-std::log(1-x); 371 368 return y*Chebyshev(aa4,aa5,cheb3,ncheb3,y); 372 369 } 373 370 else 374 { G4double y=- log(1-x);371 { G4double y=-std::log(1-x); 375 372 return y*Chebyshev(aa5,aa6,cheb4,ncheb4,y); 376 373 } … … 384 381 static G4bool FirstTime=true; 385 382 if(verboseLevel > 0 && FirstTime) 386 { G4double Emean=8./(15.*s qrt(3.))*Ecr; // mean photon energy387 G4double E_rms=s qrt(211./675.)*Ecr; // rms of photon energy distribution383 { G4double Emean=8./(15.*std::sqrt(3.))*Ecr; // mean photon energy 384 G4double E_rms=std::sqrt(211./675.)*Ecr; // rms of photon energy distribution 388 385 G4cout << "G4SynchrotronRadiation::GetRandomEnergySR :" << '\n' << std::setprecision(4) 389 386 << " Ecr = " << G4BestUnit(Ecr,"Energy") << '\n' -
trunk/source/processes/electromagnetic/xrays/src/G4SynchrotronRadiationInMat.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4SynchrotronRadiationInMat.cc,v 1. 2 2006/06/29 19:56:17 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4SynchrotronRadiationInMat.cc,v 1.3 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // -------------------------------------------------------------- … … 44 44 #include "G4Integrator.hh" 45 45 46 using namespace std;47 48 46 //////////////////////////////////////////////////////////////////// 49 47 // … … 52 50 53 51 const G4double 54 G4SynchrotronRadiationInMat::fLambdaConst = s qrt(3.0)*electron_mass_c2/52 G4SynchrotronRadiationInMat::fLambdaConst = std::sqrt(3.0)*electron_mass_c2/ 55 53 (2.5*fine_structure_const*eplus*c_light) ; 56 54 … … 317 315 G4double Phi = twopi * G4UniformRand() ; 318 316 319 G4double dirx = s in(Teta)*cos(Phi) ,320 diry = s in(Teta)*sin(Phi) ,321 dirz = cos(Teta) ;317 G4double dirx = std::sin(Teta)*std::cos(Phi) , 318 diry = std::sin(Teta)*std::sin(Phi) , 319 dirz = std::cos(Teta) ; 322 320 323 321 G4ThreeVector gammaDirection ( dirx, diry, dirz); … … 326 324 // polarization of new gamma 327 325 328 // G4double sx = cos(Teta)*cos(Phi);329 // G4double sy = cos(Teta)*sin(Phi);330 // G4double sz = -s in(Teta);326 // G4double sx = std::cos(Teta)*std::cos(Phi); 327 // G4double sy = std::cos(Teta)*std::sin(Phi); 328 // G4double sz = -std::sin(Teta); 331 329 332 330 G4ThreeVector gammaPolarization = FieldValue.cross(gammaDirection); -
trunk/source/processes/electromagnetic/xrays/src/G4TransitionRadiation.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4TransitionRadiation.cc,v 1. 7 2006/06/29 19:56:19 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4TransitionRadiation.cc,v 1.8 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // G4TransitionRadiation class -- implementation file … … 42 42 43 43 #include <cmath> 44 // #include "G4ios.hh"45 // #include <fstream.h>46 // #include <stdlib.h>47 44 48 45 #include "G4TransitionRadiation.hh" 49 46 #include "G4Material.hh" 50 51 // Init gamma array52 53 47 54 48 // Local constants … … 58 52 const G4int G4TransitionRadiation::fPointNumber = 100 ; 59 53 60 using namespace std;61 54 62 55 /////////////////////////////////////////////////////////////////////// … … 87 80 // 88 81 // Sympson integral of TR spectral-angle density over energy between 89 // the limits energy 1 and energy2 at fixed varAngle = 1 - cos(Theta)82 // the limits energy 1 and energy2 at fixed varAngle = 1 - std::cos(Theta) 90 83 91 84 G4double -
trunk/source/processes/electromagnetic/xrays/src/G4TransparentRegXTRadiator.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4TransparentRegXTRadiator.cc,v 1.1 1 2007/09/29 17:49:34 vnivanchExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4TransparentRegXTRadiator.cc,v 1.12 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 … … 35 35 #include "G4Integrator.hh" 36 36 #include "G4Gamma.hh" 37 38 using namespace std;39 37 40 38 //////////////////////////////////////////////////////////////////////////// … … 113 111 tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick); 114 112 result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2); 115 // tmp = s in(tmp)*sin(tmp)*abs(k-cofMin)/result;113 // tmp = std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 116 114 if( k == kMin && kMin == G4int(cofMin) ) 117 115 { 118 sum += 0.5*s in(tmp)*sin(tmp)*abs(k-cofMin)/result;116 sum += 0.5*std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 119 117 } 120 118 else 121 119 { 122 sum += s in(tmp)*sin(tmp)*abs(k-cofMin)/result;120 sum += std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 123 121 } 124 122 if(verboseLevel > 2) 125 123 { 126 G4cout<<"k = "<<k<<"; tmp = "<<s in(tmp)*sin(tmp)*abs(k-cofMin)/result124 G4cout<<"k = "<<k<<"; tmp = "<<std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result 127 125 <<"; sum = "<<sum<<G4endl; 128 126 } 129 127 } 130 128 result = 4*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy; 131 // result *= ( 1 - exp(-0.5*fPlateNumber*sigma) )/( 1 -exp(-0.5*sigma) );129 // result *= ( 1 - std::exp(-0.5*fPlateNumber*sigma) )/( 1 - std::exp(-0.5*sigma) ); 132 130 // fPlateNumber; 133 result *= fPlateNumber; // * exp(-0.5*fPlateNumber*sigma);134 // +1- exp(-0.5*fPlateNumber*sigma);131 result *= fPlateNumber; // *std::exp(-0.5*fPlateNumber*sigma); 132 // +1-std::exp(-0.5*fPlateNumber*sigma); 135 133 /* 136 134 fEnergy = energy; … … 174 172 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas); 175 173 176 G4complex Ha = pow(Ca,-fAlphaPlate);177 G4complex Hb = pow(Cb,-fAlphaGas);174 G4complex Ha = std::pow(Ca,-fAlphaPlate); 175 G4complex Hb = std::pow(Cb,-fAlphaGas); 178 176 G4complex H = Ha*Hb; 179 177 G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H) 180 178 * G4double(fPlateNumber) ; 181 179 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H) 182 * (1.0 - exp(-0.5*fPlateNumber*sigma)) ;183 // *(1.0 - pow(H,fPlateNumber)) ;180 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) ; 181 // *(1.0 - std::pow(H,fPlateNumber)) ; 184 182 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 185 183 // G4complex R = F2*OneInterfaceXTRdEdx(energy,gamma,varAngle); 186 result = 2.0* real(R);184 result = 2.0*std::real(R); 187 185 return result; 188 186 */ … … 196 194 bMb = fGasThick*GetGasLinearPhotoAbs(energy); 197 195 sigma = aMa*fPlateThick + bMb*fGasThick; 198 Qa = exp(-0.5*aMa);199 Qb = exp(-0.5*bMb);196 Qa = std::exp(-0.5*aMa); 197 Qb = std::exp(-0.5*bMb); 200 198 Q = Qa*Qb; 201 199 202 G4complex Ha( Qa* cos(aZa), -Qa*sin(aZa) );203 G4complex Hb( Qb* cos(bZb), -Qb*sin(bZb) );200 G4complex Ha( Qa*std::cos(aZa), -Qa*std::sin(aZa) ); 201 G4complex Hb( Qb*std::cos(bZb), -Qb*std::sin(bZb) ); 204 202 G4complex H = Ha*Hb; 205 203 G4complex Hs = conj(H); 206 204 D = 1.0 /( (1 - Q)*(1 - Q) + 207 4*Q*s in(0.5*(aZa + bZb))*sin(0.5*(aZa + bZb)) );205 4*Q*std::sin(0.5*(aZa + bZb))*std::sin(0.5*(aZa + bZb)) ); 208 206 G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs) 209 207 * G4double(fPlateNumber)*D; 210 208 G4complex F2 = (1.0 - Ha)*(1.0 - Ha)*Hb*(1.0 - Hs)*(1.0 - Hs) 211 // * (1.0 - pow(H,fPlateNumber)) * D*D;212 * (1.0 - exp(-0.5*fPlateNumber*sigma)) * D*D;209 // * (1.0 - std::pow(H,fPlateNumber)) * D*D; 210 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) * D*D; 213 211 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 214 result = 2.0* real(R);212 result = 2.0*std::real(R); 215 213 return result; 216 214 -
trunk/source/processes/electromagnetic/xrays/src/G4VTransitionRadiation.cc
r1228 r1337 25 25 // 26 26 // 27 // $Id: G4VTransitionRadiation.cc,v 1. 5 2006/06/29 19:56:23 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3$27 // $Id: G4VTransitionRadiation.cc,v 1.6 2010/06/16 15:34:15 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 29 // 30 30 // G4VTransitionRadiation class -- implementation file … … 46 46 /////////////////////////////////////////////////////////////////////// 47 47 48 using namespace std;49 50 48 G4VTransitionRadiation::G4VTransitionRadiation( const G4String& processName, 51 49 G4ProcessType type ) … … 53 51 nSteps(0), 54 52 gammaMin(100), 55 cosDThetaMax( cos(0.1))53 cosDThetaMax(std::cos(0.1)) 56 54 { 57 55 Clear(); -
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 -
trunk/source/processes/electromagnetic/xrays/src/G4XTRTransparentRegRadModel.cc
r819 r1337 33 33 #include "G4Gamma.hh" 34 34 35 using namespace std;36 37 35 //////////////////////////////////////////////////////////////////////////// 38 36 // … … 121 119 if( k == kMin && kMin == G4int(cofMin) ) 122 120 { 123 sum += 0.5*s in(tmp)*sin(tmp)*std::abs(k-cofMin)/result;121 sum += 0.5*std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 124 122 } 125 123 else 126 124 { 127 sum += s in(tmp)*sin(tmp)*std::abs(k-cofMin)/result;125 sum += std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 128 126 } 129 127 // G4cout<<"k = "<<k<<"; sum = "<<sum<<G4endl; 130 128 } 131 129 result = 4.*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy; 132 result *= ( 1. - exp(-fPlateNumber*sigma) )/( 1. -exp(-sigma) );130 result *= ( 1. - std::exp(-fPlateNumber*sigma) )/( 1. - std::exp(-sigma) ); 133 131 return result; 134 132 } … … 159 157 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas); 160 158 161 G4complex Ha = pow(Ca,-fAlphaPlate);162 G4complex Hb = pow(Cb,-fAlphaGas);159 G4complex Ha = std::pow(Ca,-fAlphaPlate); 160 G4complex Hb = std::pow(Cb,-fAlphaGas); 163 161 G4complex H = Ha*Hb; 164 162 G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H) 165 163 * G4double(fPlateNumber) ; 166 164 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H) 167 * (1.0 - exp(-0.5*fPlateNumber*sigma)) ;168 // *(1.0 - pow(H,fPlateNumber)) ;165 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) ; 166 // *(1.0 - std::pow(H,fPlateNumber)) ; 169 167 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 170 168 // G4complex R = F2*OneInterfaceXTRdEdx(energy,gamma,varAngle); 171 result = 2.0* real(R);169 result = 2.0*std::real(R); 172 170 return result; 173 171 */ … … 181 179 bMb = fGasThick*GetGasLinearPhotoAbs(energy); 182 180 sigma = aMa*fPlateThick + bMb*fGasThick; 183 Qa = exp(-0.5*aMa);184 Qb = exp(-0.5*bMb);181 Qa = std::exp(-0.5*aMa); 182 Qb = std::exp(-0.5*bMb); 185 183 Q = Qa*Qb; 186 184 187 G4complex Ha( Qa* cos(aZa), -Qa*sin(aZa) );188 G4complex Hb( Qb* cos(bZb), -Qb*sin(bZb) );185 G4complex Ha( Qa*std::cos(aZa), -Qa*std::sin(aZa) ); 186 G4complex Hb( Qb*std::cos(bZb), -Qb*std::sin(bZb) ); 189 187 G4complex H = Ha*Hb; 190 188 G4complex Hs = conj(H); 191 189 D = 1.0 /( (1 - Q)*(1 - Q) + 192 4*Q*s in(0.5*(aZa + bZb))*sin(0.5*(aZa + bZb)) );190 4*Q*std::sin(0.5*(aZa + bZb))*std::sin(0.5*(aZa + bZb)) ); 193 191 G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs) 194 192 * G4double(fPlateNumber)*D; 195 193 G4complex F2 = (1.0 - Ha)*(1.0 - Ha)*Hb*(1.0 - Hs)*(1.0 - Hs) 196 // * (1.0 - pow(H,fPlateNumber)) * D*D;197 * (1.0 - exp(-0.5*fPlateNumber*sigma)) * D*D;194 // * (1.0 - std::pow(H,fPlateNumber)) * D*D; 195 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) * D*D; 198 196 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 199 result = 2.0* real(R);197 result = 2.0*std::real(R); 200 198 return result; 201 199
Note: See TracChangeset
for help on using the changeset viewer.