Ignore:
Timestamp:
Jan 8, 2010, 11:56:51 AM (14 years ago)
Author:
garnier
Message:

update geant4.9.3 tag

File:
1 edited

Legend:

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

    r1196 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmCalculator.cc,v 1.48 2009/11/11 23:59:48 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03-cand-01 $
     26// $Id: G4EmCalculator.cc,v 1.49 2009/11/22 17:58:39 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-03 $
    2828//
    2929// -------------------------------------------------------------------
     
    127127  if(couple && UpdateParticle(p, kinEnergy) ) {
    128128    res = manager->GetDEDX(p, kinEnergy, couple);
    129     /*
     129   
    130130    if(isIon) {
    131131      if(FindEmModel(p, currentProcessName, kinEnergy)) {
    132         G4double length = 1.*um;
    133         G4cout << "### GetDEDX: E= " << kinEnergy << " res= " << res;
     132        G4double length = CLHEP::nm;
    134133        G4double eloss = res*length;
     134        //G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res
     135        //       << " de= " << eloss << G4endl;;
    135136        G4double niel  = 0.0;
     137        dynParticle.SetKineticEnergy(kinEnergy);
     138        currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
    136139        currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
    137140        res = eloss/length;
    138      
    139         //G4cout << "### GetDEDX: E= " << kinEnergy << " res= " << res; 
    140         G4cout << " res1= " << res << G4endl;;
     141        //G4cout << " de1= " << eloss << " res1= " << res
     142        //       << " " << p->GetParticleName() <<G4endl;;
    141143      }
    142144    }
    143     */
     145   
    144146    if(verbose>0) {
    145147      G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV
     
    466468
    467469      // low energy correction for ions
    468       /*
    469470      if(isIon) {
    470         G4double length = 1.*nm;
     471        G4double length = CLHEP::nm;
    471472        const G4Region* r = 0;
    472473        const G4MaterialCutsCouple* couple = FindCouple(mat, r);
    473474        G4double eloss = res*length;
    474475        G4double niel  = 0.0;
     476        dynParticle.SetKineticEnergy(kinEnergy);
     477        currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
    475478        currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
    476479        res = eloss/length;
     
    482485        }
    483486      }
    484       */
    485487    }
    486488     
     
    971973                                         G4double kinEnergy)
    972974{
    973   G4bool res = false;
     975  isApplicable = false;
    974976  if(!p) {
    975977    G4cout << "G4EmCalculator::FindEmModel WARNING: no particle defined"
    976978           << G4endl;
    977     return res;
     979    return isApplicable;
    978980  }
    979981  G4String partname =  p->GetParticleName();
     
    985987    G4cout << "G4EmCalculator::FindEmModel for " << partname
    986988           << " (type= " << p->GetParticleType()
    987            << ") and " << processName << " at e(MeV)= " << scaledEnergy;
     989           << ") and " << processName << " at E(MeV)= " << scaledEnergy;
    988990    if(p != part) G4cout << "  GenericIon is the base particle";       
    989991    G4cout << G4endl;
     
    10191021  }
    10201022  if(elproc) {
    1021     isApplicable = true;
    10221023    currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx);
    10231024    G4double eth = currentModel->LowEnergyLimit();
    1024     if(eth > 0.0) { loweModel = elproc->SelectModelForMaterial(eth-keV, idx); }       
     1025    loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
    10251026  }
    10261027
     
    10351036        currentModel = (vem[i])->SelectModelForMaterial(kinEnergy, idx);
    10361037        G4double eth = currentModel->LowEnergyLimit();
    1037         if(eth > 0.0) { loweModel = (vem[i])->SelectModelForMaterial(eth-keV, idx); }       
    1038         isApplicable    = true;
     1038        loweModel = (vem[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
    10391039        break;
    10401040      }
     
    10531053        currentModel = (vmsc[i])->SelectModelForMaterial(kinEnergy, idx);
    10541054        G4double eth = currentModel->LowEnergyLimit();
    1055         if(eth > 0.0) { loweModel = (vmsc[i])->SelectModelForMaterial(eth-keV, idx); }       
    1056         isApplicable    = true;
     1055        loweModel = (vmsc[i])->SelectModelForMaterial(eth - CLHEP::eV, idx); 
    10571056        break;
    10581057      }
    10591058    }
    10601059  }
    1061   if(currentModel) res = true;
    1062   return res;
     1060  if(currentModel) {
     1061    if(loweModel == currentModel) { loweModel = 0; }
     1062    isApplicable = true;
     1063    if(verbose > 1) {
     1064      G4cout << "Model <" << currentModel->GetName()
     1065             << "> Emin(MeV)= " << currentModel->LowEnergyLimit()/MeV;
     1066      if(loweModel) {
     1067        G4cout << " LowEnergy model <" << loweModel->GetName() << ">";
     1068      }
     1069      G4cout << G4endl;
     1070    }
     1071  }
     1072  return isApplicable;
    10631073}
    10641074
Note: See TracChangeset for help on using the changeset viewer.