84 const G4double G4PAIxSection::fDelta = 0.005;
85 const G4double G4PAIxSection::fError = 0.005;
87 const G4int G4PAIxSection::fMaxSplineSize = 500;
99 fMaterialIndex = matIndex;
105 for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
109 for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
111 (*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
113 for(j = 1; j < 5; j++)
115 (*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
118 fEnergyInterval = fA1 = fA2 = fA3 = fA4 = 0;
127 fMatSandiaMatrix = 0;
131 fMaterialIndex = materialIndex;
132 fDensity = (*theMaterialTable)[materialIndex]->GetDensity();
133 fElectronDensity = (*theMaterialTable)[materialIndex]->
134 GetElectronDensity();
135 fIntervalNumber = (*theMaterialTable)[materialIndex]->
136 GetSandiaTable()->GetMatNbOfIntervals();
140 fEnergyInterval =
new G4double[fIntervalNumber+2];
141 fA1 =
new G4double[fIntervalNumber+2];
142 fA2 =
new G4double[fIntervalNumber+2];
143 fA3 =
new G4double[fIntervalNumber+2];
144 fA4 =
new G4double[fIntervalNumber+2];
146 for(i = 1; i <= fIntervalNumber; i++ )
148 if(((*theMaterialTable)[materialIndex]->
149 GetSandiaTable()->GetSandiaCofForMaterial(i-1,0) >= maxEnergyTransfer) ||
150 i > fIntervalNumber )
152 fEnergyInterval[i] = maxEnergyTransfer;
156 fEnergyInterval[i] = (*theMaterialTable)[materialIndex]->
157 GetSandiaTable()->GetSandiaCofForMaterial(i-1,0);
158 fA1[i] = (*theMaterialTable)[materialIndex]->
159 GetSandiaTable()->GetSandiaCofForMaterial(i-1,1);
160 fA2[i] = (*theMaterialTable)[materialIndex]->
161 GetSandiaTable()->GetSandiaCofForMaterial(i-1,2);
162 fA3[i] = (*theMaterialTable)[materialIndex]->
163 GetSandiaTable()->GetSandiaCofForMaterial(i-1,3);
164 fA4[i] = (*theMaterialTable)[materialIndex]->
165 GetSandiaTable()->GetSandiaCofForMaterial(i-1,4);
169 if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer)
172 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
177 for(i=1;i<fIntervalNumber;i++)
179 if(fEnergyInterval[i+1]-fEnergyInterval[i] >
180 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
186 for(j=i;j<fIntervalNumber;j++)
188 fEnergyInterval[j] = fEnergyInterval[j+1];
222 delete[] fEnergyInterval;
240 fMatSandiaMatrix = 0;
244 fMaterialIndex = materialIndex;
245 fDensity = (*theMaterialTable)[materialIndex]->GetDensity();
246 fElectronDensity = (*theMaterialTable)[materialIndex]->
247 GetElectronDensity();
249 fIntervalNumber = intNumber;
253 fEnergyInterval =
new G4double[fIntervalNumber+2];
254 fA1 =
new G4double[fIntervalNumber+2];
255 fA2 =
new G4double[fIntervalNumber+2];
256 fA3 =
new G4double[fIntervalNumber+2];
257 fA4 =
new G4double[fIntervalNumber+2];
259 for( i = 1; i <= fIntervalNumber; i++ )
261 if( ( photoAbsCof[i-1][0] >= maxEnergyTransfer ) ||
262 i > fIntervalNumber )
264 fEnergyInterval[i] = maxEnergyTransfer;
268 fEnergyInterval[i] = photoAbsCof[i-1][0];
269 fA1[i] = photoAbsCof[i-1][1];
270 fA2[i] = photoAbsCof[i-1][2];
271 fA3[i] = photoAbsCof[i-1][3];
272 fA4[i] = photoAbsCof[i-1][4];
277 if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer)
280 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
282 for(i=1;i<=fIntervalNumber;i++)
289 for( i = 1; i < fIntervalNumber; i++ )
291 if(fEnergyInterval[i+1]-fEnergyInterval[i] >
292 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
298 for(j=i;j<fIntervalNumber;j++)
300 fEnergyInterval[j] = fEnergyInterval[j+1];
314 fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
316 NormShift(betaGammaSqRef);
317 SplainPAI(betaGammaSqRef);
321 for(i = 1; i <= fSplineNumber; i++)
323 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq);
324 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq);
325 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq);
326 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq);
327 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
336 IntegralPAIxSection();
338 delete[] fEnergyInterval;
354 fMatSandiaMatrix = 0;
357 G4int i, j, numberOfElements;
359 fMaterialIndex = materialIndex;
360 fDensity = (*theMaterialTable)[materialIndex]->GetDensity();
361 fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity();
362 numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements();
364 G4int* thisMaterialZ =
new G4int[numberOfElements];
366 for( i = 0; i < numberOfElements; i++ )
368 thisMaterialZ[i] = (
G4int)(*theMaterialTable)[materialIndex]->
369 GetElement(i)->GetZ();
372 fSandia = (*theMaterialTable)[materialIndex]->
376 (thisMaterialZ,numberOfElements);
379 (*theMaterialTable)[materialIndex]->GetFractionVector() ,
380 numberOfElements,fIntervalNumber);
384 fEnergyInterval =
new G4double[fIntervalNumber+2];
385 fA1 =
new G4double[fIntervalNumber+2];
386 fA2 =
new G4double[fIntervalNumber+2];
387 fA3 =
new G4double[fIntervalNumber+2];
388 fA4 =
new G4double[fIntervalNumber+2];
390 for( i = 1; i <= fIntervalNumber; i++ )
395 fEnergyInterval[i] = maxEnergyTransfer;
406 if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer)
409 fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
410 fA1[fIntervalNumber] = fA1[fIntervalNumber-1];
411 fA2[fIntervalNumber] = fA2[fIntervalNumber-1];
412 fA3[fIntervalNumber] = fA3[fIntervalNumber-1];
413 fA4[fIntervalNumber] = fA4[fIntervalNumber-1];
415 for(i=1;i<=fIntervalNumber;i++)
422 for( i = 1; i < fIntervalNumber; i++ )
424 if(fEnergyInterval[i+1]-fEnergyInterval[i] >
425 1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
431 for( j = i; j < fIntervalNumber; j++ )
433 fEnergyInterval[j] = fEnergyInterval[j+1];
466 fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
468 NormShift(betaGammaSqRef);
469 SplainPAI(betaGammaSqRef);
473 for(i = 1; i <= fSplineNumber; i++)
475 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
476 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq);
477 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq);
478 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq);
479 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq);
481 IntegralPAIxSection();
487 delete[] fEnergyInterval;
492 delete[] thisMaterialZ;
511 delete fMatSandiaMatrix;
522 G4double betaGammaSq = fLorentzFactor[fRefGammaNumber]*
523 fLorentzFactor[fRefGammaNumber] - 1;
527 NormShift(betaGammaSq);
528 SplainPAI(betaGammaSq);
530 IntegralPAIxSection();
536 for(i = 0; i<= fSplineNumber; i++)
538 fPAItable[i][fRefGammaNumber] = fIntegralPAIxSection[i];
541 fPAItable[i][0] = fSplineEnergy[i];
544 fPAItable[0][0] = fSplineNumber;
546 for(
G4int j = 1; j < 112; j++)
548 if( j == fRefGammaNumber )
continue;
550 betaGammaSq = fLorentzFactor[j]*fLorentzFactor[j] - 1;
552 for(i = 1; i <= fSplineNumber; i++)
554 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
555 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq);
556 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq);
557 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq);
558 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq);
560 IntegralPAIxSection();
566 for(i = 0; i <= fSplineNumber; i++)
568 fPAItable[i][j] = fIntegralPAIxSection[i];
583 for( i = 1; i <= fIntervalNumber-1; i++ )
585 for( j = 1; j <= 2; j++ )
587 fSplineNumber = (i-1)*2 + j;
589 if( j == 1 ) fSplineEnergy[fSplineNumber] = fEnergyInterval[i ]*(1+fDelta);
590 else fSplineEnergy[fSplineNumber] = fEnergyInterval[i+1]*(1-fDelta);
595 fIntegralTerm[1]=RutherfordIntegral(1,fEnergyInterval[1],fSplineEnergy[1]);
599 for( i = 2; i <= fSplineNumber; i++ )
601 if(fSplineEnergy[i]<fEnergyInterval[j+1])
603 fIntegralTerm[i] = fIntegralTerm[i-1] +
604 RutherfordIntegral(j,fSplineEnergy[i-1],
609 G4double x = RutherfordIntegral(j,fSplineEnergy[i-1],
610 fEnergyInterval[j+1] );
612 fIntegralTerm[i] = fIntegralTerm[i-1] + x +
613 RutherfordIntegral(j,fEnergyInterval[j],
619 fNormalizationCof *= fElectronDensity/fIntegralTerm[fSplineNumber];
626 for(
G4int k = 1; k <= fIntervalNumber-1; k++ )
628 for( j = 1; j <= 2; j++ )
631 fImPartDielectricConst[i] = fNormalizationCof*
632 ImPartDielectricConst(k,fSplineEnergy[i]);
633 fRePartDielectricConst[i] = fNormalizationCof*
634 RePartDielectricConst(fSplineEnergy[i]);
635 fIntegralTerm[i] *= fNormalizationCof;
637 fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
638 fdNdxCerenkov[i] = PAIdNdxCerenkov(i,betaGammaSq);
639 fdNdxMM[i] = PAIdNdxMM(i,betaGammaSq);
640 fdNdxPlasmon[i] = PAIdNdxPlasmon(i,betaGammaSq);
641 fdNdxResonance[i] = PAIdNdxResonance(i,betaGammaSq);
658 while ( (i < fSplineNumber) && (fSplineNumber < fMaxSplineSize-1) )
660 if(fSplineEnergy[i+1] > fEnergyInterval[k+1])
670 for(
G4int j = fSplineNumber; j >= i+2; j-- )
672 fSplineEnergy[j] = fSplineEnergy[j-1];
673 fImPartDielectricConst[j] = fImPartDielectricConst[j-1];
674 fRePartDielectricConst[j] = fRePartDielectricConst[j-1];
675 fIntegralTerm[j] = fIntegralTerm[j-1];
677 fDifPAIxSection[j] = fDifPAIxSection[j-1];
678 fdNdxCerenkov[j] = fdNdxCerenkov[j-1];
679 fdNdxMM[j] = fdNdxMM[j-1];
680 fdNdxPlasmon[j] = fdNdxPlasmon[j-1];
681 fdNdxResonance[j] = fdNdxResonance[j-1];
689 fSplineEnergy[i+1] = en1;
701 fImPartDielectricConst[i+1] = fNormalizationCof*
702 ImPartDielectricConst(k,fSplineEnergy[i+1]);
703 fRePartDielectricConst[i+1] = fNormalizationCof*
704 RePartDielectricConst(fSplineEnergy[i+1]);
705 fIntegralTerm[i+1] = fIntegralTerm[i] + fNormalizationCof*
706 RutherfordIntegral(k,fSplineEnergy[i],
709 fDifPAIxSection[i+1] = DifPAIxSection(i+1,betaGammaSq);
710 fdNdxCerenkov[i+1] = PAIdNdxCerenkov(i+1,betaGammaSq);
711 fdNdxMM[i+1] = PAIdNdxMM(i+1,betaGammaSq);
712 fdNdxPlasmon[i+1] = PAIdNdxPlasmon(i+1,betaGammaSq);
713 fdNdxResonance[i+1] = PAIdNdxResonance(i+1,betaGammaSq);
718 G4double x = 2*(fDifPAIxSection[i+1] -
y)/(fDifPAIxSection[i+1] + y);
724 if( x > fError && fSplineNumber < fMaxSplineSize-1 )
746 c1 = (x2 -
x1)/x1/x2;
747 c2 = (x2 -
x1)*(x2 + x1)/x1/x1/x2/
x2;
748 c3 = (x2 -
x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/
x2;
751 return fA1[k]*log(x2/x1) + fA2[k]*c1 + fA3[k]*c2/2 + fA4[k]*c3/3;
764 G4double energy2,energy3,energy4,result;
766 energy2 = energy1*energy1;
767 energy3 = energy2*energy1;
768 energy4 = energy3*energy1;
770 result = fA1[k]/energy1+fA2[k]/energy2+fA3[k]/energy3+fA4[k]/energy4;
771 result *=
hbarc/energy1;
786 energy2 = energy1*energy1;
787 energy3 = energy2*energy1;
788 energy4 = energy3*energy1;
794 for( i = 1; i <= fIntervalNumber; i++ )
796 if( energy1 < fEnergyInterval[i])
break;
801 result = fA1[i]/energy1+fA2[i]/energy2+fA3[i]/energy3+fA4[i]/energy4;
803 if( result >
DBL_MIN ) lambda = 1./result;
842 range = cofA*energy*( 1 - cofB/(1 + cofC*
energy) );
858 G4double x0, x02, x03, x04, x05,
x1,
x2, xx1 ,xx2 , xx12,
859 c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result;
864 for(
G4int i=1;i<=fIntervalNumber-1;i++)
866 x1 = fEnergyInterval[i];
867 x2 = fEnergyInterval[i+1];
878 xln3 = log((x2 + x0)/(x1 + x0));
883 c1 = (x2 -
x1)/x1/x2;
884 c2 = (x2 -
x1)*(x2 +x1)/x1/x1/x2/
x2;
885 c3 = (x2 -
x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/
x2;
887 result -= (fA1[i]/x02 + fA3[i]/x04)*xln1;
888 result -= (fA2[i]/x02 + fA4[i]/x04)*c1;
889 result -= fA3[i]*c2/2/x02;
890 result -= fA4[i]*c3/3/x02;
892 cof1 = fA1[i]/x02 + fA3[i]/x04;
893 cof2 = fA2[i]/x03 + fA4[i]/x05;
895 result += 0.5*(cof1 +cof2)*xln2;
896 result += 0.5*(cof1 - cof2)*xln3;
919 G4double be2 = betaGammaSq/(1 + betaGammaSq);
926 if( betaGammaSq < 0.01 ) x2 = log(be2);
929 x2 = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
930 (1/betaGammaSq - fRePartDielectricConst[i]) +
931 fImPartDielectricConst[i]*fImPartDielectricConst[i] )/2;
933 if( fImPartDielectricConst[i] == 0.0 ||betaGammaSq < 0.01 )
939 x3 = -fRePartDielectricConst[i] + 1/betaGammaSq;
940 x5 = -1 - fRePartDielectricConst[i] +
941 be2*((1 +fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
942 fImPartDielectricConst[i]*fImPartDielectricConst[i]);
944 x7 = atan2(fImPartDielectricConst[i],x3);
949 x4 = ((x1 +
x2)*fImPartDielectricConst[i] + x6)/
hbarc;
953 x8 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
954 fImPartDielectricConst[i]*fImPartDielectricConst[i];
956 result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]);
958 if( result < 1.0
e-8 ) result = 1.0e-8;
966 result *= (1 - exp(-beta/betaBohr/lowCof));
989 G4double logarithm, x3, x5, argument, modul2, dNdxC;
990 G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr;
994 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr;
996 be2 = betaGammaSq/(1 + betaGammaSq);
999 if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq);
1002 logarithm = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
1003 (1/betaGammaSq - fRePartDielectricConst[i]) +
1004 fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5;
1005 logarithm += log(1+1.0/betaGammaSq);
1008 if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 )
1014 x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq;
1015 x5 = -1.0 - fRePartDielectricConst[i] +
1016 be2*((1.0 +fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) +
1017 fImPartDielectricConst[i]*fImPartDielectricConst[i]);
1018 if( x3 == 0.0 ) argument = 0.5*
pi;
1019 else argument = atan2(fImPartDielectricConst[i],x3);
1022 dNdxC = ( logarithm*fImPartDielectricConst[i] + argument )/
hbarc;
1024 if(dNdxC < 1.0
e-8) dNdxC = 1.0e-8;
1026 dNdxC *= fine_structure_const/be2/
pi;
1028 dNdxC *= (1-exp(-be4/betaBohr4));
1032 modul2 = (1.0 + fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) +
1033 fImPartDielectricConst[i]*fImPartDielectricConst[i];
1047 G4double logarithm, x3, x5, argument, dNdxC;
1048 G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr;
1052 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr;
1054 be2 = betaGammaSq/(1 + betaGammaSq);
1057 if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq);
1060 logarithm = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
1061 (1/betaGammaSq - fRePartDielectricConst[i]) +
1062 fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5;
1063 logarithm += log(1+1.0/betaGammaSq);
1066 if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 )
1072 x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq;
1073 x5 = be2*( 1.0 + fRePartDielectricConst[i] ) - 1.0;
1074 if( x3 == 0.0 ) argument = 0.5*
pi;
1075 else argument = atan2(fImPartDielectricConst[i],x3);
1078 dNdxC = ( logarithm*fImPartDielectricConst[i]*be2 + argument )/
hbarc;
1080 if(dNdxC < 1.0
e-8) dNdxC = 1.0e-8;
1082 dNdxC *= fine_structure_const/be2/
pi;
1084 dNdxC *= (1-exp(-be4/betaBohr4));
1097 G4double resonance, modul2, dNdxP, cof = 1.;
1098 G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr;
1103 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr;
1105 be2 = betaGammaSq/(1 + betaGammaSq);
1109 resonance *= fImPartDielectricConst[i]/
hbarc;
1112 dNdxP = ( resonance + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i] );
1114 if( dNdxP < 1.0
e-8 ) dNdxP = 1.0e-8;
1116 dNdxP *= fine_structure_const/be2/
pi;
1117 dNdxP *= (1-exp(-be4/betaBohr4));
1119 if( fDensity >= 0.1 )
1121 modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
1122 fImPartDielectricConst[i]*fImPartDielectricConst[i];
1138 G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr;
1142 betaBohr4 = betaBohr2*betaBohr2*cofBetaBohr;
1144 be2 = betaGammaSq/(1 + betaGammaSq);
1148 resonance *= fImPartDielectricConst[i]/
hbarc;
1153 if( dNdxP < 1.0
e-8 ) dNdxP = 1.0e-8;
1155 dNdxP *= fine_structure_const/be2/
pi;
1156 dNdxP *= (1-exp(-be4/betaBohr4));
1158 if( fDensity >= 0.1 )
1160 modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
1161 fImPartDielectricConst[i]*fImPartDielectricConst[i];
1176 fIntegralPAIxSection[fSplineNumber] = 0;
1177 fIntegralPAIdEdx[fSplineNumber] = 0;
1178 fIntegralPAIxSection[0] = 0;
1179 G4int k = fIntervalNumber -1;
1181 for(
G4int i = fSplineNumber-1; i >= 1; i--)
1183 if(fSplineEnergy[i] >= fEnergyInterval[k])
1185 fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + SumOverInterval(i);
1186 fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + SumOverIntervaldEdx(i);
1190 fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] +
1191 SumOverBorder(i+1,fEnergyInterval[k]);
1192 fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] +
1193 SumOverBorderdEdx(i+1,fEnergyInterval[k]);
1208 fIntegralCerenkov[fSplineNumber] = 0;
1209 fIntegralCerenkov[0] = 0;
1210 k = fIntervalNumber -1;
1212 for( i = fSplineNumber-1; i >= 1; i-- )
1214 if(fSplineEnergy[i] >= fEnergyInterval[k])
1216 fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + SumOverInterCerenkov(i);
1221 fIntegralCerenkov[i] = fIntegralCerenkov[i+1] +
1222 SumOverBordCerenkov(i+1,fEnergyInterval[k]);
1239 fIntegralMM[fSplineNumber] = 0;
1241 k = fIntervalNumber -1;
1243 for( i = fSplineNumber-1; i >= 1; i-- )
1245 if(fSplineEnergy[i] >= fEnergyInterval[k])
1247 fIntegralMM[i] = fIntegralMM[i+1] + SumOverInterMM(i);
1252 fIntegralMM[i] = fIntegralMM[i+1] +
1253 SumOverBordMM(i+1,fEnergyInterval[k]);
1269 fIntegralPlasmon[fSplineNumber] = 0;
1270 fIntegralPlasmon[0] = 0;
1271 G4int k = fIntervalNumber -1;
1272 for(
G4int i=fSplineNumber-1;i>=1;i--)
1274 if(fSplineEnergy[i] >= fEnergyInterval[k])
1276 fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + SumOverInterPlasmon(i);
1280 fIntegralPlasmon[i] = fIntegralPlasmon[i+1] +
1281 SumOverBordPlasmon(i+1,fEnergyInterval[k]);
1296 fIntegralResonance[fSplineNumber] = 0;
1297 fIntegralResonance[0] = 0;
1298 G4int k = fIntervalNumber -1;
1299 for(
G4int i=fSplineNumber-1;i>=1;i--)
1301 if(fSplineEnergy[i] >= fEnergyInterval[k])
1303 fIntegralResonance[i] = fIntegralResonance[i+1] + SumOverInterResonance(i);
1307 fIntegralResonance[i] = fIntegralResonance[i+1] +
1308 SumOverBordResonance(i+1,fEnergyInterval[k]);
1325 x0 = fSplineEnergy[i];
1326 x1 = fSplineEnergy[i+1];
1327 y0 = fDifPAIxSection[i];
1328 yy1 = fDifPAIxSection[i+1];
1330 a = log10(yy1/y0)/log10(c);
1334 if( std::fabs(a) < 1.
e-6 )
1336 result = b*log(x1/x0);
1340 result = y0*(x1*pow(c,a-1) - x0)/a;
1343 if( std::fabs(a) < 1.e-6 )
1345 fIntegralPAIxSection[0] += b*log(x1/x0);
1349 fIntegralPAIxSection[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1361 x0 = fSplineEnergy[i];
1362 x1 = fSplineEnergy[i+1];
1363 y0 = fDifPAIxSection[i];
1364 yy1 = fDifPAIxSection[i+1];
1366 a = log10(yy1/y0)/log10(c);
1372 result = b*log(x1/x0);
1376 result = y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1392 x0 = fSplineEnergy[i];
1393 x1 = fSplineEnergy[i+1];
1394 y0 = fdNdxCerenkov[i];
1395 yy1 = fdNdxCerenkov[i+1];
1400 a = log10(yy1/y0)/log10(c);
1404 if(a == 0) result = b*log(c);
1405 else result = y0*(x1*pow(c,a-1) - x0)/a;
1408 if( a == 0 ) fIntegralCerenkov[0] += b*log(x1/x0);
1409 else fIntegralCerenkov[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1425 x0 = fSplineEnergy[i];
1426 x1 = fSplineEnergy[i+1];
1433 a = log10(yy1/y0)/log10(c);
1437 if(a == 0) result = b*log(c);
1438 else result = y0*(x1*pow(c,a-1) - x0)/a;
1441 if( a == 0 ) fIntegralMM[0] += b*log(x1/x0);
1442 else fIntegralMM[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1458 x0 = fSplineEnergy[i];
1459 x1 = fSplineEnergy[i+1];
1460 y0 = fdNdxPlasmon[i];
1461 yy1 = fdNdxPlasmon[i+1];
1463 a = log10(yy1/y0)/log10(c);
1468 if(a == 0) result = b*log(x1/x0);
1469 else result = y0*(x1*pow(c,a-1) - x0)/a;
1472 if( a == 0 ) fIntegralPlasmon[0] += b*log(x1/x0);
1473 else fIntegralPlasmon[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1489 x0 = fSplineEnergy[i];
1490 x1 = fSplineEnergy[i+1];
1491 y0 = fdNdxResonance[i];
1492 yy1 = fdNdxResonance[i+1];
1494 a = log10(yy1/y0)/log10(c);
1499 if(a == 0) result = b*log(x1/x0);
1500 else result = y0*(x1*pow(c,a-1) - x0)/a;
1503 if( a == 0 ) fIntegralResonance[0] += b*log(x1/x0);
1504 else fIntegralResonance[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
1521 x0 = fSplineEnergy[i];
1522 x1 = fSplineEnergy[i+1];
1523 y0 = fDifPAIxSection[i];
1524 yy1 = fDifPAIxSection[i+1];
1528 a = log10(yy1/y0)/log10(x1/x0);
1533 if( std::fabs(a) < 1.
e-6 )
1535 result = b*log(x0/e0);
1539 result = y0*(x0 - e0*pow(d,a-1))/a;
1542 if( std::fabs(a) < 1.e-6 )
1544 fIntegralPAIxSection[0] += b*log(x0/e0);
1548 fIntegralPAIxSection[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1550 x0 = fSplineEnergy[i - 1];
1551 x1 = fSplineEnergy[i - 2];
1552 y0 = fDifPAIxSection[i - 1];
1553 yy1 = fDifPAIxSection[i - 2];
1557 a = log10(yy1/y0)/log10(x1/x0);
1561 if( std::fabs(a) < 1.
e-6 )
1563 result += b*log(e0/x0);
1567 result += y0*(e0*pow(d,a-1) - x0)/a;
1570 if( std::fabs(a) < 1.e-6 )
1572 fIntegralPAIxSection[0] += b*log(e0/x0);
1576 fIntegralPAIxSection[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1590 x0 = fSplineEnergy[i];
1591 x1 = fSplineEnergy[i+1];
1592 y0 = fDifPAIxSection[i];
1593 yy1 = fDifPAIxSection[i+1];
1597 a = log10(yy1/y0)/log10(x1/x0);
1604 result = b*log(x0/e0);
1608 result = y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1610 x0 = fSplineEnergy[i - 1];
1611 x1 = fSplineEnergy[i - 2];
1612 y0 = fDifPAIxSection[i - 1];
1613 yy1 = fDifPAIxSection[i - 2];
1617 a = log10(yy1/y0)/log10(x1/x0);
1623 result += b*log(e0/x0);
1627 result += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1644 x0 = fSplineEnergy[i];
1645 x1 = fSplineEnergy[i+1];
1646 y0 = fdNdxCerenkov[i];
1647 yy1 = fdNdxCerenkov[i+1];
1654 a = log10(yy1/y0)/log10(c);
1659 if( a == 0 ) result = b*log(x0/e0);
1660 else result = y0*(x0 - e0*pow(d,a-1))/a;
1663 if( a == 0 ) fIntegralCerenkov[0] += b*log(x0/e0);
1664 else fIntegralCerenkov[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1668 x0 = fSplineEnergy[i - 1];
1669 x1 = fSplineEnergy[i - 2];
1670 y0 = fdNdxCerenkov[i - 1];
1671 yy1 = fdNdxCerenkov[i - 2];
1678 a = log10(yy1/y0)/log10(x1/x0);
1683 if( a == 0 ) result += b*log(e0/x0);
1684 else result += y0*(e0*pow(d,a-1) - x0 )/a;
1687 if( a == 0 ) fIntegralCerenkov[0] += b*log(e0/x0);
1688 else fIntegralCerenkov[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1708 x0 = fSplineEnergy[i];
1709 x1 = fSplineEnergy[i+1];
1718 a = log10(yy1/y0)/log10(c);
1723 if( a == 0 ) result = b*log(x0/e0);
1724 else result = y0*(x0 - e0*pow(d,a-1))/a;
1727 if( a == 0 ) fIntegralMM[0] += b*log(x0/e0);
1728 else fIntegralMM[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1732 x0 = fSplineEnergy[i - 1];
1733 x1 = fSplineEnergy[i - 2];
1734 y0 = fdNdxMM[i - 1];
1735 yy1 = fdNdxMM[i - 2];
1742 a = log10(yy1/y0)/log10(x1/x0);
1747 if( a == 0 ) result += b*log(e0/x0);
1748 else result += y0*(e0*pow(d,a-1) - x0 )/a;
1751 if( a == 0 ) fIntegralMM[0] += b*log(e0/x0);
1752 else fIntegralMM[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1772 x0 = fSplineEnergy[i];
1773 x1 = fSplineEnergy[i+1];
1774 y0 = fdNdxPlasmon[i];
1775 yy1 = fdNdxPlasmon[i+1];
1779 a = log10(yy1/y0)/log10(c);
1784 if( a == 0 ) result = b*log(x0/e0);
1785 else result = y0*(x0 - e0*pow(d,a-1))/a;
1788 if( a == 0 ) fIntegralPlasmon[0] += b*log(x0/e0);
1789 else fIntegralPlasmon[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1791 x0 = fSplineEnergy[i - 1];
1792 x1 = fSplineEnergy[i - 2];
1793 y0 = fdNdxPlasmon[i - 1];
1794 yy1 = fdNdxPlasmon[i - 2];
1798 a = log10(yy1/y0)/log10(c);
1803 if( a == 0 ) result += b*log(e0/x0);
1804 else result += y0*(e0*pow(d,a-1) - x0)/a;
1807 if( a == 0 ) fIntegralPlasmon[0] += b*log(e0/x0);
1808 else fIntegralPlasmon[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1825 x0 = fSplineEnergy[i];
1826 x1 = fSplineEnergy[i+1];
1827 y0 = fdNdxResonance[i];
1828 yy1 = fdNdxResonance[i+1];
1832 a = log10(yy1/y0)/log10(c);
1837 if( a == 0 ) result = b*log(x0/e0);
1838 else result = y0*(x0 - e0*pow(d,a-1))/a;
1841 if( a == 0 ) fIntegralResonance[0] += b*log(x0/e0);
1842 else fIntegralResonance[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
1844 x0 = fSplineEnergy[i - 1];
1845 x1 = fSplineEnergy[i - 2];
1846 y0 = fdNdxResonance[i - 1];
1847 yy1 = fdNdxResonance[i - 2];
1851 a = log10(yy1/y0)/log10(c);
1856 if( a == 0 ) result += b*log(e0/x0);
1857 else result += y0*(e0*pow(d,a-1) - x0)/a;
1860 if( a == 0 ) fIntegralResonance[0] += b*log(e0/x0);
1861 else fIntegralResonance[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
1878 meanNumber = fIntegralPAIxSection[1]*step;
1879 numOfCollisions =
G4Poisson(meanNumber);
1883 while(numOfCollisions)
1885 loss += GetEnergyTransfer();
1905 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
1907 if( position >= fIntegralPAIxSection[iTransfer] )
break;
1909 if(iTransfer > fSplineNumber) iTransfer--;
1911 energyTransfer = fSplineEnergy[iTransfer];
1915 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
1917 return energyTransfer;
1931 meanNumber = fIntegralCerenkov[1]*step;
1932 numOfCollisions =
G4Poisson(meanNumber);
1936 while(numOfCollisions)
1938 loss += GetCerenkovEnergyTransfer();
1957 meanNumber = fIntegralMM[1]*step;
1958 numOfCollisions =
G4Poisson(meanNumber);
1962 while(numOfCollisions)
1964 loss += GetMMEnergyTransfer();
1984 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
1986 if( position >= fIntegralCerenkov[iTransfer] )
break;
1988 if(iTransfer > fSplineNumber) iTransfer--;
1990 energyTransfer = fSplineEnergy[iTransfer];
1994 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
1996 return energyTransfer;
2011 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
2013 if( position >= fIntegralMM[iTransfer] )
break;
2015 if(iTransfer > fSplineNumber) iTransfer--;
2017 energyTransfer = fSplineEnergy[iTransfer];
2021 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
2023 return energyTransfer;
2037 meanNumber = fIntegralPlasmon[1]*step;
2038 numOfCollisions =
G4Poisson(meanNumber);
2042 while(numOfCollisions)
2044 loss += GetPlasmonEnergyTransfer();
2064 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
2066 if( position >= fIntegralPlasmon[iTransfer] )
break;
2068 if(iTransfer > fSplineNumber) iTransfer--;
2070 energyTransfer = fSplineEnergy[iTransfer];
2074 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
2076 return energyTransfer;
2090 meanNumber = fIntegralResonance[1]*step;
2091 numOfCollisions =
G4Poisson(meanNumber);
2095 while(numOfCollisions)
2097 loss += GetResonanceEnergyTransfer();
2118 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
2120 if( position >= fIntegralResonance[iTransfer] )
break;
2122 if(iTransfer > fSplineNumber) iTransfer--;
2124 energyTransfer = fSplineEnergy[iTransfer];
2128 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
2130 return energyTransfer;
2144 position = (fIntegralPlasmon[1]-fIntegralResonance[1])*
G4UniformRand();
2146 for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
2148 if( position >= (fIntegralPlasmon[iTransfer]-fIntegralResonance[iTransfer]) )
break;
2150 if(iTransfer > fSplineNumber) iTransfer--;
2152 energyTransfer = fSplineEnergy[iTransfer];
2156 energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*
G4UniformRand();
2158 return energyTransfer;
2164 void G4PAIxSection::CallError(
G4int i,
const G4String& methodName)
const
2166 G4String head =
"G4PAIxSection::" + methodName +
"()";
2168 ed <<
"Wrong index " << i <<
" fSplineNumber= " << fSplineNumber <<
G4endl;
2177 G4int G4PAIxSection::fNumberOfGammas = 111;
2179 const G4double G4PAIxSection::fLorentzFactor[112] =
2182 1.094989e+00, 1.107813e+00, 1.122369e+00, 1.138890e+00, 1.157642e+00,
2183 1.178925e+00, 1.203082e+00, 1.230500e+00, 1.261620e+00, 1.296942e+00,
2184 1.337032e+00, 1.382535e+00, 1.434181e+00, 1.492800e+00, 1.559334e+00,
2185 1.634850e+00, 1.720562e+00, 1.817845e+00, 1.928263e+00, 2.053589e+00,
2186 2.195835e+00, 2.357285e+00, 2.540533e+00, 2.748522e+00, 2.984591e+00,
2187 3.252533e+00, 3.556649e+00, 3.901824e+00, 4.293602e+00, 4.738274e+00,
2188 5.242981e+00, 5.815829e+00, 6.466019e+00, 7.203990e+00, 8.041596e+00,
2189 8.992288e+00, 1.007133e+01, 1.129606e+01, 1.268614e+01, 1.426390e+01,
2190 1.605467e+01, 1.808721e+01, 2.039417e+01, 2.301259e+01, 2.598453e+01,
2191 2.935771e+01, 3.318630e+01, 3.753180e+01, 4.246399e+01, 4.806208e+01,
2192 5.441597e+01, 6.162770e+01, 6.981310e+01, 7.910361e+01, 8.964844e+01,
2193 1.016169e+02, 1.152013e+02, 1.306197e+02, 1.481198e+02, 1.679826e+02,
2194 1.905270e+02, 2.161152e+02, 2.451581e+02, 2.781221e+02, 3.155365e+02,
2195 3.580024e+02, 4.062016e+02, 4.609081e+02, 5.230007e+02, 5.934765e+02,
2196 6.734672e+02, 7.642575e+02, 8.673056e+02, 9.842662e+02, 1.117018e+03,
2197 1.267692e+03, 1.438709e+03, 1.632816e+03, 1.853128e+03, 2.103186e+03,
2198 2.387004e+03, 2.709140e+03, 3.074768e+03, 3.489760e+03, 3.960780e+03,
2199 4.495394e+03, 5.102185e+03, 5.790900e+03, 6.572600e+03, 7.459837e+03,
2200 8.466860e+03, 9.609843e+03, 1.090714e+04, 1.237959e+04, 1.405083e+04,
2201 1.594771e+04, 1.810069e+04, 2.054434e+04, 2.331792e+04, 2.646595e+04,
2202 3.003901e+04, 3.409446e+04, 3.869745e+04, 4.392189e+04, 4.985168e+04,
2203 5.658206e+04, 6.422112e+04, 7.289153e+04, 8.273254e+04, 9.390219e+04,
2213 G4int G4PAIxSection::fRefGammaNumber = 29;