Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/src/G4EmCorrections.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCorrections.cc,v 1.54 2009/10/29 17:56:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4EmCorrections.cc,v 1.58 2010/06/04 09:28:46 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868#include "G4ProductionCutsTable.hh"
    6969#include "G4MaterialCutsCouple.hh"
     70#include "G4AtomicShells.hh"
    7071
    7172//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    123124  G4double sum = (2.0*(Barkas + Bloch) + Mott);
    124125
    125   if(verbose > 1)
     126  if(verbose > 1) {
    126127    G4cout << "EmCorrections: E(MeV)= " << e/MeV << " Barkas= " << Barkas
    127128           << " Bloch= " << Bloch << " Mott= " << Mott
    128            << " Sum= " << sum << G4endl;
    129 
     129           << " Sum= " << sum << " q2= " << q2 << G4endl;
     130  }
    130131  sum *= material->GetElectronDensity() * q2 *  twopi_mc2_rcl2 /beta2;
    131132  return sum;
     
    165166//   Other corrections from S.P.Ahlen Rev. Mod. Phys., Vol 52, No1, 1980
    166167  SetupKinematics(p, mat, e);
    167   if(tau <= 0.0) return 0.0;
     168  if(tau <= 0.0) { return 0.0; }
    168169
    169170  G4double Barkas = BarkasCorrection (p, mat, e);
     
    180181  sum *= material->GetElectronDensity() * q2 *  twopi_mc2_rcl2 /beta2;
    181182
    182   if(verbose > 1) G4cout << " Sum= " << sum << G4endl;
     183  if(verbose > 1) { G4cout << " Sum= " << sum << G4endl; }
    183184  return sum;
    184185}
     
    219220    sum = ComputeIonCorrections(p,couple->GetMaterial(),e) - rest/e;
    220221
    221     if(verbose > 1) G4cout << " Sum= " << sum << " dSum= " << rest/e << G4endl;
     222    if(verbose > 1) { G4cout << " Sum= " << sum << " dSum= " << rest/e << G4endl; }
    222223  }
    223224  return sum;
     
    267268    }
    268269    G4double e0= 13.6*eV*Z2;
    269     term += f*atomDensity[i]*KShell(shells.GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
     270    term += f*atomDensity[i]*KShell(G4AtomicShells::GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
    270271  }
    271272
     
    293294      G4double e0= 13.6*eV*Z2*0.25;
    294295      G4double f = 0.125;
    295       G4int nmax = std::min(4,shells.GetNumberOfShells(iz));
     296      G4int nmax = std::min(4,G4AtomicShells::GetNumberOfShells(iz));
    296297      for(G4int j=1; j<nmax; j++) {
    297         G4double ne = G4double(shells.GetNumberOfElectrons(iz,j));
    298         G4double e1 = shells.GetBindingEnergy(iz,j);
     298        G4double ne = G4double(G4AtomicShells::GetNumberOfElectrons(iz,j));
     299        G4double e1 = G4AtomicShells::GetBindingEnergy(iz,j);
    299300        //   G4cout << "LShell: j= " << j << " ne= " << ne << " e(eV)= " << e/eV
    300301        //  << " e0(eV)= " << e0/eV << G4endl;
     
    417418  for (G4int i = 0; i<numberOfElements; i++) {
    418419
     420    G4double res = 0.0;
    419421    G4double Z = (*theElementVector)[i]->GetZ();
    420422    G4int   iz = G4int(Z);
     
    426428    }
    427429    G4double e0= 13.6*eV*Z2;
    428     term += f*atomDensity[i]*KShell(shells.GetBindingEnergy(iz,0)/e0,ba2/Z2)/Z;
     430    res += f*KShell(G4AtomicShells::GetBindingEnergy(iz,0)/e0,ba2/Z2);
    429431    if(2 < iz) {
    430432      G4double Zeff = Z - ZD[10];
     
    434436      f = 0.125;
    435437      G4double eta = ba2/Z2;
    436       G4int ntot = shells.GetNumberOfShells(iz);
     438      G4int ntot = G4AtomicShells::GetNumberOfShells(iz);
    437439      G4int nmax = std::min(4, ntot);
    438440      G4double norm   = 0.0;
    439441      G4double eshell = 0.0;
    440       for(G4int j=1; j<nmax; j++) {
    441         G4double x = G4double(shells.GetNumberOfElectrons(iz,j));
    442         G4double e1 = shells.GetBindingEnergy(iz,j);
    443         norm   += x;
    444         eshell += e1*x;
    445         term += f*x*atomDensity[i]*LShell(e1/e0,eta)/Z;
     442      for(G4int j=1; j<nmax; ++j) {
     443        G4double e1 = G4AtomicShells::GetBindingEnergy(iz,j);
     444        G4int ne = G4AtomicShells::GetNumberOfElectrons(iz,j);
     445        norm   += ne;
     446        eshell += e1*ne;
     447        res += f*ne*LShell(e1/e0,eta);
    446448      }
    447       if(10 < iz) {
     449      if(ntot > nmax) {
    448450        eshell /= norm;
    449451        G4double eeff = eshell*eta;
    450         for(G4int k=nmax; k<ntot; k++) {
    451           G4double x = G4double(shells.GetNumberOfElectrons(iz,k));
    452           G4double e1 = shells.GetBindingEnergy(iz,k);
    453           term += f*x*atomDensity[i]*LShell(e1/e0,eeff/e1)/Z;
    454           //          term += f*x*atomDensity[i]*LShell(eshell/e0,eeff/e1)/Z;
     452        for(G4int k=nmax; k<ntot; ++k) {
     453          G4int ne = G4AtomicShells::GetNumberOfElectrons(iz,k);
     454          G4double e1 = G4AtomicShells::GetBindingEnergy(iz,k);
     455          res += f*ne*LShell(e1/e0,eeff/e1);
     456          //res += f*ne*LShell(e1/eshell,eeff/e1);
    455457        }
     458      }
    456459        /*
    457460        if(28 >= iz) {
    458           term += f*(Z - 10.)*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
     461          res += f*(Z - 10.)*LShell(eshell,HM[iz-11]*eta);
    459462        } else if(32 >= iz) {
    460           term += f*18.0*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
     463          res += f*18.0*LShell(eshell,HM[iz-11]*eta);
    461464        } else if(60 >= iz) {
    462           term += f*18.0*atomDensity[i]*LShell(eshell,HM[iz-11]*eta)/Z;
    463           term += f*(Z - 28.)*atomDensity[i]*LShell(eshell,HN[iz-33]*eta)/Z;
     465          res += f*18.0*LShell(eshell,HM[iz-11]*eta);
     466          res += f*(Z - 28.)*LShell(eshell,HN[iz-33]*eta);
    464467        } else {
    465           term += f*18.0*atomDensity[i]*LShell(eshell,HM[53]*eta)/Z;
    466           term += f*32.0*atomDensity[i]*LShell(eshell,HN[30]*eta)/Z;
    467           term += f*(Z - 60.)*atomDensity[i]*LShell(eshell,150.*eta)/Z;
     468          res += f*18.0*LShell(eshell,HM[50]*eta);
     469          res += f*32.0*LShell(eshell,HN[30]*eta);
     470          res += f*(Z - 60.)*LShell(eshell,150.*eta);
    468471        }
    469472        */
    470       }
    471     }
    472     //term += atomDensity[i]*MSH[iz]/(ba2*ba2);
     473    }
     474    //term += atomDensity[i]*(res/Z + MSH[iz]/(ba2*ba2));
     475    term += res*atomDensity[i]/Z;
    473476  }
    474477
    475478  term /= material->GetTotNbOfAtomsPerVolume();
     479  //if(charge < 0.0) { term = -term; }
    476480  return term;
    477481}
     
    552556
    553557  BarkasTerm *= 1.29*charge/material->GetTotNbOfAtomsPerVolume();
     558
     559  // temporary protection
     560  if(charge < -7.0 ) { BarkasTerm *= (-7.0/charge); }
     561
    554562  return BarkasTerm;
    555563}
     
    574582  } while (del > 0.01*term);
    575583
    576   return -y2*term;
     584  G4double res = -y2*term;
     585  // temporary protection
     586  if(q2 > 49. && res < -0.2) { res = -0.2; }
     587
     588  return res;
    577589}
    578590
     
    808820  ionList[idx]  = ion;
    809821  stopData[idx] = vv;
    810   if(verbose>1) G4cout << "End data set " << G4endl;
     822  if(verbose>1) { G4cout << "End data set " << G4endl; }
    811823}
    812824
     
    13951407    18.2
    13961408  };
    1397   for(i=0; i<53; i++) {HM[i] = hm[i];}
    1398   for(i=0; i<31; i++) {HN[i] = hn[i];}
     1409  for(i=0; i<53; ++i) {HM[i] = hm[i];}
     1410  for(i=0; i<31; ++i) {HN[i] = hn[i];}
    13991411
    14001412  const G4double mm[93] = {
Note: See TracChangeset for help on using the changeset viewer.