- Timestamp:
- Jan 8, 2010, 11:56:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/src/G4EmCalculator.cc
r1196 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmCalculator.cc,v 1.4 8 2009/11/11 23:59:48vnivanch 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 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 127 127 if(couple && UpdateParticle(p, kinEnergy) ) { 128 128 res = manager->GetDEDX(p, kinEnergy, couple); 129 /*129 130 130 if(isIon) { 131 131 if(FindEmModel(p, currentProcessName, kinEnergy)) { 132 G4double length = 1.*um; 133 G4cout << "### GetDEDX: E= " << kinEnergy << " res= " << res; 132 G4double length = CLHEP::nm; 134 133 G4double eloss = res*length; 134 //G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res 135 // << " de= " << eloss << G4endl;; 135 136 G4double niel = 0.0; 137 dynParticle.SetKineticEnergy(kinEnergy); 138 currentModel->GetChargeSquareRatio(p, mat, kinEnergy); 136 139 currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length); 137 140 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;; 141 143 } 142 144 } 143 */145 144 146 if(verbose>0) { 145 147 G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV … … 466 468 467 469 // low energy correction for ions 468 /*469 470 if(isIon) { 470 G4double length = 1.*nm;471 G4double length = CLHEP::nm; 471 472 const G4Region* r = 0; 472 473 const G4MaterialCutsCouple* couple = FindCouple(mat, r); 473 474 G4double eloss = res*length; 474 475 G4double niel = 0.0; 476 dynParticle.SetKineticEnergy(kinEnergy); 477 currentModel->GetChargeSquareRatio(p, mat, kinEnergy); 475 478 currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length); 476 479 res = eloss/length; … … 482 485 } 483 486 } 484 */485 487 } 486 488 … … 971 973 G4double kinEnergy) 972 974 { 973 G4bool res= false;975 isApplicable = false; 974 976 if(!p) { 975 977 G4cout << "G4EmCalculator::FindEmModel WARNING: no particle defined" 976 978 << G4endl; 977 return res;979 return isApplicable; 978 980 } 979 981 G4String partname = p->GetParticleName(); … … 985 987 G4cout << "G4EmCalculator::FindEmModel for " << partname 986 988 << " (type= " << p->GetParticleType() 987 << ") and " << processName << " at e(MeV)= " << scaledEnergy;989 << ") and " << processName << " at E(MeV)= " << scaledEnergy; 988 990 if(p != part) G4cout << " GenericIon is the base particle"; 989 991 G4cout << G4endl; … … 1019 1021 } 1020 1022 if(elproc) { 1021 isApplicable = true;1022 1023 currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx); 1023 1024 G4double eth = currentModel->LowEnergyLimit(); 1024 if(eth > 0.0) { loweModel = elproc->SelectModelForMaterial(eth-keV, idx); }1025 loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx); 1025 1026 } 1026 1027 … … 1035 1036 currentModel = (vem[i])->SelectModelForMaterial(kinEnergy, idx); 1036 1037 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); 1039 1039 break; 1040 1040 } … … 1053 1053 currentModel = (vmsc[i])->SelectModelForMaterial(kinEnergy, idx); 1054 1054 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); 1057 1056 break; 1058 1057 } 1059 1058 } 1060 1059 } 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; 1063 1073 } 1064 1074
Note: See TracChangeset
for help on using the changeset viewer.