Ignore:
Timestamp:
Apr 6, 2009, 12:21:12 PM (15 years ago)
Author:
garnier
Message:

update processes

Location:
trunk/source/processes/electromagnetic/standard/src
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/standard/src/G4ASTARStopping.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ASTARStopping.cc,v 1.6 2006/06/29 19:52:36 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4ASTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828
    2929//---------------------------------------------------------------------------
     
    5353G4ASTARStopping::G4ASTARStopping()
    5454{
     55  currentE = 0.0;
    5556  currentMaterial = 0;
    5657  index = 0;
     
    7273  for (G4int i=0; i<74; i++){
    7374    if (matName == name[i]){
    74       matIndex= -1;
     75      matIndex = i;
    7576      currentMaterial = mat;
    7677      return i;
     
    102103      return res;
    103104    } else if (energy >= kinE[77]) {
    104       index = 58;
     105      index = 76;
    105106      res = e[matIndex][77];
    106107      return res;
     
    134135 for(i=0; i<74; i++) {effZ[i]=Z[i];}
    135136 
    136 name [0] = "G4_A-150_TISSUE";
    137 Znum [0] = 0;
    138  
     137name [0] = "G4_A-150_TISSUE"; 
    139138G4double T0[78] = { 0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.0125, 0.015, 0.0175, 0.02, 0.0225, 0.025, 0.0275, 0.03, 0.035, 0.04, 0.045, 0.05, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225, 0.25, 0.275, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10 };
    140139 
     
    145144 
    146145name [1] = "G4_ACETYLENE";
    147 Znum [1] = 0;
    148  
    149146G4double e1[78] = { 192.2, 229.4, 260.2, 287, 311, 353.1, 389.7, 422.5, 452.4, 480.1, 506, 530.3, 585.9, 635.7, 681.2, 723.2, 762.5, 799.4, 834.3, 867.5, 929.6, 986.9, 1040, 1090, 1137, 1182, 1224, 1265, 1304, 1341, 1376, 1411, 1444, 1475, 1619, 1741, 1847, 1938, 2017, 2085, 2144, 2195, 2275, 2331, 2367, 2388, 2397, 2395, 2386, 2370, 2350, 2326, 2299, 2271, 2241, 2210, 2056, 1913, 1783, 1666, 1562, 1468, 1384, 1308, 1177, 1072, 986.8, 915.5, 855, 802.8, 757.2, 717.1, 681.4, 649.5, 620.7, 594.7, 570.9, 549.2 };
    150147 
     
    152149 
    153150name [2] = "G4_ADIPOSE_TISSUE_ICRP";
    154 Znum [2] = 0;
    155  
    156151G4double e2[78] = { 169.4, 204.2, 233.3, 258.8, 281.8, 322.4, 358.1, 390.2, 419.7, 447.2, 472.9, 497.2, 552.9, 603.2, 649.4, 692.4, 732.7, 770.7, 806.8, 841.3, 906, 966.1, 1022, 1075, 1125, 1173, 1219, 1262, 1304, 1344, 1383, 1420, 1456, 1491, 1650, 1787, 1907, 2012, 2104, 2185, 2256, 2317, 2417, 2489, 2539, 2571, 2588, 2592, 2587, 2573, 2554, 2529, 2500, 2468, 2434, 2398, 2213, 2035, 1874, 1731, 1605, 1499, 1408, 1328, 1197, 1091, 1004, 932.2, 870.7, 817.8, 771.5, 730.8, 694.5, 662.1, 632.9, 606.4, 582.3, 560.2 };
    157152 
     
    159154 
    160155name [3] = "G4_Ag";
    161 Znum [3] = 47;
    162  
    163156G4double e3[78] = { 31.26, 38.13, 43.91, 48.98, 53.56, 61.66, 68.79, 75.21, 81.11, 86.6, 91.74, 96.6, 107.7, 117.8, 127, 135.6, 143.6, 151.2, 158.4, 165.3, 178.2, 190.2, 201.4, 212, 222, 231.6, 240.7, 249.5, 257.9, 266, 273.9, 281.4, 288.8, 295.9, 328.8, 357.8, 383.8, 407.4, 428.8, 448.4, 466.3, 482.8, 511.8, 536.2, 556.6, 573.5, 587.3, 598.4, 607.2, 613.8, 618.5, 621.6, 623.4, 623.8, 623.3, 621.8, 604.4, 578.7, 550.8, 523.3, 497.6, 474.4, 453.6, 435, 402.7, 375.9, 353.2, 333.6, 316.9, 302, 288.8, 276.9, 266.2, 256.5, 247.7, 239.5, 232, 225.1 };
    164157 
     
    166159 
    167160name [4] = "G4_AIR";
    168 Znum [4] = 0;
    169  
    170161G4double e4[78] = { 87.5, 108.6, 126.7, 142.7, 157.3, 183.5, 206.7, 227.9, 247.5, 265.9, 283.2, 299.6, 337.7, 372.3, 404.3, 434.3, 462.6, 489.4, 515, 539.5, 585.8, 629, 669.6, 708.1, 744.8, 779.8, 813.4, 845.7, 876.8, 906.8, 935.9, 964, 991.3, 1018, 1140, 1247, 1343, 1429, 1506, 1575, 1637, 1693, 1787, 1861, 1918, 1961, 1990, 2008, 2017, 2019, 2013, 2002, 1987, 1968, 1946, 1922, 1774, 1625, 1494, 1382, 1287, 1205, 1133, 1072, 968.6, 885.9, 818, 760.7, 711.7, 669.6, 632.7, 600.2, 571.2, 545.3, 521.9, 500.6, 481.2, 463.4 };
    171162 
     
    173164 
    174165name [5] = "G4_Al";
    175 Znum [5] = 13;
    176  
    177166G4double e5[78] = { 55.8, 71.89, 86.05, 98.92, 110.9, 132.7, 152.5, 170.9, 188.2, 204.5, 220.1, 235.1, 270.1, 302.5, 332.8, 361.5, 388.6, 414.6, 439.4, 463.3, 508.4, 550.4, 589.6, 626.5, 661.1, 693.7, 724.3, 753.2, 780.3, 805.9, 830.1, 852.8, 874.3, 894.5, 980, 1045, 1096, 1136, 1168, 1195, 1216, 1234, 1262, 1280, 1291, 1297, 1298, 1297, 1293, 1286, 1279, 1269, 1259, 1248, 1237, 1225, 1161, 1098, 1039, 984.9, 937.6, 895.4, 856.8, 821, 756.1, 698.6, 647.8, 604.8, 567.8, 535.7, 507.4, 482.4, 460, 439.8, 421.6, 405.1, 389.9, 376 };
    178167 
     
    180169 
    181170name [6] = "G4_ALUMINUM_OXIDE";
    182 Znum [6] = 0;
    183  
    184171G4double e6[78] = { 71.39, 88.59, 103.3, 116.4, 128.4, 149.9, 169, 186.5, 202.8, 218, 232.3, 246, 277.7, 306.6, 333.4, 358.5, 382.1, 404.6, 426, 446.5, 485, 520.9, 554.3, 585.8, 615.5, 643.5, 670, 695.2, 719.1, 741.9, 763.6, 784.3, 804, 822.9, 905.9, 974, 1031, 1080, 1122, 1159, 1191, 1220, 1267, 1304, 1332, 1353, 1368, 1378, 1383, 1385, 1384, 1381, 1376, 1370, 1362, 1352, 1308, 1253, 1187, 1115, 1044, 982.5, 928.4, 880, 801.2, 737, 683.4, 638.1, 599.1, 565.2, 535.4, 508.9, 485.3, 464, 444.8, 427.3, 411.4, 396.7 };
    185172 
     
    187174 
    188175name [7] = "G4_Ar";
    189 Znum [7] = 40;
    190  
    191176G4double e7[78] = { 34.54, 44.56, 53.39, 61.42, 68.88, 82.53, 94.95, 106.5, 117.3, 127.6, 137.4, 146.8, 168.8, 189.3, 208.5, 226.7, 244.1, 260.8, 276.8, 292.3, 321.9, 349.8, 376.5, 401.9, 426.4, 450, 472.8, 494.9, 516.3, 537.1, 557.3, 577, 596.1, 614.8, 702.1, 780.3, 850.8, 914.4, 971.9, 1024, 1070, 1111, 1181, 1233, 1272, 1298, 1314, 1321, 1321, 1315, 1305, 1291, 1276, 1258, 1240, 1222, 1130, 1047, 974, 911.2, 856.7, 809, 767, 729.8, 666.1, 613.2, 569.7, 532.7, 501, 473.4, 449.1, 427.4, 408.3, 391, 375.4, 361.1, 348.1, 336 };
    192177 
     
    194179 
    195180name [8] = "G4_Au";
    196 Znum [8] = 79;
    197  
    198181G4double e8[78] = { 11.5, 14.55, 17.2, 19.57, 21.76, 25.72, 29.27, 32.54, 35.59, 38.46, 41.18, 43.78, 49.83, 55.39, 60.56, 65.44, 70.06, 74.46, 78.68, 82.74, 90.45, 97.69, 104.5, 111.1, 117.3, 123.3, 129.1, 134.6, 140, 145.2, 150.3, 155.2, 160, 164.7, 186.4, 205.8, 223.5, 239.5, 254.2, 267.7, 280.1, 291.5, 311.6, 328.5, 342.6, 354.3, 363.8, 371.5, 377.5, 382.1, 385.5, 387.8, 389.1, 389.6, 389.4, 388.7, 384.4, 375.7, 362.6, 346.8, 330.5, 316.4, 304, 293, 274.1, 258.4, 245, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.5, 179.7, 174.5, 169.6, 165 };
    199182 
     
    201184 
    202185name [9] = "G4_B-100_BONE";
    203 Znum [9] = 0;
    204  
    205186G4double e9[78] = { 138.6, 167.7, 192, 213.3, 232.4, 266.3, 296, 322.7, 347.2, 369.9, 391.2, 411.3, 457.3, 498.8, 536.8, 572, 605, 636.1, 665.7, 693.8, 746.5, 795.4, 841, 883.9, 924.5, 963.1, 999.9, 1035, 1069, 1101, 1133, 1163, 1192, 1220, 1348, 1460, 1557, 1643, 1719, 1786, 1845, 1897, 1983, 2047, 2093, 2124, 2142, 2149, 2148, 2139, 2125, 2106, 2084, 2059, 2031, 2003, 1861, 1726, 1600, 1484, 1379, 1290, 1214, 1147, 1035, 945.3, 871.8, 810, 757.7, 712.5, 672.9, 638.1, 607, 579.2, 554.1, 531.3, 510.5, 491.5 };
    206187 
     
    208189 
    209190name [10] = "G4_Be";
    210 Znum [10] = 4;
    211  
    212191G4double e10[78] = { 146.3, 177.1, 202.9, 225.4, 245.6, 281.3, 312.5, 340.6, 366.2, 390, 412.2, 433.2, 481.1, 524.1, 563.3, 599.7, 633.6, 665.4, 695.6, 724.2, 777.7, 827, 872.7, 915.5, 955.7, 993.7, 1030, 1064, 1096, 1128, 1157, 1186, 1213, 1239, 1356, 1453, 1534, 1602, 1659, 1706, 1745, 1776, 1821, 1846, 1856, 1855, 1845, 1829, 1809, 1785, 1759, 1732, 1703, 1674, 1645, 1617, 1499, 1406, 1326, 1254, 1189, 1129, 1075, 1024, 935.3, 858.7, 792.9, 737.6, 690, 648.7, 612.5, 580.4, 552, 526.4, 503.3, 482.4, 463.3, 445.8 };
    213192 
     
    215194 
    216195name [11] = "G4_BONE_COMPACT_ICRU";
    217 Znum [11] = 0;
    218  
    219196G4double e11[78] = { 125.9, 152.6, 175, 194.8, 212.5, 244.1, 271.8, 296.8, 319.8, 341.1, 361.2, 380.2, 423.8, 463.1, 499.3, 533, 564.6, 594.5, 622.8, 649.9, 700.8, 748.1, 792.4, 834.2, 873.7, 911.4, 947.4, 981.9, 1015, 1047, 1078, 1107, 1136, 1164, 1291, 1401, 1498, 1584, 1660, 1727, 1787, 1839, 1926, 1991, 2039, 2072, 2092, 2103, 2105, 2100, 2089, 2075, 2056, 2035, 2011, 1986, 1846, 1705, 1576, 1460, 1358, 1271, 1196, 1130, 1020, 931.6, 859.4, 798.8, 747.4, 702.9, 664, 629.7, 599.1, 571.7, 547.1, 524.7, 504.3, 485.6 };
    220197 
     
    222199 
    223200name [12] = "G4_C";
    224 Znum [12] = 6;
    225  
    226201G4double e12[78] = { 190.6, 225.6, 254.3, 279, 300.9, 339.2, 372.1, 401.4, 427.9, 452.3, 475, 496.2, 544.3, 586.9, 625.5, 661, 693.8, 724.6, 753.5, 780.8, 831.5, 877.9, 920.8, 960.6, 998, 1033, 1066, 1098, 1128, 1156, 1184, 1210, 1235, 1259, 1366, 1455, 1531, 1595, 1650, 1698, 1738, 1772, 1825, 1862, 1886, 1900, 1906, 1906, 1901, 1892, 1880, 1866, 1850, 1833, 1814, 1795, 1684, 1571, 1466, 1372, 1288, 1213, 1145, 1085, 981.9, 898.2, 829.6, 772, 722.9, 680.4, 643.1, 610.2, 580.8, 554.4, 530.6, 509, 489.2, 471.2 };
    227202 
     
    229204 
    230205name [13] = "G4_C_Graphite";
    231 Znum [13] = 0;
    232  
    233206G4double e13[78] = { 192.3, 228.9, 259, 285.1, 308.3, 348.9, 384, 415.3, 443.7, 469.9, 494.2, 517, 568.9, 615.1, 657, 695.5, 731.3, 764.8, 796.3, 826.2, 881.8, 932.7, 979.8, 1024, 1065, 1104, 1141, 1175, 1209, 1240, 1271, 1300, 1327, 1354, 1473, 1574, 1658, 1731, 1793, 1845, 1890, 1929, 1987, 2027, 2051, 2063, 2065, 2060, 2049, 2034, 2015, 1993, 1969, 1944, 1917, 1891, 1751, 1620, 1502, 1400, 1310, 1231, 1161, 1099, 994.3, 909, 839.2, 780.7, 730.8, 687.6, 649.8, 616.4, 586.6, 559.8, 535.7, 513.8, 493.8, 475.5 };
    234207 
     
    236209 
    237210name [14] = "G4_ETHYLENE";
    238 Znum [14] = 0;
    239  
    240211G4double e14[78] = { 159.8, 195.8, 226, 252.7, 276.8, 319.7, 357.4, 391.5, 422.9, 452.1, 479.5, 505.4, 565.1, 619, 668.6, 714.8, 758.1, 799.1, 838.1, 875.3, 945.4, 1011, 1072, 1130, 1185, 1237, 1288, 1336, 1383, 1428, 1471, 1514, 1555, 1594, 1779, 1945, 2094, 2230, 2354, 2468, 2571, 2666, 2830, 2961, 3060, 3130, 3172, 3189, 3185, 3164, 3129, 3086, 3038, 2986, 2931, 2876, 2578, 2306, 2084, 1907, 1763, 1642, 1539, 1450, 1303, 1185, 1089, 1010, 941.9, 883.6, 832.8, 788.1, 748.4, 712.9, 680.9, 652, 625.7, 601.7 };
    241212 
     
    243214 
    244215name [15] = "G4_C-552";
    245 Znum [15] = 0;
    246  
    247216G4double e15[78] = { 124.1, 148.8, 169.3, 187.2, 203.3, 231.5, 256.1, 278.2, 298.4, 317.1, 334.5, 351, 388.6, 422.4, 453.2, 481.8, 508.4, 533.5, 557.3, 579.9, 622.2, 661.3, 697.8, 732, 764.3, 794.9, 824, 851.9, 878.5, 904.1, 928.7, 952.4, 975.2, 997.3, 1097, 1184, 1259, 1325, 1384, 1435, 1481, 1521, 1588, 1639, 1678, 1706, 1726, 1738, 1744, 1745, 1743, 1736, 1727, 1716, 1703, 1688, 1603, 1511, 1421, 1338, 1261, 1190, 1126, 1067, 965.5, 883.8, 816.4, 759.6, 711.1, 669.1, 632.3, 599.9, 571, 545, 521.6, 500.3, 480.9, 463.1 };
    248217 
     
    250219 
    251220name [16] = "G4_CARBON_DIOXIDE";
    252 Znum [16] = 0;
    253  
    254221G4double e16[78] = { 93.28, 114.2, 131.9, 147.5, 161.6, 186.6, 208.6, 228.5, 246.8, 263.8, 279.8, 295, 329.8, 361.2, 390.2, 417.1, 442.4, 466.4, 489.1, 510.8, 551.8, 589.8, 625.6, 659.4, 691.5, 722.2, 751.6, 779.8, 807.1, 833.4, 858.9, 883.7, 907.7, 931.1, 1040, 1137, 1225, 1306, 1380, 1449, 1513, 1571, 1676, 1763, 1834, 1891, 1933, 1961, 1977, 1982, 1978, 1967, 1952, 1932, 1911, 1888, 1752, 1614, 1490, 1383, 1290, 1209, 1139, 1077, 973.3, 890, 821.5, 764, 714.9, 672.6, 635.5, 602.6, 573.5, 547.3, 523.7, 502.4, 482.9, 465 };
    255222 
     
    257224 
    258225name [17] = "G4_CALCIUM_FLUORIDE";
    259 Znum [17] = 0;
    260  
    261226G4double e17[78] = { 72.78, 90.74, 106.1, 119.8, 132.3, 154.7, 174.6, 192.8, 209.7, 225.5, 240.4, 254.5, 287.2, 317, 344.6, 370.4, 394.6, 417.6, 439.5, 460.5, 499.9, 536.5, 570.8, 603.1, 633.6, 662.6, 690.1, 716.4, 741.5, 765.6, 788.6, 810.8, 832.1, 852.6, 944.4, 1022, 1088, 1145, 1194, 1237, 1275, 1308, 1361, 1401, 1431, 1453, 1467, 1476, 1481, 1481, 1479, 1474, 1466, 1458, 1447, 1436, 1352, 1256, 1166, 1086, 1016, 954.4, 900.2, 852.3, 772.1, 708.1, 655.5, 610.7, 573.3, 540.6, 511.9, 486.6, 464, 443.8, 425.4, 408.7, 393.4, 379.4 };
    262227 
     
    264229 
    265230name [18] = "G4_CERIC_SULFATE";
    266 Znum [18] = 0;
    267  
    268231G4double e18[78] = { 99.73, 123.7, 144.1, 162.3, 178.8, 208.3, 234.6, 258.5, 280.5, 301.2, 320.6, 339.1, 381.8, 420.6, 456.5, 490, 521.6, 551.5, 580.1, 607.4, 658.9, 707, 752.2, 795, 835.7, 874.6, 911.8, 947.6, 982, 1015, 1047, 1078, 1109, 1138, 1273, 1391, 1497, 1591, 1676, 1753, 1822, 1884, 1990, 2074, 2140, 2190, 2227, 2251, 2266, 2273, 2272, 2266, 2254, 2238, 2220, 2198, 2049, 1886, 1737, 1607, 1495, 1399, 1315, 1242, 1120, 1023, 942.8, 875.6, 818.4, 769.2, 726.1, 688, 654.2, 624, 596.7, 572, 549.5, 528.9 };
    269232 
     
    271234 
    272235name [19] = "G4_CELLULOSE_NITRATE";
    273 Znum [19] = 0;
    274  
    275236G4double e19[78] = { 157.6, 186.4, 209.9, 230.3, 248.3, 279.7, 306.8, 330.8, 352.6, 372.6, 391.2, 408.7, 448.1, 483.2, 514.9, 544.1, 571.1, 596.4, 620.3, 642.8, 684.8, 723.2, 758.8, 792, 823.2, 852.7, 880.6, 907.2, 932.6, 956.9, 980.2, 1003, 1024, 1045, 1139, 1220, 1290, 1353, 1408, 1457, 1502, 1541, 1608, 1662, 1704, 1736, 1761, 1778, 1789, 1796, 1798, 1796, 1790, 1782, 1772, 1760, 1674, 1574, 1476, 1385, 1302, 1227, 1160, 1099, 993.8, 909.3, 839.7, 781.1, 731.2, 688.1, 650.2, 616.7, 587, 560.3, 536.2, 514.4, 494.5, 476.2 };
    276237 
     
    278239 
    279240name [20] = "G4_BONE_CORTICAL_ICRP";
    280 Znum [20] = 0;
    281  
    282241G4double e20[78] = { 109.1, 132.8, 152.8, 170.4, 186.2, 214.4, 239.3, 261.7, 282.4, 301.6, 319.7, 336.8, 376.1, 411.7, 444.5, 475, 503.6, 530.7, 556.5, 581.1, 627.4, 670.4, 710.8, 748.9, 785, 819.4, 852.4, 883.9, 914.3, 943.5, 971.7, 999, 1025, 1051, 1168, 1270, 1360, 1440, 1511, 1574, 1630, 1680, 1763, 1826, 1872, 1905, 1927, 1939, 1943, 1941, 1933, 1921, 1905, 1887, 1866, 1844, 1720, 1593, 1475, 1369, 1274, 1193, 1123, 1062, 959.2, 877.1, 809.7, 753, 704.9, 663.4, 627, 594.9, 566.3, 540.6, 517.5, 496.5, 477.4, 459.8 };
    283242 
     
    285244 
    286245name [21] = "G4_CESIUM_IODIDE";
    287 Znum [21] = 0;
    288  
    289246G4double e21[78] = { 40.6, 48.54, 55.16, 60.95, 66.15, 75.33, 83.38, 90.64, 97.29, 103.5, 109.3, 114.8, 127.3, 138.7, 149.2, 158.9, 168, 176.7, 184.9, 192.8, 207.6, 221.3, 234.2, 246.4, 258, 269.1, 279.7, 289.9, 299.7, 309.2, 318.3, 327.1, 335.7, 344, 382.3, 415.8, 445.6, 472.1, 495.7, 516.7, 535.4, 551.8, 578.9, 599.2, 613.8, 623.8, 629.9, 633, 633.6, 632.3, 629.5, 625.5, 620.6, 615.1, 609.1, 602.8, 567.7, 533, 501.8, 474.4, 450.3, 429, 410.1, 393.3, 364.6, 340.9, 321, 304, 289.2, 275.9, 264.1, 253.6, 243.9, 235, 226.7, 218.9, 211.9, 205.4 };
    290247 
     
    292249 
    293250name [22] = "G4_Cu";
    294 Znum [22] = 29;
    295  
    296251G4double e22[78] = { 29.51, 36.49, 42.42, 47.68, 52.45, 60.98, 68.54, 75.4, 81.74, 87.65, 93.23, 98.51, 110.7, 121.8, 132, 141.5, 150.5, 159, 167.2, 174.9, 189.5, 203.2, 216, 228.1, 239.7, 250.7, 261.3, 271.4, 281.2, 290.7, 299.8, 308.7, 317.3, 325.6, 364.2, 398.4, 429.1, 456.8, 482.1, 505.1, 526.2, 545.4, 579, 607, 630.1, 649.1, 664.4, 676.6, 686.2, 693.4, 698.8, 702.4, 704.6, 705.7, 705.7, 704.9, 692.5, 672.6, 650.3, 627.6, 606, 585.6, 566.3, 548, 514, 483.4, 455.8, 431, 408.4, 388, 369.6, 353.7, 339.1, 325.7, 313.4, 302, 291.7, 282.3 };
    297252 
     
    299254 
    300255name [23] = "G4_Fe";
    301 Znum [23] = 26;
    302  
    303256G4double e23[78] = { 54.06, 65.42, 74.91, 83.2, 90.66, 103.8, 115.3, 125.6, 135.1, 143.8, 152, 159.8, 177.4, 193.3, 207.8, 221.3, 233.9, 245.7, 256.9, 267.6, 287.7, 306.2, 323.5, 339.8, 355.2, 369.8, 383.8, 397.1, 410, 422.3, 434.2, 445.7, 456.9, 467.6, 517.1, 560.6, 599.4, 634.3, 665.9, 694.6, 720.8, 744.8, 786.6, 821.5, 850.4, 874.1, 893.1, 908.1, 919.6, 928, 933.6, 936.8, 938, 937.3, 935.1, 931.5, 899.9, 856.7, 810.9, 766.9, 727.3, 691.9, 660.2, 631.5, 581.8, 540.1, 504.6, 473.9, 447.2, 423.6, 402.6, 383.5, 366.9, 352, 338.3, 325.7, 314.1, 303.6 };
    304257 
     
    306259 
    307260name [24] = "G4_FERROUS_SULFATE";
    308 Znum [24] = 0;
    309  
    310261G4double e24[78] = { 99.58, 123.5, 144, 162.1, 178.6, 208.1, 234.3, 258.2, 280.2, 300.8, 320.3, 338.7, 381.4, 420.2, 456, 489.5, 521, 551, 579.5, 606.8, 658.3, 706.3, 751.5, 794.2, 834.9, 873.7, 910.9, 946.6, 981, 1014, 1046, 1077, 1108, 1137, 1271, 1390, 1495, 1590, 1675, 1751, 1820, 1882, 1988, 2072, 2138, 2188, 2225, 2250, 2265, 2271, 2271, 2264, 2253, 2237, 2218, 2197, 2048, 1886, 1738, 1609, 1497, 1401, 1317, 1244, 1122, 1025, 944.6, 877.4, 820, 770.7, 727.5, 689.3, 655.4, 625.2, 597.8, 573.1, 550.5, 529.9 };
    311262 
     
    313264 
    314265name [25] = "G4_Gd";
    315 Znum [25] = 64;
    316  
    317266G4double e25[78] = { 38.11, 45.4, 51.41, 56.61, 61.25, 69.34, 76.36, 82.61, 88.29, 93.53, 98.41, 103, 113.4, 122.7, 131.1, 138.9, 146.1, 152.9, 159.3, 165.4, 176.7, 187.1, 196.8, 205.9, 214.4, 222.5, 230.3, 237.6, 244.7, 251.5, 258, 264.3, 270.3, 276.2, 303.1, 326.6, 347.4, 366.2, 383.1, 398.5, 412.5, 425.4, 447.8, 466.5, 482.1, 494.8, 505.1, 513.2, 519.4, 523.9, 526.9, 528.6, 529.1, 528.6, 527.3, 525.2, 505.6, 481, 456.8, 434.6, 414.6, 396.6, 380.5, 366, 340.9, 319.7, 301.6, 285.8, 272, 259.8, 248.8, 239, 230.1, 222, 214.6, 207.7, 201.4, 195.6 };
    318267 
     
    320269 
    321270name [26] = "G4_Ge";
    322 Znum [26] = 32;
    323  
    324271G4double e26[78] = { 47.65, 57.57, 65.83, 73.05, 79.53, 90.94, 100.9, 109.9, 118, 125.6, 132.7, 139.4, 154.6, 168.3, 180.8, 192.3, 203.1, 213.3, 222.9, 232, 249.1, 264.8, 279.5, 293.2, 306.1, 318.4, 330, 341.1, 351.7, 361.8, 371.5, 380.8, 389.8, 398.4, 437.2, 469.9, 497.8, 521.7, 542.3, 560.1, 575.5, 588.9, 610.7, 627.4, 640.1, 649.9, 657.3, 662.8, 666.8, 669.6, 671.4, 672.3, 672.4, 671.9, 670.9, 669.4, 656.9, 639.5, 619.8, 599.4, 578.4, 557.6, 537.5, 518.5, 483.6, 452.9, 425.8, 401.8, 380.5, 361.5, 344.3, 328.6, 315.1, 303.1, 292.1, 282, 272.6, 263.8 };
    325272 
     
    327274 
    328275name [27] = "G4_Pyrex_Glass";
    329 Znum [27] = 0;
    330    
    331276G4double e27[78] = { 83.85, 102.1, 117.5, 131, 143.3, 165, 184.1, 201.3, 217.2, 232, 245.9, 259, 289.2, 316.5, 341.5, 364.8, 386.7, 407.4, 427.1, 445.8, 481.1, 513.8, 544.4, 573.2, 600.6, 626.6, 651.5, 675.3, 698.1, 720.1, 741.3, 761.7, 781.5, 800.6, 888, 963.9, 1031, 1090, 1142, 1189, 1231, 1268, 1330, 1378, 1414, 1441, 1460, 1473, 1481, 1485, 1484, 1481, 1475, 1466, 1456, 1445, 1389, 1323, 1249, 1171, 1095, 1029, 971.4, 920.7, 835.9, 768, 711.5, 663.8, 622.8, 587.4, 556.1, 528.4, 503.7, 481.5, 461.4, 443.2, 426.5, 411.2 };
    332277 
     
    334279 
    335280name [28] = "G4_H";
    336 Znum [28] = 1;
    337  
    338281G4double e28[78] = { 212, 275.4, 331.7, 383, 430.9, 518.8, 599.2, 674, 744.5, 811.5, 875.6, 937.1, 1082, 1217, 1344, 1465, 1580, 1691, 1798, 1901, 2098, 2285, 2463, 2634, 2798, 2956, 3108, 3256, 3399, 3538, 3674, 3805, 3933, 4058, 4637, 5152, 5610, 6019, 6383, 6705, 6988, 7235, 7632, 7915, 8100, 8203, 8240, 8222, 8161, 8067, 7947, 7808, 7655, 7494, 7327, 7157, 6345, 5647, 5068, 4588, 4188, 3860, 3585, 3351, 2971, 2675, 2438, 2242, 2078, 1939, 1818, 1713, 1620, 1538, 1464, 1398, 1337, 1283 };
    339282 
     
    341284 
    342285name [29] = "G4_HELIUM";
    343 Znum [29] = 2;
    344  
    345286G4double e29[78] = { 87.26, 110.8, 131.3, 149.8, 166.8, 197.7, 225.5, 251.1, 275, 297.5, 318.9, 339.4, 387, 430.9, 471.8, 510.4, 547, 581.9, 615.3, 647.5, 708.7, 766.1, 820.5, 872.3, 921.8, 969.3, 1015, 1059, 1102, 1143, 1183, 1221, 1259, 1296, 1465, 1614, 1748, 1867, 1975, 2071, 2156, 2233, 2361, 2460, 2535, 2588, 2624, 2644, 2652, 2650, 2639, 2621, 2598, 2571, 2540, 2507, 2323, 2139, 1976, 1832, 1706, 1593, 1493, 1402, 1249, 1130, 1033, 953.8, 886.8, 829.5, 779.8, 736.4, 697.9, 663.7, 632.9, 605.2, 580, 557 };
    346287 
     
    348289 
    349290name [30] = "G4_KAPTON";
    350 Znum [30] = 0;
    351  
    352291G4double e30[78] = { 165.5, 197.6, 224.2, 247.2, 267.8, 304, 335.4, 363.5, 389.1, 412.8, 434.8, 455.6, 502.9, 545.2, 583.8, 619.4, 652.6, 683.8, 713.3, 741.2, 793.5, 841.6, 886.3, 928.2, 967.7, 1005, 1041, 1074, 1107, 1138, 1167, 1196, 1223, 1250, 1369, 1471, 1560, 1636, 1703, 1762, 1812, 1857, 1928, 1981, 2018, 2042, 2056, 2062, 2061, 2054, 2043, 2028, 2010, 1990, 1969, 1946, 1819, 1688, 1565, 1451, 1350, 1264, 1190, 1125, 1017, 929.8, 858.3, 798.2, 747, 702.8, 664, 629.8, 599.3, 571.9, 547.2, 524.8, 504.4, 485.7 };
    353292 
     
    355294 
    356295name [31] = "G4_Kr";
    357 Znum [31] = 36;
    358  
    359296G4double e31[78] = { 10.15, 13.69, 16.93, 19.96, 22.84, 28.23, 33.29, 38.08, 42.66, 47.08, 51.35, 55.5, 65.43, 74.84, 83.85, 92.52, 100.9, 109.1, 117, 124.7, 139.7, 154.1, 168, 181.5, 194.6, 207.4, 219.9, 232.1, 244, 255.7, 267.2, 278.4, 289.5, 300.3, 351.9, 399.6, 443.7, 484.4, 522.1, 556.7, 588.4, 617.2, 666.6, 705.7, 735.5, 757, 771.4, 779.9, 783.4, 783, 779.4, 773.6, 765.9, 757, 747.2, 736.9, 683.7, 635.6, 595.2, 561.5, 533, 508.6, 487.3, 468.5, 439.9, 417.9, 398.8, 381.4, 364.9, 349.2, 334.2, 319.8, 306.2, 293.7, 282.8, 272.8, 263.6, 255.2 };
    360297 
     
    362299 
    363300name [32] = "G4_LITHIUM_TETRABORATE";
    364 Znum [32] = 0;
    365  
    366301G4double e32[78] = { 132.7, 159.4, 181.6, 200.9, 218.2, 248.6, 275, 298.7, 320.4, 340.4, 359.1, 376.6, 416.8, 452.7, 485.5, 515.8, 544, 570.6, 595.8, 619.7, 664.3, 705.6, 743.9, 779.9, 813.9, 846.1, 876.8, 906.1, 934.2, 961.1, 987, 1012, 1036, 1059, 1166, 1258, 1338, 1410, 1474, 1531, 1583, 1628, 1706, 1767, 1814, 1849, 1874, 1891, 1899, 1902, 1899, 1891, 1875, 1852, 1825, 1795, 1638, 1494, 1375, 1276, 1193, 1121, 1058, 1002, 908.8, 833.2, 770.5, 717.6, 672.4, 633.2, 598.8, 568.3, 541.2, 516.9, 494.8, 474.9, 456.6, 439.9 };
    367302 
     
    369304 
    370305name [33] = "G4_LITHIUM_FLUORIDE";
    371 Znum [33] = 0;
    372  
    373306G4double e33[78] = { 118.7, 142.6, 162.5, 179.7, 195.2, 222.4, 246, 267.2, 286.5, 304.3, 321, 336.6, 372.4, 404.4, 433.5, 460.4, 485.5, 509.1, 531.4, 552.6, 592.1, 628.5, 662.4, 694.1, 724.1, 752.4, 779.4, 805.1, 829.6, 853.2, 875.9, 897.6, 918.7, 938.9, 1031, 1110, 1179, 1240, 1294, 1341, 1383, 1421, 1483, 1530, 1566, 1592, 1610, 1621, 1627, 1627, 1624, 1618, 1609, 1598, 1585, 1571, 1483, 1387, 1296, 1214, 1140, 1074, 1015, 962.2, 872, 799.7, 739.5, 688.5, 644.8, 606.9, 573.7, 544.4, 518.3, 494.9, 473.6, 454.3, 436.7, 420.6 };
    374307 
     
    376309 
    377310name [34] = "G4_M3_WAX";
    378 Znum [34] = 0;
    379  
    380311G4double e34[78] = { 173.6, 209, 238.5, 264.3, 287.6, 328.7, 364.7, 397.1, 426.9, 454.5, 480.4, 504.9, 561, 611.6, 658, 701.1, 741.6, 779.8, 816, 850.6, 915.4, 975.6, 1032, 1085, 1135, 1182, 1228, 1271, 1313, 1353, 1392, 1429, 1465, 1499, 1657, 1792, 1910, 2012, 2101, 2179, 2247, 2305, 2398, 2463, 2507, 2533, 2544, 2544, 2534, 2517, 2494, 2468, 2437, 2405, 2371, 2335, 2154, 1981, 1825, 1686, 1564, 1460, 1372, 1295, 1167, 1064, 980.4, 910.2, 850.4, 798.9, 753.8, 714.2, 678.9, 647.3, 618.8, 593, 569.4, 547.9 };
    381312 
     
    383314 
    384315name [35] = "G4_MS20_TISSUE";
    385 Znum [35] = 0;
    386  
    387316G4double e35[78] = { 163.5, 196.6, 224.1, 248.2, 269.8, 308, 341.4, 371.4, 398.9, 424.4, 448.3, 470.9, 522.5, 569, 611.6, 651.1, 688, 722.9, 756, 787.5, 846.6, 901.2, 952.3, 1000, 1046, 1089, 1130, 1169, 1207, 1243, 1278, 1311, 1344, 1375, 1516, 1638, 1744, 1836, 1916, 1986, 2048, 2101, 2185, 2247, 2288, 2314, 2327, 2330, 2325, 2312, 2295, 2273, 2249, 2222, 2193, 2163, 2002, 1845, 1703, 1575, 1463, 1368, 1286, 1215, 1097, 1001, 923.2, 857.7, 802, 753.9, 711.7, 674.6, 641.6, 611.9, 585.2, 561, 539, 518.8 };
    388317 
     
    390319 
    391320name [36] = "G4_METHANE";
    392 Znum [36] = 0;
    393  
    394321G4double e36[78] = { 197.5, 241.8, 279.3, 312.2, 342, 394.9, 441.5, 483.7, 522.4, 558.5, 592.4, 624.4, 698.1, 764.8, 826, 883.1, 936.6, 987.3, 1035, 1081, 1168, 1249, 1324, 1396, 1464, 1529, 1591, 1650, 1708, 1764, 1818, 1870, 1920, 1970, 2198, 2402, 2586, 2754, 2907, 3047, 3175, 3291, 3492, 3652, 3773, 3856, 3905, 3921, 3899, 3849, 3783, 3708, 3627, 3544, 3460, 3378, 2998, 2685, 2432, 2226, 2055, 1911, 1789, 1683, 1508, 1370, 1257, 1163, 1084, 1015, 955.9, 903.7, 857.5, 816.2, 779.1, 745.5, 714.9, 687.1 };
    395322 
     
    397324 
    398325name [37] = "G4_Mo";
    399 Znum [37] = 42;
    400  
    401326G4double e37[78] = { 58.22, 68.98, 77.79, 85.4, 92.16, 103.9, 114.1, 123.1, 131.3, 138.8, 145.8, 152.4, 167.3, 180.5, 192.5, 203.5, 213.8, 223.4, 232.4, 241, 256.9, 271.6, 285.1, 297.8, 309.8, 321.1, 331.8, 342.1, 351.9, 361.3, 370.3, 379, 387.4, 395.5, 432.4, 464.5, 492.9, 518.2, 541, 561.6, 580.4, 597.4, 626.9, 651.2, 671.2, 687.3, 700.1, 710, 717.3, 722.3, 725.4, 726.7, 726.5, 725, 722.3, 718.8, 690.9, 655, 617.8, 582.6, 552.1, 525.7, 502.3, 481.5, 445.5, 415.5, 389.9, 367.7, 348.1, 330.6, 314.8, 300.9, 288.6, 277.3, 266.9, 257.6, 249, 241.2 };
    402327 
     
    404329 
    405330name [38] = "G4_MUSCLE_WITH_SUCROSE";
    406 Znum [38] = 0;
    407  
    408331G4double e38[78] = { 111.7, 137.5, 159.4, 178.8, 196.5, 227.9, 255.7, 281, 304.4, 326.2, 346.7, 366.2, 411.2, 452, 489.7, 525, 558.1, 589.5, 619.5, 648.1, 702.2, 752.5, 799.9, 844.6, 887.2, 927.9, 966.8, 1004, 1040, 1075, 1108, 1141, 1172, 1203, 1343, 1467, 1576, 1674, 1762, 1841, 1912, 1975, 2081, 2165, 2230, 2277, 2310, 2331, 2342, 2344, 2339, 2329, 2313, 2293, 2270, 2244, 2074, 1896, 1739, 1607, 1494, 1398, 1314, 1241, 1120, 1022, 942.4, 875.3, 818.1, 768.9, 725.8, 687.7, 653.9, 623.7, 596.4, 571.7, 549.2, 528.6 };
    409332 
     
    411334 
    412335name [39] = "G4_MUSCLE_WITHOUT_SUCROSE";
    413 Znum [39] = 0;
    414  
    415336G4double e39[78] = { 108.2, 133.5, 155, 174.1, 191.4, 222.4, 249.8, 274.8, 297.8, 319.3, 339.6, 358.9, 403.3, 443.7, 481, 515.9, 548.7, 579.8, 609.5, 637.9, 691.4, 741.4, 788.3, 832.7, 875, 915.3, 953.9, 991.1, 1027, 1061, 1095, 1127, 1158, 1189, 1328, 1451, 1560, 1658, 1745, 1824, 1895, 1958, 2065, 2150, 2215, 2263, 2298, 2320, 2332, 2335, 2331, 2321, 2306, 2287, 2265, 2240, 2075, 1901, 1746, 1613, 1501, 1404, 1320, 1247, 1125, 1027, 946.2, 878.8, 821.4, 772, 728.6, 690.4, 656.4, 626.1, 598.7, 573.9, 551.3, 530.6 };
    416337 
     
    418339 
    419340name [40] = "G4_MUSCLE_SKELETAL_ICRP";
    420 Znum [40] = 0;
    421  
    422341G4double e40[78] = { 104.5, 129.2, 150.2, 168.8, 185.8, 216.1, 242.9, 267.4, 290, 311.1, 331, 349.8, 393.5, 433.1, 469.7, 503.9, 536.2, 566.7, 595.9, 623.7, 676.3, 725.4, 771.5, 815.1, 856.6, 896.2, 934.1, 970.6, 1006, 1040, 1072, 1104, 1135, 1165, 1302, 1422, 1530, 1626, 1712, 1790, 1860, 1922, 2029, 2113, 2178, 2228, 2263, 2286, 2299, 2304, 2302, 2293, 2280, 2262, 2242, 2218, 2059, 1888, 1735, 1604, 1492, 1396, 1312, 1240, 1118, 1021, 941.1, 874.1, 817, 767.9, 724.9, 686.8, 653.1, 622.9, 595.7, 571, 548.6, 528 };
    423342 
     
    425344 
    426345name [41] = "G4_MUSCLE_STRIATED_ICRU";
    427 Znum [41] = 0;
    428  
    429346G4double e41[78] = { 104.7, 129.4, 150.5, 169.2, 186.2, 216.5, 243.4, 267.9, 290.5, 311.7, 331.6, 350.5, 394.2, 433.9, 470.6, 504.9, 537.2, 567.8, 596.9, 624.9, 677.5, 726.7, 772.8, 816.5, 858.1, 897.8, 935.8, 972.3, 1007, 1041, 1074, 1106, 1137, 1167, 1304, 1425, 1532, 1629, 1715, 1793, 1863, 1925, 2032, 2116, 2181, 2230, 2265, 2289, 2302, 2306, 2304, 2295, 2282, 2264, 2244, 2220, 2063, 1894, 1742, 1611, 1498, 1401, 1318, 1244, 1123, 1025, 944.5, 877.2, 819.9, 770.6, 727.3, 689.2, 655.3, 625, 597.7, 572.9, 550.4, 529.7 };
    430347 
     
    432349 
    433350name [42] = "G4_N";
    434 Znum [42] = 7;
    435  
    436351G4double e42[78] = { 82.8, 103.7, 121.6, 137.7, 152.3, 178.7, 202.3, 223.8, 243.8, 262.5, 280.2, 297.1, 336.2, 372, 405.1, 436.2, 465.5, 493.4, 520.1, 545.7, 594.1, 639.3, 682, 722.5, 761, 797.9, 833.4, 867.4, 900.3, 932, 962.8, 992.5, 1021, 1049, 1179, 1293, 1395, 1486, 1567, 1640, 1706, 1765, 1864, 1940, 1999, 2041, 2069, 2086, 2093, 2091, 2083, 2069, 2051, 2030, 2005, 1978, 1819, 1660, 1522, 1406, 1308, 1224, 1151, 1088, 982.9, 898.5, 829.5, 771.1, 721.3, 678.5, 641, 608, 578.6, 552.3, 528.5, 506.9, 487.2, 469.1 };
    437352 
     
    439354 
    440355name [43] = "G4_SODIUM_IODIDE";
    441 Znum [43] = 0;
    442  
    443356G4double e43[78] = { 35.86, 44.19, 51.24, 57.48, 63.13, 73.21, 82.12, 90.2, 97.64, 104.6, 111.1, 117.3, 131.6, 144.5, 156.4, 167.6, 178, 187.9, 197.3, 206.3, 223.3, 239.1, 253.9, 268, 281.3, 294, 306.2, 317.9, 329.2, 340.1, 350.6, 360.8, 370.6, 380.2, 424.5, 463.5, 498.4, 529.9, 558.2, 583.8, 607, 627.8, 663.4, 691.6, 713.4, 729.6, 740.9, 748.1, 751.7, 752.4, 750.7, 747, 741.7, 735.1, 727.6, 719.5, 664.4, 611.2, 569.4, 538.3, 514, 491.6, 472.1, 454, 422.9, 393.7, 370.2, 349.6, 331.4, 315.3, 301.2, 288.5, 276.8, 266.1, 256.3, 247.1, 238.9, 231.5 };
    444357 
     
    446359 
    447360name [44] = "G4_Ne";
    448 Znum [44] = 10;
    449  
    450361G4double e44[78] = { 68.73, 83.7, 96.26, 107.3, 117.2, 134.8, 150.3, 164.2, 177, 188.8, 199.9, 210.4, 234.5, 256.2, 276.1, 294.6, 311.9, 328.3, 343.8, 358.6, 386.3, 412, 436.1, 458.8, 480.3, 500.8, 520.3, 539.1, 557.1, 574.5, 591.2, 607.5, 623.2, 638.4, 708.4, 770.3, 825.6, 875.7, 921.2, 962.8, 1001, 1036, 1098, 1150, 1194, 1230, 1260, 1285, 1304, 1319, 1330, 1338, 1343, 1344, 1344, 1341, 1296, 1229, 1160, 1095, 1035, 981.4, 932.6, 888.5, 812.1, 748.3, 695.6, 650.4, 611.3, 577, 546.8, 520, 496, 474.4, 454.8, 437, 420.7, 405.7 };
    451362 
     
    453364 
    454365name [45] = "G4_NYLON-6/6";
    455 Znum [45] = 0;
    456  
    457366G4double e45[78] = { 167.4, 201.6, 230.3, 255.4, 278, 317.9, 352.9, 384.4, 413.4, 440.3, 465.5, 489.3, 544, 593.3, 638.6, 680.6, 720.1, 757.3, 792.7, 826.4, 889.7, 948.5, 1003, 1055, 1104, 1151, 1195, 1238, 1279, 1318, 1356, 1392, 1427, 1461, 1617, 1750, 1867, 1969, 2059, 2138, 2207, 2267, 2363, 2433, 2482, 2512, 2527, 2531, 2525, 2511, 2491, 2467, 2439, 2408, 2375, 2340, 2160, 1987, 1830, 1690, 1567, 1463, 1374, 1297, 1169, 1066, 981.3, 910.8, 850.9, 799.3, 754.1, 714.4, 679, 647.4, 618.9, 593, 569.5, 547.9 };
    458367 
     
    460369 
    461370name [46] = "G4_O";
    462 Znum [46] = 8;
    463  
    464371G4double e46[78] = { 105.8, 117.3, 257.6, 1.139e-05, 5.976e-06, 0.005, 248.1, 71.83, 352, 3.186e-05, 2.012e-05, 0.015, 412.7, 40.96, 503.1, 6.782e-05, 5.098e-05, 0.035, 610.6, 24.07, 700.7, 0.0001156, 9.613e-05, 0.07, 820, 15.89, 884.2, 0.0001583, 0.0001354, 0.125, 1124, 8.719, 1280, 0.0002775, 0.0002641, 0.3, 1573, 4.478, 1697, 0.0004528, 0.000448, 0.65, 1818, 2.655, 1822, 0.0006468, 0.0006403, 1, 1667, 1.474, 1431, 0.00138, 0.001539, 2.75, 1038, 0.7076, 860.9, 0.003906, 0.004519, 6, 616.1, 0.3845, 556.8, 0.009419, 0.01034, 9.5, 452, 0.2295, 334.7, 0.03447, 0.04325, 27.5, 196.3, 0.09039, 156.5, 0.1784, 0.2149, 60 };
    465372 
     
    467374 
    468375name [47] = "G4_PARAFFIN";
    469 Znum [47] = 0;
    470  
    471376G4double e47[78] = { 193.8, 233, 265.8, 294.4, 320.3, 365.9, 405.9, 441.9, 475, 505.7, 534.5, 561.7, 624.2, 680.6, 732.3, 780.4, 825.5, 868.2, 908.6, 947.2, 1020, 1087, 1150, 1209, 1265, 1319, 1370, 1419, 1465, 1510, 1554, 1595, 1636, 1675, 1852, 2004, 2137, 2253, 2354, 2442, 2518, 2584, 2688, 2762, 2810, 2837, 2848, 2845, 2831, 2810, 2782, 2749, 2713, 2674, 2633, 2592, 2381, 2184, 2007, 1851, 1714, 1598, 1500, 1414, 1272, 1158, 1066, 988.4, 922.7, 866.1, 816.7, 773.2, 734.5, 699.9, 668.8, 640.6, 614.9, 591.4 };
    472377 
     
    474379 
    475380name [48] = "G4_Pb";
    476 Znum [48] = 82;
    477  
    478381G4double e48[78] = { 17.96, 22.18, 25.76, 28.92, 31.8, 36.93, 41.47, 45.6, 49.4, 52.95, 56.3, 59.46, 66.77, 73.41, 79.52, 85.23, 90.6, 95.69, 100.5, 105.2, 113.9, 122, 129.7, 136.9, 143.8, 150.3, 156.6, 162.7, 168.5, 174.1, 179.5, 184.8, 189.9, 194.9, 217.7, 237.9, 256, 272.3, 287, 300.4, 312.6, 323.6, 342.6, 358.2, 370.7, 380.6, 388.3, 394.2, 398.4, 401.3, 403.1, 404, 404.1, 403.5, 402.4, 401, 392.5, 380.4, 365.3, 348.6, 332, 317.6, 304.9, 293.7, 274.4, 258.3, 244.7, 232.9, 222.5, 213.2, 205, 197.5, 190.7, 184.4, 178.7, 173.4, 168.4, 163.9 };
    479382 
     
    481384 
    482385name [49] = "G4_PHOTOGRAPHIC_EMULSION";
    483 Znum [49] = 0;
    484  
    485386G4double e49[78] = { 46.69, 57.18, 66.06, 73.91, 81.04, 93.75, 105, 115.2, 124.7, 133.5, 141.8, 149.6, 167.8, 184.3, 199.6, 213.8, 227.3, 240, 252.1, 263.8, 285.7, 306.2, 325.4, 343.6, 361, 377.5, 393.4, 408.7, 423.3, 437.5, 451.2, 464.5, 477.3, 489.8, 547, 597.3, 641.7, 681.2, 716.3, 747.6, 775.5, 800.2, 841.5, 873.5, 897.8, 915.8, 928.6, 937.1, 940, 938.4, 933.8, 927, 918.6, 909.2, 899.1, 888.5, 833.7, 781.8, 735.1, 693.7, 657.1, 624.6, 595.5, 569.4, 524.5, 487.2, 455.6, 428.5, 404.9, 383.9, 365.2, 348.6, 333.8, 320.5, 308.3, 297.2, 287, 277.8 };
    486387 
     
    488389 
    489390name [50] = "G4_PLASTIC_SC_VINYLTOLUENE";
    490 Znum [50] = 0;
    491  
    492391G4double e50[78] = { 192.4, 229.8, 260.8, 287.8, 312, 354.4, 391.4, 424.6, 454.8, 482.8, 509, 533.7, 590, 640.5, 686.6, 729.3, 769.2, 806.7, 842.2, 876, 939.2, 997.5, 1052, 1103, 1151, 1197, 1240, 1281, 1321, 1359, 1395, 1430, 1464, 1497, 1644, 1769, 1878, 1971, 2053, 2123, 2184, 2236, 2319, 2377, 2414, 2436, 2445, 2443, 2433, 2417, 2396, 2371, 2343, 2314, 2283, 2251, 2091, 1936, 1791, 1657, 1537, 1435, 1349, 1273, 1148, 1047, 964.8, 895.9, 837.3, 786.7, 742.4, 703.5, 668.8, 637.7, 609.7, 584.3, 561.2, 540 };
    493392 
     
    495394 
    496395name [51] = "G4_POLYCARBONATE";
    497 Znum [51] = 0;
    498  
    499396G4double e51[78] = { 146.3, 178.1, 204.7, 228.1, 249.2, 286.4, 319.1, 348.5, 375.5, 400.6, 424.1, 446.2, 497, 542.8, 584.7, 623.5, 659.9, 694.2, 726.6, 757.6, 815.5, 869.1, 919, 965.9, 1010, 1052, 1092, 1130, 1167, 1202, 1235, 1268, 1299, 1329, 1465, 1581, 1681, 1768, 1843, 1908, 1965, 2013, 2090, 2144, 2180, 2201, 2210, 2209, 2202, 2188, 2170, 2149, 2125, 2099, 2072, 2044, 1912, 1785, 1661, 1543, 1433, 1340, 1261, 1191, 1076, 982.4, 906, 842, 787.5, 740.5, 699.2, 662.9, 630.5, 601.5, 575.3, 551.6, 529.9, 510.1 };
    500397 
     
    502399 
    503400name [52] = "G4_POLYETHYLENE";
    504 Znum [52] = 0;
    505  
    506401G4double e52[78] = { 168.2, 205.8, 237.5, 265.4, 290.7, 335.4, 374.8, 410.5, 443.2, 473.7, 502.3, 529.3, 591.4, 647.6, 699.1, 747.1, 792.1, 834.6, 874.9, 913.5, 985.9, 1053, 1116, 1175, 1232, 1285, 1336, 1385, 1432, 1478, 1521, 1564, 1604, 1644, 1825, 1983, 2122, 2246, 2355, 2453, 2539, 2615, 2740, 2833, 2899, 2940, 2962, 2967, 2958, 2938, 2908, 2871, 2829, 2782, 2732, 2681, 2418, 2183, 1987, 1826, 1691, 1577, 1480, 1396, 1257, 1145, 1053, 977.1, 912.4, 856.5, 807.8, 764.9, 726.7, 692.6, 661.8, 633.9, 608.6, 585.4 };
    507402 
     
    509404 
    510405name [53] = "G4_MYLAR";
    511 Znum [53] = 0;
    512  
    513406G4double e53[78] = { 163.2, 195.3, 221.8, 244.9, 265.6, 301.9, 333.5, 361.8, 387.6, 411.5, 433.8, 454.8, 502.7, 545.7, 584.8, 621, 654.8, 686.6, 716.7, 745.3, 798.7, 847.9, 893.8, 936.8, 977.4, 1016, 1052, 1087, 1121, 1153, 1183, 1213, 1241, 1269, 1393, 1500, 1593, 1673, 1744, 1806, 1860, 1908, 1985, 2042, 2083, 2110, 2126, 2133, 2133, 2126, 2115, 2100, 2082, 2061, 2038, 2014, 1874, 1731, 1599, 1482, 1379, 1290, 1215, 1148, 1038, 948.5, 875.3, 813.8, 761.5, 716.3, 676.6, 641.6, 610.5, 582.5, 557.3, 534.4, 513.6, 494.5 };
    514407 
     
    516409 
    517410name [54] = "G4_PLEXIGLASS";
    518 Znum [54] = 0;
    519  
    520411G4double e54[78] = { 118.7, 146.6, 170.3, 191.4, 210.4, 244.5, 274.7, 302.1, 327.3, 350.9, 373.1, 394.2, 442.7, 486.8, 527.4, 565.2, 600.9, 634.6, 666.7, 697.4, 755.1, 808.9, 859.3, 906.9, 952, 995, 1036, 1075, 1113, 1150, 1185, 1219, 1252, 1283, 1428, 1554, 1665, 1762, 1848, 1923, 1990, 2049, 2144, 2216, 2266, 2300, 2320, 2328, 2327, 2318, 2302, 2282, 2259, 2232, 2203, 2173, 2008, 1847, 1702, 1574, 1464, 1369, 1288, 1217, 1099, 1004, 925.6, 860.1, 804.4, 756.3, 714.1, 676.9, 643.8, 614.2, 587.4, 563.2, 541.1, 520.8 };
    521412 
     
    523414 
    524415name [55] = "G4_POLYPROPYLENE";
    525 Znum [55] = 0;
    526  
    527416G4double e55[78] = { 193.7, 232.8, 265.4, 293.9, 319.6, 365, 404.8, 440.6, 473.4, 503.9, 532.5, 559.6, 621.6, 677.5, 728.8, 776.5, 821.2, 863.4, 903.5, 941.8, 1014, 1080, 1142, 1201, 1257, 1309, 1360, 1408, 1454, 1499, 1541, 1583, 1622, 1661, 1836, 1986, 2117, 2231, 2331, 2417, 2492, 2557, 2660, 2732, 2779, 2806, 2817, 2814, 2801, 2780, 2752, 2720, 2684, 2646, 2606, 2565, 2359, 2165, 1991, 1836, 1700, 1585, 1488, 1403, 1263, 1150, 1058, 981.3, 916.1, 860, 810.9, 767.8, 729.5, 695.1, 664.3, 636.2, 610.8, 587.5 };
    528417 
     
    530419 
    531420name [56] = "G4_POLYSTYRENE";
    532 Znum [56] = 0;
    533  
    534421G4double e56[78] = { 153, 187.5, 216.6, 242.2, 265.3, 306.5, 342.7, 375.5, 405.6, 433.6, 460, 484.9, 542.1, 593.8, 641.3, 685.4, 726.9, 766, 803.1, 838.5, 905, 966.6, 1024, 1078, 1130, 1178, 1225, 1269, 1312, 1352, 1392, 1429, 1466, 1501, 1661, 1797, 1915, 2017, 2106, 2183, 2249, 2305, 2394, 2454, 2492, 2511, 2516, 2509, 2494, 2471, 2443, 2410, 2376, 2339, 2301, 2262, 2070, 1895, 1742, 1609, 1493, 1395, 1312, 1239, 1119, 1021, 941.4, 874.6, 817.8, 768.7, 725.7, 687.9, 654.1, 623.9, 596.6, 571.9, 549.4, 528.7 };
    535422 
     
    537424 
    538425name [57] = "G4_TEFLON";
    539 Znum [57] = 0;
    540  
    541426G4double e57[78] = { 82.7, 99.97, 114.4, 127.1, 138.4, 158.5, 176.2, 192, 206.5, 220, 232.6, 244.5, 271.9, 296.4, 319, 339.8, 359.4, 377.8, 395.3, 412, 443.3, 472.2, 499.3, 524.7, 548.8, 571.7, 593.6, 614.5, 634.6, 653.9, 672.5, 690.4, 707.8, 724.6, 801.6, 868.9, 928.6, 981.9, 1030, 1073, 1112, 1148, 1209, 1260, 1301, 1334, 1361, 1382, 1397, 1408, 1415, 1419, 1420, 1418, 1414, 1409, 1399, 1373, 1319, 1246, 1165, 1095, 1034, 979.4, 887.4, 813.7, 752.5, 700.8, 656.5, 618.1, 584.5, 554.8, 528.3, 504.6, 483, 463.5, 445.6, 429.3 };
    542427 
     
    544429 
    545430name [58] = "G4_POLYVINYL_CHLORIDE";
    546 Znum [58] = 0;
    547  
    548431G4double e58[78] = { 94.27, 114.4, 131.3, 146.3, 159.9, 184, 205.5, 224.9, 242.9, 259.7, 275.5, 290.5, 325.3, 357, 386.3, 413.7, 439.5, 464.1, 487.6, 510.1, 552.6, 592.4, 629.9, 665.5, 699.4, 731.8, 762.9, 792.9, 821.8, 849.7, 876.7, 902.9, 928.2, 952.9, 1067, 1167, 1255, 1335, 1405, 1468, 1525, 1574, 1657, 1719, 1764, 1795, 1814, 1823, 1824, 1818, 1807, 1792, 1774, 1753, 1731, 1708, 1591, 1482, 1385, 1299, 1222, 1153, 1092, 1037, 941.7, 862.4, 795.8, 739.8, 692.3, 651.2, 615.4, 583.7, 555.6, 530.3, 507.5, 486.9, 468, 450.8 };
    549432 
     
    551434 
    552435name [59] = "G4_PROPANE";
    553 Znum [59] = 0;
    554  
    555436G4double e59[78] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022, 1868, 1739, 1629, 1534, 1377, 1252, 1150, 1065, 993, 931.1, 877.2, 829.9, 787.8, 750.2, 716.4, 685.8, 658, 632.5 };
    556437 
     
    558439 
    559440name [60] = "G4_Pt";
    560 Znum [60] = 78;
    561  
    562441G4double e60[78] = { 14.45, 17.87, 20.78, 23.37, 25.71, 29.9, 33.61, 36.99, 40.1, 43.01, 45.75, 48.35, 54.36, 59.81, 64.84, 69.54, 73.97, 78.17, 82.17, 86, 93.22, 99.96, 106.3, 112.3, 118, 123.5, 128.7, 133.8, 138.7, 143.4, 147.9, 152.4, 156.7, 160.8, 180.3, 197.6, 213.3, 227.7, 240.9, 253, 264.3, 274.7, 293.2, 309, 322.4, 333.7, 343.1, 350.7, 356.8, 361.6, 365.1, 367.6, 369.1, 369.8, 369.9, 369.3, 364.7, 357, 347.3, 336.6, 325.5, 314.4, 303.6, 293.2, 274.3, 258.5, 245.1, 233.4, 223.1, 214, 205.8, 198.4, 191.6, 185.4, 179.7, 174.4, 169.5, 164.9 };
    563442 
     
    565444 
    566445name [61] = "G4_Si";
    567 Znum [61] = 14;
    568  
    569446G4double e61[78] = { 47.32, 61.63, 74.34, 85.98, 96.82, 116.8, 135.1, 152.1, 168.2, 183.4, 198.1, 212.1, 245.3, 276.1, 305.2, 332.7, 359.1, 384.4, 408.7, 432.2, 477, 519.3, 559.4, 597.5, 633.9, 668.6, 701.9, 733.7, 764.3, 793.5, 821.6, 848.5, 874.4, 899.1, 1008, 1097, 1168, 1225, 1270, 1307, 1336, 1359, 1390, 1408, 1416, 1417, 1413, 1405, 1395, 1383, 1370, 1356, 1341, 1326, 1310, 1295, 1218, 1146, 1081, 1023, 970.6, 923.9, 881.4, 842.4, 773.1, 713.1, 661.2, 617.4, 579.7, 547, 518.2, 492.7, 470, 449.5, 430.9, 414, 398.6, 384.4 };
    570447 
     
    572449 
    573450name [62] = "G4_SILICON_DIOXIDE";
    574 Znum [62] = 0;
    575  
    576451G4double e62[78] = { 68.9, 85.1, 98.85, 111, 122.1, 141.8, 159.3, 175.1, 189.8, 203.4, 216.3, 228.5, 256.6, 282.1, 305.7, 327.6, 348.3, 367.9, 386.5, 404.4, 437.9, 469.2, 498.5, 526.3, 552.6, 577.7, 601.7, 624.7, 646.9, 668.2, 688.8, 708.7, 728, 746.7, 832.2, 906.8, 972.6, 1031, 1083, 1129, 1170, 1207, 1268, 1315, 1351, 1377, 1396, 1409, 1417, 1421, 1421, 1419, 1414, 1406, 1397, 1387, 1349, 1301, 1237, 1163, 1087, 1021, 964, 913.7, 829.4, 762.2, 706.3, 659, 618.4, 583.3, 552.3, 524.9, 500.4, 478.4, 458.5, 440.4, 423.9, 408.7 };
    577452 
     
    579454 
    580455name [63] = "G4_STILBENE";
    581 Znum [63] = 0;
    582  
    583456G4double e63[78] = { 192, 228.9, 259.4, 286, 309.7, 351.2, 387.4, 419.7, 449.2, 476.4, 501.9, 525.8, 580.4, 629.2, 673.8, 714.9, 753.3, 789.4, 823.5, 856, 916.5, 972.3, 1024, 1073, 1119, 1162, 1203, 1243, 1280, 1316, 1351, 1384, 1416, 1446, 1585, 1703, 1805, 1892, 1968, 2034, 2090, 2139, 2215, 2268, 2303, 2323, 2331, 2330, 2321, 2307, 2287, 2265, 2240, 2212, 2184, 2155, 1995, 1841, 1703, 1582, 1477, 1385, 1305, 1233, 1113, 1015, 936, 869.6, 813, 764.1, 721.3, 683.7, 650.1, 620, 592.9, 568.3, 545.9, 525.4 };
    584457 
     
    586459 
    587460name [64] = "G4_Ti";
    588 Znum [64] = 22;
    589  
    590461G4double e64[78] = { 59.24, 72.81, 84.28, 94.41, 103.6, 119.9, 134.3, 147.4, 159.4, 170.6, 181.1, 191.1, 214, 234.7, 253.8, 271.6, 288.3, 304.1, 319.1, 333.5, 360.5, 385.5, 409, 431.2, 452.2, 472.2, 491.4, 509.7, 527.3, 544.3, 560.6, 576.4, 591.7, 606.5, 674.2, 733.1, 785, 831, 871.7, 907.9, 940, 968.3, 1015, 1051, 1077, 1095, 1106, 1112, 1114, 1112, 1107, 1100, 1092, 1082, 1071, 1059, 995.6, 933.7, 877.6, 827.9, 785.2, 747.8, 714.5, 684.4, 631.9, 587.1, 548.3, 514.3, 484.2, 457.3, 433.4, 412.5, 393.7, 376.7, 361.5, 347.6, 334.9, 323.2 };
    591462 
     
    593464 
    594465name [65] = "G4_Sn";
    595 Znum [65] = 50;
    596  
    597466G4double e65[78] = { 27.39, 33.96, 39.55, 44.52, 49.04, 57.11, 64.28, 70.8, 76.82, 82.45, 87.76, 92.79, 104.4, 115, 124.8, 133.9, 142.5, 150.6, 158.4, 165.8, 179.8, 192.9, 205.2, 216.8, 227.8, 238.4, 248.4, 258.1, 267.4, 276.4, 285.1, 293.5, 301.6, 309.5, 345.7, 377.3, 405.3, 430.1, 452.1, 471.8, 489.3, 504.8, 530.7, 550.9, 566.3, 577.9, 586.3, 592.2, 596.1, 598.4, 599.3, 599.1, 598.1, 596.4, 594.2, 591.5, 573.8, 552.8, 531.2, 510.1, 488.3, 467, 447, 428.6, 396.3, 369.4, 346.8, 327.7, 311.4, 297.1, 283.9, 271.9, 260.8, 250.6, 241.7, 233.6, 226, 218.9 };
    598467 
     
    600469 
    601470name [66] = "G4_TISSUE_METHANE";
    602 Znum [66] = 0;
    603  
    604471G4double e66[78] = { 135.1, 165.6, 191.3, 213.9, 234.4, 270.7, 302.8, 331.8, 358.4, 383.2, 406.5, 428.6, 479.3, 525.2, 567.4, 606.7, 643.6, 678.5, 711.7, 743.4, 803.1, 858.6, 910.7, 960.1, 1007, 1052, 1095, 1136, 1176, 1214, 1251, 1287, 1322, 1356, 1514, 1655, 1783, 1899, 2006, 2104, 2193, 2275, 2418, 2535, 2626, 2693, 2737, 2760, 2764, 2752, 2728, 2695, 2655, 2612, 2566, 2519, 2278, 2060, 1878, 1727, 1602, 1494, 1403, 1323, 1191, 1085, 998.2, 926, 864.6, 811.7, 765.6, 724.9, 688.8, 656.5, 627.4, 601.1, 577.1, 555.2 };
    605472 
     
    607474 
    608475name [67] = "G4_TISSUE_PROPANE";
    609 Znum [67] = 0;
    610  
    611476G4double e67[78] = { 149.7, 181.5, 208.2, 231.7, 252.8, 290.4, 323.5, 353.4, 380.9, 406.5, 430.5, 453.3, 505.7, 553, 596.6, 637.2, 675.4, 711.5, 745.8, 778.6, 840.4, 897.8, 951.6, 1003, 1051, 1097, 1141, 1183, 1224, 1263, 1301, 1337, 1372, 1407, 1563, 1701, 1822, 1929, 2024, 2109, 2185, 2252, 2362, 2446, 2507, 2549, 2573, 2583, 2581, 2569, 2550, 2524, 2494, 2461, 2426, 2389, 2211, 2043, 1887, 1744, 1616, 1507, 1415, 1334, 1201, 1094, 1006, 933.3, 871.4, 818.1, 771.5, 730.5, 694.1, 661.5, 632.1, 605.6, 581.4, 559.3 };
    612477 
     
    614479 
    615480name [68] = "G4_TOLUENE";
    616 Znum [68] = 0;
    617  
    618481G4double e68[78] = { 192.5, 230, 261, 288.1, 312.3, 354.9, 392, 425.3, 455.6, 483.7, 510, 534.8, 591.3, 642.1, 688.4, 731.3, 771.4, 809.1, 844.8, 878.8, 942.4, 1001, 1056, 1107, 1155, 1201, 1245, 1287, 1327, 1365, 1401, 1437, 1471, 1504, 1652, 1779, 1888, 1983, 2065, 2136, 2197, 2250, 2333, 2392, 2430, 2452, 2461, 2459, 2449, 2433, 2411, 2386, 2358, 2328, 2296, 2264, 2109, 1960, 1817, 1683, 1560, 1456, 1368, 1291, 1163, 1060, 976.6, 906.6, 847.1, 795.7, 750.8, 711.3, 676.1, 644.6, 616.2, 590.5, 567, 545.6 };
    619482 
     
    621484 
    622485name [69] = "G4_U";
    623 Znum [69] = 92;
    624  
    625486G4double e69[78] = { 13.2, 16.72, 19.77, 22.52, 25.04, 29.61, 33.73, 37.51, 41.03, 44.35, 47.5, 50.51, 57.52, 63.96, 69.97, 75.62, 80.99, 86.11, 91.01, 95.73, 104.7, 113.1, 121.1, 128.7, 136, 143, 149.8, 156.3, 162.6, 168.8, 174.7, 180.5, 186.2, 191.7, 217.4, 240.5, 261.5, 280.8, 298.5, 314.8, 329.8, 343.7, 368, 388.4, 405.3, 419, 429.8, 438.1, 444.2, 448.4, 450.8, 451.8, 451.6, 450.3, 448.2, 445.4, 420, 390.1, 362.9, 339.6, 319.8, 303.1, 288.9, 276.7, 256.9, 241.7, 229.4, 218.6, 209.1, 200.6, 193, 186.1, 179.8, 174, 168.6, 163.7, 159.1, 154.8 };
    626487 
     
    628489 
    629490name [70] = "G4_W";
    630 Znum [70] = 74;
    631  
    632491G4double e70[78] = { 20.75, 25.23, 28.99, 32.29, 35.26, 40.51, 45.11, 49.26, 53.06, 56.59, 59.9, 63.02, 70.18, 76.63, 82.54, 88.02, 93.16, 98.01, 102.6, 107, 115.2, 122.9, 130, 136.7, 143.1, 149.2, 155, 160.6, 165.9, 171.1, 176.1, 180.9, 185.6, 190.1, 211.1, 229.6, 246.2, 261.3, 275.1, 287.7, 299.3, 310, 328.8, 344.7, 358.1, 369.2, 378.3, 385.6, 391.3, 395.6, 398.7, 400.6, 401.7, 401.9, 401.4, 400.4, 389.5, 374.8, 359.5, 344.8, 331, 318.3, 306.5, 295.7, 276.7, 260.8, 247.3, 235.5, 225.2, 216.1, 207.8, 200.3, 193.5, 187.3, 181.5, 176.2, 171.3, 166.7 };
    633492 
     
    635494 
    636495name [71] = "G4_WATER";
    637 Znum [71] = 0;
    638  
    639496G4double e71[78] = { 98.91, 122.7, 143.1, 161.1, 177.5, 206.9, 233, 256.8, 278.8, 299.3, 318.6, 337, 379.5, 418.1, 453.8, 487.1, 518.6, 548.3, 576.7, 603.9, 655.2, 703, 748, 790.5, 831, 869.6, 906.6, 942.2, 976.4, 1009, 1041, 1072, 1102, 1131, 1265, 1383, 1488, 1582, 1666, 1743, 1811, 1873, 1978, 2062, 2128, 2178, 2215, 2240, 2255, 2262, 2262, 2256, 2245, 2230, 2211, 2190, 2050, 1896, 1752, 1624, 1511, 1414, 1329, 1255, 1132, 1034, 952.7, 884.8, 826.9, 777.1, 733.4, 694.9, 660.7, 630.1, 602.5, 577.6, 554.8, 534 };
    640497 
     
    642499 
    643500name [72] = "G4_WATER_VAPOR";
    644 Znum [72] = 0;
    645  
    646501G4double e72[78] = { 126.3, 154.7, 178.7, 199.8, 218.8, 252.7, 282.5, 309.5, 334.3, 357.3, 379, 399.5, 446.7, 489.3, 528.5, 565, 599.2, 631.6, 662.4, 691.9, 747.3, 798.8, 847.2, 892.9, 936.3, 977.8, 1018, 1056, 1093, 1128, 1163, 1196, 1228, 1260, 1405, 1535, 1652, 1758, 1855, 1942, 2022, 2094, 2216, 2309, 2377, 2422, 2446, 2455, 2453, 2446, 2436, 2423, 2409, 2392, 2371, 2346, 2169, 1971, 1797, 1653, 1537, 1437, 1351, 1275, 1149, 1049, 965.8, 896.6, 837.6, 786.9, 742.5, 703.3, 668.6, 637.5, 609.5, 584.2, 561.1, 539.9 };
    647502 
     
    649504 
    650505name [73] = "G4_Xe";
    651 Znum [73] = 54;
    652  
    653506G4double e73[78] = { 18.11, 23.3, 27.86, 31.99, 35.83, 42.84, 49.2, 55.1, 60.63, 65.87, 70.87, 75.65, 86.89, 97.3, 107.1, 116.3, 125.1, 133.5, 141.7, 149.5, 164.4, 178.6, 192, 204.9, 217.3, 229.2, 240.7, 251.8, 262.6, 273.1, 283.4, 293.3, 303, 312.5, 356.7, 396.5, 432.5, 465.2, 494.9, 521.8, 546.1, 567.9, 604.7, 633.2, 654.5, 669.3, 678.8, 683.6, 684.6, 682.5, 678, 671.7, 663.9, 655.1, 645.6, 635.6, 584.6, 538.7, 500.4, 468.8, 446.7, 430.5, 417.1, 405.3, 383.9, 364, 344.9, 326.8, 309.7, 294.6, 281.3, 269.5, 258.7, 248.8, 239.6, 231.1, 223.2, 216.2 };
    654507 
  • trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheBlochModel.cc,v 1.13 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4BetheBlochModel.cc,v 1.25 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4545// 13-02-03 Add name (V.Ivanchenko)
    4646// 24-03-05 Add G4EmCorrections (V.Ivanchenko)
    47 // 11-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
     47// 11-04-05 Major optimisation of internal interfaces (V.Ivanchenko)
    4848// 11-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
    4949// 12-02-06 move G4LossTableManager::Instance()->EmCorrections()
    5050//          in constructor (mma)
     51// 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio,
     52//          CorrectionsAlongStep needed for ions(V.Ivanchenko)
    5153//
    5254// -------------------------------------------------------------------
     
    6365#include "G4EmCorrections.hh"
    6466#include "G4ParticleChangeForLoss.hh"
     67#include "G4NistManager.hh"
    6568
    6669//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    7174                                     const G4String& nam)
    7275  : G4VEmModel(nam),
    73   particle(0),
    74   tlimit(DBL_MAX),
    75   twoln10(2.0*log(10.0)),
    76   bg2lim(0.0169),
    77   taulim(8.4146e-3),
    78   isIon(false)
    79 {
     76    particle(0),
     77    tlimit(DBL_MAX),
     78    twoln10(2.0*log(10.0)),
     79    bg2lim(0.0169),
     80    taulim(8.4146e-3),
     81    isIon(false),
     82    isInitialised(false)
     83{
     84  fParticleChange = 0;
    8085  if(p) SetParticle(p);
    8186  theElectron = G4Electron::Electron();
    8287  corr = G4LossTableManager::Instance()->EmCorrections(); 
     88  nist = G4NistManager::Instance();
     89  SetLowEnergyLimit(2.0*MeV);
    8390}
    8491
     
    102109{
    103110  if (!particle) SetParticle(p);
    104   G4String pname = particle->GetParticleName();
    105   if (particle->GetParticleType() == "nucleus" &&
    106      pname != "deuteron" && pname != "triton") isIon = true;
    107 
    108   if (pParticleChange)
    109     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    110                                                               (pParticleChange);
    111   else
    112     fParticleChange = new G4ParticleChangeForLoss();
    113 }
    114 
    115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    116 
    117 G4double G4BetheBlochModel::ComputeCrossSectionPerElectron(
    118                                            const G4ParticleDefinition* p,
    119                                                  G4double kineticEnergy,
    120                                                  G4double cutEnergy,
    121                                                  G4double maxKinEnergy)                                           
     111
     112  corrFactor = chargeSquare;
     113  // always false before the run
     114  SetDeexcitationFlag(false);
     115
     116  if(!isInitialised) {
     117    isInitialised = true;
     118
     119    if(!fParticleChange) {
     120      if (pParticleChange) {
     121        fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
     122          (pParticleChange);
     123      } else {
     124        fParticleChange = new G4ParticleChangeForLoss();
     125      }
     126    }
     127  }
     128}
     129
     130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     131
     132void G4BetheBlochModel::SetParticle(const G4ParticleDefinition* p)
     133{
     134  if(particle != p) {
     135    particle = p;
     136    G4String pname = particle->GetParticleName();
     137    if (particle->GetParticleType() == "nucleus" &&
     138        pname != "deuteron" && pname != "triton") {
     139      isIon = true;
     140    }
     141   
     142    mass = particle->GetPDGMass();
     143    spin = particle->GetPDGSpin();
     144    G4double q = particle->GetPDGCharge()/eplus;
     145    chargeSquare = q*q;
     146    ratio = electron_mass_c2/mass;
     147    G4double magmom = particle->GetPDGMagneticMoment()
     148      *mass/(0.5*eplus*hbar_Planck*c_squared);
     149    magMoment2 = magmom*magmom - 1.0;
     150    formfact = 0.0;
     151    if(particle->GetLeptonNumber() == 0) {
     152      G4double x = 0.8426*GeV;
     153      if(spin == 0.0 && mass < GeV) {x = 0.736*GeV;}
     154      else if(mass > GeV) {
     155        x /= nist->GetZ13(mass/proton_mass_c2);
     156        //      tlimit = 51.2*GeV*A13[iz]*A13[iz];
     157      }
     158      formfact = 2.0*electron_mass_c2/(x*x);
     159      tlimit   = 2.0/formfact;
     160    }
     161  }
     162}
     163
     164//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     165
     166G4double G4BetheBlochModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
     167                                                 const G4Material* mat,
     168                                                 G4double kineticEnergy)
     169{
     170  // this method is called only for ions
     171  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
     172  corrFactor = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
     173  return corrFactor;
     174}
     175
     176//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     177
     178G4double G4BetheBlochModel::GetParticleCharge(const G4ParticleDefinition* p,
     179                                              const G4Material* mat,
     180                                              G4double kineticEnergy)
     181{
     182  // this method is called only for ions
     183  return corr->GetParticleCharge(p,mat,kineticEnergy);
     184}
     185
     186//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     187
     188G4double
     189G4BetheBlochModel::ComputeCrossSectionPerElectron(const G4ParticleDefinition* p,
     190                                                  G4double kineticEnergy,
     191                                                  G4double cutEnergy,
     192                                                  G4double maxKinEnergy)       
    122193{
    123194  G4double cross = 0.0;
     
    130201    G4double beta2     = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
    131202
    132     cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*log(maxEnergy/cutEnergy)/tmax;
     203    cross = 1.0/cutEnergy - 1.0/maxEnergy
     204      - beta2*log(maxEnergy/cutEnergy)/tmax;
    133205
    134206    // +term for spin=1/2 particle
    135207    if( 0.5 == spin ) cross += 0.5*(maxEnergy - cutEnergy)/energy2;
     208
     209    // High order correction different for hadrons and ions
     210    // nevetheless they are applied to reduce high energy transfers
     211    //    if(!isIon)
     212    //cross += corr->FiniteSizeCorrectionXS(p,currentMaterial,
     213    //                                    kineticEnergy,cutEnergy);
    136214
    137215    cross *= twopi_mc2_rcl2*chargeSquare/beta2;
     
    167245                                                 G4double maxEnergy)
    168246{
     247  currentMaterial   = material;
    169248  G4double eDensity = material->GetElectronDensity();
    170249  G4double cross = eDensity*ComputeCrossSectionPerElectron
     
    222301  dedx *= twopi_mc2_rcl2*chargeSquare*eDensity/beta2;
    223302
    224   //High order correction only for hadrons
    225   if(!isIon) dedx += corr->HighOrderCorrections(p,material,kineticEnergy);
    226 
     303  //High order correction different for hadrons and ions
     304  if(isIon) {
     305    dedx += corr->IonBarkasCorrection(p,material,kineticEnergy);
     306  } else {     
     307    dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy);
     308  }
    227309  return dedx;
     310}
     311
     312//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     313
     314void G4BetheBlochModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
     315                                             const G4DynamicParticle* dp,
     316                                             G4double& eloss,
     317                                             G4double&,
     318                                             G4double length)
     319{
     320  const G4ParticleDefinition* p = dp->GetDefinition();
     321  const G4Material* mat = couple->GetMaterial();
     322  G4double preKinEnergy = dp->GetKineticEnergy();
     323  G4double e = preKinEnergy - eloss*0.5;
     324  if(e < 0.0) e = preKinEnergy*0.5;
     325
     326  if(isIon) {
     327    G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
     328    GetModelOfFluctuations()->SetParticleAndCharge(p, q2);
     329    eloss *= q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor;
     330    eloss += length*corr->IonHighOrderCorrections(p,couple,e);
     331  }
     332
     333  if(nuclearStopping && preKinEnergy*proton_mass_c2/mass < chargeSquare*100.*MeV) {
     334
     335    G4double nloss = length*corr->NuclearDEDX(p,mat,e,false);
     336
     337    // too big energy loss
     338    if(eloss + nloss > preKinEnergy) {
     339      nloss *= (preKinEnergy/(eloss + nloss));
     340      eloss = preKinEnergy;
     341    } else {
     342      eloss += nloss;
     343    }
     344    /*
     345    G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
     346           << " de= " << eloss << " NIEL= " << nloss
     347           << " dynQ= " << dp->GetCharge()/eplus << G4endl;
     348    */
     349    fParticleChange->ProposeNonIonizingEnergyDeposit(nloss);
     350  }
     351
    228352}
    229353
     
    239363  G4double tmax = MaxSecondaryEnergy(dp->GetDefinition(),kineticEnergy);
    240364
    241   G4double maxKinEnergy = min(maxEnergy,tmax);
     365  G4double maxKinEnergy = std::min(maxEnergy,tmax);
    242366  if(minKinEnergy >= maxKinEnergy) return;
    243367
     
    246370  G4double beta2         = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2;
    247371
    248   G4double deltaKinEnergy, f;
    249 
    250   // sampling follows ...
     372  G4double deltaKinEnergy, f;
     373  G4double f1 = 0.0;
     374  G4double fmax = 1.0;
     375  if( 0.5 == spin ) fmax += 0.5*maxKinEnergy*maxKinEnergy/etot2;
     376
     377  // sampling without nuclear size effect
    251378  do {
    252379    G4double q = G4UniformRand();
     
    255382
    256383    f = 1.0 - beta2*deltaKinEnergy/tmax;
    257     if( 0.5 == spin ) f += 0.5*deltaKinEnergy*deltaKinEnergy/etot2;
    258 
    259     if(f > 1.0) {
    260         G4cout << "G4BetheBlochModel::SampleSecondary Warning! "
    261                << "Majorant 1.0 < "
    262                << f << " for Edelta= " << deltaKinEnergy
    263                << G4endl;
    264     }
    265 
    266   } while( G4UniformRand() > f );
    267 
     384    if( 0.5 == spin ) {
     385      f1 = 0.5*deltaKinEnergy*deltaKinEnergy/etot2;
     386      f += f1;
     387    }
     388
     389  } while( fmax*G4UniformRand() > f);
     390
     391  // projectile formfactor - suppresion of high energy
     392  // delta-electron production at high energy
     393 
     394  G4double x = formfact*deltaKinEnergy;
     395  if(x > 1.e-6) {
     396
     397    G4double x1 = 1.0 + x;
     398    G4double g  = 1.0/(x1*x1);
     399    if( 0.5 == spin ) {
     400      G4double x2 = 0.5*electron_mass_c2*deltaKinEnergy/(mass*mass);
     401      g *= (1.0 + magMoment2*(x2 - f1/f)/(1.0 + x2));
     402    }
     403    if(g > 1.0) {
     404      G4cout << "### G4BetheBlochModel WARNING: g= " << g
     405             << dp->GetDefinition()->GetParticleName()
     406             << " Ekin(MeV)= " <<  kineticEnergy
     407             << " delEkin(MeV)= " << deltaKinEnergy
     408             << G4endl;
     409    }
     410    if(G4UniformRand() > g) return;
     411  }
     412
     413  // delta-electron is produced
    268414  G4double totMomentum = totEnergy*sqrt(beta2);
    269415  G4double deltaMomentum =
     
    309455}
    310456
    311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     457//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     458
     459G4double G4BetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     460                                               G4double kinEnergy)
     461{
     462  if(isIon) SetParticle(pd);
     463  G4double tau  = kinEnergy/mass;
     464  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     465                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     466  return std::min(tmax,tlimit);
     467}
     468
     469//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4BetheHeitlerModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BetheHeitlerModel.cc,v 1.11 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4BetheHeitlerModel.cc,v 1.12 2008/10/15 15:54:57 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    6161#include "G4PhysicsLogVector.hh"
    6262#include "G4ParticleChangeForGamma.hh"
     63#include "G4LossTableManager.hh"
    6364
    6465//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    7071  : G4VEmModel(nam),
    7172    theCrossSectionTable(0),
    72     nbins(200)
    73 {
     73    nbins(10)
     74{
     75  fParticleChange = 0;
    7476  theGamma    = G4Gamma::Gamma();
    7577  thePositron = G4Positron::Positron();
     
    9294                                     const G4DataVector&)
    9395{
    94   if(pParticleChange)
    95     fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    96   else
    97     fParticleChange = new G4ParticleChangeForGamma();
     96  if(!fParticleChange) {
     97    if(pParticleChange) {
     98      fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
     99    } else {
     100      fParticleChange = new G4ParticleChangeForGamma();
     101    }
     102  }
    98103
    99104  if(theCrossSectionTable) {
     
    108113  G4double emin = LowEnergyLimit();
    109114  G4double emax = HighEnergyLimit();
     115  G4int n = nbins*G4int(log10(emax/emin));
     116  G4bool spline = G4LossTableManager::Instance()->SplineFlag();
    110117  G4double e, value;
    111118
    112119  for(size_t j=0; j<nvect ; j++) {
    113120
    114     ptrVector  = new G4PhysicsLogVector(emin, emax, nbins);
     121    ptrVector  = new G4PhysicsLogVector(emin, emax, n);
     122    ptrVector->SetSpline(spline);
    115123    G4double Z = (*theElementTable)[j]->GetZ();
    116124    G4int   iz = G4int(Z);
  • trunk/source/processes/electromagnetic/standard/src/G4BohrFluctuations.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BohrFluctuations.cc,v 1.6 2007/09/27 14:02:41 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4BohrFluctuations.cc,v 1.7 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    137137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    138138
     139G4double G4BohrFluctuations::Dispersion(const G4Material* material,
     140                                        const G4DynamicParticle* dp,
     141                                        G4double& tmax,
     142                                        G4double& length)
     143{
     144  if(!particle) InitialiseMe(dp->GetDefinition());
    139145
     146  G4double electronDensity = material->GetElectronDensity();
     147  kineticEnergy = dp->GetKineticEnergy();
     148  G4double etot = kineticEnergy + particleMass;
     149  beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);
     150  G4double siga  = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
     151                 * electronDensity * chargeSquare;
     152
     153  return siga;
     154}
     155
     156//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     157
     158
  • trunk/source/processes/electromagnetic/standard/src/G4BraggIonModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggIonModel.cc,v 1.17 2007/07/28 13:30:53 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4BraggIonModel.cc,v 1.23 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4444// 25-04-06 Add stopping data from ASTAR (V.Ivanchenko)
    4545// 23-10-06 Reduce lowestKinEnergy to 0.25 keV (V.Ivanchenko)
     46// 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio,
     47//          CorrectionsAlongStep needed for ions(V.Ivanchenko)
    4648//
    4749
     
    6264#include "G4Electron.hh"
    6365#include "G4ParticleChangeForLoss.hh"
     66#include "G4LossTableManager.hh"
     67#include "G4EmCorrections.hh"
    6468
    6569//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    7074                                 const G4String& nam)
    7175  : G4VEmModel(nam),
    72   particle(0),
    73   iMolecula(0),
    74   isIon(false)
     76    corr(0),
     77    particle(0),
     78    fParticleChange(0),
     79    iMolecula(0),
     80    isIon(false),
     81    isInitialised(false)
    7582{
    7683  if(p) SetParticle(p);
    77   highKinEnergy    = 2.0*MeV;
    78   lowKinEnergy     = 0.0*MeV;
     84  SetHighEnergyLimit(2.0*MeV);
     85
    7986  HeMass           = 3.727417*GeV;
    8087  rateMassHe2p     = HeMass/proton_mass_c2;
     
    104111{
    105112  if(p != particle) SetParticle(p);
    106   G4String pname = particle->GetParticleName();
    107   if(particle->GetParticleType() == "nucleus" &&
    108      pname != "deuteron" && pname != "triton") isIon = true;
    109 
    110   if(pParticleChange)
    111     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    112                                                               (pParticleChange);
    113   else
    114     fParticleChange = new G4ParticleChangeForLoss();
    115 
     113
     114  corrFactor = chargeSquare;
     115
     116  // always false before the run
     117  SetDeexcitationFlag(false);
     118
     119  if(!isInitialised) {
     120    isInitialised = true;
     121
     122    G4String pname = particle->GetParticleName();
     123    if(particle->GetParticleType() == "nucleus" &&
     124       pname != "deuteron" && pname != "triton") isIon = true;
     125
     126    corr = G4LossTableManager::Instance()->EmCorrections();
     127
     128    if(!fParticleChange) {
     129      if(pParticleChange) {
     130        fParticleChange =
     131          reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
     132      } else {
     133        fParticleChange = new G4ParticleChangeForLoss();
     134      }
     135    }
     136  }
     137}
     138
     139//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     140
     141G4double G4BraggIonModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
     142                                               const G4Material* mat,
     143                                               G4double kineticEnergy)
     144{
     145  // this method is called only for ions
     146  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
     147  corrFactor  = q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
     148  return corrFactor;
     149}
     150
     151//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     152
     153G4double G4BraggIonModel::GetParticleCharge(const G4ParticleDefinition* p,
     154                                            const G4Material* mat,
     155                                            G4double kineticEnergy)
     156{
     157  // this method is called only for ions
     158  return corr->GetParticleCharge(p,mat,kineticEnergy);
    116159}
    117160
     
    124167                                                 G4double maxKinEnergy)
    125168{
    126 
    127169  G4double cross     = 0.0;
    128170  G4double tmax      = MaxSecondaryEnergy(p, kineticEnergy);
    129   G4double maxEnergy = min(tmax,maxKinEnergy);
     171  G4double maxEnergy = std::min(tmax,maxKinEnergy);
    130172  if(cutEnergy < tmax) {
    131173
     
    213255//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    214256
     257void G4BraggIonModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
     258                                           const G4DynamicParticle* dp,
     259                                           G4double& eloss,
     260                                           G4double&,
     261                                           G4double length)
     262{
     263  // this method is called only for ions
     264  const G4ParticleDefinition* p = dp->GetDefinition();
     265  const G4Material* mat = couple->GetMaterial();
     266  G4double preKinEnergy = dp->GetKineticEnergy();
     267  G4double e = preKinEnergy - eloss*0.5;
     268  if(e < 0.0) e = preKinEnergy*0.5;
     269
     270  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,e);
     271  GetModelOfFluctuations()->SetParticleAndCharge(p, q2);
     272  eloss *= q2*corr->EffectiveChargeCorrection(p,mat,e)/corrFactor;
     273
     274  if(nuclearStopping) {
     275
     276    G4double nloss = length*corr->NuclearDEDX(p,mat,e,false);
     277
     278    // too big energy loss
     279    if(eloss + nloss > preKinEnergy) {
     280      nloss *= (preKinEnergy/(eloss + nloss));
     281      eloss = preKinEnergy;
     282    } else {
     283      eloss += nloss;
     284    }
     285    /*
     286    G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
     287           << " de= " << eloss << " NIEL= " << nloss
     288           << " dynQ= " << dp->GetCharge()/eplus << G4endl;
     289    */
     290    fParticleChange->ProposeNonIonizingEnergyDeposit(nloss);
     291  }
     292}
     293
     294//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     295
    215296void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
    216297                                        const G4MaterialCutsCouple*,
     
    220301{
    221302  G4double tmax = MaxSecondaryKinEnergy(dp);
    222   G4double xmax = min(tmax, maxEnergy);
     303  G4double xmax = std::min(tmax, maxEnergy);
    223304  if(xmin >= xmax) return;
    224305
     
    274355  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
    275356  fParticleChange->SetProposedMomentumDirection(finalP);
     357}
     358
     359//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     360
     361G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     362                                             G4double kinEnergy)
     363{
     364  if(pd != particle) SetParticle(pd);
     365  G4double tau  = kinEnergy/mass;
     366  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     367                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     368  return tmax;
    276369}
    277370
  • trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4BraggModel.cc,v 1.16 2007/07/28 13:30:53 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4BraggModel.cc,v 1.21 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5050// 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
    5151// 25-04-06 Add stopping data from PSTAR (V.Ivanchenko)
     52// 12-08-08 Added methods GetParticleCharge, GetChargeSquareRatio,
     53//          CorrectionsAlongStep needed for ions(V.Ivanchenko)
    5254
    5355// Class Description:
     
    6769#include "G4Electron.hh"
    6870#include "G4ParticleChangeForLoss.hh"
     71#include "G4LossTableManager.hh"
     72#include "G4EmCorrections.hh"
    6973
    7074//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    7478G4BraggModel::G4BraggModel(const G4ParticleDefinition* p, const G4String& nam)
    7579  : G4VEmModel(nam),
    76   particle(0),
    77   protonMassAMU(1.007276),
    78   iMolecula(0),
    79   isIon(false)
     80    particle(0),
     81    protonMassAMU(1.007276),
     82    iMolecula(0),
     83    isIon(false),
     84    isInitialised(false)
    8085{
    8186  if(p) SetParticle(p);
     87  SetHighEnergyLimit(2.0*MeV);
     88
    8289  lowestKinEnergy  = 1.0*keV;
    8390  theZieglerFactor = eV*cm2*1.0e-15;
     
    104111{
    105112  if(p != particle) SetParticle(p);
    106   G4String pname = particle->GetParticleName();
    107   if(particle->GetParticleType() == "nucleus" &&
    108      pname != "deuteron" && pname != "triton") isIon = true;
    109 
    110   if(pParticleChange)
    111     fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    112                                                               (pParticleChange);
    113   else
    114     fParticleChange = new G4ParticleChangeForLoss();
     113
     114  // always false before the run
     115  SetDeexcitationFlag(false);
     116
     117  if(!isInitialised) {
     118    isInitialised = true;
     119
     120    G4String pname = particle->GetParticleName();
     121    if(particle->GetParticleType() == "nucleus" &&
     122       pname != "deuteron" && pname != "triton") isIon = true;
     123
     124    corr = G4LossTableManager::Instance()->EmCorrections();
     125
     126    if(pParticleChange) {
     127      fParticleChange =
     128        reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
     129    } else {
     130      fParticleChange = new G4ParticleChangeForLoss();
     131    }
     132  }
     133}
     134
     135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     136
     137G4double G4BraggModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
     138                                            const G4Material* mat,
     139                                            G4double kineticEnergy)
     140{
     141  // this method is called only for ions
     142  G4double q2 = corr->EffectiveChargeSquareRatio(p,mat,kineticEnergy);
     143  GetModelOfFluctuations()->SetParticleAndCharge(p, q2);
     144  return q2*corr->EffectiveChargeCorrection(p,mat,kineticEnergy);
     145}
     146
     147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     148
     149G4double G4BraggModel::GetParticleCharge(const G4ParticleDefinition* p,
     150                                         const G4Material* mat,
     151                                         G4double kineticEnergy)
     152{
     153  // this method is called only for ions
     154  return corr->GetParticleCharge(p,mat,kineticEnergy);
    115155}
    116156
     
    123163                                                 G4double maxKinEnergy)
    124164{
    125 
    126165  G4double cross     = 0.0;
    127166  G4double tmax      = MaxSecondaryEnergy(p, kineticEnergy);
    128   G4double maxEnergy = min(tmax,maxKinEnergy);
     167  G4double maxEnergy = std::min(tmax,maxKinEnergy);
    129168  if(cutEnergy < tmax) {
    130169
     
    203242
    204243  return dedx;
     244}
     245
     246//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     247
     248void G4BraggModel::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
     249                                        const G4DynamicParticle* dp,
     250                                        G4double& eloss,
     251                                        G4double&,
     252                                        G4double length)
     253{
     254  if(nuclearStopping) {
     255
     256    G4double preKinEnergy = dp->GetKineticEnergy();
     257    G4double e = preKinEnergy - eloss*0.5;
     258    if(e < 0.0) e = preKinEnergy*0.5;
     259    G4double nloss = length*corr->NuclearDEDX(dp->GetDefinition(),
     260                                              couple->GetMaterial(),
     261                                              e,false);
     262
     263    // too big energy loss
     264    if(eloss + nloss > preKinEnergy) {
     265      nloss *= (preKinEnergy/(eloss + nloss));
     266      eloss = preKinEnergy;
     267    } else {
     268      eloss += nloss;
     269    }
     270    /*
     271    G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
     272           << " de= " << eloss << " NIEL= " << nloss
     273           << " dynQ= " << dp->GetCharge()/eplus << G4endl;
     274    */
     275    fParticleChange->ProposeNonIonizingEnergyDeposit(nloss);
     276  }
    205277}
    206278
     
    268340
    269341  vdp->push_back(delta);
     342}
     343
     344//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     345
     346G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd,
     347                                          G4double kinEnergy)
     348{
     349  if(pd != particle) SetParticle(pd);
     350  G4double tau  = kinEnergy/mass;
     351  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
     352                  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
     353  return tmax;
    270354}
    271355
  • trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ComptonScattering.cc,v 1.27 2006/09/14 10:27:19 maire Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4ComptonScattering.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929//
     
    7474    isInitialised(false)
    7575{
    76   SetLambdaBinning(90);
    77   SetMinKinEnergy(0.1*keV);
    78   SetMaxKinEnergy(100.0*GeV);
     76  SetProcessSubType(fComptonScattering);
    7977}
    8078
     
    8684//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8785
     86G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p)
     87{
     88  return (&p == G4Gamma::Gamma());
     89}
     90
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     92
    8893void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*)
    8994{
     
    9297    SetBuildTableFlag(true);
    9398    SetSecondaryParticle(G4Electron::Electron());
    94     G4double emin = MinKinEnergy();
    95     G4double emax = MaxKinEnergy();
    9699    if(!Model()) SetModel(new G4KleinNishinaCompton);
    97     Model()->SetLowEnergyLimit(emin);
    98     Model()->SetHighEnergyLimit(emax);
     100    Model()->SetLowEnergyLimit(MinKinEnergy());
     101    Model()->SetHighEnergyLimit(MaxKinEnergy());
    99102    AddEmModel(1, Model());
    100103  }
     
    104107
    105108void G4ComptonScattering::PrintInfo()
    106 {
    107   G4cout
    108     << " Total cross sections has a good parametrisation"
    109     << " from 10 KeV to (100/Z) GeV"
    110     << "\n      Sampling according " << Model()->GetName() << " model"
    111     << G4endl;
    112 }         
     109{}         
    113110
    114111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering52.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ComptonScattering52.cc,v 1.5 2007/05/16 14:00:56 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4ComptonScattering52.cc,v 1.7 2008/10/15 17:53:44 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929//
     
    7373    NumbBinTable(80),
    7474    fminimalEnergy(1*eV)
    75 {}
     75{
     76  SetProcessSubType(13);
     77  G4cout << "!!! G4ComptonScattering52 is the obsolete process class and will be removed soon !!!"
     78         << G4endl;
     79}
    7680
    7781//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScattering.cc,v 1.11 2007/11/20 18:43:25 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4CoulombScattering.cc,v 1.20 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5959
    6060G4CoulombScattering::G4CoulombScattering(const G4String& name)
    61   : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(DBL_MAX),
     61  : G4VEmProcess(name),thetaMin(0.0),thetaMax(pi),q2Max(TeV*TeV),
    6262    isInitialised(false)
    6363{
    64   G4VEmProcess::SetBuildTableFlag(true);
     64  SetBuildTableFlag(true);
    6565  SetStartFromNullFlag(false);
    6666  SetIntegral(true);
    67   SetMinKinEnergy(keV);
    68   SetMaxKinEnergy(PeV);
    6967  thEnergy = PeV;
    7068  thEnergyElec = PeV;
     
    7371    thEnergyElec = 10.*GeV;
    7472  }
    75   SetLambdaBinning(120);
    7673  SetSecondaryParticle(G4Electron::Electron());
    77   buildElmTableFlag = true;
     74  SetProcessSubType(fCoulombScattering);
    7875}
    7976
     
    8582//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    8683
     84G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)
     85{
     86  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());
     87}
     88
     89//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     90
    8791void G4CoulombScattering::InitialiseProcess(const G4ParticleDefinition* p)
    8892{
    89   if(!isInitialised) {
     93  // second initialisation
     94  if(isInitialised) {
     95    G4VEmModel* mod = GetModelByIndex(0);
     96    mod->SetPolarAngleLimit(PolarAngleLimit());
     97    mod = GetModelByIndex(1);
     98    if(mod) mod->SetPolarAngleLimit(PolarAngleLimit());
     99
     100    // first initialisation
     101  } else {
    90102    isInitialised = true;
    91103    aParticle = p;
    92104    G4double mass = p->GetPDGMass();
    93105    if (mass > GeV || p->GetParticleType() == "nucleus") {
    94       buildElmTableFlag = false;
     106      SetBuildTableFlag(false);
    95107      verboseLevel = 0;
    96108    } else {
     
    106118    if(mass < MeV) eth  = thEnergyElec;
    107119    if(eth > emin) {
    108       G4eCoulombScatteringModel* model =
    109         new G4eCoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max);
     120      G4eCoulombScatteringModel* model = new G4eCoulombScatteringModel();
     121      model->SetPolarAngleLimit(PolarAngleLimit());
    110122      model->SetLowEnergyLimit(emin);
    111123      model->SetHighEnergyLimit(std::min(eth,emax));
     
    113125    }
    114126    if(eth < emax) {
    115       G4CoulombScatteringModel* model =
    116         new G4CoulombScatteringModel(thetaMin,thetaMax,buildElmTableFlag,q2Max);
     127      G4CoulombScatteringModel* model = new G4CoulombScatteringModel();
     128      model->SetPolarAngleLimit(PolarAngleLimit());
    117129      model->SetLowEnergyLimit(eth);
    118130      model->SetHighEnergyLimit(emax);
     
    126138void G4CoulombScattering::PrintInfo()
    127139{
    128   G4cout << " Scattering of " << aParticle->GetParticleName()
    129          << " with   " << thetaMin/degree
    130          << " < Theta(degree) < " << thetaMax/degree
    131          << "; Eth(MeV)= ";
     140  G4cout << "      " << PolarAngleLimit()/degree
     141         << " < Theta(degree) < 180"
     142         << ", Eth(MeV)= ";
    132143  if(aParticle->GetPDGMass() < MeV) G4cout << thEnergyElec;
    133144  else                              G4cout << thEnergy;
  • trunk/source/processes/electromagnetic/standard/src/G4CoulombScatteringModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4CoulombScatteringModel.cc,v 1.29 2007/11/09 11:45:45 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4CoulombScatteringModel.cc,v 1.37 2008/07/31 13:11:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4444// 19.10.06 V.Ivanchenko use inheritance from G4eCoulombScatteringModel
    4545// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
     46// 09.06.08 V.Ivanchenko SelectIsotope is moved to the base class
    4647//
    4748// Class Description:
     
    5556#include "Randomize.hh"
    5657#include "G4ParticleChangeForGamma.hh"
    57 #include "G4NistManager.hh"
    5858#include "G4ParticleTable.hh"
    5959#include "G4IonTable.hh"
     
    6464using namespace std;
    6565
    66 G4CoulombScatteringModel::G4CoulombScatteringModel(
    67   G4double thetaMin, G4double thetaMax, G4bool build,
    68   G4double tlim, const G4String& nam)
    69   : G4eCoulombScatteringModel(thetaMin,thetaMax,build,tlim,nam)
    70 {
    71   theMatManager    = G4NistManager::Instance();
    72   theParticleTable = G4ParticleTable::GetParticleTable();
    73 }
     66G4CoulombScatteringModel::G4CoulombScatteringModel(const G4String& nam)
     67  : G4eCoulombScatteringModel(nam)
     68{}
    7469
    7570//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    8479                                G4double kinEnergy,
    8580                                G4double Z,
    86                                 G4double A,
     81                                G4double,
    8782                                G4double cutEnergy,
    8883                                G4double)
    8984{
    90   if(p == particle && kinEnergy == tkin && Z == targetZ &&
    91      A == targetA && cutEnergy == ecut) return nucXSection;
    92 
    93   // Lab system
    94   G4double ekin = std::max(keV, kinEnergy);
    95   nucXSection = ComputeElectronXSectionPerAtom(p,ekin,Z,A,cutEnergy);
     85  SetupParticle(p);
     86  G4double ekin = std::max(lowEnergyLimit, kinEnergy);
     87  SetupKinematic(ekin, cutEnergy);
     88
     89  // save lab system kinematics
     90  G4double xtkin = tkin;
     91  G4double xmom2 = mom2;
     92  G4double xinvb = invbeta2;
    9693
    9794  // CM system
    9895  G4int iz      = G4int(Z);
    99   G4double m1   = theMatManager->GetAtomicMassAmu(iz)*amu_c2;
     96  G4double m2   = fNistManager->GetAtomicMassAmu(iz)*amu_c2;
    10097  G4double etot = tkin + mass;
    10198  G4double ptot = sqrt(mom2);
    102   G4double bet  = ptot/(etot + m1);
    103   G4double gam  = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
    104   G4double momCM= gam*(ptot - bet*etot);
    105 
    106   //  G4cout << "ptot= " << ptot << " etot= " << etot << " beta= "
    107   //     << bet << " gam= " << gam << " Z= " << Z << " A= " << A << G4endl;
    108   // G4cout << " CM. mom= " << momCM  << " m= " << m
    109   // << " m1= " << m1 << " iz= " << iz <<G4endl;
    110 
    111   G4double momCM2 = momCM*momCM;
    112   cosTetMaxNuc = std::max(cosThetaMax, 1.0 - 0.5*q2Limit/momCM2);
    113   if(1.5 > targetA && p == theProton && cosTetMaxNuc < 0.0) cosTetMaxNuc = 0.0;
    114   //G4cout << " ctmax= " << cosTetMaxNuc
    115   //<< " ctmin= " << cosThetaMin << G4endl; 
    116 
    117   // Cross section in CM system
    118   if(cosTetMaxNuc < cosThetaMin) {
    119     G4double effmass = mass*m1/(mass + m1);
    120     G4double x1 = 1.0 - cosThetaMin;
    121     G4double x2 = 1.0 - cosTetMaxNuc;
    122     G4double z1 = x1 + screenZ;
    123     G4double z2 = x2 + screenZ;
    124     G4double d  = 1.0/formfactA;
    125     G4double zn1= x1 + d;
    126     G4double zn2= x2 + d;
    127     nucXSection += coeff*Z*Z*chargeSquare*(1.0 +  effmass*effmass/momCM2)
    128       *(1./z1 - 1./z2 + 1./zn1 - 1./zn2 +
    129         2.0*formfactA*std::log(z1*zn2/(z2*zn1)))/momCM2;
    130     //G4cout << "XS: x1= " << x1 << " x2= " << x2
    131     //<< " cross= " << cross << G4endl;
    132     //G4cout << "momCM2= " << momCM2 << " invbeta2= " << invbeta2
    133     //       << " coeff= " << coeff << G4endl;
    134   }
    135   if(nucXSection < 0.0) nucXSection = 0.0;
    136   return nucXSection;
    137 }
    138 
    139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    140 
    141 G4double G4CoulombScatteringModel::SelectIsotope(const G4Element* elm)
    142 {
    143   G4double N = elm->GetN();
    144   G4int ni   = elm->GetNumberOfIsotopes();
    145   if(ni > 0) {
    146     G4double* ab = elm->GetRelativeAbundanceVector();
    147     G4double x = G4UniformRand();
    148     G4int idx;
    149     for(idx=0; idx<ni; idx++) {
    150       x -= ab[idx];
    151       if (x <= 0.0) break;
    152     }
    153     if(idx >= ni) {
    154       G4cout << "G4CoulombScatteringModel::SelectIsotope WARNING: "
    155              << "abandance vector for"
    156              << elm->GetName() << " is not normalised to unit" << G4endl;
    157     } else {
    158       N = G4double(elm->GetIsotope(idx)->GetN());
    159     }
    160   }
    161   return N;
     99
     100  G4double m12  = mass*mass;
     101  G4double momCM= ptot*m2/sqrt(m12 + m2*m2 + 2.0*etot*m2);
     102
     103  mom2 = momCM*momCM;
     104  tkin = sqrt(mom2 + m12) - mass;
     105  invbeta2 = 1.0 +  m12/mom2;
     106
     107  SetupTarget(Z, tkin);
     108
     109  G4double xsec = CrossSectionPerAtom();
     110
     111  // restore Lab system kinematics
     112  tkin = xtkin;
     113  mom2 = xmom2;
     114  invbeta2 = xinvb;
     115
     116  return xsec;
    162117}
    163118
     
    169124                               const G4DynamicParticle* dp,
    170125                               G4double cutEnergy,
    171                                G4double maxEnergy)
     126                               G4double)
    172127{
    173   const G4Material* aMaterial = couple->GetMaterial();
    174   const G4ParticleDefinition* p = dp->GetDefinition();
    175128  G4double kinEnergy = dp->GetKineticEnergy();
    176 
    177   // Select isotope and setup
    178   SetupParticle(p);
    179   const G4Element* elm =
    180     SelectRandomAtom(aMaterial,p,kinEnergy,cutEnergy,maxEnergy);
    181   G4double Z  = elm->GetZ();
    182   G4double A  = SelectIsotope(elm);
     129  if(kinEnergy <= DBL_MIN) return;
     130  DefineMaterial(couple);
     131  SetupParticle(dp->GetDefinition());
     132  G4double ekin = std::max(lowEnergyLimit, kinEnergy);
     133  SetupKinematic(ekin, cutEnergy);
     134
     135  // Choose nucleus
     136  currentElement = SelectRandomAtom(couple,particle,ekin,ecut,tkin);
     137
     138  G4double Z  = currentElement->GetZ();
    183139  G4int iz    = G4int(Z);
    184   G4int ia    = G4int(A + 0.5);
    185 
    186   G4double cross =
    187     ComputeCrossSectionPerAtom(p,kinEnergy,Z,A,cutEnergy,maxEnergy);
    188 
    189   G4double costm = cosTetMaxNuc;
    190   G4double formf = formfactA;
    191   if(G4UniformRand()*cross < elecXSection) {
    192     costm = cosTetMaxElec;
    193     formf = 0.0;
    194   }
    195 
    196   //  G4cout << "SampleSec: Ekin= " << kinEnergy << " m1= " << m1
    197   // << " Z= "<< Z << " A= " <<A<< G4endl;
    198 
    199   if(costm >= cosThetaMin) return;
    200 
    201   // kinematics in CM system
    202   G4double m1   = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia);
    203   G4double etot = kinEnergy + mass;
     140  G4int ia    = SelectIsotopeNumber(currentElement);
     141  G4double m2 = theParticleTable->GetIonTable()->GetNucleusMass(iz, ia);
     142
     143  // CM system
     144  G4double etot = tkin + mass;
    204145  G4double ptot = sqrt(mom2);
    205   G4double bet  = ptot/(etot + m1);
     146
     147  G4double momCM= ptot*m2/sqrt(mass*mass + m2*m2 + 2.0*etot*m2);
     148  mom2 = momCM*momCM;
     149  G4double m12 = mass*mass;
     150  G4double eCM = sqrt(mom2 + m12);
     151
     152  // a correction for heavy projectile
     153  G4double fm = m2/(mass + m2);
     154  invbeta2 = 1.0 +  m12*fm*fm/mom2;
     155
     156  // sample scattering angle in CM system
     157  SetupTarget(Z, eCM - mass);
     158
     159  G4double cost = SampleCosineTheta();
     160  G4double z1   = 1.0 - cost;
     161  if(z1 < 0.0) return;
     162
     163  G4double sint = sqrt(z1*(1.0 + cost));
     164  G4double phi  = twopi * G4UniformRand();
     165
     166  // kinematics in the Lab system
     167  G4double bet  = ptot/(etot + m2);
    206168  G4double gam  = 1.0/sqrt((1.0 - bet)*(1.0 + bet));
    207   G4double pCM  = gam*(ptot - bet*etot);
    208   G4double eCM  = gam*(etot - bet*ptot);
    209 
    210   G4double x1 = 1. - cosThetaMin + screenZ;
    211   G4double x2 = 1. - costm;
    212   G4double x3 = cosThetaMin - costm;
    213 
    214   G4double grej,  z, z1;
    215   do {
    216     z  = G4UniformRand()*x3;
    217     z1 = (x1*x2 - screenZ*z)/(x1 + z);
    218     if(z1 < 0.0) z1 = 0.0;
    219     else if(z1 > 2.0) z1 = 2.0;
    220     grej = 1.0/(1.0 + formf*z1);
    221   } while ( G4UniformRand() > grej*grej ); 
    222  
    223   G4double cost = 1.0 - z1;
    224   G4double sint= sqrt(z1*(2.0 - z1));
    225 
    226   G4double phi = twopi * G4UniformRand();
    227 
    228   // projectile after scattering
    229   G4double pzCM = pCM*cost;
    230   G4ThreeVector v1(pCM*cos(phi)*sint,pCM*sin(phi)*sint,gam*(pzCM + bet*eCM));
     169  G4double pzCM = momCM*cost;
     170
     171  G4ThreeVector v1(momCM*cos(phi)*sint,momCM*sin(phi)*sint,gam*(pzCM + bet*eCM));
    231172  G4ThreeVector dir = dp->GetMomentumDirection();
    232173  G4ThreeVector newDirection = v1.unit();
    233174  newDirection.rotateUz(dir);   
    234175  fParticleChange->ProposeMomentumDirection(newDirection);   
     176
    235177  G4double elab = gam*(eCM + bet*pzCM);
    236   G4double ekin = elab - mass;
     178  ekin = elab - mass;
    237179  if(ekin < 0.0) ekin = 0.0;
    238   G4double plab = sqrt(ekin*(ekin + 2.0*mass));
    239180  fParticleChange->SetProposedKineticEnergy(ekin);
    240181
    241182  // recoil
    242183  G4double erec = kinEnergy - ekin;
    243   if(erec > Z*aMaterial->GetIonisation()->GetMeanExcitationEnergy()) {
     184  G4double th =
     185    std::min(recoilThreshold,
     186             Z*currentElement->GetIonisation()->GetMeanExcitationEnergy());
     187
     188  if(erec > th) {
    244189    G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
     190    G4double plab = sqrt(ekin*(ekin + 2.0*mass));
    245191    G4ThreeVector p2 = (ptot*dir - plab*newDirection).unit();
    246192    G4DynamicParticle* newdp  = new G4DynamicParticle(ion, p2, erec);
  • trunk/source/processes/electromagnetic/standard/src/G4GammaConversion.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GammaConversion.cc,v 1.27 2006/09/14 10:27:19 maire Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4GammaConversion.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929//
     
    7979    isInitialised(false)
    8080{
    81   SetLambdaBinning(100);
    8281  SetMinKinEnergy(2.0*electron_mass_c2);
    83   SetMaxKinEnergy(100.0*GeV);
     82  SetProcessSubType(fGammaConversion);
    8483}
    8584
     
    9190//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    9291
     92G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p)
     93{
     94  return (&p == G4Gamma::Gamma());
     95}
     96
     97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     98
    9399void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*)
    94100{
     
    97103    SetBuildTableFlag(true);
    98104    SetSecondaryParticle(G4Electron::Electron());
    99     G4double emin = max(MinKinEnergy(), 2.0*electron_mass_c2);
     105    G4double emin = std::max(MinKinEnergy(), 2.0*electron_mass_c2);
    100106    SetMinKinEnergy(emin);
    101     G4double emax = MaxKinEnergy();
    102     if(!Model()) SetModel(new G4BetheHeitlerModel);
     107    if(!Model()) SetModel(new G4BetheHeitlerModel());
    103108    Model()->SetLowEnergyLimit(emin);
    104     Model()->SetHighEnergyLimit(emax);
     109    Model()->SetHighEnergyLimit(MaxKinEnergy());
    105110    AddEmModel(1, Model());
    106111  }
     
    110115
    111116void G4GammaConversion::PrintInfo()
    112 {
    113   G4cout
    114     << " Total cross sections has a good parametrisation"
    115     << " from 1.5 MeV to 100 GeV for all Z;"
    116     << "\n      sampling secondary e+e- according "
    117     << Model()->GetName() << " model"
    118     << G4endl;
    119 }         
     117{}         
    120118
    121119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4InitXscPAI.cc

    r819 r961  
    2626//
    2727// $Id: G4InitXscPAI.cc,v 1.9 2006/06/29 19:53:00 gunter Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/standard/src/G4IonFluctuations.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4IonFluctuations.cc,v 1.5.2.1 2008/04/25 00:22:53 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4IonFluctuations.cc,v 1.25 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4646// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
    4747// 27-09-07 Use FermiEnergy from material, add cut dependence (V.Ivanchenko)
     48// 01-02-08 Add protection for small energies and optimise the code (V.Ivanchenko)
     49// 01-06-08 Added initialisation of effective charge prestep (V.Ivanchenko)
    4850//
    4951// Class Description:
     
    6062#include "G4Material.hh"
    6163#include "G4DynamicParticle.hh"
    62 #include "G4ParticleDefinition.hh"
    6364
    6465//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    6768
    6869G4IonFluctuations::G4IonFluctuations(const G4String& nam)
    69  :G4VEmFluctuationModel(nam),
    70   particle(0),
    71   minNumberInteractionsBohr(10.0),
    72   theBohrBeta2(50.0*keV/proton_mass_c2),
    73   minFraction(0.2),
    74   xmin(0.2),
    75   minLoss(0.001*eV)
     70  : G4VEmFluctuationModel(nam),
     71    particle(0),
     72    particleMass(proton_mass_c2),
     73    charge(1.0),
     74    chargeSquare(1.0),
     75    effChargeSquare(1.0),
     76    parameter(10.0*CLHEP::MeV/CLHEP::proton_mass_c2),
     77    minNumberInteractionsBohr(0.0),
     78    theBohrBeta2(50.0*keV/CLHEP::proton_mass_c2),
     79    minFraction(0.2),
     80    xmin(0.2),
     81    minLoss(0.001*eV)
    7682{}
    7783
     
    8995  charge         = part->GetPDGCharge()/eplus;
    9096  chargeSquare   = charge*charge;
    91   chargeSqRatio  = 1.0;
     97  effChargeSquare= chargeSquare;
     98  uniFluct.InitialiseMe(part);
    9299}
    93100
     
    96103G4double G4IonFluctuations::SampleFluctuations(const G4Material* material,
    97104                                               const G4DynamicParticle* dp,
    98                                                      G4double& tmax,
    99                                                      G4double& length,
    100                                                      G4double& meanLoss)
    101 {
     105                                               G4double& tmax,
     106                                               G4double& length,
     107                                               G4double& meanLoss)
     108{
     109  //  G4cout << "### meanLoss= " << meanLoss << G4endl;
    102110  if(meanLoss <= minLoss) return meanLoss;
    103   //  G4cout << "### meanLoss= " << meanLoss << G4endl;
     111
     112  //G4cout << "G4IonFluctuations::SampleFluctuations E(MeV)= " << dp->GetKineticEnergy()
     113  //     << "  Elim(MeV)= " << parameter*charge*particleMass << G4endl;
     114
     115  // Vavilov fluctuations
     116  if(dp->GetKineticEnergy() > parameter*charge*particleMass) {
     117    return uniFluct.SampleFluctuations(material,dp,tmax,length,meanLoss);
     118  }
    104119
    105120  G4double siga = Dispersion(material,dp,tmax,length);
     
    107122 
    108123  G4double navr = minNumberInteractionsBohr;
    109 
    110124  navr = meanLoss*meanLoss/siga;
    111   //  G4cout << "### siga= " << sqrt(siga) << "  navr= " << navr << G4endl;
     125  //G4cout << "### siga= " << sqrt(siga) << "  navr= " << navr << G4endl;
    112126
    113127  // Gaussian fluctuation
     
    126140    //       G4cout << "siga= " << siga << G4endl;
    127141    siga = sqrt(siga);
    128 
    129142    G4double lossmax = meanLoss+meanLoss;
    130     do {
    131       loss = G4RandGauss::shoot(meanLoss,siga);
    132     } while (0.0 > loss || loss > lossmax);
    133 
     143
     144    if(siga > 5.0*meanLoss) {
     145      loss = lossmax*G4UniformRand();
     146    } else {
     147      do {
     148        loss = G4RandGauss::shoot(meanLoss,siga);
     149      } while (0.0 > loss || loss > lossmax);
     150    }
    134151  // Poisson fluctuations
    135152  } else {
     
    139156  }
    140157
    141   //  G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
     158  //G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
    142159  return loss;
    143160}
     
    145162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    146163
    147 G4double G4IonFluctuations::Dispersion(
    148                           const G4Material* material,
    149                           const G4DynamicParticle* dp,
    150                                 G4double& tmax,
    151                                 G4double& length)
    152 {
    153   particle       = dp->GetDefinition();
    154   charge         = particle->GetPDGCharge()/eplus;
    155   G4double Q2    = charge*charge;
    156   particleMass   = particle->GetPDGMass();
    157   G4double q     = dp->GetCharge()/eplus;
    158   chargeSquare   = q*q;
    159   chargeSqRatio  = chargeSquare/Q2;
    160 
    161   //chargeSquare   = charge*charge;
    162   //chargeSqRatio  = 1.0;
     164G4double G4IonFluctuations::Dispersion(const G4Material* material,
     165                                       const G4DynamicParticle* dp,
     166                                       G4double& tmax,
     167                                       G4double& length)
     168{
     169  kineticEnergy = dp->GetKineticEnergy();
     170  G4double etot = kineticEnergy + particleMass;
     171  beta2 = kineticEnergy*(kineticEnergy + 2.*particleMass)/(etot*etot);
    163172
    164173  G4double electronDensity = material->GetElectronDensity();
    165   kineticEnergy  = dp->GetKineticEnergy();
    166   G4double etot = kineticEnergy + particleMass;
    167   //G4cout << "e= " <<  kineticEnergy << " m= " << particleMass
    168   //     << " tmax= " << tmax << " l= " << length << " q^2= " << chargeSquare << G4endl;
    169   beta2 = kineticEnergy*(kineticEnergy + 2.*particleMass)/(etot*etot);
    170 
     174
     175  /*
     176  G4cout << "e= " <<  kineticEnergy << " m= " << particleMass
     177         << " tmax= " << tmax << " l= " << length
     178         << " q^2= " << effChargeSquare << " beta2=" << beta2<< G4endl;
     179  */
    171180  G4double siga = (1. - beta2*0.5)*tmax*length*electronDensity*
    172     twopi_mc2_rcl2*Q2/beta2;
     181    twopi_mc2_rcl2*chargeSquare/beta2;
    173182
    174183  // Low velocity - additional ion charge fluctuations according to
    175184  // Q.Yang et al., NIM B61(1991)149-155.
    176   G4double zeff  = electronDensity/(material->GetTotNbOfAtomsPerVolume());
    177   //G4cout << "siga= " << siga << " zeff= " << zeff << " c= " << c << G4endl;
    178 
    179   G4double f = 0.0;
    180 
    181   // correction factors with cut dependence 
    182   if ( beta2 < 3.0*theBohrBeta2*zeff ) {
    183 
    184     G4double a = CoeffitientA (zeff);
    185     G4double b = CoeffitientB (material, zeff);
    186     //     G4cout << "a= " << a <<  " b= " << b << G4endl;
    187     f = a*chargeSqRatio + b;
    188   } else {
    189  
    190     // H.Geissel et al. NIM B, 195 (2002) 3.
    191     f = RelativisticFactor(material, zeff);
    192   }
     185  //G4cout << "sigE= " << sqrt(siga) << " charge= " << charge <<G4endl;
     186
     187  G4double Z = electronDensity/material->GetTotNbOfAtomsPerVolume();
     188 
     189  G4double fac = Factor(material, Z);
    193190
    194191  // heavy ion correction
     
    196193  if(beta2 > theBohrBeta2)  f1/= beta2;
    197194  else                      f1/= theBohrBeta2;
    198   if(f1 > 2.0) f1 = 2.0;
    199   f *= (1.0 + f1);
    200 
    201   if(f > 1.0) {
    202     siga *= (1. + (f - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2)));
    203   }
    204   //  G4cout << "siga= " << siga << G4endl;
     195  if(f1 > 2.5) f1 = 2.5;
     196  fac *= (1.0 + f1);
     197
     198  // taking into account the cut
     199  if(fac > 1.0) {
     200    siga *= (1.0 + (fac - 1.0)*2.0*electron_mass_c2*beta2/(tmax*(1.0 - beta2)));
     201  }
     202  //G4cout << "siga(keV)= " << sqrt(siga)/keV << " fac= " << fac
     203  //     << "  f1= " << f1 << G4endl;
    205204
    206205  return siga;
     
    209208//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    210209
    211 G4double G4IonFluctuations::CoeffitientA(G4double& zeff)
     210G4double G4IonFluctuations::Factor(const G4Material* material, G4double Z)
    212211{
    213212  // The aproximation of energy loss fluctuations
     
    215214
    216215  // Reduced energy in MeV/AMU
    217   G4double energy = kineticEnergy * amu_c2/(particleMass*MeV) ;
    218   static G4double a[96][4] = {
     216  G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ;
     217
     218  // simple approximation for higher beta2
     219  G4double s1 = RelativisticFactor(material, Z);
     220
     221  // tabulation for lower beta2
     222  if( beta2 < 3.0*theBohrBeta2*Z ) {
     223
     224    static G4double a[96][4] = {
    219225 {-0.3291, -0.8312,  0.2460, -1.0220},
    220226 {-0.5615, -0.5898,  0.5205, -0.7258},
     
    260266 {-0.3972, -0.3600,  1.0260, -0.5842},
    261267
    262 {-0.3985, -0.3803,  1.0200, -0.6013},
     268 {-0.3985, -0.3803,  1.0200, -0.6013},
    263269 {-0.3985, -0.3979,  1.0150, -0.6168},
    264270 {-0.3968, -0.3990,  1.0160, -0.6195},
     
    322328 {-0.4284, -0.3204,  1.6290, -0.6380},
    323329 {-0.4227, -0.3217,  1.6360, -0.6438}
    324   } ;
    325 
    326   G4int iz = (G4int)zeff - 2 ;
    327   if( 0 > iz ) iz = 0 ;
    328   if(95 < iz ) iz = 95 ;
    329 
    330   G4double q = 1.0 / (1.0 + a[iz][0]*pow(energy,a[iz][1])+
    331                           + a[iz][2]*pow(energy,a[iz][3])) ;
    332 
    333   return q ;
    334 }
    335 
    336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    337 
    338 G4double G4IonFluctuations::CoeffitientB(const G4Material* material, G4double& zeff)
    339 {
    340   // The aproximation of energy loss fluctuations
    341   // Q.Yang et al., NIM B61(1991)149-155.
    342 
    343   // Reduced energy in MeV/AMU
    344   G4double energy = kineticEnergy *amu_c2/(particleMass*MeV) ;
     330    } ;
     331
     332    G4int iz = G4int(Z) - 2;
     333    if( 0 > iz )      iz = 0;
     334    else if(95 < iz ) iz = 95;
     335
     336    G4double ss = 1.0 + a[iz][0]*pow(energy,a[iz][1])+
     337      + a[iz][2]*pow(energy,a[iz][3]);
     338 
     339    // protection for the validity range for low beta
     340    G4double slim = 0.001;
     341    if(ss < slim) s1 = 1.0/slim;
     342    // for high value of beta
     343    else if(s1*ss < 1.0) s1 = 1.0/ss;
     344  }
    345345
    346346  G4int i = 0 ;
     
    366366  // ions
    367367  } else {
    368     factor = charge * pow(charge/zeff, 0.3333) ;
     368
     369    factor = charge * pow(charge/Z, 0.33333333);
    369370
    370371    if( kStateGas == material->GetState() ) {
     
    378379
    379380    } else {
    380       energy /= (charge * sqrt(charge*zeff)) ;
     381      energy /= (charge * sqrt(charge*Z)) ;
    381382      i = 4 ;
    382383    }
    383384  }
    384385
    385   G4double x = b[i][2] * (1.0 - exp( - energy * b[i][3] )) ;
    386 
    387   G4double q = factor * x * b[i][0] /
    388              ((energy - b[i][1])*(energy - b[i][1]) + x*x) ;
    389 
    390   return q ;
    391 }
    392 
    393 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    394 
    395 G4double G4IonFluctuations::RelativisticFactor(const G4Material* material,
    396                                                G4double& zeff)
    397 {
     386  G4double x = b[i][2];
     387  G4double y = energy * b[i][3];
     388  if(y <= 0.2) x *= (y*(1.0 - 0.5*y));
     389  else         x *= (1.0 - exp(-y));
     390
     391  y = energy - b[i][1];
     392
     393  G4double s2 = factor * x * b[i][0] / (y*y + x*x);
     394  /* 
     395  G4cout << "s1= " << s1 << " s2= " << s2 << " q^2= " << effChargeSquare
     396         << " e= " << energy << G4endl;
     397  */
     398  return s1*effChargeSquare/chargeSquare + s2;
     399}
     400
     401//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     402
     403G4double G4IonFluctuations::RelativisticFactor(const G4Material* mat,
     404                                               G4double Z)
     405{
     406  G4double eF = mat->GetIonisation()->GetFermiEnergy();
     407  G4double I  = mat->GetIonisation()->GetMeanExcitationEnergy();
     408
    398409  // H.Geissel et al. NIM B, 195 (2002) 3.
    399   G4double eF = material->GetIonisation()->GetFermiEnergy();
    400410  G4double bF2= 2.0*eF/electron_mass_c2;
    401   G4double I  = material->GetIonisation()->GetMeanExcitationEnergy();
    402   G4double f  = 0.4*(1.0 - beta2)/((1.0 - 0.5*beta2)*zeff);
     411  G4double f  = 0.4*(1.0 - beta2)/((1.0 - 0.5*beta2)*Z);
    403412  if(beta2 > bF2) f *= log(2.0*electron_mass_c2*beta2/I)*bF2/beta2;
    404413  else            f *= log(4.0*eF/I);
    405  
     414
     415  //  G4cout << "f= " << f << " beta2= " << beta2
     416  //     << " bf2= " << bF2 << " q^2= " << chargeSquare << G4endl;
     417
    406418  return 1.0 + f;
    407419}
    408420
    409421//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     422
     423void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part,
     424                                             G4double q2)
     425{
     426  if(part != particle) {
     427    particle       = part;
     428    particleMass   = part->GetPDGMass();
     429    charge         = part->GetPDGCharge()/eplus;
     430    chargeSquare   = charge*charge;
     431  }
     432  effChargeSquare  = q2;
     433  uniFluct.SetParticleAndCharge(part, q2);
     434}
     435
     436//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4KleinNishinaCompton.cc

    r819 r961  
    2525//
    2626// $Id: G4KleinNishinaCompton.cc,v 1.9 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MollerBhabhaModel.cc,v 1.30 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4MollerBhabhaModel.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    7474                                         const G4String& nam)
    7575  : G4VEmModel(nam),
    76   particle(0),
    77   isElectron(true),
    78   twoln10(2.0*log(10.0)),
    79   lowLimit(0.2*keV)
     76    particle(0),
     77    isElectron(true),
     78    twoln10(2.0*log(10.0)),
     79    lowLimit(0.2*keV),
     80    isInitialised(false)
    8081{
    8182  theElectron = G4Electron::Electron();
     
    8788G4MollerBhabhaModel::~G4MollerBhabhaModel()
    8889{}
    89 
    90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    91 
    92 void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)
    93 {
    94   particle = p;
    95   if(p != theElectron) isElectron = false;
    96 }
    9790
    9891//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    108101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    109102
     103G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
     104                                                 G4double kinEnergy)
     105{
     106  G4double tmax = kinEnergy;
     107  if(isElectron) tmax *= 0.5;
     108  return tmax;
     109}
     110
     111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     112
    110113void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
    111114                                     const G4DataVector&)
    112115{
    113116  if(!particle) SetParticle(p);
    114   if(pParticleChange)
     117  SetDeexcitationFlag(false);
     118
     119  if(isInitialised) return;
     120
     121  isInitialised = true;
     122  if(pParticleChange) {
    115123    fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
    116124                                                     (pParticleChange);
    117   else
     125  } else {
    118126    fParticleChange = new G4ParticleChangeForLoss();
     127  }
    119128}
    120129
  • trunk/source/processes/electromagnetic/standard/src/G4MscModel71.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MscModel71.cc,v 1.5 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4MscModel71.cc,v 1.6 2008/03/13 17:20:07 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    561561  G4double tau = trueStepLength/lambda0 ;
    562562
    563   if(trueStepLength >= currentRange*dtrl)
     563  if(trueStepLength >= currentRange*dtrl) {
    564564    if(par1*trueStepLength < 1.)
    565565      tau = -par2*log(1.-par1*trueStepLength) ;
    566566    else
    567567      tau = taubig ;
    568 
     568  }
    569569  currentTau = tau ;
    570570
  • trunk/source/processes/electromagnetic/standard/src/G4MultipleScattering.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MultipleScattering.cc,v 1.70 2007/10/29 08:57:19 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4MultipleScattering.cc,v 1.75 2008/10/15 17:53:44 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    121121// 12-02-07 skin can be changed via UI command, default skin=1 (VI)
    122122// 24-04-07 default skin=0 (temporal protection) (VI)
     123// 11-03-08 use G4VMscModel interface (VI)
    123124//
    124125// -----------------------------------------------------------------------------
     
    130131#include "G4UrbanMscModel.hh"
    131132#include "G4MscStepLimitType.hh"
     133#include "G4UrbanMscModel.hh"
    132134
    133135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    138140  : G4VMultipleScattering(processName)
    139141{
    140   dtrl              = 0.05;
    141   lambdalimit       = 1.*mm;
    142  
    143   samplez           = false ;
    144   isInitialized     = false; 
     142  isInitialized = false; 
    145143}
    146144
     
    178176    SetLateralDisplasmentFlag(false);
    179177    SetBuildLambdaTable(false);
    180     SetSkin(0.0);
    181     SetRangeFactor(0.2);
    182178  }
    183179
    184180  // initialisation of parameters - defaults for particles other
    185181  // than ions can be overwritten by users
    186   mscUrban = new G4UrbanMscModel(RangeFactor(),dtrl,lambdalimit,
    187                                  GeomFactor(),Skin(),
    188                                  samplez,StepLimitType());
     182  mscUrban = new G4UrbanMscModel();
     183  mscUrban->SetStepLimitType(StepLimitType());
    189184  mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
     185  mscUrban->SetSkin(Skin());
     186  mscUrban->SetRangeFactor(RangeFactor());
     187  mscUrban->SetGeomFactor(GeomFactor());
    190188
    191189  AddEmModel(1,mscUrban);
     
    204202void G4MultipleScattering::PrintInfo()
    205203{
    206   G4cout << "      Boundary/stepping algorithm is active with RangeFactor= "
    207          << RangeFactor()
    208          << "  Step limit type " << StepLimitType()
     204  G4cout << "      RangeFactor= " << RangeFactor()
     205         << ", step limit type: " << StepLimitType()
     206         << ", lateralDisplacement: " << LateralDisplasmentFlag()
     207         << ", skin= " << Skin() 
     208         << ", geomFactor= " << GeomFactor() 
    209209         << G4endl;
    210210}
  • trunk/source/processes/electromagnetic/standard/src/G4MultipleScattering71.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4MultipleScattering71.cc,v 1.4 2006/10/16 15:26:49 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4MultipleScattering71.cc,v 1.5 2008/07/16 11:27:41 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    7676
    7777#include "G4MultipleScattering71.hh"
     78#include "G4LossTableManager.hh"
    7879#include "G4MscModel71.hh"
    7980
     
    176177}
    177178
     179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     180
     181G4double G4MultipleScattering71::GetContinuousStepLimit(
     182                                          const G4Track& track,
     183                                                G4double,
     184                                                G4double currentMinimalStep,
     185                                                G4double&)
     186{
     187  DefineMaterial(track.GetMaterialCutsCouple());
     188  const G4MaterialCutsCouple* couple = CurrentMaterialCutsCouple();
     189  G4double e = track.GetKineticEnergy();
     190  model = dynamic_cast<G4MscModel71*>(SelectModel(e));
     191  const G4ParticleDefinition* p = track.GetDefinition();
     192  G4double lambda0 = GetLambda(p, e);
     193  range =  G4LossTableManager::Instance()->GetRangeFromRestricteDEDX(p,e,couple);
     194  if(range < currentMinimalStep) currentMinimalStep = range;
     195  truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep);
     196  //  G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= "
     197  //       << lambda0 << " range= " << currentRange
     198  //       << " currentMinStep= " << currentMinimalStep << G4endl;
     199  if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;
     200  geomPathLength = model->GeomPathLength(LambdaTable(),couple,
     201           p,e,lambda0,range,truePathLength);
     202  if(geomPathLength > lambda0) geomPathLength = lambda0;
     203  return geomPathLength;
     204}
     205
    178206//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    179207
  • trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIModel.cc,v 1.46 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class
    2632// File name:     G4PAIModel.cc
    2733//
     
    177183      fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial,
    178184                                          curReg->GetProductionCuts() );
     185      //G4cout << "Reg <" <<curReg->GetName() << ">  mat <"
     186      //             << fMaterial->GetName() << ">  fCouple= "
     187      //             << fCutCouple<<G4endl;
    179188      if( fCutCouple ) {
    180189        fMaterialCutsCoupleVector.push_back(fCutCouple);
     
    197206  }
    198207}
     208
     209//////////////////////////////////////////////////////////////////
     210
     211void G4PAIModel::InitialiseMe(const G4ParticleDefinition*)
     212{}
    199213
    200214//////////////////////////////////////////////////////////////////
     
    393407  {
    394408    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    395     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     409    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     410    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    396411    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    397412  }
     
    435450  {
    436451    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    437     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     452    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     453    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
    438454    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    439455  }
     
    444460//////////////////////////////////////////////////////////////////////////////
    445461
    446 G4double G4PAIModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    447                                  const G4ParticleDefinition* p,
    448                                        G4double kineticEnergy,
    449                                        G4double cutEnergy)
     462G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*,
     463                                          const G4ParticleDefinition* p,
     464                                          G4double kineticEnergy,
     465                                          G4double cutEnergy)
    450466{
    451467  G4int iTkin,iPlace;
    452468  size_t jMat;
     469 
     470  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     471  G4double cut = cutEnergy;
     472
    453473  G4double massRatio  = fMass/p->GetPDGMass();
    454474  G4double scaledTkin = kineticEnergy*massRatio;
    455475  G4double charge     = p->GetPDGCharge();
    456   G4double charge2    = charge*charge, dEdx;
     476  G4double charge2    = charge*charge;
     477  const G4MaterialCutsCouple* matCC = CurrentCouple();
    457478
    458479  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    470491  iPlace = iTkin - 1;
    471492  if(iPlace < 0) iPlace = 0;
    472   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
    473 
     493  G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) );
    474494  if( dEdx < 0.) dEdx = 0.;
    475495  return dEdx;
     
    478498/////////////////////////////////////////////////////////////////////////
    479499
    480 G4double G4PAIModel::CrossSection( const G4MaterialCutsCouple* matCC,
    481                                    const G4ParticleDefinition* p,
    482                                          G4double kineticEnergy,
    483                                          G4double cutEnergy,
    484                                          G4double maxEnergy  )
     500G4double G4PAIModel::CrossSectionPerVolume( const G4Material*,
     501                                            const G4ParticleDefinition* p,
     502                                            G4double kineticEnergy,
     503                                            G4double cutEnergy,
     504                                            G4double maxEnergy  )
    485505{
    486506  G4int iTkin,iPlace;
    487507  size_t jMat;
    488   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     508  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     509  if(tmax <= cutEnergy) return 0.0;
    489510  G4double massRatio  = fMass/p->GetPDGMass();
    490511  G4double scaledTkin = kineticEnergy*massRatio;
    491512  G4double charge     = p->GetPDGCharge();
    492513  G4double charge2    = charge*charge, cross, cross1, cross2;
     514  const G4MaterialCutsCouple* matCC = CurrentCouple();
    493515
    494516  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    935957}
    936958
     959/////////////////////////////////////////////////////////////////////
     960
     961G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
     962                                         G4double kinEnergy)
     963{
     964  G4double tmax = kinEnergy;
     965  if(p == fElectron) tmax *= 0.5;
     966  else if(p != fPositron) {
     967    G4double mass = p->GetPDGMass();
     968    G4double ratio= electron_mass_c2/mass;
     969    G4double gamma= kinEnergy/mass + 1.0;
     970    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
     971                  (1. + 2.0*gamma*ratio + ratio*ratio);
     972  }
     973  return tmax;
     974}
     975
     976///////////////////////////////////////////////////////////////
     977
     978void G4PAIModel::DefineForRegion(const G4Region* r)
     979{
     980  fPAIRegionVector.push_back(r);
     981}
    937982
    938983//
  • trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
     26// $Id: G4PAIPhotonModel.cc,v 1.21 2009/02/19 19:17:50 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
     28//
     29// -------------------------------------------------------------------
     30//
     31// GEANT4 Class
    2632// File name:     G4PAIPhotonModel.cc
    2733//
     
    217223//////////////////////////////////////////////////////////////////
    218224
     225void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*)
     226{}
     227
     228//////////////////////////////////////////////////////////////////
     229
    219230void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof()
    220231{
     
    487498  {
    488499    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    489     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     500    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     501    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    490502    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    491503  }
     
    530542  {
    531543    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    532     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     544    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     545    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    533546    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    534547  }
     
    574587  {
    575588    //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    576     if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     589    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     590    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
    577591    else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    578592  }
     
    617631  {
    618632    //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
    619     if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     633    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     634    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
    620635    else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;     
    621636  }
     
    626641//////////////////////////////////////////////////////////////////////////////
    627642
    628 G4double G4PAIPhotonModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
    629                                  const G4ParticleDefinition* p,
    630                                        G4double kineticEnergy,
    631                                        G4double cutEnergy)
     643G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*,
     644                                                const G4ParticleDefinition* p,
     645                                                G4double kineticEnergy,
     646                                                G4double cutEnergy)
    632647{
    633648  G4int iTkin,iPlace;
    634649  size_t jMat;
     650
     651  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
     652  G4double cut = cutEnergy;
     653
    635654  G4double particleMass = p->GetPDGMass();
    636655  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    638657  G4double charge2      = charge*charge;
    639658  G4double dEdx         = 0.;
     659  const G4MaterialCutsCouple* matCC = CurrentCouple();
    640660
    641661  for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
     
    653673  iPlace = iTkin - 1;
    654674  if(iPlace < 0) iPlace = 0;
    655   dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 
     675  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 
    656676
    657677  if( dEdx < 0.) dEdx = 0.;
     
    661681/////////////////////////////////////////////////////////////////////////
    662682
    663 G4double G4PAIPhotonModel::CrossSection( const G4MaterialCutsCouple* matCC,
    664                                    const G4ParticleDefinition* p,
    665                                          G4double kineticEnergy,
    666                                          G4double cutEnergy,
    667                                          G4double maxEnergy  )
     683G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*,
     684                                                  const G4ParticleDefinition* p,
     685                                                  G4double kineticEnergy,
     686                                                  G4double cutEnergy,
     687                                                  G4double maxEnergy  )
    668688{
    669689  G4int iTkin,iPlace;
    670690  size_t jMat, jMatCC;
    671   G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     691  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
     692  if(cutEnergy >= tmax) return 0.0;
    672693  G4double particleMass = p->GetPDGMass();
    673694  G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
     
    675696  G4double charge2      = charge*charge, cross, cross1, cross2;
    676697  G4double photon1, photon2, plasmon1, plasmon2;
     698
     699  const G4MaterialCutsCouple* matCC = CurrentCouple();
    677700
    678701  const G4ProductionCutsTable* theCoupleTable=
     
    12251248}
    12261249
     1250/////////////////////////////////////////////////////////////////////
     1251
     1252G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
     1253                                                      G4double kinEnergy)
     1254{
     1255  G4double tmax = kinEnergy;
     1256  if(p == fElectron) tmax *= 0.5;
     1257  else if(p != fPositron) {
     1258    G4double mass = p->GetPDGMass();
     1259    G4double ratio= electron_mass_c2/mass;
     1260    G4double gamma= kinEnergy/mass + 1.0;
     1261    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
     1262                  (1. + 2.0*gamma*ratio + ratio*ratio);
     1263  }
     1264  return tmax;
     1265}
     1266
     1267///////////////////////////////////////////////////////////////
     1268
     1269void G4PAIPhotonModel::DefineForRegion(const G4Region* r)
     1270{
     1271  fPAIRegionVector.push_back(r);
     1272}
     1273
    12271274
    12281275//
  • trunk/source/processes/electromagnetic/standard/src/G4PAIxSection.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4PAIxSection.cc,v 1.21 2006/06/29 19:53:20 gunter Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4PAIxSection.cc,v 1.24 2008/05/30 16:04:40 grichine Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
     
    7070         70.0 ,   100.0 , 300.0 , 600.0 , 1000.0 , 3000.0 ,
    7171      10000.0 , 50000.0
    72 } ;
     72};
    7373
    7474const G4int G4PAIxSection::
    75 fRefGammaNumber = 29 ;         // The number of gamma for creation of
     75fRefGammaNumber = 29;         // The number of gamma for creation of
    7676                               // spline (9)
    7777
     
    8080// Local class constants
    8181
    82 const G4double G4PAIxSection::fDelta = 0.005 ; // energy shift from interval border
    83 const G4double G4PAIxSection::fError = 0.005 ; // error in lin-log approximation
    84 
    85 const G4int G4PAIxSection::fMaxSplineSize = 500 ;  // Max size of output spline
     82const G4double G4PAIxSection::fDelta = 0.005; // energy shift from interval border
     83const G4double G4PAIxSection::fError = 0.005; // error in lin-log approximation
     84
     85const G4int G4PAIxSection::fMaxSplineSize = 500;  // Max size of output spline
    8686                                                    // arrays
    8787
     
    9595  fDensity       = matCC->GetMaterial()->GetDensity();
    9696  G4int matIndex = matCC->GetMaterial()->GetIndex();
     97  fMaterialIndex = matIndex;   
    9798  fSandia        = new G4SandiaTable(matIndex);
    9899
     
    108109    (*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
    109110
    110     for(j = 1; j < 5 ; j++)
     111    for(j = 1; j < 5; j++)
    111112    {
    112113      (*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
    113114    }     
    114115  }                     
    115 
    116 
    117 
    118116}
     117
     118////////////////////////////////////////////////////////////////
    119119
    120120G4PAIxSection::G4PAIxSection(G4int materialIndex,
    121121                             G4double maxEnergyTransfer)
    122122{
    123    const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable() ;
    124    G4int i, j ;   
    125 
    126       fDensity                = (*theMaterialTable)[materialIndex]->GetDensity() ;
     123   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
     124   G4int i, j;   
     125
     126      fMaterialIndex   = materialIndex;   
     127      fDensity                = (*theMaterialTable)[materialIndex]->GetDensity();
    127128      fElectronDensity        = (*theMaterialTable)[materialIndex]->
    128                              GetElectronDensity() ;
     129                             GetElectronDensity();
    129130      fIntervalNumber         = (*theMaterialTable)[materialIndex]->
    130                              GetSandiaTable()->GetMatNbOfIntervals() ;
     131                             GetSandiaTable()->GetMatNbOfIntervals();
    131132      fIntervalNumber--;     
    132       // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl ;
    133 
    134       fEnergyInterval = new G4double[fIntervalNumber+2] ;
    135       fA1             = new G4double[fIntervalNumber+2] ;
    136       fA2             = new G4double[fIntervalNumber+2] ;
    137       fA3             = new G4double[fIntervalNumber+2] ;
    138       fA4             = new G4double[fIntervalNumber+2] ;
    139 
    140       for(i = 1 ; i <= fIntervalNumber ; i++ )
     133      // G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl;
     134
     135      fEnergyInterval = new G4double[fIntervalNumber+2];
     136      fA1             = new G4double[fIntervalNumber+2];
     137      fA2             = new G4double[fIntervalNumber+2];
     138      fA3             = new G4double[fIntervalNumber+2];
     139      fA4             = new G4double[fIntervalNumber+2];
     140
     141      for(i = 1; i <= fIntervalNumber; i++ )
    141142      {
    142143         if(((*theMaterialTable)[materialIndex]->
     
    144145              i > fIntervalNumber               )
    145146         {
    146             fEnergyInterval[i] = maxEnergyTransfer ;
    147             fIntervalNumber = i ;
     147            fEnergyInterval[i] = maxEnergyTransfer;
     148            fIntervalNumber = i;
    148149            break;
    149150         }
     
    159160                              GetSandiaTable()->GetSandiaCofForMaterial(i-1,4);
    160161         // G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t"
    161          //                               <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;
     162         //                               <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl;
    162163      }   
    163164      if(fEnergyInterval[fIntervalNumber] != maxEnergyTransfer)
    164165      {
    165166         fIntervalNumber++;
    166          fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;
     167         fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
    167168      }
    168169
     
    174175           1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
    175176        {
    176           continue ;
     177          continue;
    177178        }
    178179        else
     
    180181          for(j=i;j<fIntervalNumber;j++)
    181182          {
    182             fEnergyInterval[j] = fEnergyInterval[j+1] ;
    183                         fA1[j] = fA1[j+1] ;
    184                         fA2[j] = fA2[j+1] ;
    185                         fA3[j] = fA3[j+1] ;
    186                         fA4[j] = fA4[j+1] ;
     183            fEnergyInterval[j] = fEnergyInterval[j+1];
     184                        fA1[j] = fA1[j+1];
     185                        fA2[j] = fA2[j+1];
     186                        fA3[j] = fA3[j+1];
     187                        fA4[j] = fA4[j+1];
    187188          }
    188           fIntervalNumber-- ;
    189           i-- ;
     189          fIntervalNumber--;
     190          i--;
    190191        }
    191192      }
     
    194195      /* *********************************
    195196
    196       fSplineEnergy          = new G4double[fMaxSplineSize] ;   
    197       fRePartDielectricConst = new G4double[fMaxSplineSize] ;   
    198       fImPartDielectricConst = new G4double[fMaxSplineSize] ;   
    199       fIntegralTerm          = new G4double[fMaxSplineSize] ;   
    200       fDifPAIxSection        = new G4double[fMaxSplineSize] ;   
    201       fIntegralPAIxSection   = new G4double[fMaxSplineSize] ;   
     197      fSplineEnergy          = new G4double[fMaxSplineSize];   
     198      fRePartDielectricConst = new G4double[fMaxSplineSize];   
     199      fImPartDielectricConst = new G4double[fMaxSplineSize];   
     200      fIntegralTerm          = new G4double[fMaxSplineSize];   
     201      fDifPAIxSection        = new G4double[fMaxSplineSize];   
     202      fIntegralPAIxSection   = new G4double[fMaxSplineSize];   
    202203     
    203204      for(i=0;i<fMaxSplineSize;i++)
    204205      {
    205          fSplineEnergy[i]          = 0.0 ;   
    206          fRePartDielectricConst[i] = 0.0 ;   
    207          fImPartDielectricConst[i] = 0.0 ;   
    208          fIntegralTerm[i]          = 0.0 ;   
    209          fDifPAIxSection[i]        = 0.0 ;   
    210          fIntegralPAIxSection[i]   = 0.0 ;   
     206         fSplineEnergy[i]          = 0.0;   
     207         fRePartDielectricConst[i] = 0.0;   
     208         fImPartDielectricConst[i] = 0.0;   
     209         fIntegralTerm[i]          = 0.0;   
     210         fDifPAIxSection[i]        = 0.0;   
     211         fIntegralPAIxSection[i]   = 0.0;   
    211212      }
    212213      **************************************************  */   
    213214
    214       InitPAI() ;  // create arrays allocated above
     215      InitPAI();  // create arrays allocated above
    215216     
    216       delete[] fEnergyInterval ;
    217       delete[] fA1 ;
    218       delete[] fA2 ;
    219       delete[] fA3 ;
    220       delete[] fA4 ;   
     217      delete[] fEnergyInterval;
     218      delete[] fA1;
     219      delete[] fA2;
     220      delete[] fA3;
     221      delete[] fA4;   
    221222}
    222223
     
    232233{
    233234   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
    234    G4int i, j ;   
    235    
     235   G4int i, j;
     236 
     237      fMaterialIndex   = materialIndex;     
    236238      fDensity                = (*theMaterialTable)[materialIndex]->GetDensity();
    237239      fElectronDensity        = (*theMaterialTable)[materialIndex]->
    238                              GetElectronDensity() ;
    239 
    240       fIntervalNumber         = intNumber ;
     240                             GetElectronDensity();
     241
     242      fIntervalNumber         = intNumber;
    241243      fIntervalNumber--;
    242       //   G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl ;
     244      //   G4cout<<fDensity<<"\t"<<fElectronDensity<<"\t"<<fIntervalNumber<<G4endl;
    243245 
    244       fEnergyInterval = new G4double[fIntervalNumber+2] ;
    245       fA1             = new G4double[fIntervalNumber+2] ;
    246       fA2             = new G4double[fIntervalNumber+2] ;
    247       fA3             = new G4double[fIntervalNumber+2] ;
    248       fA4             = new G4double[fIntervalNumber+2] ;
    249 
    250       for( i = 1 ; i <= fIntervalNumber ; i++ )
     246      fEnergyInterval = new G4double[fIntervalNumber+2];
     247      fA1             = new G4double[fIntervalNumber+2];
     248      fA2             = new G4double[fIntervalNumber+2];
     249      fA3             = new G4double[fIntervalNumber+2];
     250      fA4             = new G4double[fIntervalNumber+2];
     251
     252      for( i = 1; i <= fIntervalNumber; i++ )
    251253      {
    252254         if( ( photoAbsCof[i-1][0] >= maxEnergyTransfer ) ||
    253255             i > fIntervalNumber )
    254256         {
    255             fEnergyInterval[i] = maxEnergyTransfer ;
    256             fIntervalNumber = i ;
     257            fEnergyInterval[i] = maxEnergyTransfer;
     258            fIntervalNumber = i;
    257259            break;
    258260         }
    259          fEnergyInterval[i] = photoAbsCof[i-1][0] ;
    260          fA1[i]             = photoAbsCof[i-1][1] ;
    261          fA2[i]             = photoAbsCof[i-1][2] ;
    262          fA3[i]             = photoAbsCof[i-1][3] ;
    263          fA4[i]             = photoAbsCof[i-1][4] ;
     261         fEnergyInterval[i] = photoAbsCof[i-1][0];
     262         fA1[i]             = photoAbsCof[i-1][1];
     263         fA2[i]             = photoAbsCof[i-1][2];
     264         fA3[i]             = photoAbsCof[i-1][3];
     265         fA4[i]             = photoAbsCof[i-1][4];
    264266         // G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t"
    265          //        <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;
     267         //        <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl;
    266268      }
    267269  // G4cout<<"i last = "<<i<<"; "<<"fIntervalNumber = "<<fIntervalNumber<<G4endl;   
     
    269271      {
    270272         fIntervalNumber++;
    271          fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;
     273         fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
    272274      }
    273275      for(i=1;i<=fIntervalNumber;i++)
    274276      {
    275277        //  G4cout<<i<<"\t"<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t"
    276         //    <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;
     278        //    <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl;
    277279      }
    278280      // Now checking, if two borders are too close together
    279281
    280       for( i = 1 ; i < fIntervalNumber ; i++ )
     282      for( i = 1; i < fIntervalNumber; i++ )
    281283      {
    282284        if(fEnergyInterval[i+1]-fEnergyInterval[i] >
    283285           1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
    284286        {
    285           continue ;
     287          continue;
    286288        }
    287289        else
     
    289291          for(j=i;j<fIntervalNumber;j++)
    290292          {
    291             fEnergyInterval[j] = fEnergyInterval[j+1] ;
    292                         fA1[j] = fA1[j+1] ;
    293                         fA2[j] = fA2[j+1] ;
    294                         fA3[j] = fA3[j+1] ;
    295                         fA4[j] = fA4[j+1] ;
     293            fEnergyInterval[j] = fEnergyInterval[j+1];
     294                        fA1[j] = fA1[j+1];
     295                        fA2[j] = fA2[j+1];
     296                        fA3[j] = fA3[j+1];
     297                        fA4[j] = fA4[j+1];
    296298          }
    297           fIntervalNumber-- ;
    298           i-- ;
     299          fIntervalNumber--;
     300          i--;
    299301        }
    300302      }
     
    305307      fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
    306308
    307       NormShift(betaGammaSqRef) ;             
    308       SplainPAI(betaGammaSqRef) ;
     309      NormShift(betaGammaSqRef);             
     310      SplainPAI(betaGammaSqRef);
    309311     
    310312      // Preparation of integral PAI cross section for input betaGammaSq
    311313   
    312       for(i = 1 ; i <= fSplineNumber ; i++)
     314      for(i = 1; i <= fSplineNumber; i++)
    313315      {
    314316         fdNdxCerenkov[i]   = PAIdNdxCerenkov(i,betaGammaSq);
     317         fdNdxMM[i]   = PAIdNdxMM(i,betaGammaSq);
    315318         fdNdxPlasmon[i]    = PAIdNdxPlasmon(i,betaGammaSq);
     319         fdNdxResonance[i]  = PAIdNdxResonance(i,betaGammaSq);
    316320         fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
     321
    317322         // G4cout<<i<<"; dNdxC = "<<fdNdxCerenkov[i]<<"; dNdxP = "<<fdNdxPlasmon[i]
    318323         //    <<"; dNdxPAI = "<<fDifPAIxSection[i]<<G4endl;
    319324      }
    320       IntegralCerenkov() ;
    321       IntegralPlasmon() ;
    322       IntegralPAIxSection() ;
     325      IntegralCerenkov();
     326      IntegralMM();
     327      IntegralPlasmon();
     328      IntegralResonance();
     329      IntegralPAIxSection();
    323330     
    324       delete[] fEnergyInterval ;
    325       delete[] fA1 ;
    326       delete[] fA2 ;
    327       delete[] fA3 ;
    328       delete[] fA4 ;   
     331      delete[] fEnergyInterval;
     332      delete[] fA1;
     333      delete[] fA2;
     334      delete[] fA3;
     335      delete[] fA4;   
    329336}
    330337
     
    339346   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
    340347
    341    G4int i, j, numberOfElements ;   
    342    
     348   G4int i, j, numberOfElements;   
     349
     350   fMaterialIndex   = materialIndex;   
    343351   fDensity         = (*theMaterialTable)[materialIndex]->GetDensity();
    344    fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity() ;
    345    numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements() ;
    346 
    347    G4int* thisMaterialZ = new G4int[numberOfElements] ;
    348    
    349    for( i = 0 ; i < numberOfElements ; i++ )
     352   fElectronDensity = (*theMaterialTable)[materialIndex]->GetElectronDensity();
     353   numberOfElements = (*theMaterialTable)[materialIndex]->GetNumberOfElements();
     354
     355   G4int* thisMaterialZ = new G4int[numberOfElements];
     356   
     357   for( i = 0; i < numberOfElements; i++ )
    350358   {
    351359         thisMaterialZ[i] = (G4int)(*theMaterialTable)[materialIndex]->
    352                                       GetElement(i)->GetZ() ;
    353    }
    354    G4SandiaTable     thisMaterialSandiaTable(materialIndex) ;
     360                                      GetElement(i)->GetZ();
     361   }
     362   // fSandia = new G4SandiaTable(materialIndex);
     363   fSandia = (*theMaterialTable)[materialIndex]->
     364     GetSandiaTable();
     365   G4SandiaTable     thisMaterialSandiaTable(materialIndex);
    355366   fIntervalNumber = thisMaterialSandiaTable.SandiaIntervals
    356                            (thisMaterialZ,numberOfElements) ;   
     367                           (thisMaterialZ,numberOfElements);   
    357368   fIntervalNumber = thisMaterialSandiaTable.SandiaMixing
    358369                           ( thisMaterialZ ,
    359370                      (*theMaterialTable)[materialIndex]->GetFractionVector() ,
    360                              numberOfElements,fIntervalNumber) ;
     371                             numberOfElements,fIntervalNumber);
    361372
    362373   fIntervalNumber--;
    363374
    364       fEnergyInterval = new G4double[fIntervalNumber+2] ;
    365       fA1             = new G4double[fIntervalNumber+2] ;
    366       fA2             = new G4double[fIntervalNumber+2] ;
    367       fA3             = new G4double[fIntervalNumber+2] ;
    368       fA4             = new G4double[fIntervalNumber+2] ;
    369 
    370       for(i=1;i<=fIntervalNumber;i++)
     375      fEnergyInterval = new G4double[fIntervalNumber+2];
     376      fA1             = new G4double[fIntervalNumber+2];
     377      fA2             = new G4double[fIntervalNumber+2];
     378      fA3             = new G4double[fIntervalNumber+2];
     379      fA4             = new G4double[fIntervalNumber+2];
     380
     381      for( i = 1; i <= fIntervalNumber; i++ )
    371382      {
    372383  if((thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) >= maxEnergyTransfer) ||
    373384          i > fIntervalNumber)
    374385         {
    375             fEnergyInterval[i] = maxEnergyTransfer ;
    376             fIntervalNumber = i ;
     386            fEnergyInterval[i] = maxEnergyTransfer;
     387            fIntervalNumber = i;
    377388            break;
    378389         }
    379    fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0) ;
    380    fA1[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity ;
    381    fA2[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity ;
    382    fA3[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity ;
    383    fA4[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity ;
     390   fEnergyInterval[i] = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,0);
     391   fA1[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,1)*fDensity;
     392   fA2[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,2)*fDensity;
     393   fA3[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,3)*fDensity;
     394   fA4[i]             = thisMaterialSandiaTable.GetPhotoAbsorpCof(i,4)*fDensity;
    384395
    385396      }   
     
    387398      {
    388399         fIntervalNumber++;
    389          fEnergyInterval[fIntervalNumber] = maxEnergyTransfer ;
    390          fA1[fIntervalNumber] = fA1[fIntervalNumber-1] ;
    391          fA2[fIntervalNumber] = fA2[fIntervalNumber-1] ;
    392          fA3[fIntervalNumber] = fA3[fIntervalNumber-1] ;
    393          fA4[fIntervalNumber] = fA4[fIntervalNumber-1] ;
     400         fEnergyInterval[fIntervalNumber] = maxEnergyTransfer;
     401         fA1[fIntervalNumber] = fA1[fIntervalNumber-1];
     402         fA2[fIntervalNumber] = fA2[fIntervalNumber-1];
     403         fA3[fIntervalNumber] = fA3[fIntervalNumber-1];
     404         fA4[fIntervalNumber] = fA4[fIntervalNumber-1];
    394405      }
    395406      for(i=1;i<=fIntervalNumber;i++)
    396407      {
    397408        // G4cout<<fEnergyInterval[i]<<"\t"<<fA1[i]<<"\t"<<fA2[i]<<"\t"
    398         //   <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl ;
     409        //   <<fA3[i]<<"\t"<<fA4[i]<<"\t"<<G4endl;
    399410      }
    400411      // Now checking, if two borders are too close together
    401412
    402       for(i=1;i<fIntervalNumber;i++)
     413      for( i = 1; i < fIntervalNumber; i++ )
    403414      {
    404415        if(fEnergyInterval[i+1]-fEnergyInterval[i] >
    405416           1.5*fDelta*(fEnergyInterval[i+1]+fEnergyInterval[i]))
    406417        {
    407           continue ;
     418          continue;
    408419        }
    409420        else
    410421        {
    411           for(j=i;j<fIntervalNumber;j++)
     422          for( j = i; j < fIntervalNumber; j++ )
    412423          {
    413             fEnergyInterval[j] = fEnergyInterval[j+1] ;
    414                         fA1[j] = fA1[j+1] ;
    415                         fA2[j] = fA2[j+1] ;
    416                         fA3[j] = fA3[j+1] ;
    417                         fA4[j] = fA4[j+1] ;
     424            fEnergyInterval[j] = fEnergyInterval[j+1];
     425                        fA1[j] = fA1[j+1];
     426                        fA2[j] = fA2[j+1];
     427                        fA3[j] = fA3[j+1];
     428                        fA4[j] = fA4[j+1];
    418429          }
    419           fIntervalNumber-- ;
    420           i-- ;
     430          fIntervalNumber--;
     431          i--;
    421432        }
    422433      }
    423434
    424435      /* *********************************
    425       fSplineEnergy          = new G4double[fMaxSplineSize] ;   
    426       fRePartDielectricConst = new G4double[fMaxSplineSize] ;   
    427       fImPartDielectricConst = new G4double[fMaxSplineSize] ;   
    428       fIntegralTerm          = new G4double[fMaxSplineSize] ;   
    429       fDifPAIxSection        = new G4double[fMaxSplineSize] ;   
    430       fIntegralPAIxSection   = new G4double[fMaxSplineSize] ;   
     436      fSplineEnergy          = new G4double[fMaxSplineSize];   
     437      fRePartDielectricConst = new G4double[fMaxSplineSize];   
     438      fImPartDielectricConst = new G4double[fMaxSplineSize];   
     439      fIntegralTerm          = new G4double[fMaxSplineSize];   
     440      fDifPAIxSection        = new G4double[fMaxSplineSize];   
     441      fIntegralPAIxSection   = new G4double[fMaxSplineSize];   
    431442     
    432443      for(i=0;i<fMaxSplineSize;i++)
    433444      {
    434          fSplineEnergy[i]          = 0.0 ;   
    435          fRePartDielectricConst[i] = 0.0 ;   
    436          fImPartDielectricConst[i] = 0.0 ;   
    437          fIntegralTerm[i]          = 0.0 ;   
    438          fDifPAIxSection[i]        = 0.0 ;   
    439          fIntegralPAIxSection[i]   = 0.0 ;   
     445         fSplineEnergy[i]          = 0.0;   
     446         fRePartDielectricConst[i] = 0.0;   
     447         fImPartDielectricConst[i] = 0.0;   
     448         fIntegralTerm[i]          = 0.0;   
     449         fDifPAIxSection[i]        = 0.0;   
     450         fIntegralPAIxSection[i]   = 0.0;   
    440451      }
    441452      */ ////////////////////////
     
    446457      fLorentzFactor[fRefGammaNumber]*fLorentzFactor[fRefGammaNumber] - 1;
    447458
    448       NormShift(betaGammaSqRef) ;             
    449       SplainPAI(betaGammaSqRef) ;
     459      NormShift(betaGammaSqRef);             
     460      SplainPAI(betaGammaSqRef);
    450461     
    451462      // Preparation of integral PAI cross section for input betaGammaSq
    452463   
    453       for(i = 1 ; i <= fSplineNumber ; i++)
     464      for(i = 1; i <= fSplineNumber; i++)
    454465      {
    455466         fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
    456467         fdNdxCerenkov[i]   = PAIdNdxCerenkov(i,betaGammaSq);
     468         fdNdxMM[i]   = PAIdNdxMM(i,betaGammaSq);
    457469         fdNdxPlasmon[i]    = PAIdNdxPlasmon(i,betaGammaSq);
    458       }
    459       IntegralPAIxSection() ;
    460       IntegralCerenkov() ;
    461       IntegralPlasmon() ;
     470         fdNdxResonance[i]  = PAIdNdxResonance(i,betaGammaSq);
     471      }
     472      IntegralPAIxSection();
     473      IntegralCerenkov();
     474      IntegralMM();
     475      IntegralPlasmon();
     476      IntegralResonance();
    462477     
    463       //   delete[] fEnergyInterval ;
    464       delete[] fA1 ;
    465       delete[] fA2 ;
    466       delete[] fA3 ;
    467       delete[] fA4 ;   
     478      //   delete[] fEnergyInterval;
     479      delete[] fA1;
     480      delete[] fA2;
     481      delete[] fA3;
     482      delete[] fA4;   
    468483}
    469484
     
    476491{
    477492   /* ************************
    478    delete[] fSplineEnergy          ;   
    479    delete[] fRePartDielectricConst ;   
    480    delete[] fImPartDielectricConst ;   
    481    delete[] fIntegralTerm          ;   
    482    delete[] fDifPAIxSection        ;   
    483    delete[] fIntegralPAIxSection   ;
     493   delete[] fSplineEnergy         ;   
     494   delete[] fRePartDielectricConst;   
     495   delete[] fImPartDielectricConst;   
     496   delete[] fIntegralTerm         ;   
     497   delete[] fDifPAIxSection       ;   
     498   delete[] fIntegralPAIxSection  ;
    484499   */ ////////////////////////
    485500}
     
    492507void G4PAIxSection::InitPAI()
    493508{   
    494    G4int i ;
     509   G4int i;
    495510   G4double betaGammaSq = fLorentzFactor[fRefGammaNumber]*
    496511                          fLorentzFactor[fRefGammaNumber] - 1;
     
    498513   // Preparation of integral PAI cross section for reference gamma
    499514   
    500    NormShift(betaGammaSq) ;             
    501    SplainPAI(betaGammaSq) ;
    502 
    503    IntegralPAIxSection() ;
    504    IntegralCerenkov() ;
    505    IntegralPlasmon() ;
    506 
    507    for(i = 0 ; i<=fSplineNumber ; i++)
    508    {
    509       fPAItable[i][fRefGammaNumber] = fIntegralPAIxSection[i] ;
     515   NormShift(betaGammaSq);             
     516   SplainPAI(betaGammaSq);
     517
     518   IntegralPAIxSection();
     519   IntegralCerenkov();
     520   IntegralMM();
     521   IntegralPlasmon();
     522   IntegralResonance();
     523
     524   for(i = 0; i<= fSplineNumber; i++)
     525   {
     526      fPAItable[i][fRefGammaNumber] = fIntegralPAIxSection[i];
    510527      if(i != 0)
    511528      {
    512          fPAItable[i][0] = fSplineEnergy[i] ;
    513       }
    514    }
    515    fPAItable[0][0] = fSplineNumber ;
    516    
    517    for(G4int j = 1 ; j < 112 ; j++)       // for other gammas
    518    {
    519       if( j == fRefGammaNumber ) continue ;
     529         fPAItable[i][0] = fSplineEnergy[i];
     530      }
     531   }
     532   fPAItable[0][0] = fSplineNumber;
     533   
     534   for(G4int j = 1; j < 112; j++)       // for other gammas
     535   {
     536      if( j == fRefGammaNumber ) continue;
    520537     
    521       betaGammaSq = fLorentzFactor[j]*fLorentzFactor[j] - 1 ;
     538      betaGammaSq = fLorentzFactor[j]*fLorentzFactor[j] - 1;
    522539     
    523       for(i = 1 ; i <= fSplineNumber ; i++)
     540      for(i = 1; i <= fSplineNumber; i++)
    524541      {
    525542         fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
    526543         fdNdxCerenkov[i]   = PAIdNdxCerenkov(i,betaGammaSq);
     544         fdNdxMM[i]   = PAIdNdxMM(i,betaGammaSq);
    527545         fdNdxPlasmon[i]    = PAIdNdxPlasmon(i,betaGammaSq);
    528       }
    529       IntegralPAIxSection() ;
    530       IntegralCerenkov() ;
    531       IntegralPlasmon() ;
     546         fdNdxResonance[i]  = PAIdNdxResonance(i,betaGammaSq);
     547      }
     548      IntegralPAIxSection();
     549      IntegralCerenkov();
     550      IntegralMM();
     551      IntegralPlasmon();
     552      IntegralResonance();
    532553     
    533       for(i = 0 ; i <= fSplineNumber ; i++)
    534       {
    535          fPAItable[i][j] = fIntegralPAIxSection[i] ;
     554      for(i = 0; i <= fSplineNumber; i++)
     555      {
     556         fPAItable[i][j] = fIntegralPAIxSection[i];
    536557      }
    537558   }
     
    546567void G4PAIxSection::NormShift(G4double betaGammaSq)
    547568{
    548   G4int i, j ;
    549 
    550   for( i = 1 ; i <= fIntervalNumber-1 ; i++ )
    551   {
    552     for( j = 1 ; j <= 2 ; j++ )
     569  G4int i, j;
     570
     571  for( i = 1; i <= fIntervalNumber-1; i++ )
     572  {
     573    for( j = 1; j <= 2; j++ )
    553574    {
    554       fSplineNumber = (i-1)*2 + j ;
     575      fSplineNumber = (i-1)*2 + j;
    555576
    556577      if( j == 1 ) fSplineEnergy[fSplineNumber] = fEnergyInterval[i  ]*(1+fDelta);
     
    562583  fIntegralTerm[1]=RutherfordIntegral(1,fEnergyInterval[1],fSplineEnergy[1]);
    563584
    564   j = 1 ;
    565 
    566   for(i=2;i<=fSplineNumber;i++)
     585  j = 1;
     586
     587  for( i = 2; i <= fSplineNumber; i++ )
    567588  {
    568589    if(fSplineEnergy[i]<fEnergyInterval[j+1])
     
    570591         fIntegralTerm[i] = fIntegralTerm[i-1] +
    571592                            RutherfordIntegral(j,fSplineEnergy[i-1],
    572                                                  fSplineEnergy[i]   ) ;
     593                                                 fSplineEnergy[i]   );
    573594    }
    574595    else
    575596    {
    576597       G4double x = RutherfordIntegral(j,fSplineEnergy[i-1],
    577                                            fEnergyInterval[j+1]   ) ;
     598                                           fEnergyInterval[j+1]   );
    578599         j++;
    579600         fIntegralTerm[i] = fIntegralTerm[i-1] + x +
    580601                            RutherfordIntegral(j,fEnergyInterval[j],
    581                                                  fSplineEnergy[i]    ) ;
     602                                                 fSplineEnergy[i]    );
    582603    }
    583604    // G4cout<<i<<"\t"<<fSplineEnergy[i]<<"\t"<<fIntegralTerm[i]<<"\n"<<G4endl;
    584605  }
    585   fNormalizationCof = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2 ;
    586   fNormalizationCof *= fElectronDensity/fIntegralTerm[fSplineNumber] ;
    587 
    588   // G4cout<<"fNormalizationCof = "<<fNormalizationCof<<G4endl ;
     606  fNormalizationCof = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2;
     607  fNormalizationCof *= fElectronDensity/fIntegralTerm[fSplineNumber];
     608
     609  // G4cout<<"fNormalizationCof = "<<fNormalizationCof<<G4endl;
    589610
    590611          // Calculation of PAI differrential cross-section (1/(keV*cm))
    591612          // in the energy points near borders of energy intervals
    592613
    593    for(G4int k=1;k<=fIntervalNumber-1;k++)
    594    {
    595       for(j=1;j<=2;j++)
    596       {
    597          i = (k-1)*2 + j ;
     614   for(G4int k = 1; k <= fIntervalNumber-1; k++ )
     615   {
     616      for( j = 1; j <= 2; j++ )
     617      {
     618         i = (k-1)*2 + j;
    598619         fImPartDielectricConst[i] = fNormalizationCof*
    599620                                     ImPartDielectricConst(k,fSplineEnergy[i]);
     
    604625         fDifPAIxSection[i] = DifPAIxSection(i,betaGammaSq);
    605626         fdNdxCerenkov[i]   = PAIdNdxCerenkov(i,betaGammaSq);
     627         fdNdxMM[i]   = PAIdNdxMM(i,betaGammaSq);
    606628         fdNdxPlasmon[i]    = PAIdNdxPlasmon(i,betaGammaSq);
     629         fdNdxResonance[i]    = PAIdNdxResonance(i,betaGammaSq);
    607630      }
    608631   }
     
    616639// linear approximation would be smaller than 'fError'
    617640
    618 void
    619    G4PAIxSection::SplainPAI(G4double betaGammaSq)
     641void G4PAIxSection::SplainPAI(G4double betaGammaSq)
    620642{
    621    G4int k = 1 ;
    622    G4int i = 1 ;
     643   G4int k = 1;
     644   G4int i = 1;
    623645
    624646   while ( (i < fSplineNumber) && (fSplineNumber < fMaxSplineSize-1) )
     
    626648      if(fSplineEnergy[i+1] > fEnergyInterval[k+1])
    627649      {
    628           k++ ;   // Here next energy point is in next energy interval
     650          k++;   // Here next energy point is in next energy interval
    629651          i++;
    630652          continue;
     
    634656      fSplineNumber++;
    635657
    636       for(G4int j = fSplineNumber; j >= i+2 ; j-- )
     658      for(G4int j = fSplineNumber; j >= i+2; j-- )
    637659      {
    638660         fSplineEnergy[j]          = fSplineEnergy[j-1];
     
    643665         fDifPAIxSection[j] = fDifPAIxSection[j-1];
    644666         fdNdxCerenkov[j]   = fdNdxCerenkov[j-1];
     667         fdNdxMM[j]   = fdNdxMM[j-1];
    645668         fdNdxPlasmon[j]    = fdNdxPlasmon[j-1];
     669         fdNdxResonance[j]  = fdNdxResonance[j-1];
    646670      }
    647671      G4double x1  = fSplineEnergy[i];
     
    658682      G4double a = log10(y2/yy1)/log10(x2/x1);
    659683      G4double b = log10(yy1) - a*log10(x1);
    660       G4double y = a*log10(en1) + b ;
     684      G4double y = a*log10(en1) + b;
    661685      y = pow(10.,y);
    662686
     
    673697      fDifPAIxSection[i+1] = DifPAIxSection(i+1,betaGammaSq);
    674698      fdNdxCerenkov[i+1]   = PAIdNdxCerenkov(i+1,betaGammaSq);
     699      fdNdxMM[i+1]   = PAIdNdxMM(i+1,betaGammaSq);
    675700      fdNdxPlasmon[i+1]    = PAIdNdxPlasmon(i+1,betaGammaSq);
     701      fdNdxResonance[i+1]  = PAIdNdxResonance(i+1,betaGammaSq);
    676702
    677703                  // Condition for next division of this segment or to pass
     
    682708      if( x < 0 )
    683709      {
    684          x = -x ;
     710         x = -x;
    685711      }
    686712      if( x > fError && fSplineNumber < fMaxSplineSize-1 )
     
    704730                                            G4double x2   )
    705731{
    706    G4double  c1, c2, c3 ;
     732   G4double  c1, c2, c3;
    707733   // G4cout<<"RI: x1 = "<<x1<<"; "<<"x2 = "<<x2<<G4endl;   
    708    c1 = (x2 - x1)/x1/x2 ;
    709    c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2 ;
    710    c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;
     734   c1 = (x2 - x1)/x1/x2;
     735   c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2;
     736   c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2;
    711737   // G4cout<<" RI: c1 = "<<c1<<"; "<<"c2 = "<<c2<<"; "<<"c3 = "<<c3<<G4endl;   
    712738   
    713    return  fA1[k]*log(x2/x1) + fA2[k]*c1 + fA3[k]*c2/2 + fA4[k]*c3/3 ;
     739   return  fA1[k]*log(x2/x1) + fA2[k]*c1 + fA3[k]*c2/2 + fA4[k]*c3/3;
    714740
    715741}   // end of RutherfordIntegral
     
    730756   energy4 = energy3*energy1;
    731757   
    732    result = fA1[k]/energy1+fA2[k]/energy2+fA3[k]/energy3+fA4[k]/energy4 
    733    result *=hbarc/energy1 ;
    734    
    735    return result ;
     758   result = fA1[k]/energy1+fA2[k]/energy2+fA3[k]/energy3+fA4[k]/energy4
     759   result *=hbarc/energy1;
     760   
     761   return result;
    736762
    737763}  // end of ImPartDielectricConst
    738764
     765/////////////////////////////////////////////////////////////////
     766//
     767// Returns lambda of photon with energy1 in current material
     768
     769G4double G4PAIxSection::GetPhotonRange( G4double energy1 )
     770{
     771  G4int i;
     772  G4double energy2, energy3, energy4, result, lambda;
     773
     774  energy2 = energy1*energy1;
     775  energy3 = energy2*energy1;
     776  energy4 = energy3*energy1;
     777
     778  // G4double* SandiaCof = fSandia->GetSandiaCofForMaterialPAI(energy1);
     779  // result = SandiaCof[0]/energy1+SandiaCof[1]/energy2+SandiaCof[2]/energy3+SandiaCof[3]/energy4;
     780  // result *= fDensity;
     781
     782  for( i = 1; i <= fIntervalNumber; i++ )
     783  {
     784     if( energy1 < fEnergyInterval[i]) break;
     785  }
     786  i--;
     787  if(i == 0) i = 1;
     788
     789  result = fA1[i]/energy1+fA2[i]/energy2+fA3[i]/energy3+fA4[i]/energy4; 
     790
     791  if( result > DBL_MIN ) lambda = 1./result;
     792  else                   lambda = DBL_MAX;
     793   
     794  return lambda;
     795
     796
     797/////////////////////////////////////////////////////////////////
     798//
     799// Return lambda of electron with energy1 in current material
     800// parametrisation from NIM A554(2005)474-493
     801
     802G4double G4PAIxSection::GetElectronRange( G4double energy )
     803{
     804  G4double range;
     805  /*
     806  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
     807
     808  G4double Z = (*theMaterialTable)[fMaterialIndex]->GetIonisation()->GetZeffective();
     809  G4double A = (*theMaterialTable)[fMaterialIndex]->GetA();
     810
     811  energy /= keV; // energy in keV in parametrised formula
     812
     813  if (energy < 10.)
     814  {
     815    range = 3.872e-3*A/Z;
     816    range *= pow(energy,1.492);
     817  }
     818  else
     819  {
     820    range = 6.97e-3*pow(energy,1.6);
     821  }
     822  */
     823  // Blum&Rolandi Particle Detection with Drift Chambers, p. 7
     824
     825  G4double cofA = 5.37e-4*g/cm2/keV;
     826  G4double cofB = 0.9815;
     827  G4double cofC = 3.123e-3/keV;
     828  // energy /= keV;
     829
     830  range = cofA*energy*( 1 - cofB/(1 + cofC*energy) );
     831
     832  // range *= g/cm2;
     833  range /= fDensity;
     834
     835  return range;
     836}
    739837
    740838//////////////////////////////////////////////////////////////////////////////
     
    747845{       
    748846   G4double x0, x02, x03, x04, x05, x1, x2, xx1 ,xx2 , xx12,
    749             c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result ;
    750 
    751    x0 = enb ;
    752    result = 0 ;
     847            c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result;
     848
     849   x0 = enb;
     850   result = 0;
    753851   
    754852   for(G4int i=1;i<=fIntervalNumber-1;i++)
    755853   {
    756       x1 = fEnergyInterval[i] ;
    757       x2 = fEnergyInterval[i+1] ;
    758       xx1 = x1 - x0 ;
    759       xx2 = x2 - x0 ;
    760       xx12 = xx2/xx1 ;
     854      x1 = fEnergyInterval[i];
     855      x2 = fEnergyInterval[i+1];
     856      xx1 = x1 - x0;
     857      xx2 = x2 - x0;
     858      xx12 = xx2/xx1;
    761859     
    762860      if(xx12<0)
     
    764862         xx12 = -xx12;
    765863      }
    766       xln1 = log(x2/x1) ;
    767       xln2 = log(xx12) ;
    768       xln3 = log((x2 + x0)/(x1 + x0)) ;
    769       x02 = x0*x0 ;
    770       x03 = x02*x0 ;
    771       x04 = x03*x0 ;
     864      xln1 = log(x2/x1);
     865      xln2 = log(xx12);
     866      xln3 = log((x2 + x0)/(x1 + x0));
     867      x02 = x0*x0;
     868      x03 = x02*x0;
     869      x04 = x03*x0;
    772870      x05 = x04*x0;
    773       c1  = (x2 - x1)/x1/x2 ;
    774       c2  = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2 ;
    775       c3  = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;
    776 
    777       result -= (fA1[i]/x02 + fA3[i]/x04)*xln1 ;
    778       result -= (fA2[i]/x02 + fA4[i]/x04)*c1 ;
    779       result -= fA3[i]*c2/2/x02 ;
    780       result -= fA4[i]*c3/3/x02 ;
    781 
    782       cof1 = fA1[i]/x02 + fA3[i]/x04 ;
    783       cof2 = fA2[i]/x03 + fA4[i]/x05 ;
    784 
    785       result += 0.5*(cof1 +cof2)*xln2 ;
    786       result += 0.5*(cof1 - cof2)*xln3 ;
     871      c1  = (x2 - x1)/x1/x2;
     872      c2  = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2;
     873      c3  = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2;
     874
     875      result -= (fA1[i]/x02 + fA3[i]/x04)*xln1;
     876      result -= (fA2[i]/x02 + fA4[i]/x04)*c1;
     877      result -= fA3[i]*c2/2/x02;
     878      result -= fA4[i]*c3/3/x02;
     879
     880      cof1 = fA1[i]/x02 + fA3[i]/x04;
     881      cof2 = fA2[i]/x03 + fA4[i]/x05;
     882
     883      result += 0.5*(cof1 +cof2)*xln2;
     884      result += 0.5*(cof1 - cof2)*xln3;
    787885   }
    788    result *= 2*hbarc/pi ;
    789    
    790    return result ;
     886   result *= 2*hbarc/pi;
     887   
     888   return result;
    791889
    792890}   // end of RePartDielectricConst
     
    801899                                        G4double betaGammaSq  )
    802900{       
    803    G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result ;
    804    //G4double beta, be4 ;
    805    G4double be4 ;
    806    G4double betaBohr2 = fine_structure_const*fine_structure_const ;
    807    G4double betaBohr4 = betaBohr2*betaBohr2*4.0 ;
    808    be2 = betaGammaSq/(1 + betaGammaSq) ;
    809    be4 = be2*be2 ;
    810    //  beta = sqrt(be2) ;
    811    cof = 1 ;
    812    x1 = log(2*electron_mass_c2/fSplineEnergy[i]) ;
    813 
    814    if( betaGammaSq < 0.01 ) x2 = log(be2) ;
     901   G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result;
     902   //G4double beta, be4;
     903   G4double be4;
     904   G4double betaBohr2 = fine_structure_const*fine_structure_const;
     905   G4double betaBohr4 = betaBohr2*betaBohr2*4.0;
     906   be2 = betaGammaSq/(1 + betaGammaSq);
     907   be4 = be2*be2;
     908   //  beta = sqrt(be2);
     909   cof = 1;
     910   x1 = log(2*electron_mass_c2/fSplineEnergy[i]);
     911
     912   if( betaGammaSq < 0.01 ) x2 = log(be2);
    815913   else
    816914   {
    817915     x2 = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
    818916                (1/betaGammaSq - fRePartDielectricConst[i]) +
    819                 fImPartDielectricConst[i]*fImPartDielectricConst[i] )/2 ;
     917                fImPartDielectricConst[i]*fImPartDielectricConst[i] )/2;
    820918   }
    821919   if( fImPartDielectricConst[i] == 0.0 ||betaGammaSq < 0.01 )
    822920   {
    823      x6=0 ;
     921     x6=0;
    824922   }
    825923   else
    826924   {
    827      x3 = -fRePartDielectricConst[i] + 1/betaGammaSq ;
     925     x3 = -fRePartDielectricConst[i] + 1/betaGammaSq;
    828926     x5 = -1 - fRePartDielectricConst[i] +
    829927          be2*((1 +fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
    830           fImPartDielectricConst[i]*fImPartDielectricConst[i]) ;
    831 
    832      x7 = atan2(fImPartDielectricConst[i],x3) ;
    833      x6 = x5 * x7 ;
    834    }
    835     // if(fImPartDielectricConst[i] == 0) x6 = 0 ;
    836    
    837    x4 = ((x1 + x2)*fImPartDielectricConst[i] + x6)/hbarc ;
    838    //   if( x4 < 0.0 ) x4 = 0.0 ;
     928          fImPartDielectricConst[i]*fImPartDielectricConst[i]);
     929
     930     x7 = atan2(fImPartDielectricConst[i],x3);
     931     x6 = x5 * x7;
     932   }
     933    // if(fImPartDielectricConst[i] == 0) x6 = 0;
     934   
     935   x4 = ((x1 + x2)*fImPartDielectricConst[i] + x6)/hbarc;
     936   //   if( x4 < 0.0 ) x4 = 0.0;
    839937   x8 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
    840         fImPartDielectricConst[i]*fImPartDielectricConst[i] ;
    841 
    842    result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]) ;
    843    if(result < 1.0e-8) result = 1.0e-8 ;
    844    result *= fine_structure_const/be2/pi ;
    845    //   result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr)) ;
    846    //  result *= (1-exp(-be2/betaBohr2)) ;
    847    result *= (1-exp(-be4/betaBohr4)) ;
     938        fImPartDielectricConst[i]*fImPartDielectricConst[i];
     939
     940   result = (x4 + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i]);
     941   if(result < 1.0e-8) result = 1.0e-8;
     942   result *= fine_structure_const/be2/pi;
     943   //   result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr));
     944   //  result *= (1-exp(-be2/betaBohr2));
     945   result *= (1-exp(-be4/betaBohr4));
    848946   if(fDensity >= 0.1)
    849947   {
    850       result /= x8 ;
    851    }
    852    return result ;
     948      result /= x8;
     949   }
     950   return result;
    853951
    854952} // end of DifPAIxSection
     
    861959                                         G4double betaGammaSq  )
    862960{       
    863    G4double cof, logarithm, x3, x5, argument, modul2, dNdxC ;
    864    G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr ;
    865 
    866    cof         = 1.0 ;
    867    cofBetaBohr = 4.0 ;
    868    betaBohr2   = fine_structure_const*fine_structure_const ;
    869    betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr ;
    870 
    871    be2 = betaGammaSq/(1 + betaGammaSq) ;
    872    be4 = be2*be2 ;
    873 
    874    if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq) ; // 0.0 ;
     961   G4double logarithm, x3, x5, argument, modul2, dNdxC;
     962   G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr;
     963
     964   cofBetaBohr = 4.0;
     965   betaBohr2   = fine_structure_const*fine_structure_const;
     966   betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr;
     967
     968   be2 = betaGammaSq/(1 + betaGammaSq);
     969   be4 = be2*be2;
     970
     971   if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq); // 0.0;
    875972   else
    876973   {
    877974     logarithm  = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
    878975                        (1/betaGammaSq - fRePartDielectricConst[i]) +
    879                         fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5 ;
    880      logarithm += log(1+1.0/betaGammaSq) ;
     976                        fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5;
     977     logarithm += log(1+1.0/betaGammaSq);
    881978   }
    882979
    883980   if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 )
    884981   {
    885      argument = 0.0 ;
     982     argument = 0.0;
    886983   }
    887984   else
    888985   {
    889      x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq ;
     986     x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq;
    890987     x5 = -1.0 - fRePartDielectricConst[i] +
    891988          be2*((1.0 +fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) +
    892           fImPartDielectricConst[i]*fImPartDielectricConst[i]) ;
     989          fImPartDielectricConst[i]*fImPartDielectricConst[i]);
    893990     if( x3 == 0.0 ) argument = 0.5*pi;
    894      else            argument = atan2(fImPartDielectricConst[i],x3) ;
    895      argument *= x5  ;
     991     else            argument = atan2(fImPartDielectricConst[i],x3);
     992     argument *= x5 ;
    896993   }   
    897    dNdxC = ( logarithm*fImPartDielectricConst[i] + argument )/hbarc ;
     994   dNdxC = ( logarithm*fImPartDielectricConst[i] + argument )/hbarc;
    898995 
    899    if(dNdxC < 1.0e-8) dNdxC = 1.0e-8 ;
    900 
    901    dNdxC *= fine_structure_const/be2/pi ;
    902 
    903    dNdxC *= (1-exp(-be4/betaBohr4)) ;
     996   if(dNdxC < 1.0e-8) dNdxC = 1.0e-8;
     997
     998   dNdxC *= fine_structure_const/be2/pi;
     999
     1000   dNdxC *= (1-exp(-be4/betaBohr4));
    9041001
    9051002   if(fDensity >= 0.1)
    9061003   {
    9071004      modul2 = (1.0 + fRePartDielectricConst[i])*(1.0 + fRePartDielectricConst[i]) +
    908                     fImPartDielectricConst[i]*fImPartDielectricConst[i] ;
    909       dNdxC /= modul2 ;
    910    }
    911    return dNdxC ;
     1005                    fImPartDielectricConst[i]*fImPartDielectricConst[i];
     1006      dNdxC /= modul2;
     1007   }
     1008   return dNdxC;
    9121009
    9131010} // end of PAIdNdxCerenkov
     1011
     1012//////////////////////////////////////////////////////////////////////////
     1013//
     1014// Calculation od dN/dx of collisions of MM with creation of Cerenkov pseudo-photons
     1015
     1016G4double G4PAIxSection::PAIdNdxMM( G4int    i ,
     1017                                         G4double betaGammaSq  )
     1018{       
     1019   G4double logarithm, x3, x5, argument, dNdxC;
     1020   G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr;
     1021
     1022   cofBetaBohr = 4.0;
     1023   betaBohr2   = fine_structure_const*fine_structure_const;
     1024   betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr;
     1025
     1026   be2 = betaGammaSq/(1 + betaGammaSq);
     1027   be4 = be2*be2;
     1028
     1029   if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq); // 0.0;
     1030   else
     1031   {
     1032     logarithm  = -log( (1/betaGammaSq - fRePartDielectricConst[i])*
     1033                        (1/betaGammaSq - fRePartDielectricConst[i]) +
     1034                        fImPartDielectricConst[i]*fImPartDielectricConst[i] )*0.5;
     1035     logarithm += log(1+1.0/betaGammaSq);
     1036   }
     1037
     1038   if( fImPartDielectricConst[i] == 0.0 || betaGammaSq < 0.01 )
     1039   {
     1040     argument = 0.0;
     1041   }
     1042   else
     1043   {
     1044     x3 = -fRePartDielectricConst[i] + 1.0/betaGammaSq;
     1045     x5 = be2*( 1.0 + fRePartDielectricConst[i] ) - 1.0;
     1046     if( x3 == 0.0 ) argument = 0.5*pi;
     1047     else            argument = atan2(fImPartDielectricConst[i],x3);
     1048     argument *= x5 ;
     1049   }   
     1050   dNdxC = ( logarithm*fImPartDielectricConst[i]*be2 + argument )/hbarc;
     1051 
     1052   if(dNdxC < 1.0e-8) dNdxC = 1.0e-8;
     1053
     1054   dNdxC *= fine_structure_const/be2/pi;
     1055
     1056   dNdxC *= (1-exp(-be4/betaBohr4));
     1057   return dNdxC;
     1058
     1059} // end of PAIdNdxMM
    9141060
    9151061//////////////////////////////////////////////////////////////////////////
     
    9211067                                        G4double betaGammaSq  )
    9221068{       
    923    G4double cof, resonance, modul2, dNdxP ;
    924    G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr ;
    925 
    926    cof = 1 ;
    927    cofBetaBohr = 4.0 ;
    928    betaBohr2   = fine_structure_const*fine_structure_const ;
    929    betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr ;
    930 
    931    be2 = betaGammaSq/(1 + betaGammaSq) ;
    932    be4 = be2*be2 ;
     1069   G4double resonance, modul2, dNdxP, cof = 1.;
     1070   G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr;
     1071
     1072 
     1073   cofBetaBohr = 4.0;
     1074   betaBohr2   = fine_structure_const*fine_structure_const;
     1075   betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr;
     1076
     1077   be2 = betaGammaSq/(1 + betaGammaSq);
     1078   be4 = be2*be2;
    9331079 
    934    resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i]) 
    935    resonance *= fImPartDielectricConst[i]/hbarc ;
    936 
    937 
    938    dNdxP = ( resonance + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i] ) ;
    939 
    940    if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8 ;
    941 
    942    dNdxP *= fine_structure_const/be2/pi ;
    943    dNdxP *= (1-exp(-be4/betaBohr4)) ;
     1080   resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i])
     1081   resonance *= fImPartDielectricConst[i]/hbarc;
     1082
     1083
     1084   dNdxP = ( resonance + cof*fIntegralTerm[i]/fSplineEnergy[i]/fSplineEnergy[i] );
     1085
     1086   if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8;
     1087
     1088   dNdxP *= fine_structure_const/be2/pi;
     1089   dNdxP *= (1-exp(-be4/betaBohr4));
    9441090
    9451091   if( fDensity >= 0.1 )
    9461092   {
    9471093     modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
    948         fImPartDielectricConst[i]*fImPartDielectricConst[i] ;
    949      dNdxP /= modul2 ;
    950    }
    951    return dNdxP ;
     1094        fImPartDielectricConst[i]*fImPartDielectricConst[i];
     1095     dNdxP /= modul2;
     1096   }
     1097   return dNdxP;
    9521098
    9531099} // end of PAIdNdxPlasmon
     1100
     1101//////////////////////////////////////////////////////////////////////////
     1102//
     1103// Calculation od dN/dx of collisions with creation of longitudinal EM
     1104// resonance excitations (plasmons, delta-electrons)
     1105
     1106G4double G4PAIxSection::PAIdNdxResonance( G4int    i ,
     1107                                        G4double betaGammaSq  )
     1108{       
     1109   G4double resonance, modul2, dNdxP;
     1110   G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr;
     1111
     1112   cofBetaBohr = 4.0;
     1113   betaBohr2   = fine_structure_const*fine_structure_const;
     1114   betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr;
     1115
     1116   be2 = betaGammaSq/(1 + betaGammaSq);
     1117   be4 = be2*be2;
     1118 
     1119   resonance = log(2*electron_mass_c2*be2/fSplineEnergy[i]); 
     1120   resonance *= fImPartDielectricConst[i]/hbarc;
     1121
     1122
     1123   dNdxP = resonance;
     1124
     1125   if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8;
     1126
     1127   dNdxP *= fine_structure_const/be2/pi;
     1128   dNdxP *= (1-exp(-be4/betaBohr4));
     1129
     1130   if( fDensity >= 0.1 )
     1131   {
     1132     modul2 = (1 + fRePartDielectricConst[i])*(1 + fRePartDielectricConst[i]) +
     1133        fImPartDielectricConst[i]*fImPartDielectricConst[i];
     1134     dNdxP /= modul2;
     1135   }
     1136   return dNdxP;
     1137
     1138} // end of PAIdNdxResonance
    9541139
    9551140////////////////////////////////////////////////////////////////////////
     
    9611146void G4PAIxSection::IntegralPAIxSection()
    9621147{
    963   fIntegralPAIxSection[fSplineNumber] = 0 ;
    964   fIntegralPAIdEdx[fSplineNumber]     = 0 ;
    965   fIntegralPAIxSection[0]             = 0 ;
    966   G4int k = fIntervalNumber -1 ;
    967 
    968   for(G4int i = fSplineNumber-1 ; i >= 1 ; i--)
     1148  fIntegralPAIxSection[fSplineNumber] = 0;
     1149  fIntegralPAIdEdx[fSplineNumber]     = 0;
     1150  fIntegralPAIxSection[0]             = 0;
     1151  G4int k = fIntervalNumber -1;
     1152
     1153  for(G4int i = fSplineNumber-1; i >= 1; i--)
    9691154  {
    9701155    if(fSplineEnergy[i] >= fEnergyInterval[k])
    9711156    {
    972       fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + SumOverInterval(i) ;
    973       fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + SumOverIntervaldEdx(i) ;
     1157      fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] + SumOverInterval(i);
     1158      fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] + SumOverIntervaldEdx(i);
    9741159    }
    9751160    else
    9761161    {
    9771162      fIntegralPAIxSection[i] = fIntegralPAIxSection[i+1] +
    978                                    SumOverBorder(i+1,fEnergyInterval[k]) ;
     1163                                   SumOverBorder(i+1,fEnergyInterval[k]);
    9791164      fIntegralPAIdEdx[i] = fIntegralPAIdEdx[i+1] +
    980                                    SumOverBorderdEdx(i+1,fEnergyInterval[k]) ;
    981       k-- ;
     1165                                   SumOverBorderdEdx(i+1,fEnergyInterval[k]);
     1166      k--;
    9821167    }
    9831168  }
     
    9921177void G4PAIxSection::IntegralCerenkov()
    9931178{
    994   G4int i, k ;
    995    fIntegralCerenkov[fSplineNumber] = 0 ;
    996    fIntegralCerenkov[0] = 0 ;
    997    k = fIntervalNumber -1 ;
    998 
    999    for( i = fSplineNumber-1 ; i >= 1 ; i-- )
     1179  G4int i, k;
     1180   fIntegralCerenkov[fSplineNumber] = 0;
     1181   fIntegralCerenkov[0] = 0;
     1182   k = fIntervalNumber -1;
     1183
     1184   for( i = fSplineNumber-1; i >= 1; i-- )
    10001185   {
    10011186      if(fSplineEnergy[i] >= fEnergyInterval[k])
    10021187      {
    1003         fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + SumOverInterCerenkov(i) ;
     1188        fIntegralCerenkov[i] = fIntegralCerenkov[i+1] + SumOverInterCerenkov(i);
    10041189        // G4cout<<"int: i = "<<i<<"; sumC = "<<fIntegralCerenkov[i]<<G4endl;
    10051190      }
     
    10071192      {
    10081193        fIntegralCerenkov[i] = fIntegralCerenkov[i+1] +
    1009                                    SumOverBordCerenkov(i+1,fEnergyInterval[k]) ;
    1010         k-- ;
     1194                                   SumOverBordCerenkov(i+1,fEnergyInterval[k]);
     1195        k--;
    10111196        // G4cout<<"bord: i = "<<i<<"; sumC = "<<fIntegralCerenkov[i]<<G4endl;
    10121197      }
     
    10141199
    10151200}   // end of IntegralCerenkov
     1201
     1202////////////////////////////////////////////////////////////////////////
     1203//
     1204// Calculation of the PAI MM-Cerenkov integral cross-section
     1205// fIntegralMM[1] = specific MM-Cerenkov ionisation, 1/cm
     1206// and fIntegralMM[0] = mean MM-Cerenkov loss per cm  in keV/cm
     1207
     1208void G4PAIxSection::IntegralMM()
     1209{
     1210  G4int i, k;
     1211   fIntegralMM[fSplineNumber] = 0;
     1212   fIntegralMM[0] = 0;
     1213   k = fIntervalNumber -1;
     1214
     1215   for( i = fSplineNumber-1; i >= 1; i-- )
     1216   {
     1217      if(fSplineEnergy[i] >= fEnergyInterval[k])
     1218      {
     1219        fIntegralMM[i] = fIntegralMM[i+1] + SumOverInterMM(i);
     1220        // G4cout<<"int: i = "<<i<<"; sumC = "<<fIntegralMM[i]<<G4endl;
     1221      }
     1222      else
     1223      {
     1224        fIntegralMM[i] = fIntegralMM[i+1] +
     1225                                   SumOverBordMM(i+1,fEnergyInterval[k]);
     1226        k--;
     1227        // G4cout<<"bord: i = "<<i<<"; sumC = "<<fIntegralMM[i]<<G4endl;
     1228      }
     1229   }
     1230
     1231}   // end of IntegralMM
    10161232
    10171233////////////////////////////////////////////////////////////////////////
     
    10231239void G4PAIxSection::IntegralPlasmon()
    10241240{
    1025    fIntegralPlasmon[fSplineNumber] = 0 ;
    1026    fIntegralPlasmon[0] = 0 ;
    1027    G4int k = fIntervalNumber -1 ;
     1241   fIntegralPlasmon[fSplineNumber] = 0;
     1242   fIntegralPlasmon[0] = 0;
     1243   G4int k = fIntervalNumber -1;
    10281244   for(G4int i=fSplineNumber-1;i>=1;i--)
    10291245   {
    10301246      if(fSplineEnergy[i] >= fEnergyInterval[k])
    10311247      {
    1032         fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + SumOverInterPlasmon(i) ;
     1248        fIntegralPlasmon[i] = fIntegralPlasmon[i+1] + SumOverInterPlasmon(i);
    10331249      }
    10341250      else
    10351251      {
    10361252        fIntegralPlasmon[i] = fIntegralPlasmon[i+1] +
    1037                                    SumOverBordPlasmon(i+1,fEnergyInterval[k]) ;
    1038         k-- ;
     1253                                   SumOverBordPlasmon(i+1,fEnergyInterval[k]);
     1254        k--;
    10391255      }
    10401256   }
    10411257
    10421258}   // end of IntegralPlasmon
     1259
     1260////////////////////////////////////////////////////////////////////////
     1261//
     1262// Calculation of the PAI resonance integral cross-section
     1263// fIntegralResonance[1] = resonance primary ionisation, 1/cm
     1264// and fIntegralResonance[0] = mean resonance loss per cm  in keV/cm
     1265
     1266void G4PAIxSection::IntegralResonance()
     1267{
     1268   fIntegralResonance[fSplineNumber] = 0;
     1269   fIntegralResonance[0] = 0;
     1270   G4int k = fIntervalNumber -1;
     1271   for(G4int i=fSplineNumber-1;i>=1;i--)
     1272   {
     1273      if(fSplineEnergy[i] >= fEnergyInterval[k])
     1274      {
     1275        fIntegralResonance[i] = fIntegralResonance[i+1] + SumOverInterResonance(i);
     1276      }
     1277      else
     1278      {
     1279        fIntegralResonance[i] = fIntegralResonance[i+1] +
     1280                                   SumOverBordResonance(i+1,fEnergyInterval[k]);
     1281        k--;
     1282      }
     1283   }
     1284
     1285}   // end of IntegralResonance
    10431286
    10441287//////////////////////////////////////////////////////////////////////
     
    10501293G4double G4PAIxSection::SumOverInterval( G4int i )
    10511294{         
    1052    G4double x0,x1,y0,yy1,a,b,c,result ;
    1053 
    1054    x0 = fSplineEnergy[i] ;
    1055    x1 = fSplineEnergy[i+1] ;
    1056    y0 = fDifPAIxSection[i] ;
     1295   G4double x0,x1,y0,yy1,a,b,c,result;
     1296
     1297   x0 = fSplineEnergy[i];
     1298   x1 = fSplineEnergy[i+1];
     1299   y0 = fDifPAIxSection[i];
    10571300   yy1 = fDifPAIxSection[i+1];
    10581301   c = x1/x0;
    1059    a = log10(yy1/y0)/log10(c) ;
    1060    // b = log10(y0) - a*log10(x0) ;
    1061    b = y0/pow(x0,a) ;
    1062    a += 1 ;
     1302   a = log10(yy1/y0)/log10(c);
     1303   // b = log10(y0) - a*log10(x0);
     1304   b = y0/pow(x0,a);
     1305   a += 1;
    10631306   if(a == 0)
    10641307   {
    1065       result = b*log(x1/x0) ;
     1308      result = b*log(x1/x0);
    10661309   }
    10671310   else
    10681311   {
    1069       result = y0*(x1*pow(c,a-1) - x0)/a ;
     1312      result = y0*(x1*pow(c,a-1) - x0)/a;
    10701313   }
    10711314   a++;
    10721315   if(a == 0)
    10731316   {
    1074       fIntegralPAIxSection[0] += b*log(x1/x0) ;
     1317      fIntegralPAIxSection[0] += b*log(x1/x0);
    10751318   }
    10761319   else
    10771320   {
    1078       fIntegralPAIxSection[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;
    1079    }
    1080    return result ;
     1321      fIntegralPAIxSection[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
     1322   }
     1323   return result;
    10811324
    10821325} //  end of SumOverInterval
     
    10861329G4double G4PAIxSection::SumOverIntervaldEdx( G4int i )
    10871330{         
    1088    G4double x0,x1,y0,yy1,a,b,c,result ;
    1089 
    1090    x0 = fSplineEnergy[i] ;
    1091    x1 = fSplineEnergy[i+1] ;
    1092    y0 = fDifPAIxSection[i] ;
     1331   G4double x0,x1,y0,yy1,a,b,c,result;
     1332
     1333   x0 = fSplineEnergy[i];
     1334   x1 = fSplineEnergy[i+1];
     1335   y0 = fDifPAIxSection[i];
    10931336   yy1 = fDifPAIxSection[i+1];
    10941337   c = x1/x0;
    1095    a = log10(yy1/y0)/log10(c) ;
    1096    // b = log10(y0) - a*log10(x0) ;
    1097    b = y0/pow(x0,a) ;
    1098    a += 2 ;
     1338   a = log10(yy1/y0)/log10(c);
     1339   // b = log10(y0) - a*log10(x0);
     1340   b = y0/pow(x0,a);
     1341   a += 2;
    10991342   if(a == 0)
    11001343   {
    1101      result = b*log(x1/x0) ;
     1344     result = b*log(x1/x0);
    11021345   }
    11031346   else
    11041347   {
    1105      result = y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;
    1106    }
    1107    return result ;
     1348     result = y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
     1349   }
     1350   return result;
    11081351
    11091352} //  end of SumOverInterval
     
    11171360G4double G4PAIxSection::SumOverInterCerenkov( G4int i )
    11181361{         
    1119    G4double x0,x1,y0,yy1,a,b,c,result ;
    1120 
    1121    x0  = fSplineEnergy[i] ;
    1122    x1  = fSplineEnergy[i+1] ;
    1123    y0  = fdNdxCerenkov[i] ;
     1362   G4double x0,x1,y0,yy1,a,b,c,result;
     1363
     1364   x0  = fSplineEnergy[i];
     1365   x1  = fSplineEnergy[i+1];
     1366   y0  = fdNdxCerenkov[i];
    11241367   yy1 = fdNdxCerenkov[i+1];
    11251368   // G4cout<<"SumC, i = "<<i<<"; x0 ="<<x0<<"; x1 = "<<x1
     
    11271370
    11281371   c = x1/x0;
    1129    a = log10(yy1/y0)/log10(c) ;
    1130    b = y0/pow(x0,a) ;
    1131 
    1132    a += 1.0 ;
    1133    if(a == 0) result = b*log(c) ;
    1134    else       result = y0*(x1*pow(c,a-1) - x0)/a ;   
    1135    a += 1.0 ;
    1136 
    1137    if( a == 0 ) fIntegralCerenkov[0] += b*log(x1/x0) ;
    1138    else         fIntegralCerenkov[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;
     1372   a = log10(yy1/y0)/log10(c);
     1373   b = y0/pow(x0,a);
     1374
     1375   a += 1.0;
     1376   if(a == 0) result = b*log(c);
     1377   else       result = y0*(x1*pow(c,a-1) - x0)/a;   
     1378   a += 1.0;
     1379
     1380   if( a == 0 ) fIntegralCerenkov[0] += b*log(x1/x0);
     1381   else         fIntegralCerenkov[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
    11391382   //  G4cout<<"a = "<<a<<"; b = "<<b<<"; result = "<<result<<G4endl;   
    1140    return result ;
     1383   return result;
    11411384
    11421385} //  end of SumOverInterCerenkov
     1386
     1387//////////////////////////////////////////////////////////////////////
     1388//
     1389// Calculation the PAI MM-Cerenkov integral cross-section inside
     1390// of interval of continuous values of photo-ionisation Cerenkov
     1391// cross-section. Parameter  'i' is the number of interval.
     1392
     1393G4double G4PAIxSection::SumOverInterMM( G4int i )
     1394{         
     1395   G4double x0,x1,y0,yy1,a,b,c,result;
     1396
     1397   x0  = fSplineEnergy[i];
     1398   x1  = fSplineEnergy[i+1];
     1399   y0  = fdNdxMM[i];
     1400   yy1 = fdNdxMM[i+1];
     1401   // G4cout<<"SumC, i = "<<i<<"; x0 ="<<x0<<"; x1 = "<<x1
     1402   //   <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl;
     1403
     1404   c = x1/x0;
     1405   a = log10(yy1/y0)/log10(c);
     1406   b = y0/pow(x0,a);
     1407
     1408   a += 1.0;
     1409   if(a == 0) result = b*log(c);
     1410   else       result = y0*(x1*pow(c,a-1) - x0)/a;   
     1411   a += 1.0;
     1412
     1413   if( a == 0 ) fIntegralMM[0] += b*log(x1/x0);
     1414   else         fIntegralMM[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
     1415   //  G4cout<<"a = "<<a<<"; b = "<<b<<"; result = "<<result<<G4endl;   
     1416   return result;
     1417
     1418} //  end of SumOverInterMM
    11431419
    11441420//////////////////////////////////////////////////////////////////////
     
    11501426G4double G4PAIxSection::SumOverInterPlasmon( G4int i )
    11511427{         
    1152    G4double x0,x1,y0,yy1,a,b,c,result ;
    1153 
    1154    x0  = fSplineEnergy[i] ;
    1155    x1  = fSplineEnergy[i+1] ;
    1156    y0  = fdNdxPlasmon[i] ;
     1428   G4double x0,x1,y0,yy1,a,b,c,result;
     1429
     1430   x0  = fSplineEnergy[i];
     1431   x1  = fSplineEnergy[i+1];
     1432   y0  = fdNdxPlasmon[i];
    11571433   yy1 = fdNdxPlasmon[i+1];
    11581434   c =x1/x0;
    1159    a = log10(yy1/y0)/log10(c) ;
    1160    // b = log10(y0) - a*log10(x0) ;
    1161    b = y0/pow(x0,a) ;
    1162 
    1163    a += 1.0 ;
    1164    if(a == 0) result = b*log(x1/x0) ;
    1165    else       result = y0*(x1*pow(c,a-1) - x0)/a ;   
    1166    a += 1.0 ;
    1167 
    1168    if( a == 0 ) fIntegralPlasmon[0] += b*log(x1/x0) ;
    1169    else         fIntegralPlasmon[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a ;
    1170    
    1171    return result ;
     1435   a = log10(yy1/y0)/log10(c);
     1436   // b = log10(y0) - a*log10(x0);
     1437   b = y0/pow(x0,a);
     1438
     1439   a += 1.0;
     1440   if(a == 0) result = b*log(x1/x0);
     1441   else       result = y0*(x1*pow(c,a-1) - x0)/a;   
     1442   a += 1.0;
     1443
     1444   if( a == 0 ) fIntegralPlasmon[0] += b*log(x1/x0);
     1445   else         fIntegralPlasmon[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
     1446   
     1447   return result;
    11721448
    11731449} //  end of SumOverInterPlasmon
     1450
     1451//////////////////////////////////////////////////////////////////////
     1452//
     1453// Calculation the PAI resonance integral cross-section inside
     1454// of interval of continuous values of photo-ionisation resonance
     1455// cross-section. Parameter  'i' is the number of interval.
     1456
     1457G4double G4PAIxSection::SumOverInterResonance( G4int i )
     1458{         
     1459   G4double x0,x1,y0,yy1,a,b,c,result;
     1460
     1461   x0  = fSplineEnergy[i];
     1462   x1  = fSplineEnergy[i+1];
     1463   y0  = fdNdxResonance[i];
     1464   yy1 = fdNdxResonance[i+1];
     1465   c =x1/x0;
     1466   a = log10(yy1/y0)/log10(c);
     1467   // b = log10(y0) - a*log10(x0);
     1468   b = y0/pow(x0,a);
     1469
     1470   a += 1.0;
     1471   if(a == 0) result = b*log(x1/x0);
     1472   else       result = y0*(x1*pow(c,a-1) - x0)/a;   
     1473   a += 1.0;
     1474
     1475   if( a == 0 ) fIntegralResonance[0] += b*log(x1/x0);
     1476   else         fIntegralResonance[0] += y0*(x1*x1*pow(c,a-2) - x0*x0)/a;
     1477   
     1478   return result;
     1479
     1480} //  end of SumOverInterResonance
    11741481
    11751482///////////////////////////////////////////////////////////////////////////////
     
    11811488                                       G4double en0    )
    11821489{               
    1183    G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;
    1184 
    1185    e0 = en0 ;
    1186    x0 = fSplineEnergy[i] ;
    1187    x1 = fSplineEnergy[i+1] ;
    1188    y0 = fDifPAIxSection[i] ;
    1189    yy1 = fDifPAIxSection[i+1] ;
     1490   G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
     1491
     1492   e0 = en0;
     1493   x0 = fSplineEnergy[i];
     1494   x1 = fSplineEnergy[i+1];
     1495   y0 = fDifPAIxSection[i];
     1496   yy1 = fDifPAIxSection[i+1];
    11901497
    11911498   c = x1/x0;
    11921499   d = e0/x0;   
    1193    a = log10(yy1/y0)/log10(x1/x0) ;
    1194    // b0 = log10(y0) - a*log10(x0) ;
    1195    b = y0/pow(x0,a);  // pow(10.,b) ;
    1196    
    1197    a += 1 ;
     1500   a = log10(yy1/y0)/log10(x1/x0);
     1501   // b0 = log10(y0) - a*log10(x0);
     1502   b = y0/pow(x0,a);  // pow(10.,b);
     1503   
     1504   a += 1;
    11981505   if(a == 0)
    11991506   {
    1200       result = b*log(x0/e0) ;
     1507      result = b*log(x0/e0);
    12011508   }
    12021509   else
    12031510   {
    1204       result = y0*(x0 - e0*pow(d,a-1))/a ;
    1205    }
    1206    a++ ;
     1511      result = y0*(x0 - e0*pow(d,a-1))/a;
     1512   }
     1513   a++;
    12071514   if(a == 0)
    12081515   {
    1209       fIntegralPAIxSection[0] += b*log(x0/e0) ;
     1516      fIntegralPAIxSection[0] += b*log(x0/e0);
    12101517   }
    12111518   else
    12121519   {
    1213       fIntegralPAIxSection[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;
    1214    }
    1215    x0 = fSplineEnergy[i - 1] ;
    1216    x1 = fSplineEnergy[i - 2] ;
    1217    y0 = fDifPAIxSection[i - 1] ;
    1218    yy1 = fDifPAIxSection[i - 2] ;
     1520      fIntegralPAIxSection[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
     1521   }
     1522   x0 = fSplineEnergy[i - 1];
     1523   x1 = fSplineEnergy[i - 2];
     1524   y0 = fDifPAIxSection[i - 1];
     1525   yy1 = fDifPAIxSection[i - 2];
    12191526
    12201527   c = x1/x0;
    12211528   d = e0/x0;   
    1222    a = log10(yy1/y0)/log10(x1/x0) ;
    1223    //  b0 = log10(y0) - a*log10(x0) ;
    1224    b = y0/pow(x0,a) ;
    1225    a += 1 ;
     1529   a = log10(yy1/y0)/log10(x1/x0);
     1530   //  b0 = log10(y0) - a*log10(x0);
     1531   b = y0/pow(x0,a);
     1532   a += 1;
    12261533   if(a == 0)
    12271534   {
    1228       result += b*log(e0/x0) ;
     1535      result += b*log(e0/x0);
    12291536   }
    12301537   else
    12311538   {
    1232       result += y0*(e0*pow(d,a-1) - x0)/a ;
    1233    }
    1234    a++ ;
     1539      result += y0*(e0*pow(d,a-1) - x0)/a;
     1540   }
     1541   a++;
    12351542   if(a == 0)
    12361543   {
    1237       fIntegralPAIxSection[0] += b*log(e0/x0) ;
     1544      fIntegralPAIxSection[0] += b*log(e0/x0);
    12381545   }
    12391546   else
    12401547   {
    1241       fIntegralPAIxSection[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;
    1242    }
    1243    return result ;
     1548      fIntegralPAIxSection[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
     1549   }
     1550   return result;
    12441551
    12451552}
     
    12501557                                       G4double en0    )
    12511558{               
    1252    G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;
    1253 
    1254    e0 = en0 ;
    1255    x0 = fSplineEnergy[i] ;
    1256    x1 = fSplineEnergy[i+1] ;
    1257    y0 = fDifPAIxSection[i] ;
    1258    yy1 = fDifPAIxSection[i+1] ;
     1559   G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
     1560
     1561   e0 = en0;
     1562   x0 = fSplineEnergy[i];
     1563   x1 = fSplineEnergy[i+1];
     1564   y0 = fDifPAIxSection[i];
     1565   yy1 = fDifPAIxSection[i+1];
    12591566
    12601567   c = x1/x0;
    12611568   d = e0/x0;   
    1262    a = log10(yy1/y0)/log10(x1/x0) ;
    1263    // b0 = log10(y0) - a*log10(x0) ;
    1264    b = y0/pow(x0,a);  // pow(10.,b) ;
    1265    
    1266    a += 2 ;
     1569   a = log10(yy1/y0)/log10(x1/x0);
     1570   // b0 = log10(y0) - a*log10(x0);
     1571   b = y0/pow(x0,a);  // pow(10.,b);
     1572   
     1573   a += 2;
    12671574   if(a == 0)
    12681575   {
    1269       result = b*log(x0/e0) ;
     1576      result = b*log(x0/e0);
    12701577   }
    12711578   else
    12721579   {
    1273       result = y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;
    1274    }
    1275    x0 = fSplineEnergy[i - 1] ;
    1276    x1 = fSplineEnergy[i - 2] ;
    1277    y0 = fDifPAIxSection[i - 1] ;
    1278    yy1 = fDifPAIxSection[i - 2] ;
     1580      result = y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
     1581   }
     1582   x0 = fSplineEnergy[i - 1];
     1583   x1 = fSplineEnergy[i - 2];
     1584   y0 = fDifPAIxSection[i - 1];
     1585   yy1 = fDifPAIxSection[i - 2];
    12791586
    12801587   c = x1/x0;
    12811588   d = e0/x0;   
    1282    a = log10(yy1/y0)/log10(x1/x0) ;
    1283    //  b0 = log10(y0) - a*log10(x0) ;
    1284    b = y0/pow(x0,a) ;
    1285    a += 2 ;
     1589   a = log10(yy1/y0)/log10(x1/x0);
     1590   //  b0 = log10(y0) - a*log10(x0);
     1591   b = y0/pow(x0,a);
     1592   a += 2;
    12861593   if(a == 0)
    12871594   {
    1288       result += b*log(e0/x0) ;
     1595      result += b*log(e0/x0);
    12891596   }
    12901597   else
    12911598   {
    1292       result += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;
    1293    }
    1294    return result ;
     1599      result += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
     1600   }
     1601   return result;
    12951602
    12961603}
     
    13041611                                             G4double en0    )
    13051612{               
    1306    G4double x0,x1,y0,yy1,a,b,e0,c,d,result ;
    1307 
    1308    e0 = en0 ;
    1309    x0 = fSplineEnergy[i] ;
    1310    x1 = fSplineEnergy[i+1] ;
    1311    y0 = fdNdxCerenkov[i] ;
    1312    yy1 = fdNdxCerenkov[i+1] ;
     1613   G4double x0,x1,y0,yy1,a,b,e0,c,d,result;
     1614
     1615   e0 = en0;
     1616   x0 = fSplineEnergy[i];
     1617   x1 = fSplineEnergy[i+1];
     1618   y0 = fdNdxCerenkov[i];
     1619   yy1 = fdNdxCerenkov[i+1];
    13131620
    13141621   //  G4cout<<G4endl;
    13151622   //  G4cout<<"SumBordC, i = "<<i<<"; en0 = "<<en0<<"; x0 ="<<x0<<"; x1 = "<<x1
    13161623   //     <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl;
    1317    c = x1/x0 ;
    1318    d = e0/x0 ;
    1319    a = log10(yy1/y0)/log10(c) ;
    1320    // b0 = log10(y0) - a*log10(x0) ;
    1321    b = y0/pow(x0,a); // pow(10.,b0) ;   
    1322    
    1323    a += 1.0 ;
    1324    if( a == 0 ) result = b*log(x0/e0) ;
    1325    else         result = y0*(x0 - e0*pow(d,a-1))/a ;   
    1326    a += 1.0 ;
    1327 
    1328    if( a == 0 ) fIntegralCerenkov[0] += b*log(x0/e0) ;
    1329    else         fIntegralCerenkov[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;
     1624   c = x1/x0;
     1625   d = e0/x0;
     1626   a = log10(yy1/y0)/log10(c);
     1627   // b0 = log10(y0) - a*log10(x0);
     1628   b = y0/pow(x0,a); // pow(10.,b0);   
     1629   
     1630   a += 1.0;
     1631   if( a == 0 ) result = b*log(x0/e0);
     1632   else         result = y0*(x0 - e0*pow(d,a-1))/a;   
     1633   a += 1.0;
     1634
     1635   if( a == 0 ) fIntegralCerenkov[0] += b*log(x0/e0);
     1636   else         fIntegralCerenkov[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
    13301637
    13311638// G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "<<b<<"; result = "<<result<<G4endl;
    13321639   
    1333    x0  = fSplineEnergy[i - 1] ;
    1334    x1  = fSplineEnergy[i - 2] ;
    1335    y0  = fdNdxCerenkov[i - 1] ;
    1336    yy1 = fdNdxCerenkov[i - 2] ;
     1640   x0  = fSplineEnergy[i - 1];
     1641   x1  = fSplineEnergy[i - 2];
     1642   y0  = fdNdxCerenkov[i - 1];
     1643   yy1 = fdNdxCerenkov[i - 2];
    13371644
    13381645   // G4cout<<"x0 ="<<x0<<"; x1 = "<<x1
    13391646   //    <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl;
    13401647
    1341    c = x1/x0 ;
    1342    d = e0/x0 ;
    1343    a  = log10(yy1/y0)/log10(x1/x0) ;
    1344    // b0 = log10(y0) - a*log10(x0) ;
    1345    b  =  y0/pow(x0,a);  // pow(10.,b0) ;
    1346 
    1347    a += 1.0 ;
    1348    if( a == 0 ) result += b*log(e0/x0) ;
    1349    else         result += y0*(e0*pow(d,a-1) - x0 )/a ;
    1350    a += 1.0 ;
    1351 
    1352    if( a == 0 )   fIntegralCerenkov[0] += b*log(e0/x0) ;
    1353    else           fIntegralCerenkov[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;
     1648   c = x1/x0;
     1649   d = e0/x0;
     1650   a  = log10(yy1/y0)/log10(x1/x0);
     1651   // b0 = log10(y0) - a*log10(x0);
     1652   b  =  y0/pow(x0,a);  // pow(10.,b0);
     1653
     1654   a += 1.0;
     1655   if( a == 0 ) result += b*log(e0/x0);
     1656   else         result += y0*(e0*pow(d,a-1) - x0 )/a;
     1657   a += 1.0;
     1658
     1659   if( a == 0 )   fIntegralCerenkov[0] += b*log(e0/x0);
     1660   else           fIntegralCerenkov[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
    13541661
    13551662   // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "
    13561663   // <<b<<"; result = "<<result<<G4endl;   
    13571664
    1358    return result ;
     1665   return result;
     1666
     1667}
     1668
     1669///////////////////////////////////////////////////////////////////////////////
     1670//
     1671// Integration of MM-Cerenkov cross-section for the case of
     1672// passing across border between intervals
     1673
     1674G4double G4PAIxSection::SumOverBordMM( G4int      i ,
     1675                                             G4double en0    )
     1676{               
     1677   G4double x0,x1,y0,yy1,a,b,e0,c,d,result;
     1678
     1679   e0 = en0;
     1680   x0 = fSplineEnergy[i];
     1681   x1 = fSplineEnergy[i+1];
     1682   y0 = fdNdxMM[i];
     1683   yy1 = fdNdxMM[i+1];
     1684
     1685   //  G4cout<<G4endl;
     1686   //  G4cout<<"SumBordC, i = "<<i<<"; en0 = "<<en0<<"; x0 ="<<x0<<"; x1 = "<<x1
     1687   //     <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl;
     1688   c = x1/x0;
     1689   d = e0/x0;
     1690   a = log10(yy1/y0)/log10(c);
     1691   // b0 = log10(y0) - a*log10(x0);
     1692   b = y0/pow(x0,a); // pow(10.,b0);   
     1693   
     1694   a += 1.0;
     1695   if( a == 0 ) result = b*log(x0/e0);
     1696   else         result = y0*(x0 - e0*pow(d,a-1))/a;   
     1697   a += 1.0;
     1698
     1699   if( a == 0 ) fIntegralMM[0] += b*log(x0/e0);
     1700   else         fIntegralMM[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
     1701
     1702// G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "<<b<<"; result = "<<result<<G4endl;
     1703   
     1704   x0  = fSplineEnergy[i - 1];
     1705   x1  = fSplineEnergy[i - 2];
     1706   y0  = fdNdxMM[i - 1];
     1707   yy1 = fdNdxMM[i - 2];
     1708
     1709   // G4cout<<"x0 ="<<x0<<"; x1 = "<<x1
     1710   //    <<"; y0 = "<<y0<<"; yy1 = "<<yy1<<G4endl;
     1711
     1712   c = x1/x0;
     1713   d = e0/x0;
     1714   a  = log10(yy1/y0)/log10(x1/x0);
     1715   // b0 = log10(y0) - a*log10(x0);
     1716   b  =  y0/pow(x0,a);  // pow(10.,b0);
     1717
     1718   a += 1.0;
     1719   if( a == 0 ) result += b*log(e0/x0);
     1720   else         result += y0*(e0*pow(d,a-1) - x0 )/a;
     1721   a += 1.0;
     1722
     1723   if( a == 0 )   fIntegralMM[0] += b*log(e0/x0);
     1724   else           fIntegralMM[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
     1725
     1726   // G4cout<<"a = "<<a<<"; b0 = "<<b0<<"; b = "
     1727   // <<b<<"; result = "<<result<<G4endl;   
     1728
     1729   return result;
    13591730
    13601731}
     
    13681739                                             G4double en0    )
    13691740{               
    1370    G4double x0,x1,y0,yy1,a,b,c,d,e0,result ;
    1371 
    1372    e0 = en0 ;
    1373    x0 = fSplineEnergy[i] ;
    1374    x1 = fSplineEnergy[i+1] ;
    1375    y0 = fdNdxPlasmon[i] ;
    1376    yy1 = fdNdxPlasmon[i+1] ;
    1377 
    1378    c = x1/x0 ;
    1379    d = e0/x0 ;   
    1380    a = log10(yy1/y0)/log10(c) ;
    1381    //  b0 = log10(y0) - a*log10(x0) ;
    1382    b = y0/pow(x0,a); //pow(10.,b) ;
    1383    
    1384    a += 1.0 ;
    1385    if( a == 0 ) result = b*log(x0/e0) ;
    1386    else         result = y0*(x0 - e0*pow(d,a-1))/a ;   
    1387    a += 1.0 ;
    1388 
    1389    if( a == 0 ) fIntegralPlasmon[0] += b*log(x0/e0) ;
    1390    else         fIntegralPlasmon[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a ;
    1391    
    1392    x0 = fSplineEnergy[i - 1] ;
    1393    x1 = fSplineEnergy[i - 2] ;
    1394    y0 = fdNdxPlasmon[i - 1] ;
    1395    yy1 = fdNdxPlasmon[i - 2] ;
    1396 
    1397    c = x1/x0 ;
    1398    d = e0/x0 ;
    1399    a = log10(yy1/y0)/log10(c) ;
    1400    // b0 = log10(y0) - a*log10(x0) ;
    1401    b = y0/pow(x0,a);// pow(10.,b0) ;
    1402 
    1403    a += 1.0 ;
    1404    if( a == 0 ) result += b*log(e0/x0) ;
    1405    else         result += y0*(e0*pow(d,a-1) - x0)/a ;
    1406    a += 1.0 ;
    1407 
    1408    if( a == 0 )   fIntegralPlasmon[0] += b*log(e0/x0) ;
    1409    else           fIntegralPlasmon[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a ;
    1410    
    1411    return result ;
     1741   G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
     1742
     1743   e0 = en0;
     1744   x0 = fSplineEnergy[i];
     1745   x1 = fSplineEnergy[i+1];
     1746   y0 = fdNdxPlasmon[i];
     1747   yy1 = fdNdxPlasmon[i+1];
     1748
     1749   c = x1/x0;
     1750   d = e0/x0;   
     1751   a = log10(yy1/y0)/log10(c);
     1752   //  b0 = log10(y0) - a*log10(x0);
     1753   b = y0/pow(x0,a); //pow(10.,b);
     1754   
     1755   a += 1.0;
     1756   if( a == 0 ) result = b*log(x0/e0);
     1757   else         result = y0*(x0 - e0*pow(d,a-1))/a;   
     1758   a += 1.0;
     1759
     1760   if( a == 0 ) fIntegralPlasmon[0] += b*log(x0/e0);
     1761   else         fIntegralPlasmon[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
     1762   
     1763   x0 = fSplineEnergy[i - 1];
     1764   x1 = fSplineEnergy[i - 2];
     1765   y0 = fdNdxPlasmon[i - 1];
     1766   yy1 = fdNdxPlasmon[i - 2];
     1767
     1768   c = x1/x0;
     1769   d = e0/x0;
     1770   a = log10(yy1/y0)/log10(c);
     1771   // b0 = log10(y0) - a*log10(x0);
     1772   b = y0/pow(x0,a);// pow(10.,b0);
     1773
     1774   a += 1.0;
     1775   if( a == 0 ) result += b*log(e0/x0);
     1776   else         result += y0*(e0*pow(d,a-1) - x0)/a;
     1777   a += 1.0;
     1778
     1779   if( a == 0 )   fIntegralPlasmon[0] += b*log(e0/x0);
     1780   else           fIntegralPlasmon[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
     1781   
     1782   return result;
    14121783
    14131784}
    14141785
     1786///////////////////////////////////////////////////////////////////////////////
     1787//
     1788// Integration of resonance cross-section for the case of
     1789// passing across border between intervals
     1790
     1791G4double G4PAIxSection::SumOverBordResonance( G4int      i ,
     1792                                             G4double en0    )
     1793{               
     1794   G4double x0,x1,y0,yy1,a,b,c,d,e0,result;
     1795
     1796   e0 = en0;
     1797   x0 = fSplineEnergy[i];
     1798   x1 = fSplineEnergy[i+1];
     1799   y0 = fdNdxResonance[i];
     1800   yy1 = fdNdxResonance[i+1];
     1801
     1802   c = x1/x0;
     1803   d = e0/x0;   
     1804   a = log10(yy1/y0)/log10(c);
     1805   //  b0 = log10(y0) - a*log10(x0);
     1806   b = y0/pow(x0,a); //pow(10.,b);
     1807   
     1808   a += 1.0;
     1809   if( a == 0 ) result = b*log(x0/e0);
     1810   else         result = y0*(x0 - e0*pow(d,a-1))/a;   
     1811   a += 1.0;
     1812
     1813   if( a == 0 ) fIntegralResonance[0] += b*log(x0/e0);
     1814   else         fIntegralResonance[0] += y0*(x0*x0 - e0*e0*pow(d,a-2))/a;
     1815   
     1816   x0 = fSplineEnergy[i - 1];
     1817   x1 = fSplineEnergy[i - 2];
     1818   y0 = fdNdxResonance[i - 1];
     1819   yy1 = fdNdxResonance[i - 2];
     1820
     1821   c = x1/x0;
     1822   d = e0/x0;
     1823   a = log10(yy1/y0)/log10(c);
     1824   // b0 = log10(y0) - a*log10(x0);
     1825   b = y0/pow(x0,a);// pow(10.,b0);
     1826
     1827   a += 1.0;
     1828   if( a == 0 ) result += b*log(e0/x0);
     1829   else         result += y0*(e0*pow(d,a-1) - x0)/a;
     1830   a += 1.0;
     1831
     1832   if( a == 0 )   fIntegralResonance[0] += b*log(e0/x0);
     1833   else           fIntegralResonance[0] += y0*(e0*e0*pow(d,a-2) - x0*x0)/a;
     1834   
     1835   return result;
     1836
     1837}
     1838
    14151839/////////////////////////////////////////////////////////////////////////
    14161840//
    1417 //
     1841// Returns random PAI-total energy loss over step
    14181842
    14191843G4double G4PAIxSection::GetStepEnergyLoss( G4double step )
    14201844
    1421   G4int iTransfer  ;
    1422   G4long numOfCollisions ;
    1423   G4double loss = 0.0 ;
    1424   G4double meanNumber, position ;
    1425 
    1426   // G4cout<<" G4PAIxSection::GetStepEnergyLoss "<<G4endl ;
    1427 
    1428 
    1429 
    1430   meanNumber = fIntegralPAIxSection[1]*step ;
    1431   numOfCollisions = G4Poisson(meanNumber) ;
    1432 
    1433   //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ;
     1845  G4long numOfCollisions;
     1846  G4double meanNumber, loss = 0.0;
     1847
     1848  // G4cout<<" G4PAIxSection::GetStepEnergyLoss "<<G4endl;
     1849
     1850  meanNumber = fIntegralPAIxSection[1]*step;
     1851  numOfCollisions = G4Poisson(meanNumber);
     1852
     1853  //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl;
    14341854
    14351855  while(numOfCollisions)
    14361856  {
    1437     position = fIntegralPAIxSection[1]*G4UniformRand() ;
    1438 
    1439     for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ )
    1440     {
    1441         if( position >= fIntegralPAIxSection[iTransfer] ) break ;
    1442     }
    1443     loss += fSplineEnergy[iTransfer]  ;
    1444     numOfCollisions-- ;
     1857   loss += GetEnergyTransfer();
     1858   numOfCollisions--;
    14451859  }
    1446   // G4cout<<"PAI energy loss = "<<loss/keV<<" keV"<<G4endl ;
    1447 
    1448   return loss ;
     1860  // G4cout<<"PAI energy loss = "<<loss/keV<<" keV"<<G4endl;
     1861
     1862  return loss;
    14491863}
    14501864
    14511865/////////////////////////////////////////////////////////////////////////
    14521866//
    1453 //
     1867// Returns random PAI-total energy transfer in one collision
     1868
     1869G4double G4PAIxSection::GetEnergyTransfer()
     1870
     1871  G4int iTransfer ;
     1872
     1873  G4double energyTransfer, position;
     1874
     1875  position = fIntegralPAIxSection[1]*G4UniformRand();
     1876
     1877  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     1878  {
     1879        if( position >= fIntegralPAIxSection[iTransfer] ) break;
     1880  }
     1881  if(iTransfer > fSplineNumber) iTransfer--;
     1882 
     1883  energyTransfer = fSplineEnergy[iTransfer];
     1884
     1885  if(iTransfer > 1)
     1886  {
     1887    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     1888  }
     1889  return energyTransfer;
     1890}
     1891
     1892/////////////////////////////////////////////////////////////////////////
     1893//
     1894// Returns random Cerenkov energy loss over step
    14541895
    14551896G4double G4PAIxSection::GetStepCerenkovLoss( G4double step )
    14561897
    1457   G4int iTransfer  ;
    1458   G4long numOfCollisions ;
    1459   G4double loss = 0.0 ;
    1460   G4double meanNumber, position ;
    1461 
    1462   // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl ;
    1463 
    1464 
    1465 
    1466   meanNumber = fIntegralCerenkov[1]*step ;
    1467   numOfCollisions = G4Poisson(meanNumber) ;
    1468 
    1469   //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ;
     1898  G4long numOfCollisions;
     1899  G4double meanNumber, loss = 0.0;
     1900
     1901  // G4cout<<" G4PAIxSection::GetStepCerenkovLoss "<<G4endl;
     1902
     1903  meanNumber = fIntegralCerenkov[1]*step;
     1904  numOfCollisions = G4Poisson(meanNumber);
     1905
     1906  //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl;
    14701907
    14711908  while(numOfCollisions)
    14721909  {
    1473     position = fIntegralCerenkov[1]*G4UniformRand() ;
    1474 
    1475     for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ )
    1476     {
    1477         if( position >= fIntegralCerenkov[iTransfer] ) break ;
    1478     }
    1479     loss += fSplineEnergy[iTransfer]  ;
    1480     numOfCollisions-- ;
     1910    loss += GetCerenkovEnergyTransfer();
     1911    numOfCollisions--;
    14811912  }
    1482   // G4cout<<"PAI Cerenkov loss = "<<loss/keV<<" keV"<<G4endl ;
    1483 
    1484   return loss ;
     1913  // G4cout<<"PAI Cerenkov loss = "<<loss/keV<<" keV"<<G4endl;
     1914
     1915  return loss;
    14851916}
    14861917
    14871918/////////////////////////////////////////////////////////////////////////
    14881919//
    1489 //
     1920// Returns random MM-Cerenkov energy loss over step
     1921
     1922G4double G4PAIxSection::GetStepMMLoss( G4double step )
     1923
     1924  G4long numOfCollisions;
     1925  G4double meanNumber, loss = 0.0;
     1926
     1927  // G4cout<<" G4PAIxSection::GetStepMMLoss "<<G4endl;
     1928
     1929  meanNumber = fIntegralMM[1]*step;
     1930  numOfCollisions = G4Poisson(meanNumber);
     1931
     1932  //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl;
     1933
     1934  while(numOfCollisions)
     1935  {
     1936    loss += GetMMEnergyTransfer();
     1937    numOfCollisions--;
     1938  }
     1939  // G4cout<<"PAI MM-Cerenkov loss = "<<loss/keV<<" keV"<<G4endl;
     1940
     1941  return loss;
     1942}
     1943
     1944/////////////////////////////////////////////////////////////////////////
     1945//
     1946// Returns Cerenkov energy transfer in one collision
     1947
     1948G4double G4PAIxSection::GetCerenkovEnergyTransfer()
     1949
     1950  G4int iTransfer ;
     1951
     1952  G4double energyTransfer, position;
     1953
     1954  position = fIntegralCerenkov[1]*G4UniformRand();
     1955
     1956  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     1957  {
     1958        if( position >= fIntegralCerenkov[iTransfer] ) break;
     1959  }
     1960  if(iTransfer > fSplineNumber) iTransfer--;
     1961 
     1962  energyTransfer = fSplineEnergy[iTransfer];
     1963
     1964  if(iTransfer > 1)
     1965  {
     1966    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     1967  }
     1968  return energyTransfer;
     1969}
     1970
     1971/////////////////////////////////////////////////////////////////////////
     1972//
     1973// Returns MM-Cerenkov energy transfer in one collision
     1974
     1975G4double G4PAIxSection::GetMMEnergyTransfer()
     1976
     1977  G4int iTransfer ;
     1978
     1979  G4double energyTransfer, position;
     1980
     1981  position = fIntegralMM[1]*G4UniformRand();
     1982
     1983  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     1984  {
     1985        if( position >= fIntegralMM[iTransfer] ) break;
     1986  }
     1987  if(iTransfer > fSplineNumber) iTransfer--;
     1988 
     1989  energyTransfer = fSplineEnergy[iTransfer];
     1990
     1991  if(iTransfer > 1)
     1992  {
     1993    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     1994  }
     1995  return energyTransfer;
     1996}
     1997
     1998/////////////////////////////////////////////////////////////////////////
     1999//
     2000// Returns random plasmon energy loss over step
    14902001
    14912002G4double G4PAIxSection::GetStepPlasmonLoss( G4double step )
    14922003
    1493   G4int iTransfer  ;
    1494   G4long numOfCollisions ;
    1495   G4double loss = 0.0 ;
    1496   G4double meanNumber, position ;
    1497 
    1498   // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl ;
    1499 
    1500 
    1501 
    1502   meanNumber = fIntegralPlasmon[1]*step ;
    1503   numOfCollisions = G4Poisson(meanNumber) ;
    1504 
    1505   //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl ;
     2004  G4long numOfCollisions;
     2005  G4double  meanNumber, loss = 0.0;
     2006
     2007  // G4cout<<" G4PAIxSection::GetStepPlasmonLoss "<<G4endl;
     2008
     2009  meanNumber = fIntegralPlasmon[1]*step;
     2010  numOfCollisions = G4Poisson(meanNumber);
     2011
     2012  //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl;
    15062013
    15072014  while(numOfCollisions)
    15082015  {
    1509     position = fIntegralPlasmon[1]*G4UniformRand() ;
    1510 
    1511     for( iTransfer=1 ; iTransfer<=fSplineNumber ; iTransfer++ )
    1512     {
    1513         if( position >= fIntegralPlasmon[iTransfer] ) break ;
    1514     }
    1515     loss += fSplineEnergy[iTransfer]  ;
    1516     numOfCollisions-- ;
     2016    loss += GetPlasmonEnergyTransfer();
     2017    numOfCollisions--;
    15172018  }
    1518   // G4cout<<"PAI Plasmon loss = "<<loss/keV<<" keV"<<G4endl ;
    1519 
    1520   return loss ;
     2019  // G4cout<<"PAI Plasmon loss = "<<loss/keV<<" keV"<<G4endl;
     2020
     2021  return loss;
    15212022}
    15222023
     2024/////////////////////////////////////////////////////////////////////////
     2025//
     2026// Returns plasmon energy transfer in one collision
     2027
     2028G4double G4PAIxSection::GetPlasmonEnergyTransfer()
     2029
     2030  G4int iTransfer ;
     2031
     2032  G4double energyTransfer, position;
     2033
     2034  position = fIntegralPlasmon[1]*G4UniformRand();
     2035
     2036  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     2037  {
     2038        if( position >= fIntegralPlasmon[iTransfer] ) break;
     2039  }
     2040  if(iTransfer > fSplineNumber) iTransfer--;
     2041 
     2042  energyTransfer = fSplineEnergy[iTransfer];
     2043
     2044  if(iTransfer > 1)
     2045  {
     2046    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     2047  }
     2048  return energyTransfer;
     2049}
     2050
     2051/////////////////////////////////////////////////////////////////////////
     2052//
     2053// Returns random resonance energy loss over step
     2054
     2055G4double G4PAIxSection::GetStepResonanceLoss( G4double step )
     2056
     2057  G4long numOfCollisions;
     2058  G4double meanNumber, loss = 0.0;
     2059
     2060  // G4cout<<" G4PAIxSection::GetStepCreLosnkovs "<<G4endl;
     2061
     2062  meanNumber = fIntegralResonance[1]*step;
     2063  numOfCollisions = G4Poisson(meanNumber);
     2064
     2065  //   G4cout<<"numOfCollisions = "<<numOfCollisions<<G4endl;
     2066
     2067  while(numOfCollisions)
     2068  {
     2069    loss += GetResonanceEnergyTransfer();
     2070    numOfCollisions--;
     2071  }
     2072  // G4cout<<"PAI resonance loss = "<<loss/keV<<" keV"<<G4endl;
     2073
     2074  return loss;
     2075}
     2076
     2077
     2078/////////////////////////////////////////////////////////////////////////
     2079//
     2080// Returns resonance energy transfer in one collision
     2081
     2082G4double G4PAIxSection::GetResonanceEnergyTransfer()
     2083
     2084  G4int iTransfer ;
     2085
     2086  G4double energyTransfer, position;
     2087
     2088  position = fIntegralResonance[1]*G4UniformRand();
     2089
     2090  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     2091  {
     2092        if( position >= fIntegralResonance[iTransfer] ) break;
     2093  }
     2094  if(iTransfer > fSplineNumber) iTransfer--;
     2095 
     2096  energyTransfer = fSplineEnergy[iTransfer];
     2097
     2098  if(iTransfer > 1)
     2099  {
     2100    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     2101  }
     2102  return energyTransfer;
     2103}
     2104
     2105
     2106/////////////////////////////////////////////////////////////////////////
     2107//
     2108// Returns Rutherford energy transfer in one collision
     2109
     2110G4double G4PAIxSection::GetRutherfordEnergyTransfer()
     2111
     2112  G4int iTransfer ;
     2113
     2114  G4double energyTransfer, position;
     2115
     2116  position = (fIntegralPlasmon[1]-fIntegralResonance[1])*G4UniformRand();
     2117
     2118  for( iTransfer = 1; iTransfer <= fSplineNumber; iTransfer++ )
     2119  {
     2120        if( position >= (fIntegralPlasmon[iTransfer]-fIntegralResonance[iTransfer]) ) break;
     2121  }
     2122  if(iTransfer > fSplineNumber) iTransfer--;
     2123 
     2124  energyTransfer = fSplineEnergy[iTransfer];
     2125
     2126  if(iTransfer > 1)
     2127  {
     2128    energyTransfer -= (fSplineEnergy[iTransfer]-fSplineEnergy[iTransfer-1])*G4UniformRand();
     2129  }
     2130  return energyTransfer;
     2131}
    15232132
    15242133
     
    15282137//
    15292138
    1530 G4int G4PAIxSection::fNumberOfGammas = 111 ;
     2139G4int G4PAIxSection::fNumberOfGammas = 111;
    15312140
    15322141const G4double G4PAIxSection::fLorentzFactor[112] =     // fNumberOfGammas+1
     
    155621655.658206e+04, 6.422112e+04, 7.289153e+04, 8.273254e+04, 9.390219e+04, // 110
    155721661.065799e+05
    1558 } ;
     2167};
    15592168
    15602169///////////////////////////////////////////////////////////////////////
     
    15642173
    15652174const
    1566 G4int G4PAIxSection::fRefGammaNumber = 29 ;
     2175G4int G4PAIxSection::fRefGammaNumber = 29;
    15672176
    15682177   
  • trunk/source/processes/electromagnetic/standard/src/G4PAIySection.cc

    r819 r961  
    2626//
    2727// $Id: G4PAIySection.cc,v 1.3 2007/10/01 18:38:10 vnivanch Exp $
    28 // GEANT4 tag $Name: $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
  • trunk/source/processes/electromagnetic/standard/src/G4PEEffectModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PEEffectModel.cc,v 1.6 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4PEEffectModel.cc,v 1.7 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4141//
    4242// 04.12.05 : SetProposedKineticEnergy(0.) for the killed photon (mma)
     43// 20.02.09 : Added initialisation of deexcitation flag and method
     44//            CrossSectionPerVolume instead of mfp (V.Ivanchenko)
    4345//
    4446// Class Description:
     
    6668  theGamma    = G4Gamma::Gamma();
    6769  theElectron = G4Electron::Electron();
     70  fminimalEnergy = 1.0*eV;
    6871}
    6972
     
    7174
    7275G4PEEffectModel::~G4PEEffectModel()
    73 {
    74 }
     76{}
    7577
    7678//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    7981                                 const G4DataVector&)
    8082{
    81  if (isInitialized) return;
    82  if (pParticleChange)
    83    fParticleChange =
    84                   reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
    85   else
    86    fParticleChange = new G4ParticleChangeForGamma();
    87 
    88  fminimalEnergy = 1.0*eV;
     83  // always false before the run
     84  SetDeexcitationFlag(false);
     85
     86  if (isInitialized) return;
     87  if (pParticleChange) {
     88    fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
     89  } else {
     90    fParticleChange = new G4ParticleChangeForGamma();
     91  }
     92  isInitialized = true;
     93}
     94
     95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
     96
     97G4double G4PEEffectModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
     98                                                     G4double energy,
     99                                                     G4double Z, G4double,
     100                                                     G4double, G4double)
     101{
     102  G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);
     103
     104  G4double energy2 = energy*energy;
     105  G4double energy3 = energy*energy2;
     106  G4double energy4 = energy2*energy2;
     107
     108  return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
     109    SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
     110}
     111
     112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     113
     114G4double G4PEEffectModel::CrossSectionPerVolume(const G4Material* material,
     115                                                const G4ParticleDefinition*,
     116                                                G4double energy,
     117                                                G4double, G4double)
     118{
     119  G4double* SandiaCof =
     120    material->GetSandiaTable()->GetSandiaCofForMaterial(energy);
     121                               
     122  G4double energy2 = energy*energy;
     123  G4double energy3 = energy*energy2;
     124  G4double energy4 = energy2*energy2;
     125         
     126  return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
     127    SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
    89128}
    90129
  • trunk/source/processes/electromagnetic/standard/src/G4PSTARStopping.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PSTARStopping.cc,v 1.5 2006/06/29 19:53:24 gunter Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4PSTARStopping.cc,v 1.8 2008/11/24 18:28:09 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828
    2929//---------------------------------------------------------------------------
     
    5353G4PSTARStopping::G4PSTARStopping()
    5454{
     55  currentE = 0.0;
    5556  currentMaterial = 0;
    5657  index = 0;
     
    7273  for (G4int i=0; i<74; i++){
    7374    if (matName == name[i]){
    74       matIndex= -1;
     75      matIndex = i;
    7576      currentMaterial = mat;
    7677      return i;
     
    115116  res = e1*std::exp(std::log(energy/t1)*std::log(e2/e1)/std::log(t2/t1));
    116117  return res;
    117  }
     118}
    118119 
    119120void G4PSTARStopping::Initialise()
     
    122123 
    123124  name [0] = "G4_A-150_TISSUE";
    124   Znum [0] = 0;
    125  
    126125  G4double T0[60] = {
    127126    0.001, 0.0015, 0.002, 0.0025, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008,
     
    131130    0.275, 0.3,    0.35,  0.4,    0.45,  0.5,    0.55,   0.6, 0.65,  0.7,
    132131    0.75,  0.8,    0.85,  0.9,    0.95,  1.,     1.25,   1.5, 1.75,  2. };
    133  
    134132  G4double e0[60] = { 176.8, 216.6, 250.1, 279.6, 306.3, 351.1, 390.9, 426.8, 459.8, 489.9, 517.8, 544, 596.4, 641.3, 680.6, 715.7, 747, 775, 800, 822.6, 861.7, 894.2, 920.7, 941.5, 957.3, 968.6, 976.2, 980.5, 982, 981, 978, 973.2, 967, 959.5, 910.4, 853.6, 797.9, 746.9, 701.5, 661.5, 626.4, 595.6, 544.8, 504.4, 471.1, 442.8, 416.4, 392, 369.9, 350, 332.2, 316.4, 302.2, 289.5, 278.1, 267.9, 228.9, 200.8, 179.5, 162.6 };
    135133 
     
    138136 
    139137  name [1] = "G4_ACETYLENE";
    140   Znum [1] = 0;
    141  
    142138  G4double e1[60] = { 185.5, 227.2, 262.3, 293.2, 321.2, 364.8, 404, 439.3, 471.6, 500.3, 526.4, 550.6, 600.2, 641.6, 677.4, 709.2, 737.3, 762, 783.7, 803.1, 837.2, 866.8, 891.7, 911.6, 926.6, 937.4, 944.7, 949, 950.8, 950.3, 947.9, 943.9, 938.4, 931.8, 887.1, 833.7, 779.9, 729.5, 686.8, 650.4, 618.5, 590.2, 541.4, 500.4, 465.3, 434.8, 408, 384.6, 364.4, 346.5, 330.5, 316.1, 303.2, 291.3, 280.4, 270.4, 230.7, 202.2, 180.5, 163.5 };
    143139 
     
    145141 
    146142  name [2] = "G4_ADIPOSE_TISSUE_ICRP";
    147   Znum [2] = 0;
    148  
    149143  G4double e2[60] = { 195.9, 239.9, 277, 309.7, 339.3, 387.5, 430.6, 469.4, 505, 537.2, 566.9, 594.6, 649.9, 696.7, 737.4, 773.3, 805.2, 833.4, 858.3, 880.5, 918.9, 951, 977.2, 997.6, 1013, 1023, 1030, 1034, 1034, 1033, 1029, 1023, 1016, 1008, 955.6, 895, 835.1, 779.6, 729.7, 685.6, 646.6, 612.3, 555, 509.1, 471.6, 440.3, 413.7, 390.4, 370.1, 352.1, 336, 321.4, 308.3, 296.3, 285.3, 275.2, 234.9, 206, 184, 166.7 };
    150144 
     
    152146 
    153147  name [3] = "G4_Ag";
    154   Znum [3] = 47;
    155  
    156148  G4double e3[60] = { 29.73, 36.41, 42.05, 47.01, 51.5, 59.46, 66.48, 72.83, 78.66, 84.09, 89.2, 94.02, 103.7, 112.1, 119.7, 126.6, 132.8, 138.5, 143.7, 148.5, 157.1, 164.3, 170.5, 175.7, 180.1, 183.7, 186.7, 189.1, 191.1, 192.5, 193.6, 194.4, 194.8, 195, 193.4, 189.3, 184.4, 179.2, 174.1, 169.3, 164.8, 160.5, 152.7, 145.7, 139.5, 133.8, 128.6, 123.9, 119.5, 115.4, 111.7, 108.1, 104.8, 101.7, 98.74, 95.98, 84.49, 75.92, 69.3, 64.05 };
    157149 
     
    159151 
    160152  name [4] = "G4_AIR";
    161   Znum [4] = 0;
    162  
    163153  G4double e4[60] = { 119.7, 146.7, 169.3, 189.3, 207.4, 239.5, 267.8, 293.3, 316.8, 338.7, 359.2, 378.7, 417, 450.4, 480.1, 506.7, 530.7, 552.6, 572.4, 590.5, 622.1, 648.3, 670, 687.7, 702, 713.2, 721.7, 727.8, 731.9, 734.1, 734.8, 734, 732, 729, 702.9, 667.2, 629.1, 592.2, 558.3, 527.8, 500.6, 476.3, 434.9, 401.2, 373.3, 349.8, 329.7, 312.1, 296.4, 282.4, 269.9, 258.7, 248.5, 239.1, 230.6, 222.7, 191.1, 168.2, 150.8, 137 };
    164154 
     
    166156 
    167157  name [5] = "G4_Al";
    168   Znum [5] = 13;
    169  
    170158  G4double e5[60] = { 92.38, 113.1, 130.6, 146.1, 160, 184.8, 206.6, 226.3, 244.4, 261.3, 277.1, 292.1, 320.6, 344.8, 365.7, 383.8, 399.6, 413.2, 425, 435.1, 451, 462, 469.2, 473.4, 475.2, 475.1, 473.7, 471.2, 468, 464.2, 460.1, 455.8, 451.3, 446.8, 424.5, 404.5, 386.7, 371, 356.8, 344, 332.3, 321.5, 301.7, 284.2, 268.6, 254.8, 242.5, 231.4, 221.5, 212.4, 204.2, 196.6, 189.7, 183.3, 177.4, 171.9, 149.4, 132.7, 119.8, 109.4 };
    171159 
     
    173161 
    174162  name [6] = "G4_ALUMINUM_OXIDE";
    175   Znum [6] = 0;
    176  
    177163  G4double e6[60] = { 73.51, 90.03, 104, 116.2, 127.3, 147, 164.4, 180.1, 194.5, 207.9, 220.5, 232.5, 256.1, 276.8, 295.3, 311.9, 327, 340.8, 353.4, 364.9, 385.3, 402.5, 417, 429.2, 439.3, 447.6, 454.3, 459.6, 463.7, 466.6, 468.6, 469.8, 470.2, 470, 461.9, 447.2, 430.1, 412.7, 396.5, 381.4, 367.5, 354.5, 331.1, 310.6, 292.6, 276.5, 262.2, 249.4, 238.1, 227.9, 218.7, 210.2, 202.6, 195.7, 189.2, 183.2, 158.9, 140.9, 127, 116 };
    178164 
     
    180166 
    181167  name [7] = "G4_Ar";
    182   Znum [7] = 40;
    183  
    184168  G4double e7[60] = { 86.08, 105.4, 121.7, 136.1, 149.1, 172.2, 192.5, 210.9, 227.7, 243.5, 258.2, 272.2, 299.7, 323.5, 344.5, 363.3, 380.2, 395.3, 409, 421.4, 442.5, 459.4, 472.8, 483.1, 490.7, 496, 499.2, 500.7, 500.8, 499.5, 497.2, 494, 490, 485.5, 457.4, 426.7, 397.7, 371.9, 349.5, 330.1, 313.2, 298.5, 274.2, 254.9, 239, 225.6, 214.4, 204.7, 196.1, 188.4, 181.3, 174.9, 168.9, 163.4, 158.2, 153.3, 133, 118.2, 106.8, 97.72 };
    185169 
     
    187171 
    188172  name [8] = "G4_Au";
    189   Znum [8] = 79;
    190  
    191173  G4double e8[60] = { 14.76, 18.07, 20.87, 23.33, 25.56, 29.51, 33, 36.15, 39.04, 41.74, 44.27, 46.66, 51.51, 55.8, 59.66, 63.18, 66.43, 69.43, 72.23, 74.84, 79.58, 83.77, 87.5, 90.81, 93.77, 96.4, 98.74, 100.8, 102.6, 104.3, 105.7, 106.9, 108, 108.9, 111.5, 112, 111.2, 109.6, 107.6, 105.4, 103.2, 101, 96.33, 91.8, 87.7, 84.05, 80.83, 78, 75.47, 73.18, 71.11, 69.21, 67.46, 65.83, 64.32, 62.91, 56.98, 52.39, 48.68, 45.58 };
    192174 
     
    194176 
    195177  name [9] = "G4_B-100_BONE";
    196   Znum [9] = 0;
    197  
    198178  G4double e9[60] = { 142.5, 174.5, 201.5, 225.2, 246.7, 283.1, 315.3, 344.4, 371.1, 395.5, 418.2, 439.6, 482.3, 519, 551.3, 580.1, 606, 629.2, 650.1, 669, 701.9, 729.5, 752.2, 770.4, 784.5, 795.1, 802.6, 807.4, 810, 810.5, 809.3, 806.6, 802.7, 797.7, 762.5, 719.5, 676.2, 635.8, 599.3, 566.7, 537.9, 512.3, 468.1, 431.4, 400.8, 375, 353, 333.7, 316.9, 301.9, 288.5, 276.3, 265.3, 255.1, 245.9, 237.4, 203.4, 178.9, 160.2, 145.4 };
    199179 
     
    201181 
    202182  name [10] = "G4_Be";
    203   Znum [10] = 4;
    204  
    205183  G4double e10[60] = { 149.7, 183.3, 211.7, 236.7, 259.2, 299.3, 334.7, 366.6, 396, 423.3, 449, 473.3, 517.2, 553.4, 583.6, 608.7, 629.6, 646.8, 660.7, 671.9, 687.3, 695.5, 698.4, 697.6, 694.2, 689.1, 682.8, 675.7, 668.2, 660.5, 652.7, 644.9, 637.2, 629.6, 594.2, 563, 535.4, 510.7, 488.4, 468.2, 449.8, 432.8, 404.4, 380.1, 358.1, 337.6, 318.8, 302.2, 287.4, 274.2, 262.3, 251.5, 241.7, 232.7, 224.4, 216.8, 186, 163.6, 146.3, 132.6 };
    206184 
     
    208186 
    209187  name [11] = "G4_BONE_COMPACT_ICRU";
    210   Znum [11] = 0;
    211  
    212188  G4double e11[60] = { 141.6, 173.4, 200.2, 223.8, 245.2, 281.3, 313.3, 342.2, 368.8, 393.1, 415.6, 436.8, 479, 515.2, 547, 575.3, 600.7, 623.4, 643.8, 662.1, 694.2, 721, 743.2, 760.9, 774.8, 785.2, 792.6, 797.6, 800.3, 801.1, 800.3, 797.9, 794.4, 789.9, 756.4, 714.5, 671.4, 630.5, 593.2, 559.7, 530, 503.5, 459, 423, 393.3, 368.3, 346.9, 328.1, 311.6, 296.9, 283.7, 271.8, 261, 251.1, 242, 233.7, 200.3, 176.3, 158, 143.5 };
    213189 
     
    215191 
    216192  name [12] = "G4_C";
    217   Znum [12] = 6;
    218  
    219193  G4double e12[60] = { 138.4, 169.5, 195.7, 218.8, 239.7, 270.2, 297.8, 322.7, 345.4, 365.1, 382.6, 398.7, 433.5, 462.4, 487.4, 509.9, 530, 547.7, 563.4, 577.6, 603.9, 628.3, 650.1, 668.6, 683.5, 695.3, 704.5, 711.4, 716.3, 719.4, 720.8, 720.9, 719.7, 717.4, 694.5, 661.1, 624.7, 589.1, 556, 526, 499.1, 475, 435.8, 404.4, 377.9, 354.6, 334, 315.9, 300.2, 286.2, 273.7, 262.4, 252.2, 242.7, 234.1, 226.1, 194.2, 171.1, 153.4, 139.4 };
    220194 
    221195  for(i=0; i<60; i++) {e[12][i]=e12[i]*MeV*cm2/g;}
    222196 
    223   name [13] = "G4_C_Graphite";
    224   Znum [13] = 0;
    225  
     197  name [13] = "G4_GRAPHITE";
    226198  G4double e13[60] = { 142.6, 175.3, 203.1, 228, 250.5, 283.4, 313.3, 340.4, 365.1, 386.7, 405.9, 423.5, 462, 494, 521.9, 546.9, 569.3, 589.2, 606.9, 622.9, 652.4, 679.9, 704.5, 725.3, 742.2, 755.6, 766.1, 774, 779.6, 783.1, 784.7, 784.8, 783.4, 780.7, 753.8, 714.5, 671.4, 629.1, 590.2, 555.6, 524.9, 497.7, 453.9, 419.3, 390.3, 365.1, 343, 323.7, 307.1, 292.3, 279.1, 267.3, 256.6, 246.8, 237.8, 229.5, 196.7, 173, 155, 140.8 };
    227199 
     
    229201 
    230202  name [14] = "G4_ETHYLENE";
    231   Znum [14] = 0;
    232  
    233203  G4double e14[60] = { 225.8, 276.5, 319.3, 357, 391.1, 445.9, 494.9, 539.1, 579.6, 616, 649.5, 680.6, 742.9, 795.1, 840.1, 879.9, 914.8, 945.5, 972.4, 996.1, 1037, 1071, 1099, 1120, 1135, 1145, 1150, 1152, 1152, 1148, 1142, 1135, 1126, 1115, 1052, 981.5, 912.8, 849.7, 795.6, 749, 708.3, 672.4, 611.7, 562.1, 520.6, 485.3, 454.9, 428.4, 405.5, 385.2, 367.1, 350.8, 336.2, 322.8, 310.5, 299.3, 254.6, 222.7, 198.6, 179.6 };
    234204 
     
    236206 
    237207  name [15] = "G4_C-552";
    238   Znum [15] = 0;
    239  
    240208  G4double e15[60] = { 119.2, 146, 168.6, 188.5, 206.5, 235.1, 260.7, 283.8, 305, 323.9, 341.3, 357.4, 390.7, 418.9, 443.7, 465.8, 485.7, 503.6, 519.5, 534.1, 560.1, 583.2, 603.2, 620, 633.7, 644.7, 653.4, 660.1, 665, 668.4, 670.3, 671.1, 670.7, 669.5, 652.9, 626.4, 596.2, 565.7, 537, 510.7, 486.8, 465.1, 427.5, 396.1, 369.6, 347, 327.4, 310.1, 294.9, 281.3, 269, 258, 247.9, 238.6, 230.2, 222.4, 191, 168.2, 150.8, 137 };
    241209 
     
    243211 
    244212  name [16] = "G4_CARBON_DIOXIDE";
    245   Znum [16] = 0;
    246  
    247213  G4double e16[60] = { 106.4, 130.3, 150.4, 168.2, 184.2, 212.7, 237.9, 260.6, 281.4, 300.9, 319.1, 336.4, 370.9, 401.2, 428.3, 452.8, 475.1, 495.6, 514.4, 531.8, 562.6, 588.8, 611.2, 630.2, 646.1, 659.3, 670.1, 678.6, 685.2, 690, 693.2, 694.9, 695.4, 694.8, 679, 650.5, 617.3, 583.6, 552.1, 523.6, 497.8, 474.6, 434.7, 401.8, 374.3, 351, 330.9, 313.2, 297.6, 283.7, 271.2, 259.9, 249.6, 240.3, 231.7, 223.7, 191.9, 168.9, 151.4, 137.5 };
    248214 
     
    250216 
    251217  name [17] = "G4_CALCIUM_FLUORIDE";
    252   Znum [17] = 0;
    253 
    254218  G4double e17[60] = { 74.48, 91.21, 105.3, 117.8, 129, 149, 166.5, 182.4, 197, 210.6, 223.4, 235.5, 259.6, 280.7, 299.6, 316.6, 332, 346.2, 359.1, 371.1, 392.2, 410.1, 425.2, 438, 448.7, 457.5, 464.6, 470.3, 474.7, 477.9, 480.1, 481.4, 481.9, 481.7, 473, 456.7, 437.6, 417.8, 398.6, 380.6, 364, 348.7, 322.9, 301.7, 283.5, 267.5, 253.4, 240.9, 229.8, 219.9, 210.8, 202.5, 194.8, 187.7, 181.3, 175.5, 151.6, 134.4, 121.1, 110.6 };
    255219 
     
    257221 
    258222  name [18] = "G4_CERIC_SULFATE";
    259   Znum [18] = 0;
    260  
    261223  G4double e18[60] = { 135.4, 165.8, 191.5, 214.1, 234.5, 270.8, 302.8, 331.7, 358.2, 383, 406.2, 428.2, 471.7, 509.8, 543.6, 574, 601.5, 626.5, 649.3, 670.1, 706.4, 736.5, 761.2, 781.4, 797.4, 809.8, 819, 825.3, 829.2, 830.8, 830.6, 828.7, 825.4, 820.9, 785.9, 741.4, 696, 653.6, 618.4, 588.8, 562.8, 539.6, 499.3, 464.8, 434.6, 407.9, 384.2, 363.4, 344.9, 328.4, 313.6, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 };
    262224 
     
    264226 
    265227  name [19] = "G4_CELLULOSE_NITRATE";
    266   Znum [19] = 0;
    267  
    268228  G4double e19[60] = { 132.2, 161.9, 187, 209, 229, 262.6, 292.5, 319.4, 344.2, 366.8, 387.8, 407.5, 447, 481, 510.8, 537.6, 561.6, 583.2, 602.7, 620.4, 651.5, 677.9, 700, 718.2, 732.7, 744.1, 752.7, 759, 763.2, 765.5, 766.2, 765.5, 763.5, 760.6, 734.4, 698.2, 659.3, 621.4, 586, 553.8, 524.9, 498.9, 452.4, 413.9, 382.9, 358, 337.7, 319.7, 303.9, 289.7, 277.1, 265.6, 255.2, 245.6, 236.9, 228.8, 196.4, 173, 155, 140.8 };
    269229 
     
    271231 
    272232  name [20] = "G4_BONE_CORTICAL_ICRP";
    273   Znum [20] = 0;
    274  
    275233  G4double e20[60] = { 123.5, 151.3, 174.7, 195.3, 214, 246.1, 274.5, 300.2, 323.8, 345.6, 365.9, 385, 423, 455.7, 484.7, 510.5, 533.8, 554.8, 573.7, 590.9, 620.8, 645.9, 666.5, 683.3, 696.6, 706.8, 714.4, 719.7, 723, 724.5, 724.5, 723.1, 720.6, 717.1, 689.6, 653.5, 615.8, 579.8, 546.6, 516.7, 490, 466.2, 426.1, 393.6, 366.6, 343.7, 324, 306.7, 291.5, 278, 265.8, 254.7, 244.7, 235.5, 227.1, 219.4, 188.4, 166.1, 149, 135.4 };
    276234 
     
    278236 
    279237  name [21] = "G4_CESIUM_IODIDE";
    280   Znum [21] = 0;
    281  
    282238  G4double e21[60] = { 34.67, 42.46, 49.03, 54.82, 60.05, 69.34, 77.52, 84.92, 91.73, 98.06, 104, 109.6, 121, 130.9, 139.9, 148, 155.5, 162.3, 168.6, 174.5, 184.9, 194, 201.8, 208.5, 214.2, 219, 223, 226.3, 228.9, 231, 232.5, 233.4, 234, 234.1, 230.4, 221.9, 211.4, 200.6, 190.1, 180.6, 171.9, 164.1, 151.1, 140.6, 132.1, 125.1, 119.1, 114, 109.6, 105.6, 102.1, 98.92, 95.83, 92.83, 89.95, 87.22, 75.76, 67.41, 61.26, 56.63 };
    283239 
     
    285241 
    286242  name [22] = "G4_Cu";
    287   Znum [22] = 29;
    288  
    289243  G4double e22[60] = { 34.9, 42.74, 49.35, 55.18, 60.45, 69.8, 78.04, 85.48, 92.33, 98.71, 104.7, 110.4, 121.4, 130.9, 139.2, 146.6, 153.2, 159, 164.3, 168.9, 176.9, 183.2, 188.4, 192.5, 195.9, 198.7, 201, 202.8, 204.4, 205.6, 206.7, 207.5, 208.2, 208.7, 209.9, 209.2, 207.5, 205.1, 202.3, 199.1, 195.8, 192.3, 185.4, 178.6, 172, 165.8, 159.6, 153.6, 148, 142.7, 137.8, 133.3, 129.1, 125.2, 121.7, 118.3, 104.7, 94.43, 86.45, 79.87 };
    290244 
     
    292246 
    293247  name [23] = "G4_Fe";
    294   Znum [23] = 26;
    295  
    296248  G4double e23[60] = { 37.81, 46.31, 53.47, 59.78, 65.49, 75.62, 84.54, 92.61, 100, 106.9, 113.4, 119.6, 132, 143, 153, 162, 170.4, 178.2, 185.4, 192.2, 204.6, 215.6, 225.4, 234.2, 242.1, 249.2, 255.5, 261.2, 266.2, 270.7, 274.6, 278.1, 281, 283.6, 290.9, 291.5, 287.6, 281, 272.8, 263.9, 254.9, 246, 229.5, 214.8, 202.1, 191.1, 181.6, 173.4, 166.2, 159.7, 153.8, 148.5, 143.6, 139.1, 135, 131.1, 115.3, 103.5, 94.02, 86.52 };
    297249 
     
    299251 
    300252  name [24] = "G4_FERROUS_SULFATE";
    301   Znum [24] = 0;
    302  
    303253  G4double e24[60] = { 135.1, 165.5, 191.1, 213.6, 234, 270.2, 302.1, 330.9, 357.4, 382.1, 405.3, 427.2, 470.7, 508.7, 542.4, 572.8, 600.3, 625.3, 648, 668.8, 705, 735.1, 759.9, 780.1, 796.1, 808.5, 817.7, 824.1, 827.9, 829.6, 829.4, 827.5, 824.2, 819.7, 784.9, 740.5, 695.1, 652.8, 617.8, 588.4, 562.8, 539.9, 499.9, 465.6, 435.5, 408.8, 385, 364.1, 345.6, 329.1, 314.3, 300.9, 288.8, 277.7, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 };
    304254 
     
    306256 
    307257  name [25] = "G4_Gd";
    308   Znum [25] = 64;
    309  
    310258  G4double e25[60] = { 25.71, 31.49, 36.37, 40.66, 44.54, 51.43, 57.5, 62.99, 68.03, 72.73, 77.14, 81.32, 89.78, 97.24, 104, 110.1, 115.8, 121, 125.8, 130.4, 138.5, 145.7, 152.1, 157.7, 162.6, 166.9, 170.7, 173.9, 176.7, 179, 181, 182.5, 183.8, 184.7, 185.6, 182.1, 176.3, 169.4, 162.2, 155.2, 148.7, 142.6, 132, 123.3, 116.2, 110.2, 105, 100.6, 96.67, 93.2, 90.08, 87.27, 84.72, 82.38, 80.24, 78.26, 70.14, 63.87, 58.87, 54.76 };
    311259 
     
    313261 
    314262  name [26] = "G4_Ge";
    315   Znum [26] = 32;
    316  
    317263  G4double e26[60] = { 45.91, 56.23, 64.93, 72.59, 79.52, 91.82, 102.7, 112.5, 121.5, 129.9, 137.7, 145.2, 159.7, 172.3, 183.3, 193.1, 201.7, 209.4, 216.3, 222.3, 232.3, 240, 245.6, 249.6, 252.3, 253.9, 254.5, 254.5, 253.9, 252.9, 251.5, 250, 248.2, 246.4, 236.5, 227.2, 218.9, 211.6, 205.1, 199.3, 193.9, 189, 180.1, 172.3, 165.2, 158.8, 152.6, 146.6, 140.9, 135.7, 130.8, 126.3, 122.1, 118.3, 114.7, 111.3, 97.72, 87.77, 80.18, 74.18 };
    318264 
     
    320266 
    321267  name [27] = "G4_Pyrex_Glass";
    322   Znum [27] = 0;
    323  
    324268  G4double e27[60] = { 88.74, 108.7, 125.5, 140.3, 153.7, 177.5, 198.4, 217.4, 234.8, 251, 266.2, 280.6, 308.9, 333.6, 355.6, 375.3, 393.1, 409.2, 423.9, 437.3, 460.8, 480.4, 496.7, 510.2, 521.2, 530.1, 537.1, 542.5, 546.4, 549.1, 550.6, 551.2, 551, 550.1, 537.6, 518.1, 496.1, 473.9, 451.2, 429.2, 408.8, 390.1, 357.9, 331.5, 309.8, 291.7, 276.2, 262.4, 250.1, 239.1, 229.2, 220.2, 212, 204.6, 197.7, 191.4, 165.6, 146.7, 132.1, 120.4 };
    325269 
     
    327271 
    328272  name [28] = "G4_H";
    329   Znum [28] = 1;
    330  
    331273  G4double e28[60] = { 746.5, 914.3, 1056, 1180, 1293, 1493, 1669, 1829, 1975, 2112, 2240, 2361, 2586, 2777, 2942, 3084, 3208, 3316, 3409, 3490, 3618, 3710, 3771, 3808, 3823, 3822, 3807, 3781, 3745, 3702, 3654, 3601, 3545, 3487, 3183, 2890, 2629, 2402, 2204, 2031, 1882, 1753, 1544, 1384, 1258, 1159, 1077, 1007, 947, 894.2, 847.5, 805.9, 768.6, 734.9, 704.3, 676.4, 566.7, 489.7, 432.5, 388.1 };
    332274 
     
    334276 
    335277  name [29] = "G4_He";
    336   Znum [29] = 2;
    337  
    338278  G4double e29[60] = { 184.2, 225.6, 260.6, 291.3, 319.1, 368.5, 412, 451.3, 487.4, 521.1, 552.7, 582.6, 641.3, 691.9, 736.7, 776.6, 812.5, 844.9, 874.2, 900.8, 946.6, 984.1, 1014, 1039, 1058, 1072, 1083, 1089, 1093, 1094, 1093, 1090, 1085, 1079, 1032, 973, 911.2, 852.1, 797.5, 748.3, 704.5, 665.8, 600.4, 547.7, 504.5, 468.3, 437.7, 411.3, 388.2, 368, 349.9, 333.8, 319.3, 306.2, 294.2, 283.2, 239.6, 208.6, 185.2, 167 };
    339279 
     
    341281 
    342282  name [30] = "G4_KAPTON";
    343   Znum [30] = 0;
    344  
    345283  G4double e30[60] = { 145.4, 178.1, 205.6, 229.9, 251.8, 286.2, 317.1, 344.9, 370.4, 393.1, 413.7, 432.9, 472.6, 506.1, 535.2, 561.3, 584.6, 605.3, 623.8, 640.4, 670.2, 696.5, 719.1, 737.7, 752.5, 763.9, 772.5, 778.6, 782.6, 784.6, 784.9, 783.8, 781.4, 778, 749.2, 710.6, 669.6, 630, 593.5, 560.4, 530.8, 504.4, 459.6, 423.3, 393.3, 368.2, 346.8, 328, 311.6, 296.9, 283.8, 272, 261.3, 251.5, 242.4, 234.1, 200.8, 176.8, 158.4, 143.8 };
    346284 
     
    348286 
    349287  name [31] = "G4_Kr";
    350   Znum [31] = 36;
    351  
    352288  G4double e31[60] = { 45.92, 56.24, 64.94, 72.6, 79.53, 91.84, 102.7, 112.5, 121.5, 129.9, 137.8, 145.2, 160.1, 173.2, 184.9, 195.5, 205.1, 213.8, 221.8, 229.1, 242, 252.7, 261.6, 268.8, 274.6, 279, 282.3, 284.5, 285.8, 286.2, 286, 285.1, 283.8, 281.9, 268.6, 252.2, 236.2, 221.7, 209, 198.2, 188.9, 180.9, 168.1, 158.1, 150.2, 143.7, 138.1, 133.2, 128.8, 124.8, 121.2, 117.8, 114.6, 111.6, 108.8, 106.1, 94.63, 85.43, 77.91, 71.84 };
    353289 
     
    355291 
    356292  name [32] = "G4_LITHIUM_TETRABORATE";
    357   Znum [32] = 0;
    358  
    359293  G4double e32[60] = { 111, 135.9, 157, 175.5, 192.2, 222, 248.2, 271.9, 293.6, 313.9, 333, 351, 386.5, 417.4, 444.8, 469.4, 491.6, 511.7, 530.1, 546.7, 575.8, 599.9, 619.8, 636, 649.1, 659.3, 667.2, 672.9, 676.7, 678.9, 679.6, 679.1, 677.6, 675.1, 653, 622.4, 589.5, 557.3, 525.5, 495.6, 468.4, 444.1, 403.1, 370.6, 344.6, 323.5, 305.9, 290.3, 276.4, 263.9, 252.7, 242.4, 233.2, 224.7, 216.9, 209.6, 180.4, 159.2, 142.8, 129.9 };
    360294 
     
    362296 
    363297  name [33] = "G4_LITHIUM_FLUORIDE";
    364   Znum [33] = 0;
    365  
    366298  G4double e33[60] = { 80.87, 99.04, 114.4, 127.9, 140.1, 161.7, 180.8, 198.1, 214, 228.7, 242.6, 255.7, 281.9, 304.9, 325.4, 344, 360.9, 376.5, 390.8, 404, 427.6, 447.8, 465.3, 480.3, 493.1, 504.1, 513.3, 521.1, 527.4, 532.5, 536.5, 539.6, 541.7, 543, 540.3, 527.4, 509.2, 488.8, 467.4, 446.5, 426.9, 408.7, 376.9, 350.4, 328, 309.1, 292.7, 278.1, 265.1, 253.3, 242.5, 232.8, 223.9, 215.6, 208.2, 201.2, 173.1, 152.5, 136.8, 124.4 };
    367299 
     
    369301 
    370302  name [34] = "G4_M3_WAX";
    371   Znum [34] = 0;
    372  
    373303  G4double e34[60] = { 198.1, 242.6, 280.2, 313.3, 343.1, 391.9, 435.4, 474.6, 510.6, 543.1, 573, 601, 656.7, 703.7, 744.4, 780.4, 812.2, 840.3, 865, 887, 925, 956.5, 982.1, 1002, 1016, 1026, 1032, 1035, 1036, 1033, 1029, 1023, 1016, 1007, 953.3, 891.9, 831.3, 775.4, 725.1, 680.6, 641.3, 606.6, 546.6, 497.8, 458.8, 427.4, 401.7, 379.2, 359.6, 342.2, 326.7, 312.7, 300.1, 288.5, 277.8, 268.1, 229.1, 201, 179.7, 162.8 };
    374304 
     
    376306 
    377307  name [35] = "G4_MS20_TISSUE";
    378   Znum [35] = 0;
    379  
    380308  G4double e35[60] = { 174.4, 213.6, 246.7, 275.8, 302.1, 345, 383.2, 417.7, 449.4, 477.9, 504.3, 528.8, 578.1, 619.8, 656, 688.2, 716.7, 742, 764.4, 784.4, 819.3, 848.7, 872.8, 892, 906.4, 916.8, 923.7, 927.8, 929.4, 928.8, 926.4, 922.3, 916.9, 910.4, 866.6, 814.5, 762, 712.8, 668.3, 628.6, 593.3, 562.1, 507.7, 463.3, 427.6, 398.9, 375.3, 354.7, 336.7, 320.6, 306.2, 293.3, 281.6, 270.9, 261, 252, 215.7, 189.5, 169.6, 153.9 };
    381309 
     
    383311 
    384312  name [36] = "G4_METHANE";
    385   Znum [36] = 0;
    386  
    387313  G4double e36[60] = { 272.8, 334.1, 385.8, 431.4, 472.5, 545.6, 610, 668.2, 721.8, 771.6, 818.4, 862.7, 949.2, 1024, 1090, 1148, 1200, 1246, 1288, 1325, 1387, 1436, 1473, 1500, 1518, 1528, 1532, 1530, 1524, 1514, 1501, 1485, 1467, 1447, 1338, 1227, 1127, 1041, 967.3, 904.6, 850.4, 803.2, 724.6, 661.8, 610.5, 567.7, 531.4, 499.8, 472.5, 448.3, 426.7, 407.4, 390, 374.1, 359.6, 346.4, 293.7, 256.2, 227.9, 205.7 };
    388314 
     
    390316 
    391317  name [37] = "G4_Mo";
    392   Znum [37] = 42;
    393  
    394318  G4double e37[60] = { 40.18, 49.21, 56.82, 63.53, 69.59, 80.35, 89.84, 98.41, 106.3, 113.6, 120.5, 127, 140.2, 151.7, 162.1, 171.5, 180.1, 188, 195.4, 202.1, 214.3, 224.8, 233.8, 241.6, 248.3, 253.9, 258.7, 262.6, 265.7, 268.2, 270, 271.3, 272.1, 272.4, 268.7, 259.5, 248, 235.8, 224, 213.1, 203.1, 194.1, 178.9, 166.6, 156.5, 148.1, 141, 134.9, 129.5, 124.7, 120.4, 116.4, 112.6, 109.1, 105.8, 102.6, 89.8, 80.34, 73.15, 67.51 };
    395319 
     
    397321 
    398322  name [38] = "G4_MUSCLE_WITH_SUCROSE";
    399   Znum [38] = 0;
    400  
    401323  G4double e38[60] = { 149.4, 183, 211.3, 236.2, 258.7, 298.3, 333.3, 364.8, 393.8, 420.8, 446, 469.8, 516.6, 557.2, 593.1, 625.2, 654, 680, 703.5, 724.8, 761.7, 792, 816.7, 836.5, 851.9, 863.6, 871.9, 877.4, 880.4, 881.2, 880.1, 877.3, 873.2, 867.9, 829.5, 781.9, 733.4, 688, 647.9, 612.8, 581.8, 554.2, 507.1, 468.4, 435.9, 408.3, 384.4, 363.5, 344.9, 328.4, 313.7, 300.3, 288.2, 277.2, 267, 257.7, 220.4, 193.5, 173, 156.9 };
    402324 
     
    404326 
    405327  name [39] = "G4_MUSCLE_WITHOUT_SUCROSE";
    406   Znum [39] = 0;
    407  
    408328  G4double e39[60] = { 146.6, 179.5, 207.3, 231.8, 253.9, 292.9, 327.3, 358.4, 386.9, 413.5, 438.4, 461.9, 508.2, 548.4, 584, 615.8, 644.5, 670.4, 693.8, 715.1, 752, 782.3, 807.1, 827, 842.5, 854.3, 862.9, 868.5, 871.6, 872.6, 871.6, 869, 865, 859.8, 822, 774.9, 726.9, 682, 643, 609.2, 579.4, 552.9, 507.4, 469.6, 437.7, 410.1, 386.1, 365.1, 346.5, 329.9, 315, 301.6, 289.4, 278.3, 268.2, 258.8, 221.3, 194.3, 173.7, 157.5 };
    409329 
     
    411331 
    412332  name [40] = "G4_MUSCLE_SKELETAL_ICRP";
    413   Znum [40] = 0;
    414  
    415333  G4double e40[60] = { 141.3, 173.1, 199.9, 223.5, 244.8, 282.5, 315.8, 345.8, 373.5, 399.2, 423.3, 446.1, 491.1, 530.2, 565, 596.1, 624.2, 649.7, 672.8, 693.8, 730.4, 760.6, 785.3, 805.3, 821.1, 833.1, 841.9, 847.9, 851.4, 852.6, 852, 849.7, 846.1, 841.2, 804.8, 758.9, 712.2, 668.5, 631.2, 599, 570.8, 545.6, 502.2, 465.8, 434.6, 407.5, 383.7, 362.8, 344.4, 327.9, 313.1, 299.8, 287.7, 276.7, 266.6, 257.3, 220, 193.2, 172.8, 156.7 };
    416334 
     
    418336 
    419337  name [41] = "G4_MUSCLE_STRIATED_ICRU";
    420   Znum [41] = 0;
    421  
    422338  G4double e41[60] = { 141.7, 173.5, 200.4, 224, 245.4, 283.2, 316.5, 346.6, 374.3, 400, 424.2, 447, 492.1, 531.3, 566.1, 597.3, 625.4, 650.9, 674, 695.1, 731.6, 761.9, 786.7, 806.6, 822.4, 834.4, 843.3, 849.2, 852.6, 853.9, 853.2, 851, 847.3, 842.4, 805.8, 759.8, 713, 669.2, 632, 600.1, 572.1, 547.1, 504, 467.7, 436.5, 409.3, 385.3, 364.3, 345.7, 329.2, 314.4, 300.9, 288.8, 277.8, 267.6, 258.3, 220.8, 193.9, 173.4, 157.2 };
    423339 
     
    425341 
    426342  name [42] = "G4_N";
    427   Znum [42] = 7;
    428  
    429343  G4double e42[60] = { 126.5, 155, 179, 200.1, 219.2, 253.1, 283, 310, 334.8, 357.9, 379.6, 400.2, 440.6, 475.8, 507, 535, 560.2, 583.1, 603.8, 622.7, 655.5, 682.7, 704.9, 722.9, 737.3, 748.4, 756.6, 762.3, 765.9, 767.5, 767.5, 766, 763.3, 759.4, 729.3, 689.8, 648.6, 609.1, 572.9, 540.4, 511.6, 486.2, 443.4, 408.8, 380.1, 356, 335.4, 317.2, 301.2, 286.8, 274.1, 262.6, 252.2, 242.7, 234, 225.9, 193.8, 170.5, 152.8, 138.8 };
    430344 
     
    432346 
    433347  name [43] = "G4_SODIUM_IODIDE";
    434   Znum [43] = 0;
    435  
    436348  G4double e43[60] = { 41.1, 50.34, 58.12, 64.98, 71.19, 82.2, 91.9, 100.7, 108.7, 116.2, 123.3, 130, 143.4, 155.2, 165.8, 175.4, 184.2, 192.3, 199.7, 206.6, 219, 229.6, 238.9, 246.8, 253.5, 259.2, 264, 268, 271.1, 273.6, 275.4, 276.7, 277.4, 277.7, 273.7, 264.2, 252.3, 239.7, 227.6, 216.2, 205.9, 196.6, 180.7, 167.8, 157.3, 148.5, 141.1, 134.7, 129.1, 124.1, 119.7, 115.7, 111.9, 108.4, 105.1, 101.9, 88.79, 78.99, 71.48, 65.54 };
    437349 
     
    439351 
    440352  name [44] = "G4_Ne";
    441   Znum [44] = 10;
    442  
    443353  G4double e44[60] = { 58.01, 71.05, 82.04, 91.73, 100.5, 116, 129.7, 142.1, 153.5, 164.1, 174, 183.5, 202.5, 219.3, 234.5, 248.3, 261, 272.8, 283.8, 294, 312.7, 329.2, 343.8, 356.9, 368.6, 379, 388.3, 396.5, 403.8, 410.2, 415.8, 420.7, 424.8, 428.4, 438.1, 437.9, 431.3, 420.8, 408.2, 394.6, 380.7, 367.1, 339, 313.8, 293.3, 277.2, 264.3, 252.6, 241.9, 232.2, 223.2, 215, 207.4, 200.4, 193.8, 187.7, 163, 144.6, 130.3, 118.9 };
    444354 
     
    446356 
    447357  name [45] = "G4_NYLON_6/6";
    448   Znum [45] = 0;
    449  
    450358  G4double e45[60] = { 191, 233.9, 270.1, 302, 330.8, 377.8, 419.7, 457.5, 492.1, 523.4, 552.3, 579.2, 633, 678.5, 717.9, 752.9, 783.8, 811.1, 835.3, 856.8, 894.2, 925.4, 951, 971, 985.8, 996.3, 1003, 1007, 1008, 1006, 1003, 997.7, 991.2, 983.5, 933.5, 875.4, 817.5, 763.6, 715, 671.7, 633.5, 599.6, 542.9, 497.4, 460.4, 429.7, 403.7, 381, 361.2, 343.6, 327.9, 313.8, 301, 289.3, 278.6, 268.8, 229.5, 201.3, 179.8, 162.9 };
    451359 
     
    453361 
    454362  name [46] = "G4_O";
    455   Znum [46] = 8;
    456 
    457363  G4double e46[60] = { 99.46, 121.8, 140.7, 157.3, 172.3, 198.9, 222.4, 243.6, 263.1, 281.3, 298.4, 314.5, 346.6, 374.7, 399.8, 422.4, 443, 461.9, 479.1, 495, 523.1, 547, 567.2, 584.4, 598.7, 610.6, 620.2, 628, 633.9, 638.3, 641.3, 643, 643.6, 643.3, 630.5, 606.7, 578.3, 549.1, 520.9, 494.6, 470.9, 449.7, 413.2, 383.1, 357.8, 336.3, 317.6, 301.1, 286.3, 273.2, 261.3, 250.5, 240.8, 231.9, 223.7, 216.1, 185.7, 163.7, 146.7, 133.4 };
    458364 
     
    460366 
    461367  name [47] = "G4_PARAFFIN";
    462   Znum [47] = 0;
    463  
    464368  G4double e47[60] = { 228.8, 280.2, 323.5, 361.7, 396.2, 451.9, 501.6, 546.5, 587.6, 624.6, 658.6, 690.2, 753.4, 806.4, 852.1, 892.4, 927.9, 959.1, 986.3, 1010, 1052, 1086, 1114, 1135, 1150, 1160, 1166, 1168, 1166, 1163, 1157, 1149, 1140, 1129, 1064, 992.4, 922.6, 858.6, 801.5, 751.1, 706.8, 667.8, 601.8, 548.9, 506.2, 471.3, 442.2, 416.9, 394.9, 375.4, 358, 342.3, 328.2, 315.3, 303.4, 292.6, 249.3, 218.3, 194.8, 176.3 };
    465369 
     
    467371 
    468372  name [48] = "G4_Pb";
    469   Znum [48] = 82;
    470  
    471373  G4double e48[60] = { 15.4, 18.86, 21.78, 24.35, 26.68, 30.81, 34.44, 37.73, 40.75, 43.57, 46.21, 48.71, 53.82, 58.34, 62.45, 66.21, 69.7, 72.94, 75.98, 78.85, 84.11, 88.84, 93.13, 97.02, 100.6, 103.8, 106.8, 109.5, 111.9, 114.1, 116.2, 118, 119.6, 121.1, 126.1, 128.1, 127.9, 126.3, 123.6, 120.4, 116.9, 113.3, 106.4, 99.98, 94.37, 89.5, 85.18, 81.37, 78.01, 75.05, 72.42, 70.08, 67.99, 66.12, 64.44, 62.92, 56.88, 52.22, 48.46, 45.34 };
    472374 
     
    474376 
    475377  name [49] = "G4_PHOTO_EMULSION";
    476   Znum [49] = 0;
    477  
    478378  G4double e49[60] = { 61.33, 75.12, 86.74, 96.97, 106.2, 122.2, 136.3, 149.1, 160.8, 171.6, 181.6, 191.1, 210, 226.3, 240.6, 253.5, 265, 275.4, 284.8, 293.3, 308, 320.3, 330.3, 338.4, 344.7, 349.4, 352.8, 355.1, 356.4, 356.9, 356.6, 355.7, 354.3, 352.4, 338.9, 322.3, 305.5, 289.9, 275.7, 263, 251.7, 241.5, 224.4, 210.3, 198.3, 188, 179, 171, 163.9, 157.5, 151.6, 146.3, 141.3, 136.6, 132.1, 128, 110.6, 97.75, 87.92, 80.2 };
    479379 
     
    481381 
    482382  name [50] = "G4_PLASTIC_SC_VINYLTOLUENE";
    483   Znum [50] = 0;
    484  
    485383  G4double e50[60] = { 190.1, 232.8, 268.8, 300.5, 329.2, 374.1, 414.4, 450.7, 483.9, 513.5, 540.4, 565.4, 616.5, 659.2, 696, 728.7, 757.6, 783, 805.3, 825.2, 860.1, 890.2, 915.4, 935.4, 950.4, 961.1, 968.2, 972.3, 973.8, 973, 970.2, 965.7, 959.9, 952.8, 906, 850.6, 795.1, 743.3, 696.4, 654.7, 617.9, 585.3, 530.7, 487.1, 451.3, 421.4, 395.9, 373.7, 354.4, 337.2, 321.9, 308.1, 295.7, 284.2, 273.8, 264.1, 225.7, 198.1, 177.1, 160.5 };
    486384 
     
    488386 
    489387  name [51] = "G4_POLYCARBONATE";
    490   Znum [51] = 0;
    491  
    492388  G4double e51[60] = { 164.8, 201.8, 233, 260.5, 285.4, 324.6, 359.7, 391.4, 420.3, 446.2, 469.7, 491.7, 536.5, 574.3, 607.1, 636.2, 662.2, 685.1, 705.4, 723.6, 755.9, 783.9, 807.7, 826.9, 841.7, 852.8, 860.8, 866, 868.8, 869.6, 868.6, 866, 862.1, 857.1, 820.5, 774.5, 727.2, 682.2, 641.1, 604.1, 571.2, 542, 492.3, 452.1, 419.1, 391.8, 368.6, 348.4, 330.7, 314.9, 300.8, 288.1, 276.7, 266.1, 256.5, 247.6, 212, 186.3, 166.8, 151.3 };
    493389 
     
    495391 
    496392  name [52] = "G4_POLYETHYLENE";
    497   Znum [52] = 0;
    498  
    499393  G4double e52[60] = { 184.9, 226.5, 261.5, 292.4, 320.3, 369.9, 413.5, 453, 489.3, 523, 554.8, 584.8, 643.9, 695.3, 740.8, 781.4, 817.9, 850.9, 880.6, 907.5, 953.7, 990.9, 1021, 1044, 1061, 1073, 1081, 1084, 1085, 1083, 1078, 1072, 1064, 1054, 994.1, 927.8, 865, 808.9, 760.1, 717.9, 681.4, 649.7, 591.2, 541, 499.2, 464.9, 436.3, 411.4, 389.8, 370.6, 353.4, 338.1, 324.2, 311.4, 299.8, 289.1, 246.4, 215.9, 192.7, 174.4 };
    500394 
     
    502396 
    503397  name [53] = "G4_POLYETHYLENE_TEREPHTHALATE_MYLAR";
    504   Znum [53] = 0;
    505  
    506398  G4double e53[60] = { 150.9, 184.9, 213.5, 238.7, 261.4, 297.8, 330.2, 359.6, 386.4, 410.5, 432.5, 453, 494.9, 530.3, 561.2, 588.8, 613.4, 635.3, 654.7, 672.3, 703.4, 730.5, 753.5, 772.3, 787, 798.3, 806.6, 812.4, 816, 817.6, 817.4, 815.8, 812.9, 808.9, 777.6, 736.5, 693.4, 651.9, 613.6, 579.1, 548.2, 520.6, 472.9, 434, 402.2, 376.1, 354.3, 335, 318.2, 303.2, 289.8, 277.7, 266.7, 256.6, 247.4, 238.9, 204.8, 180.2, 161.4, 146.5 };
    507399 
     
    509401 
    510402  name [54] = "G4_PLEXIGLASS";
    511   Znum [54] = 0;
    512  
    513403  G4double e54[60] = { 174.9, 214.2, 247.4, 276.6, 303, 345.9, 384.1, 418.7, 450.4, 479, 505.2, 529.8, 579.1, 620.8, 657.1, 689.3, 717.9, 743.2, 765.7, 785.8, 820.8, 850.5, 875, 894.5, 909.3, 920.1, 927.4, 931.9, 933.9, 933.7, 931.6, 928, 922.9, 916.8, 874.4, 823.2, 771.3, 722.4, 676.2, 634, 596.2, 562.8, 507.2, 463.4, 428.5, 400.2, 376.7, 356.1, 338, 321.9, 307.5, 294.5, 282.8, 272, 262.1, 253, 216.6, 190.4, 170.3, 154.5 };
    514404 
     
    516406 
    517407  name [55] = "G4_POLYPROPYLENE";
    518   Znum [55] = 0;
    519  
    520408  G4double e55[60] = { 197.6, 242, 279.4, 312.4, 342.2, 395.1, 441.8, 483.9, 522.7, 558.8, 592.7, 624.8, 687.3, 741.3, 789, 831.4, 869.4, 903.6, 934.3, 962, 1009, 1048, 1078, 1101, 1119, 1132, 1140, 1145, 1146, 1145, 1141, 1135, 1128, 1119, 1060, 991.7, 924.3, 862, 806.1, 756.5, 712.8, 674.2, 605.4, 548.6, 503.3, 467.5, 438.7, 413.6, 391.8, 372.4, 355.2, 339.7, 325.7, 312.9, 301.1, 290.4, 247.5, 216.8, 193.5, 175.1 };
    521409 
     
    523411 
    524412  name [56] = "G4_POLYSTYRENE";
    525   Znum [56] = 0;
    526  
    527413  G4double e56[60] = { 186, 227.8, 263.1, 294.1, 322.2, 372.1, 416, 455.7, 492.2, 526.2, 558.1, 588.3, 645.3, 693.8, 735.8, 772.4, 804.5, 832.6, 857.2, 878.7, 913.5, 939.2, 957.2, 969, 975.6, 978, 976.8, 972.8, 966.5, 958.4, 948.9, 938.3, 926.9, 914.9, 851.3, 789.6, 734.2, 685.4, 642.9, 605.7, 573, 543.9, 499.5, 465.2, 435.8, 409.1, 384.6, 363.2, 344.6, 328.1, 313.3, 300, 288, 277, 266.8, 257.5, 220.4, 193.6, 173.2, 157 };
    528414 
    529415  for(i=0; i<60; i++) {e[56][i]=e56[i]*MeV*cm2/g;}
    530416 
    531   name [57] = "G4_POLYTETRAFLUOROETHYLENE";
    532   Znum [57] = 0;
    533  
     417  name [57] = "G4_TEFLON";
    534418  G4double e57[60] = { 83.27, 102, 117.8, 131.7, 144.2, 165, 183.4, 200.1, 215.3, 229.2, 242, 254, 278.7, 300, 319, 336.2, 351.9, 366.1, 379.2, 391.2, 413.1, 432.7, 450, 465.1, 478, 489.1, 498.5, 506.4, 513, 518.4, 522.7, 526, 528.4, 530.1, 528.6, 516.7, 499.4, 479.6, 460.4, 442.3, 425.4, 409.6, 381.2, 356.4, 334.6, 315.4, 298.3, 283.1, 269.6, 257.4, 246.5, 236.5, 227.4, 219.1, 211.5, 204.4, 175.9, 155.2, 139.3, 126.7 };
    535419 
     
    537421 
    538422  name [58] = "G4_POLYVINYL_CHLORIDE";
    539   Znum [58] = 0;
    540  
    541423  G4double e58[60] = { 140.2, 171.7, 198.3, 221.7, 242.8, 277.9, 309, 337.2, 363, 386.4, 408.1, 428.4, 468.9, 503.4, 533.6, 560.3, 584.1, 605.3, 624.1, 640.9, 670.1, 694.5, 714.3, 729.8, 741.4, 749.6, 755, 757.9, 758.6, 757.6, 755, 751, 746, 740, 701.3, 656.7, 612.9, 572.6, 538.7, 509.8, 484.7, 462.4, 424.2, 392.4, 365.3, 341.8, 321.1, 302.9, 287.3, 273.6, 261.3, 250.1, 240.1, 231.1, 222.7, 215, 184.5, 162.6, 145.9, 132.6 };
    542424 
     
    544426
    545427  name [59] = "G4_PROPANE";
    546   Znum [59] = 0;
    547 
    548428  G4double e59[60] = { 194.5, 234.7, 268.4, 298, 324.7, 372, 413.6, 451.2, 485.8, 518, 548.2, 576.8, 642.6, 702.2, 756.9, 808, 855.9, 901.2, 944.4, 985.6, 1063, 1135, 1203, 1267, 1327, 1385, 1440, 1492, 1543, 1592, 1639, 1684, 1728, 1770, 1964, 2131, 2277, 2404, 2516, 2613, 2698, 2771, 2887, 2969, 3022, 3053, 3065, 3061, 3046, 3021, 2990, 2953, 2912, 2868, 2822, 2775, 2564, 2372, 2191, 2022 };
    549429
     
    551431
    552432  name [60] = "G4_Pt";
    553   Znum [60] = 78;
    554 
    555433  G4double e60[60] = { 30.79, 33.73, 36.43, 38.95, 41.31, 43.55, 48.11, 52.16, 55.83, 59.2, 62.32, 65.23, 67.95, 70.51, 75.22, 79.46, 83.3, 86.79, 89.97, 92.87, 95.51, 97.92, 100.1, 102.1, 103.9, 105.5, 107, 108.3, 112.7, 114.5, 114.4, 113, 110.8, 108.1, 105.3, 102.4, 96.92, 92.12, 87.91, 84.22, 80.97, 78.11, 75.56, 73.26, 71.17, 69.26, 67.5, 65.87, 64.36, 62.94, 57, 52.39, 48.67, 45.57, 42.94, 40.66, 38.67, 36.9, 33.91, 31.45 };
    556434
     
    558436 
    559437  name [61] = "G4_Si";
    560   Znum [61] = 14;
    561  
    562438  G4double e61[60] = { 105, 128.6, 148.5, 166, 181.8, 210, 234.8, 257.2, 277.8, 296.9, 315, 332, 364.6, 392.5, 416.7, 437.8, 456.3, 472.5, 486.6, 498.9, 518.4, 532.3, 541.6, 547, 549.2, 549, 546.8, 543, 538, 532.2, 525.7, 518.8, 511.7, 504.4, 468.7, 437.3, 410.7, 388.4, 369.4, 353, 338.7, 325.9, 304.1, 285.9, 270.3, 256.7, 245.2, 235.1, 225.9, 217.2, 209, 201.1, 193.6, 187, 180.9, 175.3, 152.3, 135.4, 122.2, 111.7 };
    563439 
    564440  for(i=0; i<60; i++) {e[61][i]=e61[i]*MeV*cm2/g;}
    565441 
    566   name [62] = "G4_SiO2";
    567   Znum [62] = 0;
    568  
     442  name [62] = "G4_SILICON_DIOXIDE";
    569443  G4double e62[60] = { 85.64, 104.9, 121.1, 135.4, 148.3, 171.3, 191.5, 209.8, 226.6, 242.2, 256.9, 270.8, 298.1, 322, 343.1, 362.1, 379.3, 394.9, 409.1, 422.1, 444.8, 463.8, 479.7, 492.8, 503.6, 512.3, 519.2, 524.5, 528.5, 531.2, 532.9, 533.7, 533.6, 532.9, 521.9, 503.9, 483.5, 462.8, 442.9, 424.2, 406.7, 390.6, 358.9, 330.8, 307.6, 288.9, 273.6, 259.9, 247.8, 236.9, 227.1, 218.2, 210.1, 202.7, 195.9, 189.7, 164.2, 145.5, 131.1, 119.6 };
    570444 
     
    572446 
    573447  name [63] = "G4_STILBENE";
    574   Znum [63] = 0;
    575  
    576448  G4double e63[60] = { 179.2, 219.5, 253.4, 283.3, 310.4, 352.2, 389.8, 423.8, 454.7, 482.3, 507.2, 530.3, 577.9, 617.7, 652.1, 682.6, 709.7, 733.5, 754.4, 773, 806.1, 835.1, 859.5, 879.2, 894.2, 905.1, 912.7, 917.4, 919.6, 919.6, 917.7, 914.2, 909.3, 903.3, 861.4, 810.7, 759.2, 710.8, 667.1, 628.3, 593.9, 563.4, 511.8, 470.2, 435.9, 407.2, 382.8, 361.4, 342.9, 326.4, 311.6, 298.4, 286.4, 275.4, 265.3, 256.1, 219, 192.4, 172.1, 156.1 };
    577449 
     
    579451 
    580452  name [64] = "G4_Ti";
    581   Znum [64] = 22;
    582  
    583453  G4double e64[60] = { 60.88, 74.56, 86.1, 96.26, 105.4, 121.8, 136.1, 149.1, 161.1, 172.2, 182.6, 192.5, 212.3, 229.6, 245.1, 259.1, 271.8, 283.5, 294.2, 304.1, 321.6, 336.5, 349.1, 359.8, 368.7, 376, 382, 386.7, 390.2, 392.7, 394.4, 395.2, 395.3, 394.8, 385.4, 369.3, 351, 332.6, 315.4, 299.6, 285.5, 272.8, 251.3, 233.9, 219.6, 207.6, 197.4, 188.7, 181, 174.1, 167.9, 162.2, 157, 152.2, 147.7, 143.5, 126, 112.5, 101.7, 93.07 };
    584454 
     
    586456 
    587457  name [65] = "G4_Sn";
    588   Znum [65] = 50;
    589  
    590458  G4double e65[60] = { 32.4, 39.68, 45.82, 51.23, 56.12, 64.8, 72.45, 79.36, 85.72, 91.64, 97.2, 102.5, 113.1, 122.4, 130.8, 138.5, 145.5, 151.9, 157.9, 163.4, 173.4, 182, 189.5, 196, 201.6, 206.4, 210.4, 213.8, 216.5, 218.7, 220.4, 221.6, 222.4, 222.9, 220.7, 213.8, 204.9, 195.4, 186, 177.3, 169.4, 162.3, 150.1, 140.3, 132.2, 125.5, 119.7, 114.7, 110.1, 106.1, 102.5, 99.14, 96.12, 93.34, 90.77, 88.4, 78.69, 71.47, 65.7, 60.79 };
    591459 
     
    593461 
    594462  name [66] = "G4_TISSUE-METHANE";
    595   Znum [66] = 0;
    596  
    597463  G4double e66[60] = { 174.5, 213.8, 246.8, 276, 302.3, 349.1, 390.3, 427.6, 461.8, 493.7, 523.6, 552, 607.8, 656.2, 699.1, 737.4, 771.9, 803, 831.1, 856.5, 900.2, 935.6, 963.8, 985.9, 1003, 1015, 1022, 1027, 1028, 1027, 1023, 1018, 1011, 1002, 947.8, 885.5, 824.9, 769.7, 720.9, 678.2, 641, 608.6, 553.2, 507.9, 470.5, 439.1, 412.4, 389, 368.6, 350.5, 334.4, 319.8, 306.6, 294.6, 283.6, 273.5, 233.2, 204.4, 182.5, 165.2 };
    598464 
     
    600466 
    601467  name [67] = "G4_TISSUE-PROPANE";
    602   Znum [67] = 0;
    603  
    604468  G4double e67[60] = { 169.9, 208.1, 240.3, 268.6, 294.3, 339.8, 379.9, 416.2, 449.5, 480.6, 509.7, 537.3, 591.5, 638.4, 679.9, 716.9, 750.2, 780.2, 807.4, 832, 874.4, 909.1, 937.1, 959.3, 976.6, 989.5, 998.7, 1005, 1008, 1008, 1006, 1003, 998, 991.7, 946.9, 891.9, 836, 783.4, 735.7, 693.2, 655.4, 622, 563.5, 515.3, 475.8, 443.4, 416.2, 392.6, 371.9, 353.6, 337.3, 322.5, 309.3, 297.1, 286, 275.8, 235.1, 206, 183.9, 166.5 };
    605469 
     
    607471 
    608472  name [68] = "G4_TOLUENE";
    609   Znum [68] = 0;
    610  
    611473  G4double e68[60] = { 191.6, 234.7, 271, 302.9, 331.9, 377.2, 417.8, 454.5, 488, 517.9, 545.1, 570.4, 621.9, 665, 702.2, 735.2, 764.3, 790, 812.4, 832.5, 867.7, 897.9, 923.2, 943.3, 958.3, 969, 976, 980, 981.4, 980.4, 977.5, 972.9, 966.9, 959.8, 912.2, 856.2, 800.1, 747.8, 700.6, 658.5, 621.4, 588.5, 535.1, 492.8, 457.8, 427.9, 401.8, 379.1, 359.4, 341.9, 326.3, 312.3, 299.6, 287.9, 277.3, 267.5, 228.5, 200.4, 179.1, 162.3 };
    612474 
     
    614476 
    615477  name [69] = "G4_U";
    616   Znum [69] = 92;
    617  
    618478  G4double e69[60] = { 18.38, 22.51, 25.99, 29.06, 31.83, 36.75, 41.09, 45.01, 48.62, 51.98, 55.13, 58.11, 64.19, 69.57, 74.44, 78.9, 83.02, 86.84, 90.42, 93.78, 99.92, 105.4, 110.3, 114.8, 118.8, 122.4, 125.7, 128.6, 131.2, 133.5, 135.6, 137.4, 139, 140.4, 144.4, 144.8, 142.7, 139.1, 134.5, 129.6, 124.2, 118.8, 108.7, 100, 92.78, 86.72, 81.64, 77.35, 73.71, 70.6, 67.92, 65.59, 63.56, 61.77, 60.19, 58.78, 53.33, 49.08, 45.62, 42.73 };
    619479 
     
    621481 
    622482  name [70] = "G4_W";
    623   Znum [70] = 74;
    624  
    625483  G4double e70[60] = { 14.97, 18.34, 21.17, 23.67, 25.93, 29.94, 33.47, 36.67, 39.61, 42.34, 44.91, 47.34, 52.3, 56.7, 60.68, 64.33, 67.7, 70.84, 73.78, 76.55, 81.61, 86.15, 90.24, 93.95, 97.3, 100.3, 103.1, 105.6, 107.8, 109.9, 111.7, 113.3, 114.7, 116, 120, 121.2, 120.5, 118.5, 115.9, 112.9, 109.8, 106.7, 100.2, 94.14, 89.08, 85, 81.68, 78.78, 76.2, 73.88, 71.78, 69.86, 68.09, 66.45, 64.93, 63.5, 57.52, 52.9, 49.15, 46.04 };
    626484 
     
    628486 
    629487  name [71] = "G4_WATER";
    630   Znum [71] = 0;
    631  
    632488  G4double e71[60] = { 133.7, 163.8, 189.1, 211.4, 231.6, 267.5, 299, 327.6, 353.8, 378.2, 401.2, 422.9, 466, 503.6, 537.2, 567.3, 594.6, 619.5, 642.1, 662.8, 698.9, 729, 753.8, 774, 790.1, 802.6, 811.9, 818.3, 822.3, 824.1, 823.9, 822.2, 819, 814.5, 780.1, 736, 695.9, 660.4, 628.6, 599.9, 573.7, 549.7, 507.5, 471.4, 440.1, 412.8, 388.8, 367.6, 348.9, 332.2, 317.2, 303.7, 291.4, 280.3, 270, 260.6, 222.8, 195.5, 174.8, 158.5 };
    633489 
     
    635491 
    636492  name [72] = "G4_WATER_VAPOR";
    637   Znum [72] = 0;
    638  
    639493  G4double e72[60] = { 152.2, 186.5, 215.3, 240.7, 263.7, 304.5, 340.4, 372.9, 402.8, 430.6, 456.7, 481.4, 530.5, 573.2, 611.3, 645.4, 676.4, 704.4, 730, 753.3, 793.8, 827.4, 855, 877.2, 894.8, 908.2, 918.1, 924.7, 928.5, 929.9, 929.1, 926.5, 922.3, 916.9, 876.3, 825.9, 775.3, 728.5, 686.8, 650.1, 618, 589.9, 536.1, 489.2, 450.8, 420.2, 395.5, 373.8, 354.6, 337.5, 322.2, 308.3, 295.8, 284.4, 273.9, 264.3, 225.7, 198, 176.9, 160.4 };
    640494 
     
    642496 
    643497  name [73] = "G4_Xe";
    644   Znum [73] = 54;
    645  
    646498  G4double e73[60] = { 38.1, 46.67, 53.88, 60.24, 65.99, 76.2, 85.2, 93.33, 100.8, 107.8, 114.3, 120.5, 132.8, 143.6, 153.2, 161.8, 169.6, 176.7, 183.2, 189.1, 199.4, 208, 215, 220.7, 225.2, 228.7, 231.2, 232.9, 233.9, 234.3, 234.1, 233.5, 232.5, 231.1, 221.3, 209.3, 197.4, 186.5, 177, 168.6, 161.3, 155, 144.4, 135.9, 128.8, 122.8, 117.5, 112.7, 108.4, 104.5, 101, 97.75, 94.8, 92.09, 89.6, 87.29, 77.8, 70.52, 64.84, 60.13 };
    647499 
  • trunk/source/processes/electromagnetic/standard/src/G4PhotoElectricEffect.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4PhotoElectricEffect.cc,v 1.37 2006/09/14 10:27:19 maire Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4PhotoElectricEffect.cc,v 1.42 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929//
     
    8080  G4ProcessType type):G4VEmProcess (processName, type),
    8181    isInitialised(false)
    82 {}
     82{
     83  SetProcessSubType(fPhotoElectricEffect);
     84}
    8385
    8486//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    8688G4PhotoElectricEffect::~G4PhotoElectricEffect()
    8789{}
     90
     91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     92
     93G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p)
     94{
     95  return (&p == G4Gamma::Gamma());
     96}
    8897
    8998//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    95104    SetBuildTableFlag(false);
    96105    SetSecondaryParticle(G4Electron::Electron());
    97     if(!Model()) SetModel(new G4PEEffectModel);
     106    if(!Model()) SetModel(new G4PEEffectModel());
    98107    Model()->SetLowEnergyLimit(MinKinEnergy());
    99108    Model()->SetHighEnergyLimit(MaxKinEnergy());
     
    105114
    106115void G4PhotoElectricEffect::PrintInfo()
    107 {
    108   G4cout
    109     << " Total cross sections from Sandia parametrisation. "
    110     << "\n      Sampling according " << Model()->GetName() << " model" 
    111     << G4endl;
    112 }
     116{}
    113117
    114118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4PolarizedComptonScattering.cc

    r819 r961  
    2525//
    2626//
    27 // $Id: G4PolarizedComptonScattering.cc,v 1.16 2006/06/29 19:53:30 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     27// $Id: G4PolarizedComptonScattering.cc,v 1.18 2008/10/15 17:53:44 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
     
    5050using namespace std;
    5151
    52 G4PolarizedComptonScattering::G4PolarizedComptonScattering(
    53                                                   const G4String& processName)
    54 : G4ComptonScattering52 (processName)
     52G4PolarizedComptonScattering::G4PolarizedComptonScattering(const G4String& pname)
     53  : G4ComptonScattering52 (pname)
    5554{ }
    5655
  • trunk/source/processes/electromagnetic/standard/src/G4UniversalFluctuation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UniversalFluctuation.cc,v 1.15 2007/07/13 11:01:50 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4UniversalFluctuation.cc,v 1.17 2009/02/19 11:26:01 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    107107
    108108G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
    109                                                 const G4DynamicParticle* dp,
    110                                                       G4double& tmax,
    111                                                       G4double& length,
    112                                                       G4double& meanLoss)
     109                                                    const G4DynamicParticle* dp,
     110                                                    G4double& tmax,
     111                                                    G4double& length,
     112                                                    G4double& meanLoss)
    113113{
    114114// Calculate actual loss from the mean loss.
     
    305305}
    306306
    307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     307//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     308
     309void
     310G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part,
     311                                             G4double q2)
     312{
     313  if(part != particle) {
     314    particle       = part;
     315    particleMass   = part->GetPDGMass();
     316  }
     317  chargeSquare = q2;
     318}
     319
     320//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel.cc,v 1.77.2.2 2008/04/25 00:34:55 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4UrbanMscModel.cc,v 1.86 2008/10/29 14:15:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    178178using namespace std;
    179179
    180 G4UrbanMscModel::G4UrbanMscModel(G4double m_facrange, G4double m_dtrl,
    181                                  G4double m_lambdalimit,
    182                                  G4double m_facgeom,G4double m_skin,
    183                                  G4bool m_samplez, G4MscStepLimitType m_stepAlg,
    184                                  const G4String& nam)
    185   : G4VEmModel(nam),
    186     dtrl(m_dtrl),
    187     lambdalimit(m_lambdalimit),
    188     facrange(m_facrange),
    189     facgeom(m_facgeom),
    190     skin(m_skin),
    191     steppingAlgorithm(m_stepAlg),
    192     samplez(m_samplez),
     180G4UrbanMscModel::G4UrbanMscModel(const G4String& nam)
     181  : G4VMscModel(nam),
    193182    isInitialized(false)
    194183{
     
    202191  tlimitminfix  = 1.e-6*mm;           
    203192  stepmin       = tlimitminfix;
    204   skindepth     = skin*stepmin;
    205193  smallstep     = 1.e10;
    206194  currentRange  = 0. ;
     
    213201  geommin       = 1.e-3*mm;
    214202  geomlimit     = geombig;
    215   facsafety     = 0.25;
    216203  presafety     = 0.*mm;
    217204  Zeff          = 1.;
     
    396383  G4double eKineticEnergy = KineticEnergy;
    397384
    398   if((particle->GetParticleName() != "e-") &&
    399      (particle->GetParticleName() != "e+") )
     385  if(mass > electron_mass_c2)
    400386  {
    401      G4double TAU = KineticEnergy/mass ;
    402      G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
    403      G4double w = c-2. ;
    404      G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
    405      eKineticEnergy = electron_mass_c2*tau ;
     387    G4double TAU = KineticEnergy/mass ;
     388    G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
     389    G4double w = c-2. ;
     390    G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
     391    eKineticEnergy = electron_mass_c2*tau ;
    406392  }
    407393
     
    504490{
    505491  tPathLength = currentMinimalStep;
    506   G4int stepNumber = track.GetCurrentStepNumber();
    507492  const G4DynamicParticle* dp = track.GetDynamicParticle();
    508 
    509   if(stepNumber == 1) {
     493  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
     494  G4StepStatus stepStatus = sp->GetStepStatus();
     495
     496  if(stepStatus == fUndefined) {
    510497    inside = false;
    511498    insideskin = false;
     
    527514  if(tPathLength > currentRange) tPathLength = currentRange;
    528515
    529   G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
    530516  presafety = sp->GetSafety();
    531517
     
    541527    }
    542528
    543   G4StepStatus stepStatus = sp->GetStepStatus();
    544 
    545529  // standard  version
    546530  //
     
    560544      insideskin = false;
    561545
    562       if((stepStatus == fGeomBoundary) || (stepNumber == 1))
     546      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    563547        {
    564           if(stepNumber == 1) smallstep = 1.e10;
     548          if(stepStatus == fUndefined) smallstep = 1.e10;
    565549          else  smallstep = 1.;
    566550
     
    660644        }
    661645
    662       if((stepStatus == fGeomBoundary) || (stepNumber == 1))
     646      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    663647        {
    664648          // facrange scaling in lambda
     
    870854{
    871855  G4double kineticEnergy = dynParticle->GetKineticEnergy();
    872   if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)) return;
     856  if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) ||
     857     (tPathLength/tausmall < lambda0) ) return;
    873858
    874859  G4double cth  = SampleCosineTheta(tPathLength,kineticEnergy);
    875860  // protection against 'bad' cth values
    876   if(cth > 1.)  cth =  1.;
    877   if(cth < -1.) cth = -1.;
     861  if(abs(cth) > 1.) return;
     862
    878863  G4double sth  = sqrt((1.0 - cth)*(1.0 + cth));
    879864  G4double phi  = twopi*G4UniformRand();
  • trunk/source/processes/electromagnetic/standard/src/G4UrbanMscModel90.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4UrbanMscModel90.cc,v 1.1.2.2 2008/04/25 00:34:55 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4UrbanMscModel90.cc,v 1.10 2008/10/29 14:15:30 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    6969using namespace std;
    7070
    71 G4UrbanMscModel90::G4UrbanMscModel90(G4double m_facrange, G4double m_dtrl,
    72                                      G4double m_lambdalimit,
    73                                      G4double m_facgeom,G4double m_skin,
    74                                      G4bool m_samplez, G4MscStepLimitType m_stepAlg,
    75                                      const G4String& nam)
    76   : G4VEmModel(nam),
    77     dtrl(m_dtrl),
    78     lambdalimit(m_lambdalimit),
    79     facrange(m_facrange),
    80     facgeom(m_facgeom),
    81     skin(m_skin),
    82     steppingAlgorithm(m_stepAlg),
    83     samplez(m_samplez),
     71G4UrbanMscModel90::G4UrbanMscModel90(const G4String& nam)
     72  : G4VMscModel(nam),
    8473    isInitialized(false)
    8574{
     
    9079  tlimitminfix  = 1.e-6*mm;           
    9180  stepmin       = tlimitminfix;
    92   skindepth     = skin*stepmin;
    9381  smallstep     = 1.e10;
    9482  currentRange  = 0. ;
     
    10189  geommin       = 1.e-3*mm;
    10290  geomlimit     = geombig;
    103   facsafety     = 0.25;
    10491  presafety     = 0.*mm;
    10592  Zeff          = 1.;
     
    126113  SetParticle(p);
    127114
    128   if (pParticleChange)
     115  if (pParticleChange) {
    129116   fParticleChange = reinterpret_cast<G4ParticleChangeForMSC*>(pParticleChange);
    130   else
     117  } else {
    131118   fParticleChange = new G4ParticleChangeForMSC();
    132 
     119  }
    133120  safetyHelper = G4TransportationManager::GetTransportationManager()
    134121    ->GetSafetyHelper();
     
    283270  G4double eKineticEnergy = KineticEnergy;
    284271
    285   if((particle->GetParticleName() != "e-") &&
    286      (particle->GetParticleName() != "e+") )
     272  if(mass > electron_mass_c2)
    287273  {
    288      G4double TAU = KineticEnergy/mass ;
    289      G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
    290      G4double w = c-2. ;
    291      G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
    292      eKineticEnergy = electron_mass_c2*tau ;
     274    G4double TAU = KineticEnergy/mass ;
     275    G4double c = mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
     276    G4double w = c-2. ;
     277    G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
     278    eKineticEnergy = electron_mass_c2*tau ;
    293279  }
    294280
     
    391377{
    392378  tPathLength = currentMinimalStep;
    393   G4int stepNumber = track.GetCurrentStepNumber();
    394379  const G4DynamicParticle* dp = track.GetDynamicParticle();
    395 
    396   if(stepNumber == 1) {
     380  G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
     381  G4StepStatus stepStatus = sp->GetStepStatus();
     382
     383  if(stepStatus == fUndefined) {
    397384    inside = false;
    398385    insideskin = false;
     
    414401  if(tPathLength > currentRange) tPathLength = currentRange;
    415402
    416   G4StepPoint* sp = track.GetStep()->GetPreStepPoint();
    417403  presafety = sp->GetSafety();
    418 
    419   //  G4cout << "G4UrbanMscModel90::ComputeTruePathLengthLimit tPathLength= "
    420   //     <<tPathLength<<" safety= " << presafety
    421   //     << " range= " <<currentRange<<G4endl;
    422 
     404  /*
     405  G4cout << "G4UrbanMscModel90::ComputeTruePathLengthLimit tPathLength= "
     406         <<tPathLength<<" safety= " << presafety
     407       << " range= " <<currentRange<<G4endl;
     408  */
    423409  // far from geometry boundary
    424410  if(currentRange < presafety)
     
    427413      return tPathLength; 
    428414    }
    429 
    430   G4StepStatus stepStatus = sp->GetStepStatus();
    431415
    432416  // standard  version
     
    447431      insideskin = false;
    448432
    449       if((stepStatus == fGeomBoundary) || (stepNumber == 1))
     433      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    450434        {
    451435
    452           if(stepNumber == 1) smallstep = 1.e10;
     436          if(stepStatus == fUndefined) smallstep = 1.e10;
    453437          else  smallstep = 1.;
    454438
     
    547531        }
    548532
    549       if((stepStatus == fGeomBoundary) || (stepNumber == 1))
     533      if((stepStatus == fGeomBoundary) || (stepStatus == fUndefined))
    550534        {
    551535          // facrange scaling in lambda
     
    584568  //  G4cout << "tPathLength= " << tPathLength << "  geomlimit= " << geomlimit
    585569  //     << " currentMinimalStep= " << currentMinimalStep << G4endl;
    586 
    587570  return tPathLength ;
    588571}
     
    755738void G4UrbanMscModel90::SampleScattering(const G4DynamicParticle* dynParticle,
    756739                                         G4double safety)
    757 
    758 
    759 
    760740{
    761741  G4double kineticEnergy = dynParticle->GetKineticEnergy();
    762   if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix)) return;
     742  if((kineticEnergy <= 0.0) || (tPathLength <= tlimitminfix) ||
     743     (tPathLength/tausmall < lambda0) ) return;
    763744
    764745  G4double cth  = SampleCosineTheta(tPathLength,kineticEnergy);
    765746  // protection against 'bad' cth values
    766   if(cth > 1.)  cth =  1.;
    767   if(cth < -1.) cth = -1.;
     747  if(std::abs(cth) > 1.) return;
    768748
    769749  G4double sth  = sqrt((1.0 - cth)*(1.0 + cth));
  • trunk/source/processes/electromagnetic/standard/src/G4WaterStopping.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4WaterStopping.cc,v 1.2 2006/06/29 19:53:40 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4WaterStopping.cc,v 1.11 2008/12/18 13:01:38 gunter Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828
    2929//---------------------------------------------------------------------------
     
    4848//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    4949
    50 G4WaterStopping::G4WaterStopping(G4EmCorrections* corr)
     50G4WaterStopping::G4WaterStopping(G4EmCorrections* corr, G4bool splineFlag)
    5151{
     52  spline = splineFlag;
    5253  Initialise(corr);
    5354}
     
    5657
    5758G4WaterStopping::~G4WaterStopping()
    58 {
    59   int n = dedx.size();
    60   for(int i=0; i<n; i++) {delete dedx[i];}
    61 }
     59{}
    6260
    6361//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    6664{
    6765  G4double res = 0.0;
     66  if(iz < 3 || iz > 18) return res;
    6867  G4bool b;
    69   G4int idx = 0;
    70   for(; idx<8; idx++) {
    71     if(iz == Z[idx]) {
    72       res = (dedx[idx])->GetValue(energy, b);
    73       break;
    74     }
     68  G4int idx = iz - 3;
     69  G4double scaledEnergy = energy/A[idx];
     70  G4double emin = 0.025*MeV;
     71  if(scaledEnergy < emin) {
     72    res = (dedx[idx])->GetValue(emin, b)*std::sqrt(scaledEnergy/emin);
     73  } else {
     74    res = (dedx[idx])->GetValue(scaledEnergy, b);
    7575  }
    7676  return res;
    77  }
     77}
     78
     79//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     80
     81void G4WaterStopping::AddData(G4double* energy, G4double* stoppower,
     82                              G4double factor)
     83{
     84  G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,energy[0],energy[52]);
     85  pv->SetSpline(spline);
     86  dedx.push_back(pv);
     87  for(G4int i=0;i<53;i++) {
     88    pv->PutValues(i,energy[i],stoppower[i]*factor);
     89  }
     90}
     91
     92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7893
    7994void G4WaterStopping::Initialise(G4EmCorrections* corr)
     
    8196  G4int i;
    8297  //..List of ions
    83   G4int zz[8] = {3, 4, 5, 6, 7, 8, 9, 10 };
    84   G4int aa[8] = {7, 9, 11, 12, 14, 16, 19, 20 };
    85 
    86   for(i=0; i<8; i++) {
     98  G4int zz[16] = {3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18};
     99  G4int aa[16] = {7, 9, 11, 12, 14, 16, 19, 20, 23, 24, 27, 28,31,32, 35,40};
     100  // G4double A_Ion[16] = {6.941,9.0122,10.811,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.086,30.974,32.065,35.453,39.948};
     101  for(i=0; i<16; i++) {
    87102    Z[i] = zz[i];
    88     A[i] = aa[i];
     103    A[i] = G4double(aa[i]);
    89104  }
    90105  //..Reduced energies
    91   G4double E[53] = {0.025,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,4,5,6,7,8,9,10,15,20,25,30,40,50,60,70,80,90,100,150,200,250
    92 ,300,400,500,600,700,800,900,1000};
     106  G4double E[53] = {0.025,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,4,5,6,7,8,9,10,15,20,25,30,40,50,60,70,80,90,100,150,200,250,300,400,500,600,700,800,900,1000};
    93107  for(i=0; i<53; i++) {E[i] *= MeV;}
    94108
    95   //..Li
    96   G4double Li[53] = {2.626,2.84,3.191,3.461,3.665,3.817,3.927,4.004,4.056,4.102,3.998,3.853,3.702,3.413,3.158,2.934,2.739,2.567,2.415,2.28,1.782,1.465,1.247,1.087,0.8706,0.7299,0.631,0.5575,0.5005,0.455,0.4178,0.3004,0.2376,0.1981,0.1708,0.1354,0.1132,0.09803,0.08692,0.07842,0.07171,0.06627,0.0495,0.04085,0.03557,0.03203,0.0276,0.02498,0.02327,0.0221,0.02126,0.02064,0.02016};
    97   G4LPhysicsFreeVector* pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    98   dedx.push_back(pv);
    99   for(i=0; i<53; i++) { pv->PutValues(i,E[i],Li[i]*1000.*MeV/cm); }
     109  G4double factor = 1000.*MeV/cm;
    100110
    101   //..Be
    102   G4double Be[53] = {3.272,3.565,4.061,4.463,4.79,5.052,5.258,5.419,5.542,5.803,5.787,5.675,5.529,5.215,4.912,4.634,4.381,4.152,3.944,3.756,3.026,2.533,2.179,1.913,1.542,1.296,1.122,0.9911,0.8898,0.8087,0.7423,0.5335,0.4219,0.3518,0.3034,0.2406,0.2013,0.1743,0.1545,0.1394,0.1275,0.1178,0.08805,0.07266,0.06328,0.05698,0.0491,0.04444,0.04141,0.03933,0.03783,0.03672,0.03588};
    103   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    104   dedx.push_back(pv);
    105   for(i=0; i<53; i++) { pv->PutValues(i,E[i],Be[i]*1000.*MeV/cm); }
     111G4double G4_WATER_Li [53]={2.626, 2.84, 3.191, 3.461, 3.665, 3.817, 3.927, 4.004, 4.056, 4.102, 3.998, 3.853, 3.702, 3.413, 3.158, 2.934, 2.739, 2.567, 2.415, 2.28, 1.782, 1.465, 1.247, 1.087, 0.8706, 0.7299, 0.631, 0.5575, 0.5005, 0.455, 0.4178, 0.3004, 0.2376, 0.1981, 0.1708, 0.1354, 0.1132, 0.09803, 0.08692, 0.07842, 0.07171, 0.06627, 0.0495, 0.04085, 0.03557, 0.03203, 0.0276, 0.02498, 0.02327, 0.0221, 0.02126, 0.02064, 0.02016, };
     112AddData(E,G4_WATER_Li,factor);
    106113
    107   //..B
    108   G4double B[53] = {3.773,4.142,4.776,5.304,5.749,6.122,6.431,6.684,6.89,7.432,7.551,7.505,7.391,7.091,6.772,6.463,6.172,5.901,5.65,5.418,4.484,3.817,3.322,2.94,2.392,2.02,1.752,1.549,1.391,1.265,1.161,0.8332,0.6587,0.5492,0.4737,0.3757,0.3144,0.2723,0.2415,0.2179,0.1993,0.1842,0.1376,0.1136,0.09894,0.08909,0.07678,0.0695,0.06477,0.06151,0.05916,0.05743,0.05611};
    109   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    110   dedx.push_back(pv);
    111   for(i=0; i<53; i++) { pv->PutValues(i,E[i],B[i]*1000.*MeV/cm); }
     114G4double G4_WATER_Be [53]={3.272, 3.565, 4.061, 4.463, 4.79, 5.052, 5.258, 5.419, 5.542, 5.803, 5.787, 5.675, 5.529, 5.215, 4.912, 4.634, 4.381, 4.152, 3.944, 3.756, 3.026, 2.533, 2.179, 1.913, 1.542, 1.296, 1.122, 0.9911, 0.8898, 0.8087, 0.7423, 0.5335, 0.4219, 0.3518, 0.3034, 0.2406, 0.2013, 0.1743, 0.1545, 0.1394, 0.1275, 0.1178, 0.08805, 0.07266, 0.06328, 0.05698, 0.0491, 0.04444, 0.04141, 0.03933, 0.03783, 0.03672, 0.03588, };
     115AddData(E,G4_WATER_Be,factor);
    112116
    113   //..C
    114   G4double C[53] = {4.154,4.593,5.358,6.009,6.568,7.049,7.46,7.809,8.103,8.968,9.262,9.311,9.25,8.994,8.68,8.358,8.045,7.747,7.465,7.199,6.093,5.269,4.636,4.137,3.403,2.891,2.516,2.23,2.004,1.823,1.673,1.2,0.9483,0.7904,0.6817,0.5406,0.4525,0.392,0.3477,0.3138,0.287,0.2653,0.1983,0.1637,0.1426,0.1284,0.1107,0.1002,0.09335,0.08865,0.08528,0.08278,0.08088};
    115   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    116   dedx.push_back(pv);
    117   for(i=0; i<53; i++) { pv->PutValues(i,E[i],C[i]*1000.*MeV/cm); }
     117G4double G4_WATER_B [53]={3.773, 4.142, 4.776, 5.304, 5.749, 6.122, 6.431, 6.684, 6.89, 7.432, 7.551, 7.505, 7.391, 7.091, 6.772, 6.463, 6.172, 5.901, 5.65, 5.418, 4.484, 3.817, 3.322, 2.94, 2.392, 2.02, 1.752, 1.549, 1.391, 1.265, 1.161, 0.8332, 0.6587, 0.5492, 0.4737, 0.3757, 0.3144, 0.2723, 0.2415, 0.2179, 0.1993, 0.1842, 0.1376, 0.1136, 0.09894, 0.08909, 0.07678, 0.0695, 0.06477, 0.06151, 0.05916, 0.05743, 0.05611, };
     118AddData(E,G4_WATER_B,factor);
    118119
    119   //..N
    120   G4double N[53] = {4.49,4.984,5.86,6.616,7.276,7.854,8.36,8.799,9.179,10.39,10.89,11.07,11.08,10.9,10.61,10.3,9.974,9.66,9.357,9.068,7.823,6.859,6.097,5.484,4.56,3.9,3.408,3.029,2.727,2.482,2.28,1.636,1.291,1.076,0.9274,0.7354,0.6156,0.5333,0.4731,0.427,0.3906,0.3611,0.27,0.2229,0.1942,0.1749,0.1507,0.1365,0.1272,0.1208,0.1162,0.1128,0.1102};
    121   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    122   dedx.push_back(pv);
    123   for(i=0; i<53; i++) { pv->PutValues(i,E[i],N[i]*1000.*MeV/cm); }
     120G4double G4_WATER_C [53]={4.154, 4.593, 5.358, 6.009, 6.568, 7.049, 7.46, 7.809, 8.103, 8.968, 9.262, 9.311, 9.25, 8.994, 8.68, 8.358, 8.045, 7.747, 7.465, 7.199, 6.093, 5.269, 4.636, 4.137, 3.403, 2.891, 2.516, 2.23, 2.004, 1.823, 1.673, 1.2, 0.9483, 0.7904, 0.6817, 0.5406, 0.4525, 0.392, 0.3477, 0.3138, 0.287, 0.2653, 0.1983, 0.1637, 0.1426, 0.1284, 0.1107, 0.1002, 0.09335, 0.08865, 0.08528, 0.08278, 0.08088, };
     121AddData(E,G4_WATER_C,factor);
    124122
    125   //..O
    126   G4double O[53] = {4.778,5.321,6.298,7.152,7.907,8.578,9.173,9.7,10.16,11.73,12.46,12.78,12.89,12.81,12.57,12.27,11.95,11.63,11.32,11.01,9.659,8.571,7.691,6.967,5.854,5.042,4.427,3.945,3.56,3.245,2.983,2.142,1.689,1.406,1.212,0.9602,0.8037,0.6963,0.6178,0.5577,0.5102,0.4716,0.3527,0.2913,0.2538,0.2285,0.197,0.1784,0.1663,0.1579,0.1519,0.1475,0.1441};
    127   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    128   dedx.push_back(pv);
    129   for(i=0; i<53; i++) { pv->PutValues(i,E[i],O[i]*1000.*MeV/cm); }
     123G4double G4_WATER_N [53]={4.49, 4.984, 5.86, 6.616, 7.276, 7.854, 8.36, 8.799, 9.179, 10.39, 10.89, 11.07, 11.08, 10.9, 10.61, 10.3, 9.974, 9.66, 9.357, 9.068, 7.823, 6.859, 6.097, 5.484, 4.56, 3.9, 3.408, 3.029, 2.727, 2.482, 2.28, 1.636, 1.291, 1.076, 0.9274, 0.7354, 0.6156, 0.5333, 0.4731, 0.427, 0.3906, 0.3611, 0.27, 0.2229, 0.1942, 0.1749, 0.1507, 0.1365, 0.1272, 0.1208, 0.1162, 0.1128, 0.1102, };
     124AddData(E,G4_WATER_N,factor);
    130125
    131   //..F
    132   G4double F[53] = {4.992, 5.575, 6.637, 7.578, 8.418, 9.171, 9.847, 10.45, 11, 12.9, 13.88, 14.35, 14.56, 14.59, 14.4, 14.13, 13.83, 13.51, 13.19, 12.87, 11.44, 10.26, 9.279, 8.463, 7.187, 6.237, 5.506, 4.928, 4.461, 4.076, 3.753, 2.707, 2.137, 1.779, 1.533, 1.215, 1.017, 0.8809, 0.7816, 0.7056, 0.6456, 0.5969, 0.4466, 0.3688, 0.3213, 0.2894, 0.2496, 0.2259,
    133 0.2106, 0.2, 0.1924, 0.1868, 0.1825};
    134   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    135   dedx.push_back(pv);
    136   for(i=0; i<53; i++) { pv->PutValues(i,E[i],F[i]*1000.*MeV/cm); }
     126G4double G4_WATER_O [53]={4.778, 5.321, 6.298, 7.152, 7.907, 8.578, 9.173, 9.7, 10.16, 11.73, 12.46, 12.78, 12.89, 12.81, 12.57, 12.27, 11.95, 11.63, 11.32, 11.01, 9.659, 8.571, 7.691, 6.967, 5.854, 5.042, 4.427, 3.945, 3.56, 3.245, 2.983, 2.142, 1.689, 1.406, 1.212, 0.9602, 0.8037, 0.6963, 0.6178, 0.5577, 0.5102, 0.4716, 0.3527, 0.2913, 0.2538, 0.2285, 0.197, 0.1784, 0.1663, 0.1579, 0.1519, 0.1475, 0.1441, };
     127AddData(E,G4_WATER_O,factor);
    137128
    138   //..Ne
    139   G4double Ne[53] = {5.182, 5.797, 6.931, 7.948, 8.865, 9.693, 10.044, 11.12, 11.74, 13.98, 15.21, 15.85, 16.17, 16.33, 16.21, 15.98, 15.69, 15.38, 15.06, 14.74, 13.24, 11.98, 10.91, 10.01, 8.584, 7.503, 6.66, 5.986, 5.436, 4.979, 4.595, 3.332, 2.635, 2.195, 1.892, 1.499, 1.255, 1.087, 0.9646, 0.8709, 0.7969, 0.7368, 0.5514, 0.4555, 0.3969, 0.3576, 0.3083, 0.2792, 0.2602, 0.2472, 0.2378, 0.2308, 0.2255};
    140   pv = new G4LPhysicsFreeVector(53,E[0],E[52]);
    141   dedx.push_back(pv);
    142   for(i=0; i<53; i++) { pv->PutValues(i,E[i],Ne[i]*1000.*MeV/cm); }
     129G4double G4_WATER_F [53]={4.992, 5.575, 6.637, 7.578, 8.418, 9.171, 9.847, 10.45, 11, 12.9, 13.88, 14.35, 14.56, 14.59, 14.4, 14.13, 13.83, 13.51, 13.19, 12.87, 11.44, 10.26, 9.279, 8.463, 7.187, 6.237, 5.506, 4.928, 4.461, 4.076, 3.753, 2.707, 2.137, 1.779, 1.533, 1.215, 1.017, 0.8809, 0.7816, 0.7056, 0.6456, 0.5969, 0.4466, 0.3688, 0.3213, 0.2894, 0.2496, 0.2259, 0.2106, 0.2, 0.1924, 0.1868, 0.1825, };
     130AddData(E,G4_WATER_F,factor);
     131
     132G4double G4_WATER_Ne [53]={5.182, 5.797, 6.931, 7.948, 8.865, 9.693, 10.44, 11.12, 11.74, 13.98, 15.21, 15.85, 16.17, 16.33, 16.21, 15.98, 15.69, 15.38, 15.06, 14.74, 13.24, 11.98, 10.91, 10.01, 8.584, 7.503, 6.66, 5.986, 5.436, 4.979, 4.595, 3.332, 2.635, 2.195, 1.892, 1.499, 1.255, 1.087, 0.9646, 0.8709, 0.7969, 0.7368, 0.5514, 0.4555, 0.3969, 0.3576, 0.3083, 0.2792, 0.2602, 0.2472, 0.2378, 0.2308, 0.2255, };
     133AddData(E,G4_WATER_Ne,factor);
     134
     135G4double G4_WATER_Na [53]={5.352, 5.998, 7.203, 8.3, 9.298, 10.21, 11.04, 11.81, 12.5, 15.13, 16.68, 17.56, 18.04, 18.43, 18.44, 18.29, 18.05, 17.78, 17.48, 17.18, 15.67, 14.32, 13.15, 12.14, 10.5, 9.226, 8.218, 7.401, 6.728, 6.166, 5.69, 4.112, 3.237, 2.686, 2.307, 1.821, 1.521, 1.317, 1.168, 1.054, 0.9644, 0.8917, 0.6674, 0.5514, 0.4806, 0.4329, 0.3734, 0.3381, 0.3152, 0.2993, 0.288, 0.2796, 0.2732, };
     136AddData(E,G4_WATER_Na,factor);
     137
     138G4double G4_WATER_Mg [53]={5.542, 6.193, 7.42, 8.551, 9.59, 10.54, 11.42, 12.23, 12.98, 15.85, 17.62, 18.66, 19.26, 19.76, 19.83, 19.7, 19.47, 19.2, 18.89, 18.58, 17.02, 15.62, 14.41, 13.36, 11.64, 10.3, 9.233, 8.362, 7.64, 7.033, 6.516, 4.777, 3.792, 3.162, 2.725, 2.159, 1.806, 1.565, 1.388, 1.254, 1.147, 1.061, 0.7944, 0.6565, 0.5722, 0.5156, 0.4447, 0.4027, 0.3754, 0.3566, 0.343, 0.333, 0.3254, };
     139AddData(E,G4_WATER_Mg,factor);
     140
     141G4double G4_WATER_Al [53]={5.724, 6.39, 7.649, 8.82, 9.905, 10.91, 11.84, 12.71, 13.51, 16.66, 18.69, 19.93, 20.68, 21.38, 21.56, 21.5, 21.32, 21.07, 20.79, 20.48, 18.91, 17.47, 16.19, 15.08, 13.24, 11.78, 10.61, 9.641, 8.835, 8.153, 7.569, 5.583, 4.444, 3.71, 3.199, 2.534, 2.12, 1.836, 1.629, 1.471, 1.346, 1.245, 0.9325, 0.7707, 0.6719, 0.6054, 0.5223, 0.473, 0.441, 0.4189, 0.403, 0.3912, 0.3823, };
     142AddData(E,G4_WATER_Al,factor);
     143
     144G4double G4_WATER_Si [53]={5.905, 6.583, 7.868, 9.073, 10.2, 11.25, 12.23, 13.14, 13.99, 17.4, 19.66, 21.1, 22.01, 22.91, 23.21, 23.22, 23.09, 22.87, 22.61, 22.32, 20.76, 19.28, 17.95, 16.78, 14.83, 13.26, 11.99, 10.94, 10.06, 9.304, 8.656, 6.43, 5.135, 4.294, 3.705, 2.938, 2.458, 2.129, 1.889, 1.706, 1.561, 1.444, 1.082, 0.8942, 0.7796, 0.7026, 0.6061, 0.549, 0.5119, 0.4862, 0.4678, 0.4542, 0.4438, };
     145AddData(E,G4_WATER_Si,factor);
     146
     147G4double G4_WATER_P [53]={6.12, 6.81, 8.118, 9.352, 10.51, 11.61, 12.63, 13.58, 14.48, 18.13, 20.63, 22.28, 23.34, 24.47, 24.91, 25.02, 24.95, 24.78, 24.55, 24.28, 22.76, 21.26, 19.89, 18.67, 16.59, 14.92, 13.54, 12.39, 11.42, 10.59, 9.867, 7.367, 5.896, 4.935, 4.259, 3.376, 2.824, 2.445, 2.169, 1.959, 1.792, 1.657, 1.242, 1.027, 0.8954, 0.807, 0.6963, 0.6308, 0.5881, 0.5587, 0.5375, 0.5219, 0.51, };
     148AddData(E,G4_WATER_P,factor);
     149
     150G4double G4_WATER_S [53]={6.294, 7, 8.338, 9.604, 10.8, 11.94, 13, 14, 14.94, 18.82, 21.55, 23.41, 24.65, 26.01, 26.6, 26.81, 26.81, 26.69, 26.5, 26.26, 24.79, 23.28, 21.88, 20.61, 18.43, 16.64, 15.16, 13.92, 12.86, 11.95, 11.15, 8.371, 6.715, 5.624, 4.856, 3.847, 3.217, 2.785, 2.47, 2.229, 2.04, 1.886, 1.413, 1.169, 1.019, 0.9187, 0.7929, 0.7183, 0.6697, 0.6362, 0.6122, 0.5944, 0.5808, };
     151AddData(E,G4_WATER_S,factor);
     152
     153G4double G4_WATER_Cl [53]={6.522, 7.237, 8.59, 9.875, 11.1, 12.26, 13.36, 14.39, 15.37, 19.45, 22.4, 24.45, 25.86, 27.46, 28.19, 28.5, 28.57, 28.5, 28.34, 28.13, 26.72, 25.21, 23.78, 22.47, 20.2, 18.32, 16.75, 15.42, 14.28, 13.3, 12.44, 9.392, 7.557, 6.34, 5.479, 4.344, 3.633, 3.145, 2.789, 2.517, 2.303, 2.13, 1.596, 1.32, 1.151, 1.038, 0.8957, 0.8115, 0.7567, 0.7189, 0.6917, 0.6717, 0.6563, };
     154AddData(E,G4_WATER_Cl,factor);
     155
     156G4double G4_WATER_Ar [53]={6.642, 7.369, 8.739, 10.04, 11.28, 12.47, 13.59, 14.66, 15.66, 19.93, 23.08, 25.32, 26.89, 28.72, 29.6, 30.01, 30.15, 30.13, 30, 29.82, 28.46, 26.94, 25.49, 24.15, 21.81, 19.86, 18.22, 16.82, 15.61, 14.57, 13.65, 10.39, 8.394, 7.063, 6.114, 4.859, 4.067, 3.522, 3.125, 2.821, 2.581, 2.387, 1.789, 1.48, 1.291, 1.164, 1.005, 0.9105, 0.8491, 0.8067, 0.7763, 0.7537, 0.7365, };
     157AddData(E,G4_WATER_Ar,factor);
    143158
    144159  if(corr) {
    145     for(i=0; i<8; i++) {corr->AddStoppingData(Z[i], A[i], "G4_WATER", *(dedx[i]));}
     160    for(i=0; i<16; i++) {corr->AddStoppingData(Z[i], aa[i], "G4_WATER", dedx[i]);}
    146161  }
    147162}
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlung.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlung.cc,v 1.48 2007/05/23 08:47:34 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4eBremsstrahlung.cc,v 1.56 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    6969// 22-05-06 Use gammaThreshold from manager (V.Ivantchenko)
    7070// 15-01-07 use SetEmModel() from G4VEnergyLossProcess (mma)
    71 //
     71//          use RelEmModel above 1GeV (AS &  VI) 
     72// 13-11-08 reenable LPM switch (A.Schaelicke)
    7273// -------------------------------------------------------------------
    7374//
     
    7879#include "G4Gamma.hh"
    7980#include "G4eBremsstrahlungModel.hh"
    80 #include "G4UniversalFluctuation.hh"
     81#include "G4eBremsstrahlungRelModel.hh"
    8182#include "G4UnitsTable.hh"
    8283#include "G4LossTableManager.hh"
     
    9293  G4VEnergyLossProcess(name),
    9394  isInitialised(false)
    94 {}
     95{
     96  SetProcessSubType(fBremsstrahlung);
     97}
    9598
    9699//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    98101G4eBremsstrahlung::~G4eBremsstrahlung()
    99102{}
     103
     104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     105
     106G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
     107{
     108  return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
     109}
    100110
    101111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    109119    SetSecondaryParticle(G4Gamma::Gamma());
    110120    SetIonisation(false);
    111     if (!EmModel()) SetEmModel(new G4eBremsstrahlungModel());
    112     EmModel()->SetLowEnergyLimit (100*eV);
    113     EmModel()->SetHighEnergyLimit(100*TeV);
    114     if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
     121
     122    if (!EmModel(1)) SetEmModel(new G4eBremsstrahlungModel(), 1);
     123    if (!EmModel(2)) SetEmModel(new G4eBremsstrahlungRelModel(), 2);
     124
     125    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
     126    EmModel(1)->SetHighEnergyLimit(EmModel(2)->LowEnergyLimit());
     127    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
    115128               
    116     AddEmModel(1, EmModel(), FluctModel());
     129    G4VEmFluctuationModel* fm = 0;
     130    AddEmModel(1, EmModel(1), fm);
     131    AddEmModel(2, EmModel(2), fm);
    117132    isInitialised = true;
    118133  }
    119134  G4LossTableManager* man = G4LossTableManager::Instance();
    120   dynamic_cast<G4eBremsstrahlungModel*>(EmModel())
    121     ->SetEnergyThreshold(man->BremsstrahlungTh());
    122   dynamic_cast<G4eBremsstrahlungModel*>(EmModel())
    123     ->SetLPMflag(man->LPMFlag());
     135  G4double eth = man->BremsstrahlungTh();
     136  EmModel(1)->SetSecondaryThreshold(eth);
     137  EmModel(2)->SetSecondaryThreshold(eth);
     138
     139  // Only high energy model LMP flag is ON/OFF
     140  EmModel(1)->SetLPMFlag(false);
     141  EmModel(2)->SetLPMFlag(man->LPMFlag());
    124142}
    125143
     
    128146void G4eBremsstrahlung::PrintInfo()
    129147{
    130   if(EmModel()) {
    131     G4cout << "      Total cross sections and sampling from "
    132            << EmModel()->GetName() << " model" 
    133            << " (based on the EEDL data library) "
    134            << "\n      Good description from 1 KeV to 100 GeV, "
    135            << "log scale extrapolation above 100 GeV."
    136            << " LPM flag "
    137            << dynamic_cast<G4eBremsstrahlungModel*>(EmModel())->LPMflag()
    138            << G4endl;
    139     G4double eth = dynamic_cast<G4eBremsstrahlungModel*>(EmModel())->EnergyThreshold();
    140     if(eth < DBL_MIN)
    141       G4cout << "      HighEnergyThreshold(GeV)= " << eth/GeV
    142              << G4endl;
     148  if(EmModel(1)) {
     149    G4LossTableManager* man = G4LossTableManager::Instance();
     150    G4double eth = man->BremsstrahlungTh();
     151    G4cout << "      LPM flag: " << man->LPMFlag() << " for E > "
     152           << EmModel(1)->HighEnergyLimit()/GeV << " GeV";
     153    if(eth < DBL_MAX) G4cout << ",  HighEnergyThreshold(GeV)= " << eth/GeV;
     154    G4cout << G4endl;
    143155  }
    144156}
  • trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eBremsstrahlungModel.cc,v 1.39 2007/05/23 08:47:35 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     26// $Id: G4eBremsstrahlungModel.cc,v 1.43 2008/11/13 19:28:58 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5454// 27-03-06  Fix calculation of fl parameter at low energy (energy loss) (VI)
    5555// 15-02-07  correct LPMconstant by a factor 2, thanks to G. Depaola (mma)
     56// 09-09-08  MigdalConstant increased in (2pi)^2 times (A.Schaelicke)
    5657//
    5758// Class Description:
     
    8586    isElectron(true),
    8687    probsup(1.0),
    87     MigdalConstant(classic_electr_radius*electron_Compton_length*electron_Compton_length/pi),
     88    MigdalConstant(classic_electr_radius*electron_Compton_length*electron_Compton_length*4.0*pi),
    8889    LPMconstant(fine_structure_const*electron_mass_c2*electron_mass_c2/(4.*pi*hbarc)),
    89     theLPMflag(true),
    9090    isInitialised(false)
    9191{
     
    9393  theGamma = G4Gamma::Gamma();
    9494  minThreshold = 1.0*keV;
    95   highKinEnergy= 100.*TeV;
    96   lowKinEnergy = 1.0*keV;
    97   highEnergyTh = DBL_MAX;
    9895}
    9996
     
    164161  if(isInitialised) return;
    165162
    166   if(pParticleChange)
     163  if(pParticleChange) {
    167164    fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
    168   else
     165  } else {
    169166    fParticleChange = new G4ParticleChangeForLoss();
    170 
     167  }
    171168  isInitialised = true;
    172169}
     
    834831    gammaEnergy = x*kineticEnergy;
    835832
    836     if (theLPMflag) {
     833    if (LPMFlag()) {
    837834     // take into account the supression due to the LPM effect
    838835      if (G4UniformRand() <= SupressionFunction(material,kineticEnergy,
     
    879876
    880877  // stop tracking and create new secondary instead of primary
    881   if(gammaEnergy > highEnergyTh) {
     878  if(gammaEnergy > SecondaryThreshold()) {
    882879    fParticleChange->ProposeTrackStatus(fStopAndKill);
    883880    fParticleChange->SetProposedKineticEnergy(0.0);
     
    951948  G4double supr = 1.0;
    952949
    953   if (theLPMflag) {
     950  if (LPMFlag()) {
    954951
    955952    G4double s2lpm = LPMEnergy*gammaEnergy/totEnergySquare;
  • trunk/source/processes/electromagnetic/standard/src/G4eCoulombScatteringModel.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eCoulombScatteringModel.cc,v 1.40 2008/01/07 08:32:01 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4eCoulombScatteringModel.cc,v 1.59 2008/10/22 18:39:29 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    4444// 19.08.06 V.Ivanchenko add inline function ScreeningParameter
    4545// 09.10.07 V.Ivanchenko reorganized methods, add cut dependence in scattering off e-
     46// 09.06.08 V.Ivanchenko add SelectIsotope and sampling of the recoil ion
    4647//
    4748// Class Description:
     
    6162#include "G4Positron.hh"
    6263#include "G4Proton.hh"
     64#include "G4ParticleTable.hh"
    6365
    6466//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    6668using namespace std;
    6769
    68 G4eCoulombScatteringModel::G4eCoulombScatteringModel(
    69   G4double thetaMin, G4double thetaMax, G4bool build,
    70   G4double tlim, const G4String& nam)
     70G4eCoulombScatteringModel::G4eCoulombScatteringModel(const G4String& nam)
    7171  : G4VEmModel(nam),
    72     cosThetaMin(cos(thetaMin)),
    73     cosThetaMax(cos(thetaMax)),
    74     q2Limit(tlim),
    75     theCrossSectionTable(0),
    76     lowKEnergy(keV),
    77     highKEnergy(TeV),
     72    cosThetaMin(1.0),
     73    cosThetaMax(-1.0),
     74    q2Limit(TeV*TeV),
    7875    alpha2(fine_structure_const*fine_structure_const),
    7976    faclim(100.0),
    80     nbins(12),
    81     nmax(100),
    82     buildTable(build),
    8377    isInitialised(false)
    8478{
    8579  fNistManager = G4NistManager::Instance();
     80  theParticleTable = G4ParticleTable::GetParticleTable();
    8681  theElectron = G4Electron::Electron();
    8782  thePositron = G4Positron::Positron();
    8883  theProton   = G4Proton::Proton();
     84  currentMaterial = 0;
     85  currentElement  = 0;
    8986  a0 = alpha2*electron_mass_c2*electron_mass_c2/(0.885*0.885);
    9087  G4double p0 = electron_mass_c2*classic_electr_radius;
    9188  coeff  = twopi*p0*p0;
    9289  constn = 6.937e-6/(MeV*MeV);
    93   tkin = targetZ = targetA = mom2 = DBL_MIN;
     90  tkin = targetZ = mom2 = DBL_MIN;
    9491  elecXSection = nucXSection = 0.0;
     92  recoilThreshold = DBL_MAX;
    9593  ecut = DBL_MAX;
    9694  particle = 0;
    97   for(size_t j=0; j<100; j++) {index[j] = -1;}
     95  currentCouple = 0;
     96  for(size_t j=0; j<100; j++) {
     97    FF[j] = 0.0;
     98  }
    9899}
    99100
     
    101102
    102103G4eCoulombScatteringModel::~G4eCoulombScatteringModel()
    103 {
    104   if(theCrossSectionTable) {
    105     theCrossSectionTable->clearAndDestroy();
    106     delete theCrossSectionTable;
    107   }
    108 }
     104{}
    109105
    110106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    111107
    112108void G4eCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
    113                                            const G4DataVector&)
    114 {
    115   //  G4cout << "!!! G4eCoulombScatteringModel::Initialise for "
    116   // << p->GetParticleName() << "  cos(TetMin)= " << cosThetaMin
    117   // << "  cos(TetMax)= " << cosThetaMax <<G4endl;
     109                                           const G4DataVector& cuts)
     110{
     111  SetupParticle(p);
     112  currentCouple = 0;
     113  elecXSection = nucXSection = 0.0;
     114  tkin = targetZ = mom2 = DBL_MIN;
     115  ecut = etag = DBL_MAX;
     116  cosThetaMin = cos(PolarAngleLimit());
     117  currentCuts = &cuts;
     118  //G4cout << "!!! G4eCoulombScatteringModel::Initialise for "
     119  //     << p->GetParticleName() << "  cos(TetMin)= " << cosThetaMin
     120  //     << "  cos(TetMax)= " << cosThetaMax <<G4endl;
    118121  if(!isInitialised) {
    119122    isInitialised = true;
     
    124127    else
    125128      fParticleChange = new G4ParticleChangeForGamma();
    126   } else {
    127     return;
    128   }
    129 
    130   if(p->GetParticleType() == "nucleus") buildTable = false;
    131   if(!buildTable) return;
    132 
    133   // Compute log cross section table per atom
    134   if(!theCrossSectionTable) theCrossSectionTable = new G4PhysicsTable();
    135  
    136   nbins = 2*G4int(log10(highKEnergy/lowKEnergy));
    137 }
    138 
    139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    140 
    141 G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom(
    142                 const G4ParticleDefinition* p,
    143                 G4double kinEnergy,
    144                 G4double Z, G4double A,
    145                 G4double cutEnergy, G4double)
    146 {
    147   if(p == particle && kinEnergy == tkin && Z == targetZ &&
    148      A == targetA && cutEnergy == ecut) return nucXSection;
    149 
    150   //G4cout << "### G4eCoulombScatteringModel::ComputeCrossSectionPerAtom  for "
    151   //     << p->GetParticleName() << " Z= " << Z << " A= " << A
    152   //     << " e= " << kinEnergy << G4endl;
    153 
    154   nucXSection = ComputeElectronXSectionPerAtom(p,kinEnergy,Z,A,cutEnergy);
    155 
    156   // nuclear cross section
    157   if(theCrossSectionTable) {
    158     G4bool b;
    159     G4int iz  = G4int(Z);
    160     G4int idx = index[iz];
    161 
    162     // compute table for given Z
    163     if(-1 == idx) {
    164       idx = theCrossSectionTable->size();
    165       index[iz] = idx;
    166       G4PhysicsLogVector* ptrVector
    167         = new G4PhysicsLogVector(lowKEnergy, highKEnergy, nbins);
    168       //  G4cout << "New vector Z= " << iz << " A= " << A << " idx= " << idx << G4endl;
    169       G4double e, value;
    170       for(G4int i=0; i<=nbins; i++) {
    171         e     = ptrVector->GetLowEdgeEnergy( i ) ;
    172         value = CalculateCrossSectionPerAtom(p, e, Z, A); 
    173         ptrVector->PutValue( i, log(value) );
    174       }
    175       theCrossSectionTable->push_back(ptrVector);
    176     }
    177 
    178       // take value from the table
    179     nucXSection +=
    180       std::exp((((*theCrossSectionTable)[idx]))->GetValue(kinEnergy, b));
    181 
    182     // compute value from scratch
    183   } else nucXSection += CalculateCrossSectionPerAtom(p, kinEnergy, Z, A);
    184  
    185   //  G4cout << " cross(bn)= " << nucXSection/barn << G4endl;
    186  
    187   if(nucXSection < 0.0) nucXSection = 0.0;
    188   return nucXSection;
    189 }
    190 
    191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    192 
    193 G4double G4eCoulombScatteringModel::ComputeElectronXSectionPerAtom(
    194                 const G4ParticleDefinition* p,
    195                 G4double kinEnergy,
    196                 G4double Z,
    197                 G4double A,
    198                 G4double cutEnergy)
    199 {
    200   if(p == particle && kinEnergy == tkin && Z == targetZ &&
    201      cutEnergy == ecut) return elecXSection;
     129  }
     130  if(mass < GeV && particle->GetParticleType() != "nucleus") {
     131    InitialiseElementSelectors(p,cuts);
     132  }
     133}
     134
     135//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     136
     137void G4eCoulombScatteringModel::ComputeMaxElectronScattering(G4double cutEnergy)
     138{
    202139  ecut = cutEnergy;
    203   elecXSection = 0.0;
    204   SetupParticle(p);
    205   G4double ekin = std::max(keV, kinEnergy);
    206   //G4double ekin = kinEnergy;
    207   SetupTarget(Z, A, ekin);
    208 
    209140  G4double tmax = tkin;
    210   if(p == theElectron) tmax *= 0.5;
    211   else if(p != thePositron) {
     141  cosTetMaxElec = 1.0;
     142  if(mass > MeV) {
    212143    G4double ratio = electron_mass_c2/mass;
    213144    G4double tau = tkin/mass;
    214145    tmax = 2.0*electron_mass_c2*tau*(tau + 2.)/
    215146      (1.0 + 2.0*ratio*(tau + 1.0) + ratio*ratio);
    216   }
    217 
    218   cosTetMaxElec = cosTetMaxNuc;
    219   G4double t = std::min(cutEnergy, tmax);
    220   G4double mom21 = t*(t + 2.0*electron_mass_c2);
    221   G4double t1 = tkin - t;
    222   if(t1 > 0.0) {
    223     G4double mom22 = t1*(t1 + 2.0*mass);
    224     G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
    225     if(ctm > cosTetMaxElec && ctm <= 1.0) cosTetMaxElec = ctm;
    226   }
    227 
    228   if(cosTetMaxElec < cosThetaMin) {
    229     G4double x1 = 1.0 - cosThetaMin  + screenZ;
    230     G4double x2 = 1.0 - cosTetMaxElec + screenZ;
    231     elecXSection = coeff*Z*chargeSquare*invbeta2*
    232       (cosThetaMin - cosTetMaxElec)/(x1*x2*mom2);
    233   }
    234   //  G4cout << "cut= " << ecut << " e= " << tkin
    235   // << " croosE(barn)= " << elecXSection/barn
    236   // << " cosEl= " << cosTetMaxElec << " costmin= " << cosThetaMin << G4endl;
    237   return elecXSection;
    238 }
    239 
    240 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    241 
    242 G4double G4eCoulombScatteringModel::CalculateCrossSectionPerAtom(
    243                              const G4ParticleDefinition* p,
    244                              G4double kinEnergy,
    245                              G4double Z, G4double A)
    246 {
    247   G4double cross = 0.0;
     147    cosTetMaxElec = 1.0 - std::min(cutEnergy, tmax)*electron_mass_c2/mom2;
     148  } else {
     149
     150    if(particle == theElectron) tmax *= 0.5;
     151    G4double t = std::min(cutEnergy, tmax);
     152    G4double mom21 = t*(t + 2.0*electron_mass_c2);
     153    G4double t1 = tkin - t;
     154    //G4cout << "tkin= " << tkin << " t= " << t << " t1= " << t1 << G4endl;
     155    if(t1 > 0.0) {
     156      G4double mom22 = t1*(t1 + 2.0*mass);
     157      G4double ctm = (mom2 + mom22 - mom21)*0.5/sqrt(mom2*mom22);
     158      //G4cout << "ctm= " << ctm << G4endl;
     159      if(ctm < 1.0) cosTetMaxElec = ctm;
     160    }
     161  }
     162}
     163
     164//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     165
     166G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom(
     167                const G4ParticleDefinition* p,
     168                G4double kinEnergy,
     169                G4double Z, G4double,
     170                G4double cutEnergy, G4double)
     171{
     172  //G4cout << "### G4eCoulombScatteringModel::ComputeCrossSectionPerAtom  for "
     173  //  << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV << G4endl;
     174  G4double xsec = 0.0;
    248175  SetupParticle(p);
    249   G4double ekin = std::max(keV, kinEnergy);
    250   //G4double ekin = kinEnergy;
    251   SetupTarget(Z, A, ekin);
    252 
    253   if(cosTetMaxNuc < cosThetaMin) {
    254     G4double x1 = 1.0 - cosThetaMin;
    255     G4double x2 = 1.0 - cosTetMaxNuc;
    256     G4double x3 = cosThetaMin - cosTetMaxNuc;
    257     G4double z1 = x1 + screenZ;
    258     G4double z2 = x2 + screenZ;
    259     G4double d  = 1.0/formfactA - screenZ;
    260     G4double d1 = 1.0 - formfactA*screenZ;
    261     G4double zn1= x1 + d;
    262     G4double zn2= x2 + d;
    263     cross = coeff*Z*Z*chargeSquare*invbeta2
    264       *(x3/(z1*z2) + x3/(zn1*zn2) +
    265         2.0*std::log(z1*zn2/(z2*zn1))/d) / (mom2*d1*d1);
    266   }
     176  G4double ekin = std::max(lowEnergyLimit, kinEnergy);
     177  SetupKinematic(ekin, cutEnergy);
     178  if(cosTetMaxNuc < cosTetMinNuc) {
     179    SetupTarget(Z, ekin);
     180    xsec = CrossSectionPerAtom(); 
     181  }
     182  /*
     183  G4cout << "e(MeV)= " << ekin/MeV << "cosTetMinNuc= " << cosTetMinNuc
     184         << " cosTetMaxNuc= " << cosTetMaxNuc
     185         << " cosTetMaxElec= " << cosTetMaxElec
     186         << " screenZ= " << screenZ
     187         << " formfactA= " << formfactA
     188         << " cosTetMaxHad= " << cosTetMaxHad << G4endl;
     189  */
     190  return xsec; 
     191}
     192
     193//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     194
     195G4double G4eCoulombScatteringModel::CrossSectionPerAtom()
     196{
     197  // This method needs initialisation before be called
     198
     199  G4double fac = coeff*targetZ*chargeSquare*invbeta2/mom2;
     200  elecXSection = 0.0;
     201  nucXSection  = 0.0;
     202
     203  G4double x  = 1.0 - cosTetMinNuc;
     204  G4double x1 = x + screenZ;
     205
     206  if(cosTetMaxElec2 < cosTetMinNuc) {
     207    elecXSection = fac*(cosTetMinNuc - cosTetMaxElec2)/
     208      (x1*(1.0 - cosTetMaxElec2 + screenZ));
     209    nucXSection  = elecXSection;
     210  }
     211
     212  //G4cout << "XS tkin(MeV)= " << tkin<<" xs= " <<nucXSection
     213  //     << " costmax= " << cosTetMaxNuc2
     214  //     << " costmin= " << cosTetMinNuc << "  Z= " << targetZ <<G4endl;
     215  if(cosTetMaxNuc2 < cosTetMinNuc) {
     216    G4double s  = screenZ*formfactA;
     217    G4double z1 = 1.0 - cosTetMaxNuc2 + screenZ;
     218    G4double d  = (1.0 - s)/formfactA;
     219    //G4cout <<"x1= "<<x1<<" z1= " <<z1<<" s= "<<s << " d= " <<d <<G4endl;
     220    if(d < 0.2*x1) {
     221      G4double x2 = x1*x1;
     222      G4double z2 = z1*z1;
     223      x = (1.0/(x1*x2) - 1.0/(z1*z2) - d*1.5*(1.0/(x2*x2) - 1.0/(z2*z2)))/
     224        (3.0*formfactA*formfactA);
     225    } else {
     226      G4double x2 = x1 + d;
     227      G4double z2 = z1 + d;
     228      x = (1.0 + 2.0*s)*((cosTetMinNuc - cosTetMaxNuc2)*(1.0/(x1*z1) + 1.0/(x2*z2)) -
     229                         2.0*log(z1*x2/(z2*x1))/d);
     230    }
     231    nucXSection += fac*targetZ*x;
     232  }
     233
     234  //G4cout<<" cross(bn)= "<<nucXSection/barn<<" xsElec(bn)= "<<elecXSection/barn
     235  //    << " Asc= " << screenZ << G4endl;
    267236 
    268   //  G4cout << "CalculateCrossSectionPerAtom: e(MeV)= " << tkin
    269   // << " cross(b)= " << cross/barn << " ctmin= " << cosThetaMin
    270   // << " ctmax= " << cosTetMaxNuc << G4endl;
    271  
    272   return cross;
     237  return nucXSection;
    273238}
    274239
     
    276241
    277242void G4eCoulombScatteringModel::SampleSecondaries(
    278                 std::vector<G4DynamicParticle*>*,
     243                std::vector<G4DynamicParticle*>* fvect,
    279244                const G4MaterialCutsCouple* couple,
    280245                const G4DynamicParticle* dp,
    281246                G4double cutEnergy,
    282                 G4double maxEnergy)
    283 {
    284   const G4Material* aMaterial = couple->GetMaterial();
    285   const G4ParticleDefinition* p = dp->GetDefinition();
     247                G4double)
     248{
    286249  G4double kinEnergy = dp->GetKineticEnergy();
    287 
    288   // Select atom and setup
    289   SetupParticle(p);
    290   const G4Element* elm =
    291     SelectRandomAtom(aMaterial,p,kinEnergy,cutEnergy,maxEnergy);
    292   G4double Z  = elm->GetZ();
    293   G4double A  = elm->GetN();
    294 
    295   G4double cross =
    296     ComputeCrossSectionPerAtom(p,kinEnergy,Z,A,cutEnergy,maxEnergy);
    297 
    298   G4double costm = cosTetMaxNuc;
     250  if(kinEnergy <= DBL_MIN) return;
     251  DefineMaterial(couple);
     252  SetupParticle(dp->GetDefinition());
     253  G4double ekin = std::max(lowEnergyLimit, kinEnergy);
     254  SetupKinematic(ekin, cutEnergy);
     255  //G4cout << "G4eCoulombScatteringModel::SampleSecondaries e(MeV)= "
     256  //     << kinEnergy << "  " << particle->GetParticleName() << G4endl;
     257 
     258  // Choose nucleus
     259  currentElement = SelectRandomAtom(couple,particle,ekin,cutEnergy,ekin);
     260
     261  SetupTarget(currentElement->GetZ(),ekin);
     262 
     263  G4double cost = SampleCosineTheta();
     264  G4double z1   = 1.0 - cost;
     265  if(z1 < 0.0) return;
     266
     267  G4double sint = sqrt(z1*(1.0 + cost));
     268 
     269  //G4cout<<"## Sampled sint= " << sint << "  Z= " << targetZ
     270  //    << "  screenZ= " << screenZ << " cn= " << formfactA << G4endl;
     271 
     272  G4double phi  = twopi * G4UniformRand();
     273
     274  G4ThreeVector direction = dp->GetMomentumDirection();
     275  G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost);
     276  newDirection.rotateUz(direction);   
     277
     278  fParticleChange->ProposeMomentumDirection(newDirection);   
     279
     280  // recoil sampling assuming a small recoil
     281  // and first order correction to primary 4-momentum
     282  if(lowEnergyLimit < kinEnergy) {
     283    G4int ia = SelectIsotopeNumber(currentElement);
     284    G4double Trec = z1*mom2/(amu_c2*G4double(ia));
     285    G4double th =
     286      std::min(recoilThreshold,
     287               targetZ*currentElement->GetIonisation()->GetMeanExcitationEnergy());
     288
     289    if(Trec > th) {
     290      G4int iz = G4int(targetZ);
     291      G4ParticleDefinition* ion = theParticleTable->FindIon(iz, ia, 0, iz);
     292      Trec = z1*mom2/ion->GetPDGMass();
     293      if(Trec < kinEnergy) {
     294        G4ThreeVector dir = (direction - newDirection).unit();
     295        G4DynamicParticle* newdp = new G4DynamicParticle(ion, dir, Trec);
     296        fvect->push_back(newdp);
     297        fParticleChange->SetProposedKineticEnergy(kinEnergy - Trec);
     298      }
     299    }
     300  }
     301 
     302  return;
     303}
     304
     305//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     306
     307G4double G4eCoulombScatteringModel::SampleCosineTheta()
     308{
     309  G4double costm = cosTetMaxNuc2;
    299310  G4double formf = formfactA;
    300   if(G4UniformRand()*cross < elecXSection) {
    301     costm = cosTetMaxElec;
     311  G4double prob  = 0.0;
     312  G4double xs = CrossSectionPerAtom();
     313  if(xs > 0.0) prob = elecXSection/xs;
     314
     315  // scattering off e or A?
     316  if(G4UniformRand() < prob) {
     317    costm = cosTetMaxElec2;
    302318    formf = 0.0;
    303319  }
     320
    304321  /*
    305   G4cout << "G4eCoul...SampleSecondaries: e(MeV)= " << tkin
     322  G4cout << "SampleCost: e(MeV)= " << tkin
    306323         << " ctmin= " << cosThetaMin
    307324         << " ctmaxN= " << cosTetMaxNuc
    308325         << " ctmax= " << costm
    309          << " Z= " << Z << " A= " << A
    310          << " cross= " << cross/barn << " crossE= " << elecXSection/barn
     326         << " Z= " << targetZ << " A= " << targetA
    311327         << G4endl;
    312328  */
    313   if(costm >= cosThetaMin) return;
    314 
    315   G4double x1 = 1. - cosThetaMin + screenZ;
    316   G4double x2 = 1. - costm;
    317   G4double x3 = cosThetaMin - costm;
    318   G4double grej,  z, z1;
     329  if(costm >= cosTetMinNuc) return 2.0;
     330
     331  G4double x1 = 1. - cosTetMinNuc + screenZ;
     332  G4double x2 = 1. - costm + screenZ;
     333  G4double x3 = cosTetMinNuc - costm;
     334  G4double grej, z1;
    319335  do {
    320     z  = G4UniformRand()*x3;
    321     z1 = (x1*x2 - screenZ*z)/(x1 + z);
    322     if(z1 < 0.0) z1 = 0.0;
    323     else if(z1 > 2.0) z1 = 2.0;
     336    z1 = x1*x2/(x1 + G4UniformRand()*x3) - screenZ;
    324337    grej = 1.0/(1.0 + formf*z1);
    325338  } while ( G4UniformRand() > grej*grej ); 
    326  
    327   G4double cost = 1.0 - z1;
    328   G4double sint= sqrt(z1*(2.0 - z1));
    329   /*
    330   if(sint > 0.1)
    331     G4cout<<"## SampleSecondaries: e(MeV)= " << kinEnergy
    332           << " sint= " << sint << "  Z= " << Z << "  screenZ= " << screenZ
    333           << " cn= " << formf
    334           << G4endl;
    335   */
    336   G4double phi  = twopi * G4UniformRand();
    337 
    338   G4ThreeVector direction = dp->GetMomentumDirection();
    339   G4ThreeVector newDirection(cos(phi)*sint,sin(phi)*sint,cost);
    340   newDirection.rotateUz(direction);   
    341 
    342   fParticleChange->ProposeMomentumDirection(newDirection);   
    343  
    344   return;
    345 }
    346 
    347 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    348 
    349 
     339
     340  //G4cout << "z= " << z1 << " cross= " << nucXSection/barn
     341  // << " crossE= " << elecXSection/barn << G4endl;
     342
     343  return 1.0 - z1;
     344}
     345
     346//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     347
     348
  • trunk/source/processes/electromagnetic/standard/src/G4eIonisation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eIonisation.cc,v 1.53 2007/05/22 17:34:36 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4eIonisation.cc,v 1.57 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    9090    isInitialised(false)
    9191{
    92   SetStepFunction(0.2, 1*mm);
    93   SetIntegral(true);
    94   SetVerboseLevel(1);
     92  //  SetStepFunction(0.2, 1*mm);
     93  // SetIntegral(true);
     94  // SetVerboseLevel(1);
     95  SetProcessSubType(fIonisation);
    9596}
    9697
     
    99100G4eIonisation::~G4eIonisation()
    100101{}
     102
     103//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     104
     105G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     106                                         const G4Material*,
     107                                         G4double cut)
     108{
     109  G4double x = cut;
     110  if(isElectron) x += cut;
     111  return x;
     112}
     113
     114//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     115
     116G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p)
     117{
     118  return (&p == G4Electron::Electron() || &p == G4Positron::Positron());
     119}
    101120
    102121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    110129    SetSecondaryParticle(theElectron);
    111130    if (!EmModel()) SetEmModel(new G4MollerBhabhaModel());
    112     EmModel()->SetLowEnergyLimit (100*eV);
    113     EmModel()->SetHighEnergyLimit(100*TeV);
     131    EmModel()->SetLowEnergyLimit (MinKinEnergy());
     132    EmModel()->SetHighEnergyLimit(MaxKinEnergy());
    114133    if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
    115134               
     
    122141
    123142void G4eIonisation::PrintInfo()
    124 {
    125   if(EmModel())
    126     G4cout << "      Delta cross sections and sampling from "
    127            << EmModel()->GetName() << " model"
    128            << "\n      Good description from 1 KeV to 100 GeV."
    129            << G4endl;
    130 }
     143{}
    131144
    132145//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4eeToTwoGammaModel.cc

    r819 r961  
    2525//
    2626// $Id: G4eeToTwoGammaModel.cc,v 1.14 2007/05/23 08:47:35 vnivanch Exp $
    27 // GEANT4 tag $Name: $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
  • trunk/source/processes/electromagnetic/standard/src/G4eplusAnnihilation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4eplusAnnihilation.cc,v 1.27 2007/10/02 10:17:12 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4eplusAnnihilation.cc,v 1.30 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    6868  : G4VEmProcess(name), isInitialised(false)
    6969{
     70  SetProcessSubType(fAnnihilation);
    7071  enableAtRestDoIt = true;
    7172}
     
    7879//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    7980
     81G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p)
     82{
     83  return (&p == G4Positron::Positron());
     84}
     85
     86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     87
     88G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength(
     89                              const G4Track&, G4ForceCondition* condition)
     90{
     91  *condition = NotForced;
     92  return 0.0;
     93}
     94
     95//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     96
    8097void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*)
    8198{
     
    85102    SetStartFromNullFlag(false);
    86103    SetSecondaryParticle(G4Gamma::Gamma());
    87     G4double emin = 0.1*keV;
    88     G4double emax = 100.*TeV;
    89     SetLambdaBinning(120);
    90     SetMinKinEnergy(emin);
    91     SetMaxKinEnergy(emax);
    92     if(!Model()) SetModel(new G4eeToTwoGammaModel);
    93     Model()->SetLowEnergyLimit(emin);
    94     Model()->SetHighEnergyLimit(emax);
     104    if(!Model()) SetModel(new G4eeToTwoGammaModel());
     105    Model()->SetLowEnergyLimit(MinKinEnergy());
     106    Model()->SetHighEnergyLimit(MaxKinEnergy());
    95107    AddEmModel(1, Model());
    96108  }
     
    100112
    101113void G4eplusAnnihilation::PrintInfo()
    102 {
    103   G4cout
    104     << "      Sampling according " << Model()->GetName() << " model"   
    105     << G4endl;
    106 }
     114{}
    107115
    108116//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hIonisation.cc,v 1.70 2008/01/14 11:59:45 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    7878//          positive from pi+ and p (VI)
    7979// 14-01-07 use SetEmModel() and SetFluctModel() from G4VEnergyLossProcess (mma)
     80// 12-09-08 Removed CorrectionsAlongStep (VI)
    8081//
    8182// -------------------------------------------------------------------
     
    9091#include "G4BraggModel.hh"
    9192#include "G4BetheBlochModel.hh"
     93#include "G4IonFluctuations.hh"
    9294#include "G4UniversalFluctuation.hh"
    9395#include "G4BohrFluctuations.hh"
     
    9597#include "G4PionPlus.hh"
    9698#include "G4PionMinus.hh"
    97 #include "G4LossTableManager.hh"
     99#include "G4KaonPlus.hh"
     100#include "G4KaonMinus.hh"
    98101
    99102//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    103106G4hIonisation::G4hIonisation(const G4String& name)
    104107  : G4VEnergyLossProcess(name),
    105     theParticle(0),
    106     theBaseParticle(0),
    107     isInitialised(false)
    108 {
    109   SetStepFunction(0.2, 1*mm);
    110   SetIntegral(true);
    111   SetVerboseLevel(1);
     108    isInitialised(false),
     109    nuclearStopping(true)
     110{
     111  //  SetStepFunction(0.2, 1.0*mm);
     112  //SetIntegral(true);
     113  //SetVerboseLevel(1);
     114  SetProcessSubType(fIonisation);
    112115  mass = 0.0;
    113116  ratio = 0.0;
    114   corr = G4LossTableManager::Instance()->EmCorrections(); 
    115   nuclearStopping = true;
    116117}
    117118
     
    120121G4hIonisation::~G4hIonisation()
    121122{}
     123
     124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     125
     126G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)
     127{
     128  return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&
     129         !p.IsShortLived());
     130}
     131
     132//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     133
     134G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,
     135                                         const G4Material*,
     136                                         G4double cut)
     137{
     138  G4double x = 0.5*cut/electron_mass_c2;
     139  G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));
     140  return mass*(g - 1.0);
     141}
    122142
    123143//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 
     
    127147                    const G4ParticleDefinition* bpart)
    128148{
    129   if(isInitialised) return;
    130 
    131   theParticle = part;
    132 
    133   G4String pname = part->GetParticleName();
    134 
    135   // standard base particles
    136   if(part == bpart || pname == "proton" ||
    137      pname == "anti_proton" || pname == "pi+" || pname == "pi-" )
    138     theBaseParticle = 0;
    139 
    140   // select base particle
    141   else if(bpart == 0) {
    142 
    143     if(pname == "kaon+")      theBaseParticle = G4PionPlus::PionPlus();
    144     else if(pname == "kaon-") theBaseParticle = G4PionMinus::PionMinus();
    145     else if(part->GetPDGCharge() > 0.0) theBaseParticle = G4Proton::Proton();
    146     else theBaseParticle = G4AntiProton::AntiProton();
    147 
    148   } else theBaseParticle = bpart;
    149 
    150   SetBaseParticle(theBaseParticle);
    151   SetSecondaryParticle(G4Electron::Electron());
    152   mass  = theParticle->GetPDGMass();
    153   ratio = electron_mass_c2/mass;
    154   massratio = 1.0;
    155   if(theBaseParticle) massratio = theBaseParticle->GetPDGMass()/mass;
    156 
    157   if (!EmModel(1)) SetEmModel(new G4BraggModel(),1);
    158   EmModel(1)->SetLowEnergyLimit(100*eV);
    159   eth = 2.0*MeV*mass/proton_mass_c2;
    160   ethnuc = eth*50.0;
    161   EmModel(1)->SetHighEnergyLimit(eth);
    162   if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
    163   AddEmModel(1, EmModel(1), FluctModel());
    164 
    165   if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
    166   EmModel(2)->SetLowEnergyLimit(eth);
    167   EmModel(2)->SetHighEnergyLimit(100*TeV);
    168   AddEmModel(2, EmModel(2), FluctModel()); 
    169 
    170   isInitialised = true;
     149  if(!isInitialised) {
     150
     151    const G4ParticleDefinition* theBaseParticle = 0;
     152    G4String pname = part->GetParticleName();
     153
     154    // standard base particles
     155    if(part == bpart || pname == "proton" ||
     156       pname == "anti_proton" ||
     157       pname == "pi+" || pname == "pi-" ||
     158       pname == "kaon+" || pname == "kaon-")
     159      {
     160        theBaseParticle = 0;
     161      }
     162    // select base particle
     163    else if(bpart == 0) {
     164
     165      if(part->GetPDGSpin() == 0.0)
     166        if(part->GetPDGCharge() > 0.0 ) {
     167          theBaseParticle = G4KaonPlus::KaonPlus();
     168        } else {
     169          theBaseParticle = G4KaonMinus::KaonMinus();
     170        }
     171      else if(part->GetPDGCharge() > 0.0) {
     172        theBaseParticle = G4Proton::Proton();
     173      } else {
     174        theBaseParticle = G4AntiProton::AntiProton();
     175      }
     176      // base particle defined by interface
     177    } else {
     178      theBaseParticle = bpart;
     179    }
     180    SetBaseParticle(theBaseParticle);
     181    SetSecondaryParticle(G4Electron::Electron());
     182
     183    mass  = part->GetPDGMass();
     184    ratio = electron_mass_c2/mass;
     185
     186    if(mass < 900.*MeV) nuclearStopping = false;
     187
     188    if (!EmModel(1)) SetEmModel(new G4BraggModel(),1);
     189    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
     190
     191    // model limit defined for protons
     192    eth = (EmModel(1)->HighEnergyLimit())*mass/proton_mass_c2;
     193    EmModel(1)->SetHighEnergyLimit(eth);
     194    AddEmModel(1, EmModel(1), new G4IonFluctuations());
     195
     196    if (!FluctModel()) SetFluctModel(new G4UniversalFluctuation());
     197
     198    if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
     199    EmModel(2)->SetLowEnergyLimit(eth);
     200    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
     201    AddEmModel(2, EmModel(2), FluctModel()); 
     202
     203    isInitialised = true;
     204  }
     205  EmModel(1)->ActivateNuclearStopping(nuclearStopping);
     206  EmModel(2)->ActivateNuclearStopping(nuclearStopping);
    171207}
    172208
     
    175211void G4hIonisation::PrintInfo()
    176212{
    177   if(EmModel(1) && EmModel(2))
    178     G4cout << "      Scaling relation is used from proton dE/dx and range."
    179            << "\n      Delta cross sections and sampling from "
    180            << EmModel(2)->GetName() << " model for scaled energy > "
    181            << eth/MeV << " MeV"
    182            << "\n      Parametrisation from "
    183            << EmModel(1)->GetName() << " for protons below."
    184            << " NuclearStopping= " << nuclearStopping
     213  if(EmModel(1) && EmModel(2)) {
     214    G4cout << "      NuclearStopping= " << nuclearStopping
    185215           << G4endl;
    186 }
    187 
    188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    189 
    190 void G4hIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
    191                                          const G4DynamicParticle* dp,
    192                                          G4double& eloss,
    193                                          G4double& s)
    194 {
    195   G4double ekin = dp->GetKineticEnergy();
    196   if(nuclearStopping && ekin < ethnuc) {
    197     G4double nloss = s*corr->NuclearDEDX(theParticle,couple->GetMaterial(),
    198                                          ekin - eloss*0.5);
    199     eloss += nloss;
    200     //  G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
    201     //     << " de= " << eloss << " NIEL= " << nloss << G4endl;
    202     fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);
    203216  }
    204217}
  • trunk/source/processes/electromagnetic/standard/src/G4hMultipleScattering.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4hMultipleScattering.cc,v 1.7 2007/12/07 17:35:52 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4hMultipleScattering.cc,v 1.13 2008/10/15 17:53:44 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -----------------------------------------------------------------------------
     
    5858  : G4VMultipleScattering(processName)
    5959{
    60   dtrl              = 0.05;
    61   lambdalimit       = 1.*mm;
    62  
    63   samplez           = false ;
    64   isInitialized     = false; 
    65 
    66   SetLateralDisplasmentFlag(true);
    67   SetSkin(0.0);
    68   SetRangeFactor(0.2);
    69   SetGeomFactor(0.1);
     60  isInitialized = false; 
     61  isIon         = false;
    7062  SetStepLimitType(fMinimal);
    7163}
     
    8981  // Modification of parameters between runs
    9082  if(isInitialized) {
    91     if (p->GetParticleType() != "nucleus") {
     83    if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) {
    9284      mscUrban->SetStepLimitType(StepLimitType());
    9385      mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
     
    9991  }
    10092
     93  // defaults for ions, which cannot be overwritten
     94  if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) {
     95    SetStepLimitType(fMinimal);
     96    SetLateralDisplasmentFlag(false);
     97    SetBuildLambdaTable(false);
     98    if(p->GetParticleType() == "nucleus") isIon = true;
     99  }
     100
    101101  // initialisation of parameters
    102102  G4String part_name = p->GetParticleName();
    103   mscUrban = new G4UrbanMscModel90(RangeFactor(),dtrl,lambdalimit,
    104                                  GeomFactor(),Skin(),
    105                                  samplez,StepLimitType());
     103  mscUrban = new G4UrbanMscModel90();
     104
     105  mscUrban->SetStepLimitType(StepLimitType());
    106106  mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
     107  mscUrban->SetSkin(Skin());
     108  mscUrban->SetRangeFactor(RangeFactor());
     109  mscUrban->SetGeomFactor(GeomFactor());
    107110
    108   if (p->GetParticleType() == "nucleus") {
    109     mscUrban->SetStepLimitType(fMinimal);
    110     SetLateralDisplasmentFlag(false);
    111     SetBuildLambdaTable(false);
    112     SetSkin(0.0);
    113     SetRangeFactor(0.2);
    114   }
    115111  AddEmModel(1,mscUrban);
    116112  isInitialized = true;
     
    121117void G4hMultipleScattering::PrintInfo()
    122118{
    123   G4cout << "      Boundary/stepping algorithm is active with RangeFactor= "
    124          << RangeFactor()
    125          << "  Step limit type " << StepLimitType()
     119  G4cout << "      RangeFactor= " << RangeFactor()
     120         << ", step limit type: " << StepLimitType()
     121         << ", lateralDisplacement: " << LateralDisplasmentFlag()
     122         << ", skin= " << Skin() 
     123    //   << ", geomFactor= " << GeomFactor() 
    126124         << G4endl;
    127125}
     
    129127//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    130128
     129G4double G4hMultipleScattering::AlongStepGetPhysicalInteractionLength(
     130                             const G4Track& track,
     131                             G4double,
     132                             G4double currentMinimalStep,
     133                             G4double& currentSafety,
     134                             G4GPILSelection* selection)
     135{
     136  // get Step limit proposed by the process
     137  valueGPILSelectionMSC = NotCandidateForSelection;
     138
     139  G4double escaled = track.GetKineticEnergy();
     140  if(isIon) escaled *= track.GetDynamicParticle()->GetMass()/proton_mass_c2;
     141
     142  G4double steplength = GetMscContinuousStepLimit(track,
     143                                                  escaled,
     144                                                  currentMinimalStep,
     145                                                  currentSafety);
     146  // G4cout << "StepLimit= " << steplength << G4endl;
     147  // set return value for G4GPILSelection
     148  *selection = valueGPILSelectionMSC;
     149  return  steplength;
     150}
     151
     152//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     153
  • trunk/source/processes/electromagnetic/standard/src/G4ionGasIonisation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionGasIonisation.cc,v 1.4 2008/01/14 11:59:45 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4ionGasIonisation.cc,v 1.14 2008/09/12 16:26:34 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5656
    5757G4ionGasIonisation::G4ionGasIonisation(const G4String& name)
    58   : G4ionIonisation(name),
    59     currParticle(0),
    60     baseParticle(0),
    61     initialised(false)
     58  : G4ionIonisation(name)
    6259{
    63   atomXS = CLHEP::pi*CLHEP::Bohr_radius*CLHEP::Bohr_radius;
    64   verboseLevel = 1;
    6560}
    6661
     
    7065{}
    7166
    72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    73 
    74 void G4ionGasIonisation::InitialiseEnergyLossProcess(
    75                       const G4ParticleDefinition* part,
    76                       const G4ParticleDefinition* bpart)
    77 {
    78   G4ionIonisation::InitialiseEnergyLossProcess(part, bpart);
    79   if(initialised) return;
    80 
    81   currParticle = part;
    82 
    83   if(part == bpart || part == G4GenericIon::GenericIon()) baseParticle = 0;
    84   else if(bpart == 0) baseParticle = G4GenericIon::GenericIon();
    85   else                baseParticle = bpart;
    86 
    87   if(baseParticle) basePartMass = baseParticle->GetPDGMass();
    88   else             basePartMass = currParticle->GetPDGMass();
    89  
    90   initialised = true;
    91 }
    92 
    93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    94 
    95 void G4ionGasIonisation::PrintInfo()
    96 {
    97   G4ionIonisation::PrintInfo();
    98   G4cout << "      Version of ion process with simulation discrete ion/media change exchange."
    99          << G4endl;     
    100 }
    101 
    102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    103 
    104 void G4ionGasIonisation::InitialiseMassCharge(const G4Track& track)
    105 {
    106   // First step of an ion
    107   if(track.GetCurrentStepNumber() == 1) {
    108     currParticle = track.GetDefinition();
    109     ionZ = G4int(currParticle->GetPDGCharge()/eplus + 0.5);
    110     currentIonZ = G4int(track.GetDynamicParticle()->GetCharge()/eplus + 0.5);
    111     currMassRatio = basePartMass/currParticle->GetPDGMass();
    112   }
    113   // any step
    114   G4double q = eplus*currentIonZ;
    115   SetDynamicMassCharge(currMassRatio, q*q);
    116   preStepKinEnergy = track.GetKineticEnergy();
    117 }
    118 
    119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    120 
    121 void G4ionGasIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
    122                                               const G4DynamicParticle* dp,
    123                                               G4double& eloss,
    124                                               G4double& s)
    125 {
    126   const G4ParticleDefinition* part = dp->GetDefinition();
    127   const G4Material* mat = couple->GetMaterial();
    128   // add corrections
    129   if(eloss < preStepKinEnergy) {
    130 
    131     // use Bethe-Bloch with corrections
    132     if(preStepKinEnergy*currMassRatio > BetheBlochEnergyThreshold())
    133       eloss += s*corr->HighOrderCorrections(part,mat,preStepKinEnergy);
    134 
    135     // effective number of collisions
    136     G4double x = mat->GetElectronDensity()*s*atomXS;
    137     // equilibrium charge
    138     G4double q = fParticleChange.GetProposedCharge();
    139  
    140     // sample charge change during the step
    141     fParticleChange.SetProposedCharge(SampleChargeAfterStep(q, x));
    142   }
    143 
    144   // use nuclear stopping
    145   if(NuclearStoppingFlag()) {
    146     G4double nloss = s*corr->NuclearDEDX(part,mat,preStepKinEnergy - eloss*0.5);
    147     eloss += nloss;
    148     fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);
    149   }
    150 }
    151 
     67/*
    15268//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    15369
     
    15773  // xeff - effective number of collisions
    15874  // q    - current charge
    159   G4double q = eplus*currentIonZ;
     75  G4double q = G4double(currentIonZ);
     76  if(qeff > q) {
     77    if(G4UniformRand() < qeff - q) currentIonZ++;
     78  } else {
     79    if(G4UniformRand() < q - qeff) currentIonZ--;
     80  }
     81
     82  q = eplus*currentIonZ;
    16083  if(verboseLevel > 1) G4cout << "G4ionGasIonisation: Q1= " << currentIonZ
    16184                              << " Qeff= " << qeff/eplus << "  Neff= " << xeff
     
    16386  return q;
    16487}
    165 
     88*/
    16689//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
  • trunk/source/processes/electromagnetic/standard/src/G4ionIonisation.cc

    r819 r961  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ionIonisation.cc,v 1.45.2.2 2008/04/25 00:34:55 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-01-patch-02 $
     26// $Id: G4ionIonisation.cc,v 1.66 2009/02/20 12:06:37 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2828//
    2929// -------------------------------------------------------------------
     
    5555// 16-05-07 Add data for light ion stopping only for GenericIon (V.Ivantchenko)
    5656// 07-11-07 Fill non-ionizing energy loss (V.Ivantchenko)
     57// 12-09-08 Removed InitialiseMassCharge and CorrectionsAlongStep (VI)
    5758//
    5859//
     
    6566#include "G4Electron.hh"
    6667#include "G4Proton.hh"
     68//#include "G4Alpha.hh"
    6769#include "G4GenericIon.hh"
    6870#include "G4BraggModel.hh"
    6971#include "G4BraggIonModel.hh"
    7072#include "G4BetheBlochModel.hh"
    71 #include "G4IonFluctuations.hh"
    7273#include "G4UnitsTable.hh"
    7374#include "G4LossTableManager.hh"
    7475#include "G4WaterStopping.hh"
     76#include "G4EmCorrections.hh"
     77#include "G4IonFluctuations.hh"
    7578
    7679//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    8083G4ionIonisation::G4ionIonisation(const G4String& name)
    8184  : G4VEnergyLossProcess(name),
     85    corr(0),
    8286    theParticle(0),
    83     theBaseParticle(0),
    8487    isInitialised(false),
    8588    stopDataActive(true),
     
    8992  SetStepFunction(0.1, 0.1*mm);
    9093  SetIntegral(true);
    91   SetVerboseLevel(1);
     94  SetProcessSubType(fIonisation);
     95  //  SetVerboseLevel(1);
    9296  corr = G4LossTableManager::Instance()->EmCorrections();
    9397}
     
    100104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    101105
     106G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p)
     107{
     108  return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() &&
     109          p.GetParticleType() == "nucleus");
     110}
     111
     112//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     113
     114G4double G4ionIonisation::MinPrimaryEnergy(const G4ParticleDefinition* p,
     115                                           const G4Material*,
     116                                           G4double cut)
     117{
     118  return
     119    p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0);
     120}
     121
     122//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     123
    102124void G4ionIonisation::InitialiseEnergyLossProcess(
    103125                      const G4ParticleDefinition* part,
    104126                      const G4ParticleDefinition* bpart)
    105127{
    106   if(isInitialised) return;
     128  const G4ParticleDefinition* ion = G4GenericIon::GenericIon();
    107129
    108   theParticle = part;
     130  if(!isInitialised) {
    109131
    110   if(part == bpart || part == G4GenericIon::GenericIon()) theBaseParticle = 0;
    111   else if(bpart == 0) theBaseParticle = G4GenericIon::GenericIon();
    112   else                theBaseParticle = bpart;
     132    theParticle = part;
     133    //G4String pname = part->GetParticleName();
    113134
    114   SetBaseParticle(theBaseParticle);
    115   SetSecondaryParticle(G4Electron::Electron());
     135    // define base particle
     136    const G4ParticleDefinition* theBaseParticle = 0;
    116137
    117   if(theBaseParticle) baseMass = theBaseParticle->GetPDGMass();
    118   else                baseMass = theParticle->GetPDGMass();
    119  
    120   if (!EmModel(1)) SetEmModel(new G4BraggIonModel(),1);
    121   EmModel(1)->SetLowEnergyLimit(100*eV);
    122   eth = 2.0*MeV; 
    123   EmModel(1)->SetHighEnergyLimit(eth);
    124   if (!FluctModel()) SetFluctModel(new G4IonFluctuations());
    125   AddEmModel(1, EmModel(1), FluctModel());
     138    if(part == ion)     theBaseParticle = 0;
     139    else if(bpart == 0) theBaseParticle = ion;
     140    else                theBaseParticle = bpart;
    126141
    127   if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
    128   EmModel(2)->SetLowEnergyLimit(eth);
    129   EmModel(2)->SetHighEnergyLimit(100*TeV);
    130   AddEmModel(2, EmModel(2), FluctModel());   
     142    SetBaseParticle(theBaseParticle);
     143    SetSecondaryParticle(G4Electron::Electron());
    131144
    132   // Add ion stoping tables for Generic Ion
    133   if(part == G4GenericIon::GenericIon()) {
    134     G4WaterStopping  ws(corr);
    135     effCharge = corr->GetIonEffectiveCharge(EmModel(1));
    136   } else {
    137     effCharge = corr->GetIonEffectiveCharge(0);
     145    if (!EmModel(1)) SetEmModel(new G4BraggIonModel(), 1);
     146    EmModel(1)->SetLowEnergyLimit(MinKinEnergy());
     147
     148    // model limit defined for protons
     149    eth = (EmModel(1)->HighEnergyLimit())*part->GetPDGMass()/proton_mass_c2;
     150    EmModel(1)->SetHighEnergyLimit(eth);
     151
     152    if (!FluctModel()) SetFluctModel(new G4IonFluctuations());
     153    AddEmModel(1, EmModel(1), FluctModel());
     154
     155    if (!EmModel(2)) SetEmModel(new G4BetheBlochModel(),2); 
     156    EmModel(2)->SetLowEnergyLimit(eth);
     157    EmModel(2)->SetHighEnergyLimit(MaxKinEnergy());
     158    AddEmModel(2, EmModel(2), FluctModel());   
     159
     160    // Add ion stoping tables for Generic Ion
     161    if(part == ion) {
     162      G4WaterStopping  ws(corr);
     163      corr->SetIonisationModels(EmModel(1),EmModel(2));
     164    }
     165    isInitialised = true;
    138166  }
    139 
    140   isInitialised = true;
     167  // reinitialisation of corrections for the new run
     168  EmModel(1)->ActivateNuclearStopping(nuclearStopping);
     169  EmModel(2)->ActivateNuclearStopping(nuclearStopping);
     170  if(part == ion) corr->InitialiseForNewRun();
    141171}
    142172
     
    145175void G4ionIonisation::PrintInfo()
    146176{
    147   if(EmModel(1) && EmModel(2))
    148     G4cout << "      Scaling relation is used from proton dE/dx and range."
    149            << "\n      Delta cross sections and sampling from "
    150            << EmModel(2)->GetName() << " model for scaled energy > "
    151            << eth/MeV << " MeV"
    152            << "\n      Parametrisation from "
    153            << EmModel(1)->GetName() << " for protons below."
    154            << " NuclearStopping= " << nuclearStopping
    155            << G4endl;   
    156   if (stopDataActive)
    157     G4cout << "\n      Stopping Power data for "
     177  if (stopDataActive && G4GenericIon::GenericIon() == theParticle) {
     178    G4cout << "      Stopping Power data for "
    158179           << corr->GetNumberOfStoppingVectors()
    159            << " ion/material pairs are used."
     180           << " ion/material pairs, nuclearStopping: " << nuclearStopping
    160181           << G4endl;
     182  }
    161183}
    162184
     
    165187void G4ionIonisation::AddStoppingData(G4int Z, G4int A,
    166188                                      const G4String& mname,
    167                                       G4PhysicsVector& dVector)
     189                                      G4PhysicsVector* dVector)
    168190{
    169191  corr->AddStoppingData(Z, A, mname, dVector);
     
    171193
    172194//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    173 
    174 void G4ionIonisation::CorrectionsAlongStep(const G4MaterialCutsCouple* couple,
    175                                            const G4DynamicParticle* dp,
    176                                            G4double& eloss,
    177                                            G4double& s)
    178 {
    179   const G4ParticleDefinition* part = dp->GetDefinition();
    180   const G4Material* mat = couple->GetMaterial();
    181   if(eloss < preKinEnergy) {
    182     //    G4cout << "e= " << preKinEnergy << " ratio= " << massRatio << " eth= " << eth<<  G4endl;
    183     if(preKinEnergy*massRatio > eth)
    184       eloss += s*corr->HighOrderCorrections(part,mat,preKinEnergy);
    185     else {
    186 
    187       if(stopDataActive)
    188         eloss *= corr->EffectiveChargeCorrection(part,mat,preKinEnergy);
    189 
    190     }
    191     fParticleChange.SetProposedCharge(effCharge->EffectiveCharge(part,
    192                                       mat,preKinEnergy-eloss));
    193   }
    194   if(nuclearStopping && preKinEnergy*massRatio < 50.*eth*charge2) {
    195     G4double nloss = s*corr->NuclearDEDX(part,mat,preKinEnergy - eloss*0.5);
    196     eloss += nloss;
    197     //  G4cout << "G4ionIonisation::CorrectionsAlongStep: e= " << preKinEnergy
    198     //     << " de= " << eloss << " NIEL= " << nloss << G4endl;
    199     fParticleChange.ProposeNonIonizingEnergyDeposit(nloss);
    200   }
    201 }
    202 
    203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracChangeset for help on using the changeset viewer.