94 currentCoupleIndex = 0;
108 currentParticleName=
"";
109 currentMaterialName=
"";
115 isApplicable =
false;
123 for (
G4int i=0; i<nLocalMaterials; ++i) {
124 delete localCouples[i];
135 if(couple && UpdateParticle(p, kinEnergy) ) {
136 res = manager->
GetDEDX(p, kinEnergy, couple);
139 if(FindEmModel(p, currentProcessName, kinEnergy)) {
155 G4cout <<
"G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/
MeV
156 <<
" DEDX(MeV/mm)= " << res*
mm/
MeV
160 <<
" isIon= " << isIon
185 if(couple && UpdateParticle(p, kinEnergy)) {
188 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
189 <<
" range(mm)= " << res/
mm
207 if(couple && UpdateParticle(p, kinEnergy)) {
210 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
211 <<
" range(mm)= " << res/
mm
229 if(couple && UpdateParticle(p, kinEnergy)) {
230 res = manager->
GetRange(p, kinEnergy, couple);
232 G4cout <<
"G4EmCalculator::GetRange: E(MeV)= " << kinEnergy/
MeV
233 <<
" range(mm)= " << res/
mm
284 if(couple && UpdateParticle(p, 1.0*
GeV)) {
285 res = manager->
GetEnergy(p, range, couple);
287 G4cout <<
"G4EmCalculator::GetKinEnergy: Range(mm)= " << range/
mm
288 <<
" KinE(MeV)= " << res/
MeV
317 if(couple && UpdateParticle(p, kinEnergy)) {
319 FindLambdaTable(p, processName, kinEnergy);
323 res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
329 G4cout <<
"G4EmCalculator::GetXSPerVolume: E(MeV)= " << kinEnergy/
MeV
330 <<
" cross(cm-1)= " << res*
cm
334 G4cout <<
" idx= " << idx <<
" Escaled((MeV)= "
335 << kinEnergy*massRatio
336 <<
" q2= " << chargeSquare;
382 if(x > 0.0) { res = 1.0/
x; }
384 G4cout <<
"G4EmCalculator::GetMeanFreePath: E(MeV)= " << kinEnergy/
MeV
385 <<
" MFP(mm)= " << res/
mm
428 G4cout <<
"### G4EmCalculator: Inverse Range Table for "
441 currentMaterial =
mat;
442 currentMaterialName = mat->
GetName();
446 <<
" in " << currentMaterialName
447 <<
" e(MeV)= " << kinEnergy/
MeV <<
" cut(MeV)= " << cut/
MeV
450 if(UpdateParticle(p, kinEnergy)) {
451 if(FindEmModel(p, processName, kinEnergy)) {
452 G4double escaled = kinEnergy*massRatio;
455 mat, baseParticle, escaled, cut) * chargeSquare;
458 <<
" Escaled(MeV)= " << escaled;
462 if(verbose > 1) {
G4cout <<
" no basePart E(MeV)= " << kinEnergy <<
" "; }
466 <<
" DEDX(MeV*cm^2/g)= "
487 G4cout <<
"At boundary energy(MeV)= " << eth/
MeV
488 <<
" DEDX(MeV/mm)= " << res1*
mm/
MeV
496 if(res1 > 0.0 && escaled > 0.0) {
497 res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
514 G4cout <<
"After Corrections: DEDX(MeV/mm)= " << res*
mm/
MeV
522 G4cout <<
"Sum: E(MeV)= " << kinEnergy/
MeV
523 <<
" DEDX(MeV/mm)= " << res*
mm/
MeV
525 <<
" cut(MeV)= " << cut/
MeV
527 <<
" in " << currentMaterialName
528 <<
" Zi^2= " << chargeSquare
529 <<
" isIon=" << isIon
543 currentMaterial =
mat;
544 currentMaterialName = mat->
GetName();
546 if(UpdateParticle(part, kinEnergy)) {
549 const std::vector<G4VEnergyLossProcess*> vel =
556 for(
G4int i=0; i<
n; ++i) {
559 if(ActiveForParticle(part, p)) {
562 dedx +=
ComputeDEDX(kinEnergy,part,(vel[i])->GetProcessName(),mat,cut);
623 <<
" NuclearDEDX(MeV/mm)= " << res*
mm/
MeV
624 <<
" NuclearDEDX(MeV*cm^2/g)= "
650 currentMaterial =
mat;
651 currentMaterialName = mat->
GetName();
653 if(UpdateParticle(p, kinEnergy)) {
654 if(FindEmModel(p, processName, kinEnergy)) {
657 e *= kinEnergy*massRatio;
659 mat, baseParticle, e, cut, e) * chargeSquare;
664 G4cout <<
"G4EmCalculator::ComputeXSPerVolume: E(MeV)= " << kinEnergy/
MeV
665 <<
" cross(cm-1)= " << res*
cm
666 <<
" cut(keV)= " << cut/
keV
700 if(UpdateParticle(p, kinEnergy)) {
701 if(FindEmModel(p, processName, kinEnergy)) {
704 e *= kinEnergy*massRatio;
706 baseParticle, e, Z, A, cut) * chargeSquare;
712 <<
" cross(barn)= " << res/
barn
714 <<
" Z= " << Z <<
" A= " << A/(
g/
mole) <<
" g/mole"
747 if(res > 0.0) { res = 1.0/res; }
780 if(x > 0.0) { mfp = 1.0/
x; }
783 <<
" MFP(mm)= " << mfp/
mm
811 ConvertRangeToEnergy(part, mat, range);
831 if(p != currentParticle) {
835 dynParticle.
SetDefinition(const_cast<G4ParticleDefinition*>(p));
842 currentProcess = FindEnergyLossProcess(p);
843 currentProcessName =
"";
859 && currentParticleName !=
"deuteron"
860 && currentParticleName !=
"triton"
861 && currentParticleName !=
"alpha+"
862 && currentParticleName !=
"helium"
863 && currentParticleName !=
"hydrogen"
867 baseParticle = theGenericIon;
893 if(name != currentParticleName) {
896 G4cout <<
"### WARNING: G4EmCalculator::FindParticle fails to find "
918 if(name != currentMaterialName) {
920 currentMaterialName =
name;
922 G4cout <<
"### WARNING: G4EmCalculator::FindMaterial fails to find "
925 return currentMaterial;
933 if(reg !=
"" && reg !=
"world") {
947 if(!material)
return 0;
949 currentMaterialName = material->
GetName();
965 if(!material)
return false;
967 currentMaterialName = material->
GetName();
968 for (
G4int i=0; i<nLocalMaterials; ++i) {
969 if(material == localMaterials[i] && cut == localCuts[i]) {
970 currentCouple = localCouples[i];
971 currentCoupleIndex = currentCouple->
GetIndex();
977 localMaterials.push_back(material);
978 localCouples.push_back(cc);
979 localCuts.push_back(cut);
982 currentCoupleIndex = currentCouple->
GetIndex();
994 if (!currentLambda || p != lambdaParticle || processName != lambdaName) {
995 lambdaName = processName;
1000 if(isIon) { part = theGenericIon; }
1003 currentName = processName;
1011 isApplicable =
true;
1013 G4cout <<
"G4VEnergyLossProcess is found out: " << currentName
1021 G4VEmProcess* proc = FindDiscreteProcess(part, processName);
1025 isApplicable =
true;
1027 G4cout <<
"G4VEmProcess is found out: " << currentName <<
G4endl;
1059 isApplicable =
false;
1061 G4cout <<
"G4EmCalculator::FindEmModel WARNING: no particle defined"
1063 return isApplicable;
1067 G4double scaledEnergy = kinEnergy*massRatio;
1068 if(isIon) { part = theGenericIon; }
1071 G4cout <<
"## G4EmCalculator::FindEmModel for " << partname
1073 <<
") and " << processName <<
" at E(MeV)= " << scaledEnergy
1075 if(p != part) {
G4cout <<
" GenericIon is the base particle" <<
G4endl; }
1079 currentName = processName;
1090 if(loweModel == currentModel) { loweModel = 0; }
1096 G4VEmProcess* proc = FindDiscreteProcess(part, processName);
1102 if(loweModel == currentModel) { loweModel = 0; }
1116 if(loweModel == currentModel) { loweModel = 0; }
1117 isApplicable =
true;
1127 G4cout <<
" LowEnergy model <" << loweModel->
GetName() <<
">";
1132 return isApplicable;
1145 && currentParticleName !=
"deuteron"
1146 && currentParticleName !=
"triton"
1147 && currentParticleName !=
"alpha+"
1148 && currentParticleName !=
"helium"
1149 && currentParticleName !=
"hydrogen"
1150 ) { part = theGenericIon; }
1163 const std::vector<G4VEnergyLossProcess*>
v =
1166 for(
G4int i=0; i<
n; ++i) {
1167 if((v[i])->GetProcessName() == processName) {
1169 if(ActiveForParticle(part, p)) {
1185 const std::vector<G4VEmProcess*> v =
1188 for(
G4int i=0; i<
n; ++i) {
1189 if((v[i])->GetProcessName() == processName) {
1191 if(ActiveForParticle(part, p)) {
1207 const std::vector<G4VMultipleScattering*> v =
1210 for(
G4int i=0; i<
n; ++i) {
1211 if((v[i])->GetProcessName() == processName) {
1213 if(ActiveForParticle(part, p)) {
1231 for(
G4int i=0; i<
n; ++i) {
1232 if((*pv)[i] == proc) {