Ignore:
Timestamp:
Sep 30, 2010, 2:47:17 PM (14 years ago)
Author:
garnier
Message:

tag geant4.9.4 beta 1 + modifs locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/xrays/src/G4VXTRenergyLoss.cc

    r1228 r1337  
    2525//
    2626//
    27 // $Id: G4VXTRenergyLoss.cc,v 1.44 2007/09/29 17:49:34 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4VXTRenergyLoss.cc,v 1.45 2010/06/16 15:34:15 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-01 $
    2929//
    3030// History:
     
    5454#include "G4PhysicsFreeVector.hh"
    5555#include "G4PhysicsLinearVector.hh"
    56 
    57 using namespace std;
    5856
    5957////////////////////////////////////////////////////////////////////////////
     
    142140  //  fSigma1 = (20.9*eV)*(20.9*eV) ;
    143141  if(verboseLevel > 0)
    144     G4cout<<"plate plasma energy = "<<sqrt(fSigma1)/eV<<" eV"<<G4endl ;
     142    G4cout<<"plate plasma energy = "<<std::sqrt(fSigma1)/eV<<" eV"<<G4endl ;
    145143
    146144  // plasma energy squared for gas material
     
    148146  fSigma2 = fPlasmaCof*gasMat->GetElectronDensity()  ;
    149147  if(verboseLevel > 0)
    150     G4cout<<"gas plasma energy = "<<sqrt(fSigma2)/eV<<" eV"<<G4endl ;
     148    G4cout<<"gas plasma energy = "<<std::sqrt(fSigma2)/eV<<" eV"<<G4endl ;
    151149
    152150  // Compute cofs for preparation of linear photo absorption
     
    203201    }
    204202
    205     if ( fabs( gamma - fGamma ) < 0.05*gamma ) lambda = fLambda;
     203    if ( std::fabs( gamma - fGamma ) < 0.05*gamma ) lambda = fLambda;
    206204    else
    207205    {
     
    495493    result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
    496494
    497     tmp = sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
     495    tmp = std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result;
    498496
    499497    if( k == kMin && kMin == G4int(cofMin) )
    500498    {
    501       angleSum   += 0.5*tmp; // 0.5*sin(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;
    502500    }
    503501    else
    504502    {
    505       angleSum   += tmp; // sin(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);
    508506    if(verboseLevel > 2)
    509507    {
    510508      G4cout<<"iTheta = "<<iTheta<<"; k = "<<k<<"; theta = "
    511509            <<std::sqrt(theta)*fGamma<<"; tmp = "
    512             <<tmp // sin(tmp)*sin(tmp)*abs(k-cofMin)/result
     510            <<tmp // std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result
    513511            <<";    angleSum = "<<angleSum<<G4endl;
    514512    }
     
    697695      if (fAngleRadDistr)
    698696      {
    699         // theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
     697        // theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma));
    700698        theta2 = GetRandomAngle(energyTR,iTkin);
    701699        if(theta2 > 0.) theta = std::sqrt(theta2);
    702700        else            theta = theta2;
    703701      }
    704       else theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
     702      else theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma));
    705703
    706704      if( theta >= 0.1 ) theta = 0.1;
     
    710708      phi = twopi*G4UniformRand();
    711709
    712       dirX = sin(theta)*cos(phi);
    713       dirY = sin(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);
    715713
    716714      G4ThreeVector directionTR(dirX,dirY,dirZ);
     
    762760// The high energy small theta approximation is applied.
    763761// (matter1 -> matter2, or 2->1)
    764 // varAngle =2* (1 - cos(theta)) or approximately = theta*theta
     762// varAngle =2* (1 - std::cos(theta)) or approximately = theta*theta
    765763//
    766764
     
    850848  // G4cout<<"cof1 = "<<cof1<<"; cof2 = "<<cof2<<"; cofPHC = "<<cofPHC<<G4endl;
    851849
    852   cofMin  =  sqrt(cof1*cof2);
     850  cofMin  =  std::sqrt(cof1*cof2);
    853851  cofMin /= cofPHC;
    854852
     
    863861  {
    864862    tmp1 = cofPHC*k;
    865     tmp2 = sqrt(tmp1*tmp1-cof1*cof2);
     863    tmp2 = std::sqrt(tmp1*tmp1-cof1*cof2);
    866864    energy1 = (tmp1+tmp2)/cof1;
    867865    energy2 = (tmp1-tmp2)/cof1;
     
    874872        tmp1 = ( energy1*energy1*(1./fGamma/fGamma + varAngle) + fSigma1 )
    875873          * fPlateThick/(4*hbarc*energy1);
    876         tmp2 = sin(tmp1);
     874        tmp2 = std::sin(tmp1);
    877875        tmp  = energy1*tmp2*tmp2;
    878876        tmp2 = fPlateThick/(4*tmp1);
     
    880878        tmp *= (tmp1-tmp2)*(tmp1-tmp2);
    881879        tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy1*energy1);
    882         tmp2 = abs(tmp1);
     880        tmp2 = std::abs(tmp1);
    883881        if(tmp2 > 0.) tmp /= tmp2;
    884882        else continue;
     
    889887        tmp1 = ( energy2*energy2*(1./fGamma/fGamma + varAngle) + fSigma1 )
    890888          * fPlateThick/(4*hbarc*energy2);
    891         tmp2 = sin(tmp1);
     889        tmp2 = std::sin(tmp1);
    892890        tmp  = energy2*tmp2*tmp2;
    893891        tmp2 = fPlateThick/(4*tmp1);
     
    895893        tmp *= (tmp1-tmp2)*(tmp1-tmp2);
    896894        tmp1 = cof1/(4*hbarc) - cof2/(4*hbarc*energy2*energy2);
    897         tmp2 = abs(tmp1);
     895        tmp2 = std::abs(tmp1);
    898896        if(tmp2 > 0.) tmp /= tmp2;
    899897        else continue;
     
    940938                                             G4double varAngle    )
    941939{
    942   G4double cof, length,delta, real, image ;
     940  G4double cof, length,delta, real_v, image_v ;
    943941
    944942  length = 0.5*GetPlateFormationZone(omega,gamma,varAngle) ;
     
    946944  cof    = 1.0/(1.0 + delta*delta) ;
    947945
    948   real   = length*cof ;
    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);
    952950  return zone ;
    953951}
     
    10131011                                           G4double varAngle    )
    10141012{
    1015   G4double cof, length,delta, real, image ;
     1013  G4double cof, length,delta, real_v, image_v ;
    10161014
    10171015  length = 0.5*GetGasFormationZone(omega,gamma,varAngle) ;
     
    10191017  cof    = 1.0/(1.0 + delta*delta) ;
    10201018
    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);
    10251023  return zone ;
    10261024}
     
    10801078void G4VXTRenergyLoss::GetPlateZmuProduct()
    10811079{
    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 );
    10841082
    10851083  G4int i ;
     
    11181116void G4VXTRenergyLoss::GetGasZmuProduct()
    11191117{
    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 );
    11221120  G4int i ;
    11231121  G4double omega, varAngle, gamma ;
     
    12091207  if (Z < 1.5) T0 = 40.0*keV;
    12101208
    1211   G4double X   = max(GammaEnergy, T0) / electron_mass_c2;
     1209  G4double X   = std::max(GammaEnergy, T0) / electron_mass_c2;
    12121210  CrossSection = p1Z*std::log(1.+2.*X)/X
    12131211               + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
     
    12191217    G4double dT0 = 1.*keV;
    12201218    X = (T0+dT0) / electron_mass_c2 ;
    1221     G4double sigma = p1Z*log(1.+2*X)/X
     1219    G4double sigma = p1Z*std::log(1.+2*X)/X
    12221220                    + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
    12231221    G4double   c1 = -T0*(sigma-CrossSection)/(CrossSection*dT0);
    12241222    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));
    12281226  }
    12291227  //  G4cout << "e= " << GammaEnergy << " Z= " << Z << " cross= " << CrossSection << G4endl;
     
    12391237// The high energy small theta approximation is applied.
    12401238// (matter1 -> matter2, or 2->1)
    1241 // varAngle =2* (1 - cos(theta)) or approximately = theta*theta
     1239// varAngle =2* (1 - std::cos(theta)) or approximately = theta*theta
    12421240//
    12431241
     
    13261324  G4double gamma, numberE ;
    13271325
    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 );
    13331331
    13341332  for(iTkin=0;iTkin<fTotBin;iTkin++)      // Lorentz factor loop
Note: See TracChangeset for help on using the changeset viewer.