870{
871
873
880
885
886
887 if (k==fTdummyVec.back()) k=k*(1.-1e-12);
888
889
890
891 std::vector<G4double>::iterator k2 = std::upper_bound(fTdummyVec.begin(),
892 fTdummyVec.end(),
893 k);
894 std::vector<G4double>::iterator k1 = k2 - 1;
895
896
897
898
899
900
901
902
903
904
905
906
907
908 if (random <= fProbaShellMap[ionizationLevelIndex][(*k1)].back()
909 && random <= fProbaShellMap[ionizationLevelIndex][(*k2)].back())
910 {
911 std::vector<G4double>::iterator prob12 =
912 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
913 fProbaShellMap[ionizationLevelIndex][(*k1)].end(),
914 random);
915
916 std::vector<G4double>::iterator prob11 = prob12 - 1;
917
918 std::vector<G4double>::iterator prob22 =
919 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
920 fProbaShellMap[ionizationLevelIndex][(*k2)].end(),
921 random);
922
923 std::vector<G4double>::iterator prob21 = prob22 - 1;
924
925 valueK1 = *k1;
926 valueK2 = *k2;
927 valuePROB21 = *prob21;
928 valuePROB22 = *prob22;
929 valuePROB12 = *prob12;
930 valuePROB11 = *prob11;
931
932
933
934
935
936
937 nrjTransf11 = fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
938 nrjTransf12 = fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
939 nrjTransf21 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
940 nrjTransf22 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
941
942
943
944
945
946
947
948
949
950 }
951
952 if (random > fProbaShellMap[ionizationLevelIndex][(*k1)].back())
953 {
954 std::vector<G4double>::iterator prob22 =
955 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
956 fProbaShellMap[ionizationLevelIndex][(*k2)].end(),
957 random);
958
959 std::vector<G4double>::iterator prob21 = prob22 - 1;
960
961 valueK1 = *k1;
962 valueK2 = *k2;
963 valuePROB21 = *prob21;
964 valuePROB22 = *prob22;
965
966
967
968 nrjTransf21 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
969 nrjTransf22 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
970
971 G4double interpolatedvalue2 = Interpolate(valuePROB21,
972 valuePROB22,
973 random,
974 nrjTransf21,
975 nrjTransf22);
976
977
978
979 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
980
981
982
983
984
985
986
987
988
989
990
991 return value;
992 }
993
994
995
996 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
997 * nrjTransf22;
998
999
1000 if (nrjTransfProduct != 0.)
1001 {
1002 nrj = QuadInterpolator(valuePROB11,
1003 valuePROB12,
1004 valuePROB21,
1005 valuePROB22,
1006 nrjTransf11,
1007 nrjTransf12,
1008 nrjTransf21,
1009 nrjTransf22,
1010 valueK1,
1011 valueK2,
1012 k,
1013 random);
1014 }
1015
1016
1017 return nrj;
1018}