diff --git a/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.fig b/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.fig index 090e190a1..6c11a4e30 100644 --- a/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.fig +++ b/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.fig @@ -1,4 +1,4 @@ -#FIG 3.2 Produced by xfig version 3.2.5b +#FIG 3.2 Produced by xfig version 3.2.8b Portrait Center Inches @@ -178,22 +178,10 @@ Single 1 1 1.00 60.00 90.00 1 1 1.00 60.00 90.00 6815 14424 7527 14424 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1014 499 1014 5747 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1289 499 1289 5778 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1777 5290 -419 5290 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 1838 2666 -359 2666 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 1868 835 -327 835 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1534 499 1534 5778 -2 1 1 1 0 6 50 0 20 4.000 0 0 -1 0 0 2 - 1831 2929 -366 2929 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1892 3904 -457 3904 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 1800 3649 -395 3649 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 @@ -215,10 +203,6 @@ Single 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 -181 967 557 967 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1838 1140 -359 1140 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - -64 1036 520 1036 520 1237 -64 1237 -64 1036 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 66.00 36.00 1 1 1.00 66.00 36.00 @@ -242,26 +226,12 @@ Single 1 1 1.00 66.00 36.00 1 1 1.00 66.00 36.00 818 5228 1012 5228 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 - 1 1 1.00 96.00 96.00 - 1 1 1.00 96.00 96.00 - 21 4066 1513 4066 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 673 4966 1138 4966 1138 5176 673 5176 673 4966 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 1662 4253 1664 4676 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 1735 4922 1742 5299 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 283 4411 748 4411 748 4621 283 4621 283 4411 -2 2 0 0 -1 7 0 0 20 0.000 0 0 -1 0 0 5 - 171 2002 921 2002 921 2266 171 2266 171 2002 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 801 499 801 5747 -2 1 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 2 - 588 499 588 5747 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 13577 5526 11774 5526 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 @@ -274,14 +244,6 @@ Single 13652 827 11851 827 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 13603 4765 11799 4765 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 13636 591 11836 591 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 12776 491 12776 5740 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 13177 491 13177 5771 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 12125 491 12125 5740 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 @@ -308,8 +270,6 @@ Single 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 12921 561 12924 1120 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 13627 2901 11825 2901 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 66.00 36.00 1 1 1.00 66.00 36.00 @@ -319,14 +279,6 @@ Single 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 13305 2168 13298 2527 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 - 1 1 1.00 96.00 96.00 - 1 1 1.00 96.00 96.00 - 12338 1794 13355 1794 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 12653 1686 12930 1686 12930 1903 12653 1903 12653 1686 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11881 4196 13333 4196 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 11922 3862 13374 3862 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 @@ -352,18 +304,10 @@ Single 14717 600 14725 5505 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 14273 2737 15443 2737 15443 3067 14273 3067 14273 2737 -2 1 1 1 0 6 50 0 20 4.000 0 0 -1 0 0 2 - 7 499 7 5747 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 1777 4680 -419 4680 -2 3 0 2 0 6 51 0 20 0.000 0 0 -1 0 0 17 - -205 865 -205 2666 7 2666 7 4680 1014 4680 1014 5290 - 801 5290 801 5533 1534 5533 1534 2910 1289 2910 1289 1140 - 588 1140 588 835 -205 835 -205 897 -205 865 2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 -208 484 -208 5732 -2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 - -4 3642 1511 3642 1511 3904 -4 3904 -4 3642 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 -566 4694 244 3734 2 3 0 2 0 6 51 0 20 0.000 0 0 -1 0 0 17 @@ -392,22 +336,14 @@ Single 4477 8983 4443 9087 4789 9087 4809 8977 4477 8983 2 3 0 2 0 13 50 0 20 0.000 0 0 -1 0 0 5 4754 9625 4737 9724 5064 9719 5064 9624 4754 9625 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2786 1929 4553 1929 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2755 1655 4523 1655 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4795 1655 2605 1655 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4523 436 4523 5707 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4795 1929 2605 1929 -2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 - 2753 405 2753 5645 2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 2748 1655 4523 1655 4523 1915 2748 1915 2748 1655 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 3003 407 3003 5647 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 4583 314 4586 873 @@ -446,8 +382,6 @@ Single 4208 2536 4507 2536 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4355 2569 4659 2936 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4757 5077 2567 5077 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4779 2296 2522 2304 2 3 0 2 0 6 51 0 20 0.000 0 0 -1 0 0 15 @@ -562,14 +496,10 @@ Single 10918 8760 11283 8760 11283 12020 10918 12020 10918 8760 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 10706 5267 8928 5267 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9100 1934 10534 1934 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 9075 1661 10510 1661 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 10731 1661 8953 1661 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 10731 1934 8953 1934 2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 9069 1661 10510 1661 10510 1920 9069 1920 9069 1661 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 @@ -601,10 +531,6 @@ Single 1 1 1.00 66.00 36.00 1 1 1.00 66.00 36.00 10255 2561 10505 2561 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 - 1 1 1.00 96.00 96.00 - 1 1 1.00 96.00 96.00 - 9285 3770 10505 3773 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 96.00 96.00 10355 4499 10355 5054 @@ -633,10 +559,6 @@ Single 5097 6830 5097 10745 2 4 2 1 -1 7 0 0 -1 3.000 0 0 7 0 0 5 1151 8456 9332 8456 9332 10196 1151 10196 1151 8456 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 6865 481 6865 5760 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7355 481 7355 5791 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 7845 5545 5640 5545 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 @@ -649,18 +571,6 @@ Single 7906 1126 5702 1126 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 7937 819 5734 819 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5825 3886 7600 3886 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5825 4197 7600 4197 -2 3 0 2 0 6 51 0 20 0.000 0 0 -1 0 0 15 - 6314 819 6314 2662 5942 2661 5942 4776 6865 4779 6865 5299 - 6069 5299 6069 5545 7600 5545 7600 2905 7355 2905 7355 1126 - 6652 1126 6652 819 6314 819 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7814 3886 5717 3883 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7937 4197 5680 4198 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 7877 4779 5672 4779 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 @@ -705,8 +615,6 @@ Single 1 1 1.00 66.00 36.00 1 1 1.00 66.00 36.00 7367 2986 7566 2986 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8067 2306 7465 2966 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 @@ -715,46 +623,16 @@ Single 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 5965 4686 6848 4686 -2 2 0 0 -1 7 0 0 20 0.000 0 0 -1 0 0 5 - 6408 3903 7158 3903 7158 4167 6408 4167 6408 3903 -2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 - 5942 466 5942 5745 -2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 - 5935 3883 7593 3883 7593 4201 5935 4201 5935 3883 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 6314 481 6314 5760 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 - 1 1 1.00 96.00 96.00 - 1 1 1.00 96.00 96.00 - 6310 1809 7606 1809 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 6647 1681 6985 1681 6985 1899 6647 1899 6647 1681 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 6652 481 6652 5760 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 6069 481 6069 5760 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 6138 4530 6603 4530 6603 4740 6138 4740 6138 4530 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 5628 1478 6213 1478 6213 1703 5628 1703 5628 1478 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 11643 1455 12250 1455 12250 1747 11643 1747 11643 1455 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 12325 491 12325 5740 -2 3 0 2 0 6 51 0 20 0.000 0 0 -1 0 0 15 - 12325 827 12325 2660 12020 2659 12020 4762 12776 4765 12776 5282 - 12125 5282 12125 5526 13378 5526 13388 2542 13178 2542 13177 1132 - 12601 1132 12601 827 12325 827 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 12003 1837 12258 1837 12258 2070 12003 2070 12003 1837 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 10250 4257 10505 4257 10505 4490 10250 4490 10250 4257 -2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 - 12020 476 12020 5725 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 13651 4190 11806 4191 -2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 - 12015 3875 13369 3875 13369 4182 12015 4182 12015 3875 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 @@ -771,14 +649,12 @@ Single 9945 1305 10486 1305 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4818 1237 2626 1237 -2 3 0 2 0 6 52 0 20 0.000 0 0 -1 0 0 15 +2 3 0 2 0 6 57 0 20 0.000 0 0 -1 0 0 15 4187 5281 4186 2459 4531 2461 4523 1228 3825 1230 3828 894 4400 893 4400 589 2755 589 2739 2304 2996 2309 2994 5069 3705 5070 3705 5280 4187 5281 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4400 436 4400 5707 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4766 893 2574 893 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 94.50 94.50 1 1 1.00 94.50 94.50 @@ -787,27 +663,19 @@ Single 1 1 1.00 66.00 66.00 1 1 1.00 66.00 66.00 3714 5352 4164 5352 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 12601 491 12601 5740 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 12214 4410 12594 4410 12594 4619 12214 4619 12214 4410 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 12282 4926 12634 4926 12634 5130 12282 5130 12282 4926 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 6257 4970 6722 4970 6722 5180 6257 5180 6257 4970 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 13400 493 13400 5773 2 2 0 0 0 7 50 -1 20 0.000 0 0 -1 0 0 5 13260 1873 13590 1873 13590 2120 13260 2120 13260 1873 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7600 481 7600 5791 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 4187 436 4187 5676 2 1 1 1 0 7 55 0 -1 4.000 0 0 -1 0 0 2 14814 591 -245 581 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 3877 637 4342 637 4342 847 3877 847 3877 637 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 3975 1380 4440 1380 4440 1590 3975 1590 3975 1380 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 3697 400 3697 5640 @@ -817,46 +685,178 @@ Single 1 1 1.00 96.00 96.00 1 1 1.00 96.00 96.00 3021 3748 4521 3766 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 3502 3630 3840 3630 3840 3848 3502 3848 3502 3630 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 15182 5524 -419 5533 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 3697 5415 4281 5415 4281 5616 3697 5616 3697 5415 2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 9923 443 9923 5654 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 +2 1 1 1 0 7 49 0 -1 4.000 0 0 -1 0 0 2 10706 904 8928 904 2 1 1 1 0 7 55 0 -1 4.000 0 0 -1 0 0 2 10706 601 8928 601 -2 3 0 2 0 6 52 0 20 0.000 0 0 -1 0 0 15 +2 3 0 2 0 6 57 0 20 0.000 0 0 -1 0 0 15 10236 5267 10235 2460 10516 2462 10510 1237 9930 1236 9930 906 10409 904 10409 601 9075 601 9061 2307 9269 2312 9268 5056 9780 5055 9780 5273 10236 5267 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 10236 449 10236 5660 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 9948 675 10383 675 10383 867 9948 867 9948 675 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 10409 449 10409 5691 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 9960 1380 10478 1380 10478 1609 9960 1609 9960 1380 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 9773 435 9773 5646 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 9631 3637 9973 3637 9973 3870 9631 3870 9631 3637 2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 1 1 1.00 66.00 66.00 1 1 1.00 66.00 66.00 9786 5325 10235 5324 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 9741 5385 10325 5385 10325 5586 9741 5586 9741 5385 2 2 0 0 -1 7 6 0 20 0.000 0 0 -1 0 0 5 -384 4769 366 4769 366 5033 -384 5033 -384 4769 -2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 - 495 3937 833 3937 833 4155 495 4155 495 3937 2 2 0 0 0 7 50 0 20 0.000 0 0 -1 0 0 5 10262 4260 10470 4260 10470 4485 10262 4485 10262 4260 +2 1 1 1 0 6 50 0 20 4.000 0 0 -1 0 0 2 + 7 499 7 5747 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1892 3904 -457 3904 +2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 + -4 3642 1511 3642 1511 3904 -4 3904 -4 3642 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 96.00 96.00 + 1 1 1.00 96.00 96.00 + 13 4245 1505 4245 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 645 507 645 5755 +2 2 0 0 0 7 48 0 20 0.000 0 0 -1 0 0 5 + 352 4343 817 4343 817 4553 352 4553 352 4343 +2 3 0 2 0 6 57 0 20 0.000 0 0 -1 0 0 15 + 6314 819 6314 2662 5942 2661 5942 4776 6865 4779 6865 5299 + 6069 5299 6069 5545 7600 5545 7600 2905 7355 2905 7355 1126 + 6652 1126 6652 819 6314 819 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 6652 481 6652 5760 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5788 3922 7563 3922 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 7822 3916 5725 3913 +2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 + 5942 466 5942 5745 +2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 + 5939 3915 7597 3915 7597 4233 5939 4233 5939 3915 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 7899 4230 5642 4231 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 6865 481 6865 5760 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5903 4230 7678 4230 +2 2 0 0 -1 7 0 0 20 0.000 0 0 -1 0 0 5 + 6378 3944 7128 3944 7128 4208 6378 4208 6378 3944 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 8067 2306 7465 2966 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 9051 1912 10485 1912 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 10738 1920 8960 1920 +2 3 0 2 0 6 57 0 20 0.000 0 0 -1 0 0 15 + 12325 827 12325 2660 12020 2659 12020 4762 12776 4765 12776 5282 + 12125 5282 12125 5526 13378 5526 13388 2542 13178 2542 13177 1132 + 12601 1132 12601 827 12325 827 +2 2 0 2 0 14 51 0 20 0.000 0 0 -1 0 0 5 + 12015 3863 13369 3863 13369 4170 12015 4170 12015 3863 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 13643 4170 11798 4171 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 11936 4170 13388 4170 +2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 + 12023 476 12023 5725 +2 1 1 1 0 7 49 0 -1 4.000 0 0 -1 0 0 2 + 10236 449 10236 5660 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 10409 449 10409 5691 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 9960 1380 10478 1380 10478 1609 9960 1609 9960 1380 +2 2 0 0 0 7 48 0 20 0.000 0 0 -1 0 0 5 + 9948 675 10383 675 10383 867 9948 867 9948 675 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 4795 1912 2605 1912 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 2786 1912 4553 1912 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 801 499 801 5747 +2 2 0 0 0 7 48 0 20 0.000 0 0 -1 0 0 5 + 675 3982 1013 3982 1013 4200 675 4200 675 3982 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1289 499 1289 5778 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1777 5290 -419 5290 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1534 499 1534 5778 +2 3 0 2 0 6 57 0 20 0.000 0 0 -1 0 0 17 + -205 865 -205 2666 7 2666 7 4680 1014 4680 1014 5290 + 801 5290 801 5533 1534 5533 1534 2910 1289 2910 1289 1140 + 588 1140 588 835 -205 835 -205 897 -205 865 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 4757 5077 2567 5077 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 4766 893 2574 893 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 3003 407 3003 5647 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 7600 481 7600 5791 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 7355 481 7355 5791 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 13177 491 13177 5771 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 9773 435 9773 5646 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 13380 486 13380 5766 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 96.00 96.00 + 1 1 1.00 96.00 96.00 + 9285 3770 10505 3773 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 9685 3487 10027 3487 10027 3720 9685 3720 9685 3487 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 15182 5524 -419 5533 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 9719 5372 10303 5372 10303 5573 9719 5573 9719 5372 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 96.00 96.00 + 1 1 1.00 96.00 96.00 + 6310 1809 7606 1809 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 6682 1553 7020 1553 7020 1771 6682 1771 6682 1553 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 6195 4448 6660 4448 6660 4658 6195 4658 6195 4448 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 6314 481 6314 5760 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 3450 3495 3788 3495 3788 3713 3450 3713 3450 3495 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 3644 5415 4228 5415 4228 5616 3644 5616 3644 5415 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1838 1140 -359 1140 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + -111 1050 473 1050 473 1251 -111 1251 -111 1050 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1014 499 1014 5747 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 652 4965 1117 4965 1117 5175 652 5175 652 4965 +2 2 0 0 -1 7 47 0 20 0.000 0 0 -1 0 0 5 + 171 2002 921 2002 921 2266 171 2266 171 2002 +2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 96.00 96.00 + 1 1 1.00 96.00 96.00 + 12338 1830 13355 1830 +2 1 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 2 + 12768 543 12768 5792 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 12638 1575 12915 1575 12915 1792 12638 1792 12638 1575 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 12601 491 12601 5740 +2 2 0 0 0 7 47 0 20 0.000 0 0 -1 0 0 5 + 12282 4926 12634 4926 12634 5130 12282 5130 12282 4926 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 12128 481 12128 5730 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 13636 591 11836 591 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 12315 454 12315 5703 +2 1 1 1 0 7 52 0 -1 4.000 0 0 -1 0 0 2 + 2745 390 2745 5630 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 13635 2543 11833 2543 +2 1 1 1 0 6 50 0 20 4.000 0 0 -1 0 0 2 + 1831 2910 -366 2910 4 0 -1 0 0 18 16 0.0000 4 210 165 8160 14739 Z\001 4 0 -1 0 0 18 16 0.0000 4 210 165 2687 14859 Z\001 4 0 -1 0 0 18 16 0.0000 4 270 1410 2851 14528 RMAX_CM\001 @@ -887,17 +887,12 @@ Single 4 0 0 50 0 18 16 0.0000 4 210 225 873 278 zl\001 4 0 0 50 0 18 16 0.0000 4 210 495 1827 3542 zbh\001 4 0 0 50 0 18 16 0.0000 4 210 330 1731 2350 zg\001 -4 0 0 50 0 18 16 0.0000 4 270 540 -24 1207 wtip\001 4 0 0 50 0 18 16 0.0000 4 195 240 -473 2049 zt\001 4 0 0 50 0 18 16 0.0000 4 195 285 -551 3378 wt\001 4 0 0 50 0 18 16 0.0000 4 210 375 1632 1877 wg\001 4 0 0 50 0 18 16 0.0000 4 210 405 1599 3236 zth\001 -4 0 0 50 0 18 16 0.0000 4 210 525 676 5147 wbs\001 4 0 0 50 0 18 16 0.0000 4 195 390 1604 4216 zts\001 4 0 0 50 0 18 16 0.0000 4 210 480 1715 4899 zbs\001 -4 0 0 50 0 18 16 0.0000 4 195 435 317 4584 wts\001 -4 0 0 50 0 18 16 0.0000 4 210 270 530 4155 wl\001 -4 0 -1 0 0 18 16 0.0000 4 210 780 216 2221 MED2\001 4 0 -1 0 0 18 18 0.0000 4 210 1170 3131 -176 TARGET\001 4 0 -1 0 0 18 18 0.0000 4 210 765 3311 -536 HALF\001 4 0 -1 0 0 18 18 0.0000 4 210 765 6401 -536 HALF\001 @@ -909,7 +904,6 @@ Single 4 0 0 50 0 18 16 0.0000 4 270 540 11706 1685 wtip\001 4 0 0 50 0 18 16 0.0000 4 210 225 12858 504 zl\001 4 0 0 50 0 18 16 0.0000 4 210 375 13866 2218 wg\001 -4 0 0 50 0 18 16 0.0000 4 210 270 12648 1880 wl\001 4 0 0 50 0 18 16 0.0000 4 210 405 13410 3518 zth\001 4 0 0 50 0 18 16 0.0000 4 210 495 13694 3906 zbh\001 4 0 0 50 0 18 16 0.0000 4 195 390 13624 4515 zts\001 @@ -929,7 +923,6 @@ Single 4 0 0 50 0 18 16 0.0000 4 210 330 4818 2182 zg\001 4 0 0 50 0 18 16 0.0000 4 195 285 2433 3024 wt\001 4 0 0 50 0 18 16 0.0000 4 210 375 4608 3108 wg\001 -4 0 0 50 0 18 16 0.0000 4 210 270 3531 3834 wl\001 4 0 -1 0 0 18 16 0.0000 4 210 780 8007 8999 MED1\001 4 0 -1 0 0 18 16 0.0000 4 210 720 1570 10442 leaf 1\001 4 0 -1 0 0 18 16 0.0000 4 195 150 2830 10452 2\001 @@ -947,7 +940,6 @@ Single 4 0 0 50 0 18 16 0.0000 4 210 405 10680 1444 zth\001 4 0 0 50 0 18 16 0.0000 4 210 495 10805 1724 zbh\001 4 0 0 50 0 18 16 0.0000 4 210 330 10727 2177 zg\001 -4 0 0 50 0 18 16 0.0000 4 210 270 9648 3827 wl\001 4 0 0 50 0 18 16 0.0000 4 210 225 10266 4474 zl\001 4 0 0 50 0 18 16 0.0000 4 270 495 10574 4657 ztip\001 4 0 0 50 0 18 16 0.0000 4 195 240 8755 1903 zt\001 @@ -964,20 +956,28 @@ Single 4 0 0 50 0 18 16 0.0000 4 270 540 5645 1669 wtip\001 4 0 0 50 0 18 16 0.0000 4 195 285 5389 3455 wt\001 4 0 0 50 0 18 16 0.0000 4 210 375 8102 2314 wg\001 -4 0 0 50 0 18 16 0.0000 4 195 435 6177 4721 wts\001 -4 0 -1 0 0 18 16 0.0000 4 210 780 6441 4118 MED3\001 -4 0 0 50 0 18 16 0.0000 4 210 525 6226 5172 wbs\001 -4 0 0 50 0 18 16 0.0000 4 210 270 6695 1872 wl\001 4 0 -1 0 0 18 16 0.0000 4 210 1020 14067 2995 ZTHICK\001 4 0 -1 0 0 18 16 0.0000 4 210 690 14252 550 ZMIN\001 4 0 -1 0 0 19 34 0.0000 4 435 3585 3945 -1245 SYNCHDMLC\001 4 0 0 50 0 18 16 0.0000 4 210 330 13260 2098 zg\001 -4 0 0 50 0 18 16 0.0000 4 270 540 3696 5598 wtip\001 -4 0 0 50 0 18 16 0.0000 4 210 525 3950 1557 wbs\001 -4 0 0 50 0 18 16 0.0000 4 270 540 9778 5581 wtip\001 -4 0 0 50 0 18 16 0.0000 4 195 435 12158 4590 wts\001 -4 0 0 50 0 18 16 0.0000 4 210 525 12203 5116 wbs\001 -4 0 0 50 0 18 16 0.0000 4 195 435 3888 821 wts\001 -4 0 0 50 0 18 16 0.0000 4 195 435 9940 839 wts\001 -4 0 0 50 0 18 16 0.0000 4 210 525 9960 1592 wbs\001 +4 0 0 46 0 18 16 0.0000 4 195 435 12158 4590 wts\001 +4 0 0 44 0 18 16 0.0000 4 195 435 9940 839 wts\001 +4 0 0 46 0 18 16 0.0000 4 210 525 9960 1592 wbs\001 4 0 0 1 0 18 16 0.0000 4 270 1755 -1412 4987 driving screw\001 +4 0 0 44 0 18 16 0.0000 4 195 435 368 4539 wts\001 +4 0 -1 0 0 18 16 0.0000 4 210 780 6388 4179 MED3\001 +4 0 0 43 0 18 16 0.0000 4 210 270 703 4177 wl\001 +4 0 0 46 0 18 16 0.0000 4 210 270 9731 3700 wl\001 +4 0 0 46 0 18 16 0.0000 4 270 540 9750 5566 wtip\001 +4 0 0 46 0 18 16 0.0000 4 210 270 6717 1752 wl\001 +4 0 0 46 0 18 16 0.0000 4 195 435 6192 4638 wts\001 +4 0 0 46 0 18 16 0.0000 4 210 525 6219 5165 wbs\001 +4 0 0 46 0 18 16 0.0000 4 210 270 3471 3707 wl\001 +4 0 0 46 0 18 16 0.0000 4 270 540 3673 5598 wtip\001 +4 0 0 46 0 18 16 0.0000 4 210 525 3935 1558 wbs\001 +4 0 0 46 0 18 16 0.0000 4 195 435 3896 821 wts\001 +4 0 0 46 0 18 16 0.0000 4 270 540 -83 1238 wtip\001 +4 0 0 46 0 18 16 0.0000 4 210 525 653 5148 wbs\001 +4 0 -1 46 0 18 16 0.0000 4 210 780 216 2221 MED2\001 +4 0 0 46 0 18 16 0.0000 4 210 270 12645 1769 wl\001 +4 0 0 46 0 18 16 0.0000 4 210 525 12210 5123 wbs\001 diff --git a/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.pdf b/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.pdf index 3935242c5..0ec560303 100644 Binary files a/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.pdf and b/HEN_HOUSE/doc/src/pirs509a-beamnrc/figures/synchdmlcd.pdf differ diff --git a/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex b/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex index 49d0629ff..ea3afe440 100644 --- a/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex +++ b/HEN_HOUSE/doc/src/pirs509a-beamnrc/pirs509a-beamnrc.tex @@ -64,6 +64,8 @@ \usepackage{moreverb} %this is used for the boxedverbatim environment %used to box the listing files for tutor programs +\renewcommand{\labelenumi}{\theenumi} + \renewcommand{\footrulewidth}{0.4pt} \renewcommand{\headrulewidth}{0.4pt} \lhead[{\sffamily \thepage}]{{\sffamily BEAMnrc Users Manual}} @@ -8491,6 +8493,12 @@ \subsubsection{SYNCHDMLC} similar to the TARGET/ISOCENTER leaves in DYNVMLC, with HALF TARGET/HALF ISOCENTER leaves being wider than the QUARTER TARGET/QUARTER ISOCENTER leaves. +In addition to the option to specify leaves opening in either the Y- ({\tt ORIENT}=0) or X-direction ({\tt ORIENT}=1) +shared with other dynamic MLCs, SYNCHDMLC provides two additional possible settings of {\tt ORIENT} which +will automatically transform the SYNCHDMLC coordinate system to match that given in the manufacturers specifications +for the 120MLC and HD120 MLCs for leaves opening in the Y- ({\tt ORIENT}=2) or X-direction ({\tt ORIENT}=3). More +details on {\tt ORIENT}=2,3 are given below. + \begin{figure}[htpb] \begin{center} \vspace*{-0.7cm} @@ -8525,57 +8533,15 @@ \subsubsection{SYNCHDMLC} have the same meanings as those used for DYNVMLC (See Section~\ref{dynvmlcsect} and Table~\ref{dynvmlc_tab}). In general, QUARTER leaves are used closer to middle of the mlc, and, while their Z-dimensions are similar to those for their HALF counterparts, they -are significantly thinner in the X- ({\tt ORIENT}=0) or Y- ({\tt ORIENT}=1) +are significantly thinner in the X- ({\tt ORIENT}=0,2) or Y- ({\tt ORIENT}=1,3) dimension. -\index{SYNCHDMLC!Relaxation of leaf cross-section input restrictions} -In general, SYNCHDMLC is similar to DYNVMLC and SYNCVMLC in that leaf cross-section dimensions must be defined so that -the grid lines shown in Figure~\ref{synchdmlc_fig}, defining the cross-section regions, remain in the same order -shown in the figure. This should allow modeling of the HD120 based on manufacturer specifications assuming either -non-divergent leaves ({\em i.e.,} leaves in which the vertical cross-section boundaries are parallel as opposed -to intersecting at some value of Z$<${\tt ZMIN}), as shown in -Figure~\ref{synchdmlc_fig}, or else minimal divergence. Leaves may diverge to a significant extent, however, -and it has -come to our attention that, in an effort to more accurately model this, users may project manufacturer-specified -cross-section widths ({\em e.g.,} {\tt wtip}, {\tt wts}, {\tt wbs}, etc) from the Z values at which they are defined -back to {\tt ZMIN}. This results in a change in order in some of the vertical cross-section boundaries. In an effort -to accommodate this in SYNCHDMLC, we have recently introduced the following relaxations of prior input restrictions: -\begin{enumerate} -\item {\bf For HALF TARGET and QUARTER TARGET leaves}: The bottom of the support rail can extend to the left of the -leaf tip ({\tt wbs} $>$ {\tt wg} + {\tt wtip}), changing the -order of the 3rd and 4th (counting from the right) vertical cross-section boundaries shown in Figure~\ref{synchdmlc_fig}. -\item {\bf For HALF TARGET and QUARTER TARGET leaves}: The top of the support rail can extend past the right edge -of the leaf ({\tt wts} $>$ {\tt wbs}), changing the order of the -6th and 7th vertical cross-section boundaries. -\item {\bf For QUARTER TARGET leaves}: The top of the support rail need not extend past the beginning (left edge) -of the groove ({\tt wts} $<$ {\tt wbs} - {\tt wg}), -effectively changing the order of vertical boundries 5 and -6, provided that, if relaxation 1 above is in effect, it does extend past the left edge of the leaf tip. -\item {\bf For HALF ISOCENTER leaves}: The bottom of the support rail can extend past the left edge of the leaf -({\tt wbs} $>$ {\tt wts}), changing the order of the 1st and 2nd vertical cross-section boundaries. -\item {\bf For QUARTER ISOCENTER leaves}: The bottom of the support rail need not extend (to the right) as far as -the right edge of the tongue ({\tt wbs} $<$ {\tt wts} - {\tt wt}), changing -the order of the 2nd and 3rd vertical cross-section boundaries, provided that it still extends past the -right edge of the leaf tip. -\item {\bf For QUARTER ISOCENTER leaves}: The Z-position of the groove, {\tt zg}, can be greater than that of the tongue, -{\tt zt}, allowing for duelling interpretations of manufacturer specifications for this leaf type in which the -relative Z-positions of these structures are not entirely clear. -\end{enumerate} -If user input dimensions require any of the above relaxations, a warning message will be output stating which restriction -is being relaxed and indicating that the input cross-section differs from that shown in this manual. -It is important to note that, while these relaxations in boundary ordering may allow the user to input -accurate dimensions consistent with divergent MLC leaves, leaves are still modeled as if they are non-divergent, -with all side surfaces focused at {\tt ZFOCUS(1)}, and, thus, the geometry remains an approximation. -Many thanks to Dr. Jarkko Ojala at Tampere University -Hospital, Finland, who, through detailed examination of manufacturer specifications and measurement of MLC leaves, -determined which restrictions needed to be relaxed and who helped test the modified code. - \index{SYNCHDMLC!restrictions on leaf dimensions} -Similar to DYNVMLC, leaf cross-section dimensions must be defined so that the Z and X ({\tt ORIENT}=0) or Y ({\tt ORIENT}=1) grid lines +Leaf cross-section dimensions must be defined so that the Z and X ({\tt ORIENT}=0,2) or Y ({\tt ORIENT}=1,3) grid lines shown on the cross-sections at the top of Figure~\ref{synchdmlc_fig} do not change order. The Z-positions of tongues and grooves must allow leaves to fit together in the following -combinations: \\ +combinations:\\~~\\ FULL/FULL ({\tt zt}$_{FULL}$ $\leq$ {\tt zg}$_{FULL}$)\\ FULL/HALF TARGET ({\tt zg}$_{FULL}$ $\geq$ {\tt zt}$_{HALF~TARGET}$)\\ HALF TARGET/HALF ISOCENTER ({\tt zg}$_{HALF~TARGET}$ $\leq$ {\tt zt}$_{HALF~ISOCENTER}$)\\ @@ -8586,22 +8552,11 @@ \subsubsection{SYNCHDMLC} QUARTER ISOCENTER/HALF TARGET ({\tt zg}$_{QUARTER~ISOCENTER}$ $\geq$ {\tt zt}$_{HALF~TARGET}$)\\ and HALF ISOCENTER/FULL (ie {\tt zg}$_{HALF~ISOCENTER}$ $\geq$ {\tt zt}$_{FULL}$). - - -As in DYNVMLC and SYNCVMLC, rather than specifying the type of each leaf in the MLC, the user is able to specify groups -of adjacent leaves of the same type. Since TARGET leaves always alternate with ISOCENTER leaves within a group, -for the purpose of defining a leaf group, HALF or QUARTER TARGET/ISOCENTER leaves are considered one type. -Unlike DYNVMLC and SYNCVMLC, however, the number of TARGET/ISOCENTER leaves in a group does not have to be even. Thus, -the final TARGET or ISOCENTER leaf in a group need not be matched by its ISOCENTER or TARGET (respectively) -counterpart. If a group of TARGET/ISOCENTER is defined adjacent to another group of TARGET/ISOCENTER leaves, the -first leaf in the group will automatically be chosen to match the last leaf of the previous group. Thus, if -the last leaf of the previous group was a QUARTER or HALF TARGET leaf, then the first leaf of the current -group will be a QUARTER or HALF ISOCENTER leaf, and vice versa. In terms of leaf groups, the only restriction -is that the numbers and types of leaves cannot be specified so that a QUARTER or HALF TARGET leaf ends up -immediately adjacent to a FULL leaf on the -X (ORIENT=0) or -Y (ORIENT=1) side. -Finally, note that the user need not use all leaf types in a simulated MLC. Thus, there may be no FULL leaves, HALF TARGET/ISOCENTER -leaves, or QUARTER TARGET/ISOCENTER leaves in the simulation. In this case, inputs for the -cross-section parameters of the unused leaves can be left as blanks or zeros. +The default cross-sections for each leaf type are shown in Figure~\ref{synchdmlc_fig}. The width of +each vertical region is specified as back projected to {\tt ZMIN}. Thus, for any width, $w_i$, +the user inputs the value, $w_i\times\left(\frac{{\tt ZMIN}}{Z_i}\right)$, where $Z_i$ is the value of Z +where $w_i$ is defined. For example, for any leaf type, to define the groove width, $wg$, +the user would input $wg\times\left(\frac{{\tt ZMIN}}{zg}\right)$. Similar to DYNVMLC and SYNCVMLC, leaf ends can be straight, focused ({\tt ENDTYPE}=1) or cylindrical ({\tt ENDTYPE}=0). For straight, focused ends, the user must specify the Z-position of the @@ -8636,9 +8591,67 @@ \subsubsection{SYNCHDMLC} leaves when determining the perpendicular distance to the nearest region boundary for charged particle range rejection. For this option to be in effect, charged particles must be in the leaf medium and have:\\ -particle Y ({\tt ORIENT}=0) or X ({\tt ORIENT}=1) $<$ minimum Y ({\tt ORIENT}=0) or X ({\tt ORIENT}=1) of all leaf openings +particle Y ({\tt ORIENT}=0,2) or X ({\tt ORIENT}=1,3) $<$ minimum Y ({\tt ORIENT}=0,2) or X ({\tt ORIENT}=1,3) of all leaf openings (excluding rounded or focused leaf end) or\\ -particle Y ({\tt ORIENT}=0) or X ({\tt ORIENT}=1) $>$ maximum Y ({\tt ORIENT}=0) or X ({\tt ORIENT}=1) of all leaf openings (excluding leaf end)\\ +particle Y ({\tt ORIENT}=0,2) or X ({\tt ORIENT}=1,3) $>$ maximum Y ({\tt ORIENT}=0,2) or X ({\tt ORIENT}=1,3) of all leaf openings (excluding leaf end)\\ + +\subsubsubsection{More accurate modeling of manufacturer specifications for 120MLC and HD120 collimators} +\index{SYNCHDMLC!And manufacturer MLC specifications} + +\index{SYNCHDMLC!Relaxation of leaf cross-section input restrictions} +The default cross-sections were originally implemented assuming that leaf divergence ({\em i.e.}, due +to all leaf sides being focused at a single Z-value, {\tt ZFOCUS(1)}) is sufficiently small that +the order of vertical boundaries does not change when widths are back projected to {\tt ZMIN}, and +restrictions have been placed on cross-section inputs based on this assumption. However, recent work +by Dr. Jarkko Ojala (2018, Tampere University Hospital, Finland) involving detailed measurements +of leaf cross-sections and reference to the manufacturer's (Varian) specifications has shown +that this assumption does not hold for a number of vertical regions. To facilitate more accurate modelling +of leaf cross-sections, then, we have implemented the following exceptions to the original cross-section +input restrictions: + +For accurate modelling of HALF TARGET and HALF ISOCENTER leaves (Varian MLC120 and HDMLC): +\renewcommand{\theenumi}{\roman{enumi}}% +\begin{enumerate} +\item In HALF TARGET leaves, the bottom of the support rail is allowed to extend to the left of the +leaf tip ({\tt wbs} $>$ {\tt wg} + {\tt wtip}), changing the +order of the 3rd and 4th (counting from the right) vertical cross-section boundaries shown in Figure~\ref{synchdmlc_fig}. +\item In HALF TARGET leaves, the top of the support rail can extend past the right edge +of the leaf ({\tt wts} $>$ {\tt wbs}), changing the order of the +6th and 7th vertical cross-section boundaries. +\item In HALF ISOCENTER leaves, the bottom of the support rail can extend past the left edge of the leaf +({\tt wbs} $>$ {\tt wts}), changing the order of the 1st and 2nd vertical cross-section boundaries. +\end{enumerate} + +For accurate modeling of QUARTER TARGET and QUARTER ISOCENTER leaves (Varian HDMLC only): +\begin{enumerate} +\item In QUARTER TARGET leaves, the bottom of the support rail is allowed to extend to the left of the +leaf tip ({\tt wbs} $>$ {\tt wg} + {\tt wtip}). This is similar to the exception for HALF TARGET leaves (see above). +\item In QUARTER TARGET leaves, the top of the support rail can extend past the right edge +of the leaf ({\tt wts} $>$ {\tt wbs}). This is also similar to the exception for HALF TARGET leaves (see above). +\end{enumerate} + +In addition, in the past there has been some doubt interpreting the manufacturer's specifications for the relative Z-positions +of the tongue ({\tt zt}) and groove ({\tt zg}) of QUARTER ISOCENTER leaves, with one interpretation consistent with the +cross-section shown in Figure~\ref{synchdmlc_fig} ({\tt i.e.}, {\tt zg} $<$ {\tt zt}) and another indicating +that {\tt zg} $>$ {\tt zt}. Ojala's work has shown that the latter interpretation is correct, and so we have implemented +an input exception for QUARTER ISOCENTER leaves allowing {\tt zg} $>$ {\tt zt}. + +Each of the exceptions above will generate a warning message on input making clear that the leaf cross-section now differs +from that shown in this manual. + +\index{SYNCHDMLC!{\tt ORIENT}=2 and 3} +More recent comparisons between simulated and measured dose results using the Varian +MLC120 and HDMLC collimators (Ojala, 2022) have revealed a mismatch between the BEAMnrc coordinate system and +that used in the manufacturer specifications for these MLCs. While the BEAMnrc coordinate system is right-handed, that used by in the manufacturer specifications is left-handed. As a result, for the definitions of positive +and negative leaf banks in BEAMnrc-space to +be consistent with specifications, leaf cross-sections must be flipped about the Z-axis and leaf ordering +must be reversed. This is best pictured by considering the X cross-section view shown in Figure~\ref{synchdmlc_fig} +with the X-axis replaced by the -X-axis. In order to preserve leaf opening sequences, however, +we must then ``flip'' the +leaf opening coordinates so that the opening coordinates formerly applied to leaf i are now applied to leaf +{\tt TOT\_LEAF} - i + 1, where {\tt TOT\_LEAF} is the total number of leaves in the bank. +These transformations are done automatically if +the user sets {\tt ORIENT=2} (for leaves opening in X-direction) or {\tt ORIENT=3} (for leaves opening in Y-direction). An example of a file specifying dynamic leaf settings for SYNCHDMLC is included with the distribution. This file is {\tt \$OMEGA\_HOME/beamnrc/CMs/sample\_synchdmlc.sequence}. diff --git a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran index 1565b296e..28d4a1c9a 100644 --- a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran +++ b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_cm.mortran @@ -238,6 +238,13 @@ "I> "I> ORIENT_$SYNCHDMLC = 0 for leaves parallel to Y direction "I> = 1 for leaves parallel to X direction +"I> = 2 same as 0 but with leaf numbering and cross- +"I> sections reversed--Note: This makes the +"I> +ve leaves equivalent to leaf bank A +"I> -ve leaves equivalent to bank B in TrueBeam +"I> specs +"I> = 3 same as 1 but with leaf numbering and cross- +"I> sections reversed similar to option 2 "I> NGROUP_$SYNCHDMLC = number of groups of adjacent leaves where "I> all leaves in a group are: "I> 1. FULL leaves @@ -488,19 +495,18 @@ "I> "I> Repeat 14 until coordinates of all leaves are defined once. Leaves "I> are numbered 1,2,...TOT_LEAF_$SYNCHDMLC, where numbering goes from leaf -"I> 1 to leaf TOT_LEAF_$SYNCHDMLC. Convention is lower to upper or -"I> left to right depending on ORIENT_$SYNCHDMLC i.e from negative to -"I> positive. +"I> 1 to leaf TOT_LEAF_$SYNCHDMLC. Convention is -ve to +ve +"I> (ORIENT_$SYNCHDMLC=0,2) or +ve to -ve (ORIENT_$SYNCHDMLC=1,3) "I> "I> 14a NEG_$SYNCHDMLC, POS_$SYNCHDMLC, NUM_$SYNCHDMLC (2F15.5,I5) "I> -"I> NEG_$SYNCHDMLC: Min. Y (ORIENT_$SYNCHDMLC=0) or X (ORIENT_$SYNCHDMLC=1) -"I> of front opening in leaf I (ie the opening at -"I> ZMIN_$SYNCHDMLC) if ENDTYPE=1, or of rounded end -"I> of leaf I if ENDTYPE=0. -"I> POS_$SYNCHDMLC: Max. Y (ORIENT_$SYNCHDMLC=0) or X (ORIENT_$SYNCHDMLC=1) -"I> of front opening in leaf I if ENDTYPE=1, or of +"I> NEG_$SYNCHDMLC: Min. Y (ORIENT_$SYNCHDMLC=0,2) or X +"I> (ORIENT_$SYNCHDMLC=1,3) of front opening in leaf I (ie +"I> the opening at ZMIN_$SYNCHDMLC) if ENDTYPE=1, or of "I> rounded end of leaf I if ENDTYPE=0. +"I> POS_$SYNCHDMLC: Max. Y (ORIENT_$SYNCHDMLC=0,2) or X +"I> (ORIENT_$SYNCHDMLC=1,3) of front opening in leaf I if +"I> ENDTYPE=1, or of rounded end of leaf I if ENDTYPE=0. "I> NUM_$SYNCHDMLC: Apply NEG_$SYNCHDMLC and POS_$SYNCHDMLC to leaves "I> I,...,I+NUM_$SYNCHDMLC-1. Defaults to 1 if set <=0. "I> Defaults to TOT_LEAF_$SYNCHDMLC-I+1 if set > @@ -535,13 +541,13 @@ "I> number is compared to a random number on (0,1) at "I> the start of each history; if the random number is "I> <= INDEX_$SYNCHDMLC(I), then field I is used. -"I> NEG_$SYNCHDMLC: Min. Y (ORIENT_$SYNCHDMLC=0) or -"I> X (ORIENT_$SYNCHDMLC=1) +"I> NEG_$SYNCHDMLC: Min. Y (ORIENT_$SYNCHDMLC=0,2) or +"I> X (ORIENT_$SYNCHDMLC=1,3) "I> of front opening in leaf (ie the opening at "I> ZMIN_$SYNCHDMLC) if ENDTYPE=1, or of rounded end "I> of leaf if ENDTYPE=0 for leaf J in field I. -"I> POS_$SYNCHDMLC: Max. Y (ORIENT_$SYNCHDMLC=0) or -"I> X (ORIENT_$SYNCHDMLC=1) +"I> POS_$SYNCHDMLC: Max. Y (ORIENT_$SYNCHDMLC=0,2) or +"I> X (ORIENT_$SYNCHDMLC=1,3) "I> of front opening in leaf if ENDTYPE=1, or of "I> rounded end of leaf if ENDTYPE=0 for leaf J in "I> field I. @@ -575,10 +581,10 @@ "I> rejection in leaf material when the particle X position "I> is < min X of all leaf openings (not including leaf "I> ends) or > max X of leaf openings (not including ends) -"I> (ORIENT_$SYNCHDMLC=1) or if the particle Y position +"I> (ORIENT_$SYNCHDMLC=1,3) or if the particle Y position "I> is < min Y of all leaf openings (not including leaf "I> ends) or > max Y of leaf openings (not including ends) -"I> (ORIENT_$SYNCHDMLC=0). This approximation is designed +"I> (ORIENT_$SYNCHDMLC=0,2). This approximation is designed "I> to make range rejection more efficient deep in the "I> leaves, while still preserving accurate transport "I> in the leaf ends. Note that if you have significant @@ -701,18 +707,21 @@ "V>$GEO_SHIFT_1_(#) "V>============= "V>{p1} the value to compare with ustep -"V> if {p1}+1.0e-5 < ustep shift it, otherwise no shift +"V> if {p1}+1.0e-5 < ustep shift it, otherwise set it to ustep +"V> Note: if above condition failed, this used to leave {p1} +"V> unshifted, which led to transport errors ; REPLACE {$GEO_SHIFT_1_(#)} WITH { ;IF({P1}~=0.00 ) [ IF({P1}+1.0E-5< USTEP) [{P1}={P1}+1.0E-5;] + ELSE [{P1}=USTEP;] ] ELSE [{P1}={P1}+1.0E-5;]; } ;IMPLICIT NONE; -;COMIN/CMs,CM_$SYNCHDMLC,EPCONT,STACK,USER,EGS-IO/; +;COMIN/MISC,SCORE,CMs,CM_$SYNCHDMLC,EPCONT,STACK,USER,EGS-IO/; "T> "T>********************************** "T>TYPE DECLARATIONS FOR HOWFAR_$SYNCHDMLC @@ -759,9 +768,19 @@ parameter (one = 1); IRL = IR(NP); "local region number (absolute)" IR_$SYNCHDMLC = IRL - IRSTART_$SYNCHDMLC + 1; "rel. local region number" "IR_$SYNCHDMLC = IRL - IRSTART_$SYNCHDMLC; rel. local region number" -IF(ORIENT_$SYNCHDMLC=1) [ - XYL(1)=Y(NP); XYL(2)=X(NP);UVL(1)=V(NP);UVL(2)=U(NP);] -ELSE[ XYL(1)=X(NP); XYL(2)=Y(NP);UVL(1)=U(NP);UVL(2)=V(NP);] + +IF(ORIENT_$SYNCHDMLC=0)[ + XYL(1)=X(NP); XYL(2)=Y(NP);UVL(1)=U(NP);UVL(2)=V(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=1)[ + XYL(1)=Y(NP); XYL(2)=X(NP);UVL(1)=V(NP);UVL(2)=U(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=2)[ + XYL(1)=-X(NP); XYL(2)=Y(NP);UVL(1)=-U(NP);UVL(2)=V(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=3)[ + XYL(1)=-Y(NP); XYL(2)=X(NP);UVL(1)=-V(NP);UVL(2)=U(NP); +] ; STEP_UNIT=0.0; @@ -936,7 +955,7 @@ ELSEIF( (STEP_UNIT>DIST1) & (DIST1>=0)) [ DIST1=DIST1+1.0E-5; "we have to shift it regardless to avoid " "infinite loops" "OUTPUT REGION_$SYNCHDMLC;(I3);-prints 67 to 69" - " IF(DIST1>=STEP_UNIT)[EXIT;]" + IF(DIST1>=STEP_UNIT)[EXIT;] " ELSE[" $SYNCHDMLC_FIND(NEWREGION_$SYNCHDMLC,DIST1); @@ -968,6 +987,10 @@ ELSEIF( (STEP_UNIT>DIST1) & (DIST1>=0)) [ ] IRNEW = NEWREGION_$SYNCHDMLC; + "Holy assumption: If there is no airgap between leaves, we could" + "have the situation where we do not transport as far as the new" + "region but the region no. is changed anyway" + "Consider using the _FIND macro to get the reg. no. anyway" RETURN; ] ELSE [ $SYNCHDMLC_MINDISTANCE(DIST2); @@ -1058,9 +1081,18 @@ INTEGER NX,NY,NZ, "T>Indices of subregions DOUBLE PRECISION XYL(2), XYFL(2), ZFL, UVL(2), XoN, XoP, Zo, TEMP1, TEMP2, TEMP3, TEMP4, HOLE; -IF(ORIENT_$SYNCHDMLC=1) - [ XYL(1)=Y(NP); XYL(2)=X(NP);UVL(1)=V(NP);UVL(2)=U(NP);] -ELSE[ XYL(1)=X(NP); XYL(2)=Y(NP);UVL(1)=U(NP);UVL(2)=V(NP);]; +IF(ORIENT_$SYNCHDMLC=0)[ + XYL(1)=X(NP); XYL(2)=Y(NP);UVL(1)=U(NP);UVL(2)=V(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=1)[ + XYL(1)=Y(NP); XYL(2)=X(NP);UVL(1)=V(NP);UVL(2)=U(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=2)[ + XYL(1)=-X(NP); XYL(2)=Y(NP);UVL(1)=-U(NP);UVL(2)=V(NP); +] +ELSEIF(ORIENT_$SYNCHDMLC=3)[ + XYL(1)=-Y(NP); XYL(2)=X(NP);UVL(1)=-V(NP);UVL(2)=U(NP); +] IF (IDIR=1) [ "particle entering this CM through front face (upstream)" IF(N_GAP_$SYNCHDMLC = 0) [ "no air gap this CM" @@ -1123,7 +1155,9 @@ EGS-IO/; DOUBLE PRECISION NEG_$SYNCHDMLC, "T>Leaf B tip POS_$SYNCHDMLC, "T>Leaf A Tip TEMP1, - TEMP2; + TEMP2, + tmp_coord; "a variable to hold values while" + "reversing leaf opening definitions" INTEGER I,J,K,L, "T>DO loop indices IRA, "T>Absolute region number @@ -1144,16 +1178,12 @@ $REAL INDEXTMP; "T>temporary input variable for field indices in dynamic and " step-and-shoot simulations $LOGICAL check_full_qtr; -"a flag indicating whether a sector of a given leaf cross-section has" -"an alternative definition to that specified in the BEAMnrc Manual" -"indexing: LEAFTYPE, 1 (Y bound) or 2 (Z bound), boundary no. -$INTEGER I_LEAF_ALT_DEF(5,2,10); -$REAL YTMP; +$REAL YTMP,YLEAFEND; DO I=1,5[ DO J=1,2[ DO K=1,10[ - I_LEAF_ALT_DEF(I,J,K)=0; + I_LEAF_ALT_DEF_$SYNCHDMLC(I,J,K)=0; ] ] ] @@ -1180,12 +1210,12 @@ OUTPUT TITLE_$SYNCHDMLC;(' ',60A1); "II. CHOOSE THE SYNCHDMLC ORIENTATION " "============================== " -OUTPUT; (' Input leaf orientation (0=parallel to y, 1=parallel to x) and '/ +OUTPUT; (' Input leaf orientation (0,2=parallel to y, 1,3=parallel to x) and '/ ' no. of groups of leaves with equal width on one line'/' :',$); MINPUT ($SYNCHDMLC) ORIENT_$SYNCHDMLC, NGROUP_$SYNCHDMLC, MODE_$SYNCHDMLC; (3I5); OUTPUT ORIENT_$SYNCHDMLC,NGROUP_$SYNCHDMLC,MODE_$SYNCHDMLC; (3I5/); -IF(ORIENT_$SYNCHDMLC~=1) [ +IF(ORIENT_$SYNCHDMLC<0 | ORIENT_$SYNCHDMLC>3) [ ORIENT_$SYNCHDMLC=0; OUTPUT;(/' Orientation defaults to 0.'/); ]; @@ -1609,7 +1639,7 @@ IF(NUM_HLF>0) [ ' WRAILBOT_$SYNCHDMLC(2) > WGROOVE_$SYNCHDMLC(2)+WTIP_$SYNCHDMLC(2).'/ ' Leaf cross-section differs from that specified in the BEAMnrc'/ ' Manual.'//); - I_LEAF_ALT_DEF(2,1,4) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,4) = 1; ] IF(WRAILTOP_$SYNCHDMLC(2)>WRAILBOT_$SYNCHDMLC(2))[ OUTPUT ICM_$SYNCHDMLC; @@ -1617,7 +1647,7 @@ IF(NUM_HLF>0) [ ' WRAILTOP_$SYNCHDMLC(2) > WRAILBOT_$SYNCHDMLC(2).'/ ' This differs from the cross-section specified in the BEAMnrc'/ ' Manual.'//); - I_LEAF_ALT_DEF(2,1,6) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,6) = 1; ] IF(WRAILTOP_$SYNCHDMLC(2)0) [ (//' ***WARNING IN CM ',I3,' ($SYNCHDMLC) in HALF ISO leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(3) > WRAILTOP_$SYNCHDMLC(3).'/ ' This differs from the cross-section specified in the BEAMnrc Manual.'//); - I_LEAF_ALT_DEF(3,1,1) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1) = 1; ] IF(WRAILBOT_$SYNCHDMLC(3)0) [ ' WRAILBOT_$SYNCHDMLC(4) > WGROOVE_$SYNCHDMLC(4)+WTIP_$SYNCHDMLC(4).'/ ' This differs from the cross-section specified in the BEAMnrc'/ ' Manual.'//); - I_LEAF_ALT_DEF(4,1,4) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,4) = 1; ] IF(WRAILTOP_$SYNCHDMLC(4)>WRAILBOT_$SYNCHDMLC(4))[ OUTPUT ICM_$SYNCHDMLC; (//' ***WARNING IN CM ',I3,' ($SYNCHDMLC) in QTR TARGET leaf definition:'/ ' WRAILTOP_$SYNCHDMLC(4) > WRAILBOT_$SYNCHDMLC(4).'/ ' This differs from the cross-section specified in the BEAMnrc Manual.'//); - I_LEAF_ALT_DEF(4,1,6) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,6) = 1; ] IF(WRAILTOP_$SYNCHDMLC(4)0) [ (//' ***WARNING IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' WRAILBOT_$SYNCHDMLC(5) < WRAILTOP_$SYNCHDMLC(5)-WTONGUE_$SYNCHDMLC(5).'/ ' Cross-section definition differs from BEAMnrc Manual.'//); - I_LEAF_ALT_DEF(5,1,2) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2) = 1; IF(WRAILBOT_$SYNCHDMLC(5)0) [ (//' ***WARNING IN CM ',I5,' ($SYNCHDMLC) in QTR ISO leaf definition:'/ ' ZGROOVE_$SYNCHDMLC(5) > ZTONGUE_$SYNCHDMLC(5).'/ ' This differs from the cross-section specified in the BEAMnrc Manual.'//); - I_LEAF_ALT_DEF(5,2,4) = 1; + I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4) = 1; ] IF(ZHOLETOP_$SYNCHDMLC(5)0) [ DO L = 1,NGROUP_$SYNCHDMLC[ DO K = 1,NUM_LEAF_$SYNCHDMLC(L) [ - I=I+1; IF(I=1)[ YREG_$SYNCHDMLC(I,1)=START_$SYNCHDMLC; ] - ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=1)[ - YREG_$SYNCHDMLC(I,1)=YREG_$SYNCHDMLC(I-1,7)+LEAFGAP_$SYNCHDMLC- + ELSE[ + + YLEAFEND=YREG_$SYNCHDMLC(I-1,7); + "possible exceptions" + IF(LEAFTYPE_$SYNCHDMLC(I-1)=2 & I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,6)=1)[ + YLEAFEND=YREG_$SYNCHDMLC(I-1,6); + ] + ELSEIF(LEAFTYPE_$SYNCHDMLC(I-1)=4 & I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,6)=1)[ + YLEAFEND=YREG_$SYNCHDMLC(I-1,6); + ] + + IF(LEAFTYPE_$SYNCHDMLC(I)=1)[ + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- WTONGUE_$SYNCHDMLC(1); - ] - ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=2)["half target leaf" - YREG_$SYNCHDMLC(I,1)=YREG_$SYNCHDMLC(I-1,7)+LEAFGAP_$SYNCHDMLC- + ] + ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=2)["half target leaf" + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- WTONGUE_$SYNCHDMLC(2); - ] - ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=3)["half isocenter leaf" - YREG_$SYNCHDMLC(I,1)=YREG_$SYNCHDMLC(I-1,7)+LEAFGAP_$SYNCHDMLC- + ] + ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=3)["half isocenter leaf" + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1)=1)[ + "here we are saying that leaf gap is defined wrt tongue/groove" + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- + WTONGUE_$SYNCHDMLC(3)- + ABS(WRAILBOT_$SYNCHDMLC(3)-WRAILTOP_$SYNCHDMLC(3)); + ] + ELSE[ + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- WTONGUE_$SYNCHDMLC(3); - ] - ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=4)["qtr target leaf" - YREG_$SYNCHDMLC(I,1)=YREG_$SYNCHDMLC(I-1,7)+LEAFGAP_$SYNCHDMLC- + ] + ] + ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=4)["qtr target leaf" + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- WTONGUE_$SYNCHDMLC(4); - ] - ELSE ["qtr iso leaf" - YREG_$SYNCHDMLC(I,1)=YREG_$SYNCHDMLC(I-1,7)+LEAFGAP_$SYNCHDMLC- + ] + ELSE ["qtr iso leaf" + YREG_$SYNCHDMLC(I,1)=YLEAFEND+LEAFGAP_$SYNCHDMLC- WTONGUE_$SYNCHDMLC(5); + ] ] "we have now defined YREG_$SYNCHDMLC(I,1)" @@ -2468,16 +2517,23 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ ] ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=2)["half target leaf" YREG_$SYNCHDMLC(I,2)=YREG_$SYNCHDMLC(I,1)+WTONGUE_$SYNCHDMLC(2); - YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(2); - YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,7)- + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,6)=1)[ + YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(2); + YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,6)+ ABS(WRAILBOT_$SYNCHDMLC(2)-WRAILTOP_$SYNCHDMLC(2)); - IF(I_LEAF_ALT_DEF(2,1,6)=1)[ + ] + ELSE[ + YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(2); + YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,7)- + ABS(WRAILBOT_$SYNCHDMLC(2)-WRAILTOP_$SYNCHDMLC(2)); + ] + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,6)=1)[ YTMP = YREG_$SYNCHDMLC(I,6); ] ELSE[ YTMP = YREG_$SYNCHDMLC(I,7); ] - IF(I_LEAF_ALT_DEF(2,1,4)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(2,1,4)=1)[ YREG_$SYNCHDMLC(I,4)=YTMP-WGROOVE_$SYNCHDMLC(2)-WTIP_$SYNCHDMLC(2); YREG_$SYNCHDMLC(I,3)=YTMP-WRAILBOT_$SYNCHDMLC(2); ] @@ -2490,9 +2546,14 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=3)["half isocenter leaf" YREG_$SYNCHDMLC(I,2)=YREG_$SYNCHDMLC(I,1)+ABS(WRAILTOP_$SYNCHDMLC(3)- WRAILBOT_$SYNCHDMLC(3)); - YREG_$SYNCHDMLC(I,3)=YREG_$SYNCHDMLC(I,1)+WTONGUE_$SYNCHDMLC(3); + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1)=1)[ + YREG_$SYNCHDMLC(I,3)=YREG_$SYNCHDMLC(I,2)+WTONGUE_$SYNCHDMLC(3); + ] + ELSE[ + YREG_$SYNCHDMLC(I,3)=YREG_$SYNCHDMLC(I,1)+WTONGUE_$SYNCHDMLC(3); + ] YREG_$SYNCHDMLC(I,4)=YREG_$SYNCHDMLC(I,3)+WTIP_$SYNCHDMLC(3); - IF(I_LEAF_ALT_DEF(3,1,1)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1)=1)[ YREG_$SYNCHDMLC(I,5)=YREG_$SYNCHDMLC(I,1)+WRAILBOT_$SYNCHDMLC(3); ] ELSE[ @@ -2504,21 +2565,28 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ ] ELSEIF(LEAFTYPE_$SYNCHDMLC(I)=4)["qtr target leaf" YREG_$SYNCHDMLC(I,2)=YREG_$SYNCHDMLC(I,1)+WTONGUE_$SYNCHDMLC(4); - YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(4); - IF(I_LEAF_ALT_DEF(4,1,5)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,5)=1)[ + YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(4); YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,7)-WGROOVE_$SYNCHDMLC(4); ] + ELSEIF(I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,6)=1)[ + "this exception and the above are mutually exclusive" + YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(2); + YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,6)+ + ABS(WRAILBOT_$SYNCHDMLC(4)-WRAILTOP_$SYNCHDMLC(4)); + ] ELSE[ + YREG_$SYNCHDMLC(I,7)=YREG_$SYNCHDMLC(I,2)+LEAFWIDTH_$SYNCHDMLC(4); YREG_$SYNCHDMLC(I,6)=YREG_$SYNCHDMLC(I,7)- ABS(WRAILBOT_$SYNCHDMLC(4)-WRAILTOP_$SYNCHDMLC(4)); ] - IF(I_LEAF_ALT_DEF(4,1,6)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,6)=1)[ YTMP = YREG_$SYNCHDMLC(I,6); ] ELSE[ YTMP = YREG_$SYNCHDMLC(I,7); ] - IF(I_LEAF_ALT_DEF(4,1,4)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,4)=1)[ YREG_$SYNCHDMLC(I,4)=YTMP-WGROOVE_$SYNCHDMLC(4)-WTIP_$SYNCHDMLC(4); YREG_$SYNCHDMLC(I,3)=YTMP-WRAILBOT_$SYNCHDMLC(4); ] @@ -2526,7 +2594,7 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ YREG_$SYNCHDMLC(I,3)=YTMP-WGROOVE_$SYNCHDMLC(4)-WTIP_$SYNCHDMLC(4); YREG_$SYNCHDMLC(I,4)=YTMP-WRAILBOT_$SYNCHDMLC(4); ] - IF(I_LEAF_ALT_DEF(4,1,5)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(4,1,5)=1)[ YREG_$SYNCHDMLC(I,5)=YTMP-WRAILBOT_$SYNCHDMLC(4)+ WRAILTOP_$SYNCHDMLC(4); ] @@ -2535,7 +2603,7 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ ] ] ELSE ["qtr isocenter leaf" - IF(I_LEAF_ALT_DEF(5,1,2)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1)[ YREG_$SYNCHDMLC(I,3)=YREG_$SYNCHDMLC(I,1)+WRAILTOP_$SYNCHDMLC(5)- WRAILBOT_$SYNCHDMLC(5); YREG_$SYNCHDMLC(I,2)=YREG_$SYNCHDMLC(I,1)+WTONGUE_$SYNCHDMLC(5); @@ -2557,6 +2625,8 @@ IF(TOT_LEAF_$SYNCHDMLC>0) [ DO J = 1, 7 [ SURPARA1_$SYNCHDMLC(I,J)=YREG_$SYNCHDMLC(I,J)/TEMP1; "OUTPUT I, J, YREG_$SYNCHDMLC(I,J); (I5, I5, F12.6, ' ', $/);" + "write(*,*)' i, leafis, j, yreg ',i,LEAFTYPE_$SYNCHDMLC(I),j," + " YREG_$SYNCHDMLC(I,J);" " OUTPUT I, J, SURPARA1_$SYNCHDMLC(I,J); (I5, I5, F12.6, ' ', $/);" ];"End of J Loop" ]; "End of K Loop" @@ -2619,6 +2689,23 @@ IF(MODE_$SYNCHDMLC=1|MODE_$SYNCHDMLC=2)["dynamic or step-and-shoot leaf inputs" ] J=K; ]WHILE(J<=TOT_LEAF_$SYNCHDMLC); + IF(ORIENT_$SYNCHDMLC>=2)[ + "reverse order of leaf opening coordinates" + DO K=1,TOT_LEAF_$SYNCHDMLC/2[ + tmp_coord = LEAFNEG_$SYNCHDMLC(K+(I-1)*TOT_LEAF_$SYNCHDMLC); + LEAFNEG_$SYNCHDMLC(K+(I-1)*TOT_LEAF_$SYNCHDMLC) = + LEAFNEG_$SYNCHDMLC((TOT_LEAF_$SYNCHDMLC-K+1)+ + (I-1)*TOT_LEAF_$SYNCHDMLC); + LEAFNEG_$SYNCHDMLC((TOT_LEAF_$SYNCHDMLC-K+1)+ + (I-1)*TOT_LEAF_$SYNCHDMLC) = tmp_coord; + tmp_coord = LEAFPOS_$SYNCHDMLC(K+(I-1)*TOT_LEAF_$SYNCHDMLC); + LEAFPOS_$SYNCHDMLC(K+(I-1)*TOT_LEAF_$SYNCHDMLC) = + LEAFPOS_$SYNCHDMLC((TOT_LEAF_$SYNCHDMLC-K+1)+ + (I-1)*TOT_LEAF_$SYNCHDMLC); + LEAFPOS_$SYNCHDMLC((TOT_LEAF_$SYNCHDMLC-K+1)+ + (I-1)*TOT_LEAF_$SYNCHDMLC) = tmp_coord; + ] + ] ] CLOSE(UNIT=mlc_unit); @@ -2632,7 +2719,7 @@ IF(MODE_$SYNCHDMLC=1|MODE_$SYNCHDMLC=2)["dynamic or step-and-shoot leaf inputs" ] ELSE[ OUTPUT; (' Input for MLC A and B leaf tips '/); -IF(ORIENT_$SYNCHDMLC=1)[ +IF(ORIENT_$SYNCHDMLC=1 | ORIENT_$SYNCHDMLC=3)[ IF(ENDTYPE_$SYNCHDMLC=1)[ OUTPUT;(' Input min. X, max. X of top of opening in leaves,'); ] @@ -2680,6 +2767,17 @@ LOOP[ ] I=J; ]WHILE(I<=TOT_LEAF_$SYNCHDMLC);"End of Coordinate inputs for || direction " +IF(ORIENT_$SYNCHDMLC>=2)[ + "reverse leaf opening definitions" + DO I=1,TOT_LEAF_$SYNCHDMLC/2 [ + tmp_coord = LEAFB_$SYNCHDMLC(I); + LEAFB_$SYNCHDMLC(I) = LEAFB_$SYNCHDMLC(TOT_LEAF_$SYNCHDMLC-I+1); + LEAFB_$SYNCHDMLC(TOT_LEAF_$SYNCHDMLC-I+1) = tmp_coord; + tmp_coord = LEAFA_$SYNCHDMLC(I); + LEAFA_$SYNCHDMLC(I) = LEAFA_$SYNCHDMLC(TOT_LEAF_$SYNCHDMLC-I+1); + LEAFA_$SYNCHDMLC(TOT_LEAF_$SYNCHDMLC-I+1) = tmp_coord; + ] +] IF(ENDTYPE_$SYNCHDMLC=1)[ DO I=1, TOT_LEAF_$SYNCHDMLC [ @@ -2753,7 +2851,7 @@ DO IR_$SYNCHDMLC = 1,N_$SYNCHDMLC ["loop through regions to get information" ; IF(IGNOREGAPS_$SYNCHDMLC=1 & IREJCT_GLOBAL>0)[ - IF(ORIENT_$SYNCHDMLC=1)["leaves parallel to X" + IF(ORIENT_$SYNCHDMLC=1 | ORIENT_$SYNCHDMLC=3)["leaves parallel to X" OUTPUT;(/' *******Range rejection in $SYNCHDMLC will ignore all'/ ' air gaps if the particle is in the leaves and has'/ ' X < min. X of leaf openings (not including leaf ends)'/ @@ -2896,14 +2994,14 @@ DO L=1,TOT_LEAF_$SYNCHDMLC[ SUBINDEX_$SYNCHDMLC(L,I,2,6)=2; SUBINDEX_$SYNCHDMLC(L,I,2,7)=2; SUBINDEX_$SYNCHDMLC(L,I,3,1)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,4)~=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,4)~=1)[ SUBINDEX_$SYNCHDMLC(L,I,3,2)=2; ] SUBINDEX_$SYNCHDMLC(L,I,3,3)=2; SUBINDEX_$SYNCHDMLC(L,I,3,5)=2; SUBINDEX_$SYNCHDMLC(L,I,3,6)=2; SUBINDEX_$SYNCHDMLC(L,I,3,7)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,4)~=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,4)~=1)[ SUBINDEX_$SYNCHDMLC(L,I,3,8)=2; ] SUBINDEX_$SYNCHDMLC(L,I,4,1)=2; @@ -2912,13 +3010,13 @@ DO L=1,TOT_LEAF_$SYNCHDMLC[ SUBINDEX_$SYNCHDMLC(L,I,4,6)=2; SUBINDEX_$SYNCHDMLC(L,I,4,7)=2; SUBINDEX_$SYNCHDMLC(L,I,4,8)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,5)~=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,5)~=1)[ SUBINDEX_$SYNCHDMLC(L,I,5,1)=2; ] SUBINDEX_$SYNCHDMLC(L,I,5,3)=2; SUBINDEX_$SYNCHDMLC(L,I,5,5)=2; SUBINDEX_$SYNCHDMLC(L,I,5,6)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,6)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,6)=1)[ SUBINDEX_$SYNCHDMLC(L,I,6,1)=2; ] ELSE[ @@ -2963,12 +3061,12 @@ DO L=1,TOT_LEAF_$SYNCHDMLC[ ] ELSE [ "This is an Half or Quarter Isocenter Leaf" "Common to both Half and Quarter" - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,1)=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,1)=1)[ SUBINDEX_$SYNCHDMLC(L,I,1,9)=2; ] ELSE[ IF (LEAFTYPE_$SYNCHDMLC(L)=3 | - I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),2,4)=1) [ + I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),2,4)=1) [ "either 1) half isocentre or 2) quarter isocentre with zg>zt" SUBINDEX_$SYNCHDMLC(L,I,1,4)=2; ] @@ -2976,13 +3074,13 @@ DO L=1,TOT_LEAF_$SYNCHDMLC[ SUBINDEX_$SYNCHDMLC(L,I,1,7)=2; ] IF(LEAFTYPE_$SYNCHDMLC(L)=3 | - I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),2,4)=1)[ + I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),2,4)=1)[ "either 1) half isocentre or 2) quarter isocentre with zg>zt" SUBINDEX_$SYNCHDMLC(L,I,2,4)=2; ] SUBINDEX_$SYNCHDMLC(L,I,2,5)=2; SUBINDEX_$SYNCHDMLC(L,I,2,7)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),1,2)~=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(L),1,2)~=1)[ SUBINDEX_$SYNCHDMLC(L,I,2,9)=2; ] SUBINDEX_$SYNCHDMLC(L,I,3,2)=2; @@ -3007,7 +3105,8 @@ DO L=1,TOT_LEAF_$SYNCHDMLC[ SUBINDEX_$SYNCHDMLC(L,I,6,8)=2; SUBINDEX_$SYNCHDMLC(L,I,6,9)=2; - IF(I_LEAF_ALT_DEF(LEAFTYPE_$SYNCHDMLC(L),2,4)~=1) [ + IF(LEAFTYPE_$SYNCHDMLC(L)=5 & + I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)~=1) [ "Quarter Isocenter with zg0)[ - IF(ORIENT_$SYNCHDMLC=1)["leaves parallel to X" + IF(ORIENT_$SYNCHDMLC=1 | ORIENT_$SYNCHDMLC=3)["leaves parallel to X" WRITE(IOUTLIST,'(/'' *******Range rejection in $SYNCHDMLC will ignore all''/ '' air gaps if the particle is in the leaves and has''/ '' X < min. X of leaf openings (not including leaf ends)''/ @@ -3496,7 +3607,6 @@ $INTEGER I,J, "T> looping index" LEAFIS, "T> leaf no. where particle is located" I1,I2; "T> used to mark min. max. Z boundaries for calculating dist" - IR_$SYNCHDMLC=IR(NP)-IRSTART_$SYNCHDMLC +1; "IR_$SYNCHDMLC=IR(NP)-IRSTART_$SYNCHDMLC; CB" IF(IR_$SYNCHDMLC=4) [ "in the air gap at the top" @@ -3504,8 +3614,18 @@ IF(IR_$SYNCHDMLC=4) [ "in the air gap at the top" ] ELSE [ - IF(ORIENT_$SYNCHDMLC=1) [ XYL1=Y(NP);XYL2=X(NP);UVL1=V(NP);UVL2=U(NP); ] - ELSE [ XYL1=X(NP);XYL2=Y(NP);UVL1=U(NP);UVL2=V(NP);]; + IF(ORIENT_$SYNCHDMLC=0) [ + XYL1=X(NP);XYL2=Y(NP);UVL1=U(NP);UVL2=V(NP); + ] + ELSEIF(ORIENT_$SYNCHDMLC=1) [ + XYL1=Y(NP);XYL2=X(NP);UVL1=V(NP);UVL2=U(NP); + ] + ELSEIF(ORIENT_$SYNCHDMLC=2) [ + XYL1=-X(NP);XYL2=Y(NP);UVL1=-U(NP);UVL2=V(NP); + ] + ELSEIF(ORIENT_$SYNCHDMLC=3) [ + XYL1=-Y(NP);XYL2=X(NP);UVL1=-V(NP);UVL2=U(NP); + ] IF(IGNOREGAPS_$SYNCHDMLC=1 & XYL2 < MIN_PLANE_$SYNCHDMLC & XYL1 > SURPARA1_$SYNCHDMLC(1,1)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1)) & @@ -3587,8 +3707,11 @@ IF(LEAFIS~=0) [ "Check if we are in groove on leaf and move to adjacent leaf" IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ "target leaf" - IF((NY=5|NY=6) & (NZ=7|NZ=8|NZ=9) & LEAFIS~=TOT_LEAF_$SYNCHDMLC) [ - IF(XYL1>SURPARA1_$SYNCHDMLC(LEAFIS+1,1)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1)))[ + IF(LEAFIS~=TOT_LEAF_$SYNCHDMLC & ((((NY=5|NY=6) & (NZ=7|NZ=8|NZ=9)) & + XYL1>SURPARA1_$SYNCHDMLC(LEAFIS+1,1)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1))) | + (I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1 & + NY=6 & NZ>1 & + XYL1>SURPARA1_$SYNCHDMLC(LEAFIS+1,3)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1))))) [ LEAFIS=LEAFIS+1; TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1)); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7)*(Z(NP)-ZFOCUS_$SYNCHDMLC(1)); @@ -3618,7 +3741,6 @@ IF(LEAFIS~=0) [ ]; ] ]; - ]; ] ELSE [ "we are on a full leaf or isocenter leaf" IF((NY=6 & NZ<=4 & LEAFIS~=TOT_LEAF_$SYNCHDMLC & @@ -3677,7 +3799,33 @@ IF(LEAFIS~=0) [ ]; ] ]; - ]; + ] + ELSEIF(LEAFIS ~=1 & NY<=2 & + ((LEAFTYPE_$SYNCHDMLC(LEAFIS) = 3 & NZ<=3) | + (LEAFTYPE_$SYNCHDMLC(LEAFIS) = 5 & NZ<=4)))[ + "here we are in an isocenter leaf + "check if particle is in region of previous leaf" + IF(XYL1ZREG_$SYNCHDMLC(LEAFIS,10))[ + NZ=9; + ] ELSE[ + DO I=1,9 ["recheck Z region" + IF((Z(NP)>=ZREG_$SYNCHDMLC(LEAFIS,I)) & + (ZREG_$SYNCHDMLC(LEAFIS,I+1)>=Z(NP))) [NZ=I; EXIT]; + ]; + ] + ] + ] ]; "Determine which X region we are in" @@ -3721,21 +3869,77 @@ IF(LEAFIS~=0) [ "Set minimum and maximum Z boundaries" IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ "Quarter or Half Target leaf" - - IF((NY=1|NY=2) & NZ<=3) [I1=1; I2=4;] - ELSEIF(NY=1 & NZ=5) [I1=5; I2=6;] - ELSEIF(NY=1 & NZ>=6) [I1=6; I2=10;] - ELSEIF(NZ=4) [I1=4; I2=5;] - ELSEIF((NY=2|NY=3) & NZ>=8) [I1=8; I2=10;] - ELSEIF((NY=3|NY=4|NY=5) & NZ=1) [I1=1; I2=2;] - ELSEIF((NY=3|NY=4|NY=5) & NZ=2) [I1=2; I2=3;] - ELSEIF(NY>=3 & NZ=3) [I1=3; I2=4;] - ELSEIF((NY=2|NY=3) & (NZ=5|NZ=6|NZ=7)) [I1=5; I2=8;] - ELSEIF(NY=4 & (NZ=5|NZ=6|NZ=7|NZ=8)) [I1=5; I2=9;] - ELSEIF(NY=4 & NZ=9) [I1=9; I2=10;] - ELSEIF((NY=5|NY=6) & (NZ=5|NZ=6)) [I1=5; I2=7;] - ELSEIF((NY=5|NY=6) & NZ>=7) [I1=7; I2=10;] - ELSEIF(NY=6 & NZ<=2) [I1=1; I2=3;] + "take care of distance to corners possibly being min. distance" + "here." + + IF(NY=1) [ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSE [I1=6; I2=10;] + ] + ELSEIF(NY=2) [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2) [I1=1; I2=4;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ<=7) [I1=5; I2=8;] + ELSE [I1=8; I2=10;] + ] + ELSEIF(NY=3) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,4)=1) [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2) [I1=2; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ<=6) [I1=5; I2=7;] + ELSEIF(NZ=7) [I1=5; I2=8;] + ELSE [I1=8; I2=10;] + ] + ELSE [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2) [I1=1; I2=4;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=5; I2=7;] + ELSEIF(NZ=7) [I1=5; I2=8;] + ELSEIF(NZ=8) [I1=5; I2=9;] + ELSE [I1=9; I2=10;] + ] + ] + ELSEIF(NY=4) [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2) [I1=2; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ<=6) [I1=5; I2=7;] + ELSEIF(NZ=7) [I1=5; I2=8;] + ELSEIF(NZ=8) [I1=5; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=5) [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2) [I1=2; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ<=6) [I1=5; I2=7;] + ELSE [I1=7; I2=10;] + ] + ELSEIF(NY=6) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + IF(NZ=1) [I1=1; I2=2;] + ELSE[ I1=2; I2=10;] + ] + ELSE [ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=4;] + ELSEIF(NZ=4) [I1=4; I2=5;] + ELSEIF(NZ<=6) [I1=5; I2=7;] + ELSE [ I1=7; I2=10;] + ] + ] ] ELSEIF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=1) [ "Full leaf" @@ -3758,44 +3962,158 @@ IF(LEAFIS~=0) [ ] ELSEIF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=3) [ "Half Isocenter leaf" - - IF((NY=1|NY=2) & NZ<=3) [I1=1; I2=4;] - ELSEIF((NY=1|NY=2) & (NZ=4|NZ=5)) [I1=4; I2=6;] - ELSEIF(NZ=6) [I1=6; I2=7;] - ELSEIF(NY<=4 & NZ=7) [I1=7; I2=8;] - ELSEIF(NY=1 & NZ>=8) [I1=8; I2=10;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=8) [I1=8; I2=9;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=9) [I1=9; I2=10;] - ELSEIF(NY=3 & NZ=1) [I1=1; I2=2;] - ELSEIF(NY=3 & (NZ=2|NZ=3|NZ=4|NZ=5)) [I1=2; I2=6;] - ELSEIF((NY=4|NY=5) & NZ<=2) [I1=1; I2=3;] - ELSEIF((NY=4|NY=5) & (NZ=3|NZ=4|NZ=5)) [I1=3; I2=6;] - ELSEIF((NY=5|NY=6) & NZ>=7) [I1=7; I2=10;] - ELSEIF(NY=6 & NZ<=4) [I1=1; I2=5;] - ELSEIF(NY=6 & NZ=5) [I1=5; I2=6;] - + IF(NY=1) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1)=1) [ + IF(NZ<=8) [I1=1; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSE [ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSE [I1=8; I2=10;] + ] + ] + ELSEIF(NY=2) [ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=3) [ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2)[I1=2; I2=6;] + ELSEIF(NZ=3) [I1=3; I2=6;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=4) [ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=6;] + ELSEIF(NZ=4) [I1=4; I2=6;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=5) [ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ<=4) [I1=3; I2=6;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=6) [ + IF(NZ<=4) [I1=1; I2=5;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] ] ELSE [ "Quarter Isocenter leaf" - - "!= from Half Isocenter" - IF((NY=1|NY=2) & NZ<=4) [I1=1; I2=5;] - "!= from Half Isocenter" - ELSEIF((NY=1|NY=2) & (NZ=5)) [I1=5; I2=6;] - ELSEIF(NZ=6) [I1=6; I2=7;] - ELSEIF(NY<=4 & NZ=7) [I1=7; I2=8;] - ELSEIF(NY=1 & NZ>=8) [I1=8; I2=10;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=8) [I1=8; I2=9;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=9) [I1=9; I2=10;] - ELSEIF(NY=3 & NZ=1) [I1=1; I2=2;] - ELSEIF(NY=3 & (NZ=2|NZ=3|NZ=4|NZ=5)) [I1=2; I2=6;] - ELSEIF((NY=4|NY=5) & NZ<=2) [I1=1; I2=3;] - ELSEIF((NY=4|NY=5) & (NZ=3|NZ=4|NZ=5)) [I1=3; I2=6;] - ELSEIF((NY=5|NY=6) & NZ>=7) [I1=7; I2=10;] - "!= from Half Isocenter" - ELSEIF(NY=6 & NZ<=3) [I1=1; I2=4;] - "!= from Half Isocenter" - ELSEIF(NY=6 & (NZ=4|NZ=5)) [I1=4; I2=6;] - + IF(NY=1) [ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSE [I1=8; I2=10;] + ] + ELSEIF(NY=2) [ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSE[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1)[ + I1=8; I2=10; + ] + ELSE[ + IF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ] + ] + ELSEIF(NY=3) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2)[I1=2; I2=6;] + ELSEIF(NZ=3) [I1=3; I2=6;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSE[ "Zg > Zt" + IF(NZ=1) [I1=1; I2=2;] + ELSEIF(NZ=2)[I1=2; I2=6;] + ELSEIF(NZ<=4) [I1=3; I2=6;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ] + ELSEIF(NY=4) [ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=6;] + ELSEIF(NZ=4) [I1=4; I2=6;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=8; I2=9;] + ELSE [I1=9; I2=10;] + ] + ELSEIF(NY=5) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ<=4) [I1=3; I2=6;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] + ELSE[ + IF(NZ<=2) [I1=1; I2=3;] + ELSEIF(NZ=3) [I1=3; I2=6;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] + ] + ELSEIF(NY=6) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ<=4) [I1=1; I2=5;] + ELSEIF(NZ=5) [I1=5; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] + ELSE[ + IF(NZ<=3) [I1=1; I2=4;] + ELSEIF(NZ<=5) [I1=4; I2=6;] + ELSEIF(NZ=6) [I1=6; I2=7;] + ELSEIF(NZ=7) [I1=7; I2=8;] + ELSEIF(NZ=8) [I1=7; I2=10;] + ELSE [I1=9; I2=10;] + ] + ] ]; DIST=MIN(ABS(ZREG_$SYNCHDMLC(LEAFIS,I1)-Z(NP)), @@ -3807,36 +4125,62 @@ IF(LEAFIS~=0) [ IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ "Target leaf" - IF(NZ=1 & NY<=5) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); - - ] ELSEIF(NZ=1 & NY=6) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,6); - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + IF(NZ=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - ] ELSE [ - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,3); ] + ELSE[ + IF(NY<=5) [ - ] ELSEIF(NZ=2 & NY<=2) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); - ] ELSEIF(NZ=2 & NY>=3) [ + ] ELSEIF(NY=6) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] - ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,3);] + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,6); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] ELSE [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,3); + ] + ] + ] + ] ELSEIF(NZ=2) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,4)=1) [ + IF(NY<=2) [ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,3);] + ] + ] + ELSE[ + IF(NY<=3)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,3);] + ] + ] ] ELSEIF(NZ=3|NZ=4|NZ=5) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] ] ELSEIF(NY=1 & (NZ=6|NZ=7)) [ @@ -3845,33 +4189,62 @@ IF(LEAFIS~=0) [ TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,2); ] ELSEIF(NY>=2 & NZ=6) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] ] ELSEIF(NZ=7 & (NY=2|NY=3|NY=4)) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); - ] ELSEIF((NZ=7|NZ=8) & NY>=5) [ + ] ELSEIF(NZ=7 & NY>=5) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,5); IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] - ] ELSEIF(NZ=8 & NY<=3) [IF(LEAFIS=1) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] - ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); - - ] - ELSEIF(NZ=8 & NY=4) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); - ] + ] ELSEIF(NZ=8)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,4)=1) [ + IF(NY<=3)[ + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); ] + ELSE[ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); + ] + ELSEIF(NY=4)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,5); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE[TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ] + ELSE[ + IF(NY<=2)[ + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); ] + ELSE[ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + ELSEIF(NY<=4)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,5); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [ + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE[TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ] + ] ELSEIF(NZ=9) [IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] @@ -3936,83 +4309,317 @@ IF(LEAFIS~=0) [ TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); ] ] - ELSE ["Isocenter leaf" - "EH - because the quarter and half leaves are slightly different" - " you will need a modification for NZ=4 and NY=6" - + ELSEIF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=3) [ + "half isocenter leaf IF(NZ=1) [ - IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] - ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);]; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] - ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);]; - ] - ELSEIF(((NZ=2|NZ=3) & (NY=1|NY=2)) | - ((NY<3) & (NZ=4) & LEAFTYPE_$SYNCHDMLC(LEAFIS)=5)) [ - IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] - ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);]; - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); - ] - ELSEIF(NZ=2 & NY=3) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); - ] - ELSEIF(NZ=2 & NY>=4) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + "possibly use LHS=6?" IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] - ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);]; - ] - ELSEIF(NZ=3 & (NY=3|NY=4|NY=5)) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); - ] - ELSEIF((NZ=3 & NY=6) - | (NZ=4 & NY=6 & (LEAFTYPE_$SYNCHDMLC(LEAFIS)=3))) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,6); + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ELSEIF(NZ=2)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + IF(NY=3)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ] + ELSEIF(NZ=3)[ + IF(NY<=2)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [ + IF(Z(NP)>ZREG_$SYNCHDMLC(LEAFIS-1,7))[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7); + ] + ] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + IF(NY<=5)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,6); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [ "ignores that LEAFIS+1 might be FULL" + IF(Z(NP)Ztip(LEAFIS-1) but should be okay" + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,2); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] + ] + ] + ] + ELSE ["Quarter Isocenter leaf" + IF(NZ=1) [ + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + "possibly use LHS=6?" IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] - ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);]; - ] - ELSEIF (NZ=4 & NY>=3 - & (LEAFTYPE_$SYNCHDMLC(LEAFIS)=5)) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - ] - " ELSEIF (NZ=4 & NY<3" - " & (LEAFTYPE_$SYNCHDMLC(LEAFIS)=5)) [" - - " IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);]" - " ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);];" - " TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3);" - " ]" - ELSEIF(NZ=4 & NY<=5 & (LEAFTYPE_$SYNCHDMLC(LEAFIS)=3)) [ - - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); - ] - ELSEIF(NZ=5|NZ=6|NZ=7) [ + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ELSEIF(NZ=2)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + IF(NY=3)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,4); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,4); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS+1,1);] + ] + ] + ELSEIF(NZ=3)[ + IF(NY<=2)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [ + IF(Z(NP)>ZREG_$SYNCHDMLC(LEAFIS-1,7))[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7); + ] + ] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + IF(NY<=5)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,6); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,6); + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7);] + ELSE [ "ignores that LEAFIS+1 might be FULL" + IF(Z(NP) Zg" + IF(NY<=2)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [ + IF(Z(NP)>ZREG_$SYNCHDMLC(LEAFIS-1,7))[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,7); + ] + ] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] + ] + ] + ELSEIF(NZ=5)[ TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - ] - ELSEIF(NZ=8 & NY<=4) [ - IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] - ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);]; - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); - ] - ELSEIF(NZ=8 & NY>=5) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,5); + ] + ELSEIF(NZ=6)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - ] - ELSEIF(NZ=9 & NY=1) [ - IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] - ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);] - TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,2); - ] - ELSEIF(NZ=9 & NY>=2) [ - TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); + ] + ELSEIF(NZ=7)[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1); TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); - ] - ]; + ] + ELSEIF(NZ=8)[ + IF(NY<=4)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,5); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,5); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] + ] + ELSEIF(NZ=9)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1) [ + IF(NY<=2)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);] + "here we are ignoring the possibility that Z could be" + ">Ztip(LEAFIS-1) but should be okay" + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,3); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,3); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] + ] + ELSE[ + IF(NY=1)[ + IF(LEAFIS=1) [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,1);] + ELSE [TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS-1,5);] + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,2); + ] + ELSE[ + TEMP1=SURPARA1_$SYNCHDMLC(LEAFIS,2); + TEMP2=SURPARA1_$SYNCHDMLC(LEAFIS,7); + ] + ] + ] + ]; TEMP1=ABS((TEMP1*(Z(NP)-ZFOCUS_$SYNCHDMLC(1))-XYL1)/ SQRT(1+TEMP1**2)); TEMP2=ABS((TEMP2*(Z(NP)-ZFOCUS_$SYNCHDMLC(1))-XYL1)/ diff --git a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_macros.mortran b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_macros.mortran index fadb53e88..c9452d9b8 100644 --- a/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_macros.mortran +++ b/HEN_HOUSE/omega/beamnrc/CMs/SYNCHDMLC_macros.mortran @@ -182,6 +182,11 @@ REPLACE {$MAXFIELDLEAF} WITH {{COMPUTE $MAXLEAF*$MAXFIELD_$SYNCHDMLC}} "I> when doing range rejection "V> for particles in the leaves and beyond the most open "V> leaf. 0 (default) otherwise. +"V>I_LEAF_ALT_DEF_$SYNCHDMLC An array of flags indicating whether a sector +"V> of a given leaf cross-section has an alternative +"V> definition to that specified in the BEAMnrc Manual" +"V> indexing: LEAFTYPE, 1 (Y bound) or 2 (Z bound), +"V> boundary no. ; REPLACE{;COMIN/CM_$SYNCHDMLC/;} WITH { ;COMMON/CM_$SYNCHDMLC/ @@ -206,6 +211,7 @@ REPLACE{;COMIN/CM_$SYNCHDMLC/;} WITH { IR_$SYNCHDMLC,NUM_LEAF_$SYNCHDMLC, ORIENT_$SYNCHDMLC, SUBINDEX_$SYNCHDMLC,NGROUP_$SYNCHDMLC, LEAFTYPE_$SYNCHDMLC, + I_LEAF_ALT_DEF_$SYNCHDMLC, TITLE_$SYNCHDMLC; DOUBLE PRECISION ZMAX_$SYNCHDMLC, @@ -230,7 +236,8 @@ REPLACE{;COMIN/CM_$SYNCHDMLC/;} WITH { N_GAP_$SYNCHDMLC,IR_$SYNCHDMLC,NUM_LEAF_$SYNCHDMLC($MAXLEAF), ORIENT_$SYNCHDMLC,SUBINDEX_$SYNCHDMLC($MAXLEAF,5,6,9), NGROUP_$SYNCHDMLC, - LEAFTYPE_$SYNCHDMLC($MAXLEAF); + LEAFTYPE_$SYNCHDMLC($MAXLEAF), + I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,10); CHARACTER*1 TITLE_$SYNCHDMLC(60); } @@ -514,7 +521,9 @@ ELSE ["inside leaf bank" IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ "Originally on Target (Quarter or Half) Leaf" - IF((NY=5|NY=6) & (NZ=7|NZ=8|NZ=9) & (LEAFIS~=TOT_LEAF_$SYNCHDMLC)) [ + IF(LEAFIS~=TOT_LEAF_$SYNCHDMLC & (((NY=5|NY=6) & (NZ=7|NZ=8|NZ=9)) | + (I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1 & + NY=6 & NZ>1))) [ "In groove check if on next leaf" IF(XYFL(1)>SURPARA1_$SYNCHDMLC(LEAFIS+1,1)* @@ -621,7 +630,32 @@ ELSE ["inside leaf bank" ]; ] ]; - ]; + ] + ELSEIF(LEAFIS ~=1 & + I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,1)=1 & + NY=1 & NZ<9)[ + "check if particle is in region of previous leaf" + IF(XYFL(1)ZREG_$SYNCHDMLC(LEAFIS,10))[ + NZ=9; + ] ELSE[ + DO I=1,9 ["recheck Z region" + IF((ZFL>=ZREG_$SYNCHDMLC(LEAFIS,I)) & + (ZREG_$SYNCHDMLC(LEAFIS,I+1)>=ZFL)) [NZ=I; EXIT]; + ]; + ] + ] + ] ]; "Now determine X region index" IF(ENDTYPE_$SYNCHDMLC=1)[ @@ -674,16 +708,15 @@ ELSE ["inside leaf bank" ;} ; -" $SYNCHDMLC_MINDISTANCE; " -"=============================== " -" The following macro will give the nearest distance the particle" -" can travel along its given direction before it strikes the boundary" -" in the x, y or z direction." -"{P1}: The change value for ir region #" - -REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; "boundaries in Z direction" - IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ - "Target leaf" +"Macro to find ZLHS and ZRHS, upper and lower indices of boundaries in" +"Z-direction" +"Put in a separate macro to prevent the parent macro from getting too long" +REPLACE {$SYNCHDMLC_FIND_Z_BOUNDS;} WITH{; +"Note: some of these will underestimate dZ when input dimension" +"restrictions are overridden--this should not result in transport" +"errors, but will potentially slow transport" +IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ + "Target leaf" IF((NY=1|NY=2) & NZ<=3) [ZLHS=1; ZRHS=4;] ELSEIF(NY=1 & NZ=5) [ZLHS=5; ZRHS=6;] @@ -698,7 +731,14 @@ REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; "boundaries in Z direction" ELSEIF(NY=4 & NZ=9) [ZLHS=9; ZRHS=10;] ELSEIF((NY=5|NY=6) & (NZ=5|NZ=6)) [ZLHS=5; ZRHS=7;] ELSEIF((NY=5|NY=6) & NZ>=7) [ZLHS=7; ZRHS=10;] - ELSEIF(NY=6 & NZ<=2) [ZLHS=1; ZRHS=3;] + ELSEIF(NY=6 & NZ<=2) [ + "dZ potentially overestimated--deal with it!" + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1)[ + IF(NZ=1)[ZLHS=1; ZRHS=2;] + ELSE[ZLHS=2; ZRHS=10;] + ] + ELSE[ZLHS=1; ZRHS=3;] + ] ] ELSEIF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=1) ["Full leaf" @@ -725,7 +765,14 @@ REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; "boundaries in Z direction" ELSEIF((NY=1|NY=2) & (NZ=4|NZ=5)) [ZLHS=4; ZRHS=6;] ELSEIF(NZ=6) [ZLHS=6; ZRHS=7;] ELSEIF(NY<=4 & NZ=7) [ZLHS=7; ZRHS=8;] - ELSEIF(NY=1 & NZ>=8) [ZLHS=8; ZRHS=10;] + "potential overestimate of dZ below--correct it" + ELSEIF(NY=1 & NZ>=8) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(3,1,1)=1)[ + IF(NZ=9)[ZLHS=9; ZRHS=10;] + ELSE[ZLHS=1; ZRHS=9;] + ] + ELSE[ZLHS=8; ZRHS=10;] + ] ELSEIF((NY=2|NY=3|NY=4) & NZ=8) [ZLHS=8; ZRHS=9;] ELSEIF((NY=2|NY=3|NY=4) & NZ=9) [ZLHS=9; ZRHS=10;] ELSEIF(NY=3 & NZ=1) [ZLHS=1; ZRHS=2;] @@ -738,81 +785,231 @@ REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; "boundaries in Z direction" ] ELSE [ "Quarter Isocenter leaf" + IF(NY=1)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ<=3)[ZLHS=1; ZRHS=4;] + ELSEIF(NZ<=5)[ZLHS=4; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSE[ZLHS=8; ZRHS=10;] + ] + ELSE[ + IF(NZ<=4)[ZLHS=1; ZRHS=5;] + ELSEIF(NZ=5)[ZLHS=5; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSE[ZLHS=8; ZRHS=10;] + ] + ] + ELSEIF(NY=2)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ<=3)[ZLHS=1; ZRHS=4;] + ELSEIF(NZ<=5)[ZLHS=4; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSEIF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1)[ZLHS=8; ZRHS=10;] + ELSEIF(NZ=8)[ZLHS=8; ZRHS=9;] + ELSE[ZLHS=9; ZRHS=10;] + ] + ELSE[ + IF(NZ<=4)[ZLHS=1; ZRHS=5;] + ELSEIF(NZ=5)[ZLHS=5; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSEIF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1)[ZLHS=8; ZRHS=10;] + ELSEIF(NZ=8)[ZLHS=8; ZRHS=9;] + ELSE[ZLHS=9; ZRHS=10;] + ] + ] + ELSEIF(NY=3)[ + IF(NZ=1)[ZLHS=1; ZRHS=2;] + ELSEIF(NZ<=5)[ZLHS=2; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSEIF(NZ=8)[ZLHS=8; ZRHS=9;] + ELSE[ZLHS=9; ZRHS=10;] + ] + ELSEIF(NY=4)[ + IF(NZ<=2)[ZLHS=1; ZRHS=3;] + ELSEIF(NZ<=5)[ZLHS=3; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSEIF(NZ=7)[ZLHS=7; ZRHS=8;] + ELSEIF(NZ=8)[ZLHS=8; ZRHS=9;] + ELSE[ZLHS=9; ZRHS=10;] + ] + ELSEIF(NY=5)[ + IF(NZ<=2)[ZLHS=1; ZRHS=3;] + ELSEIF(NZ<=5)[ZLHS=3; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSE[ZLHS=7; ZRHS=10;] + ] + ELSEIF(NY=6)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,2,4)=1)[ + IF(NZ<=4)[ZLHS=1; ZRHS=5;] + ELSEIF(NZ=5)[ZLHS=5; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSE[ZLHS=7; ZRHS=10;] + ] + ELSE[ + IF(NZ<=3)[ZLHS=1; ZRHS=4;] + ELSEIF(NZ<=5)[ZLHS=4; ZRHS=6;] + ELSEIF(NZ=6)[ZLHS=6; ZRHS=7;] + ELSE[ZLHS=7; ZRHS=10;] + ] + ] +] +}; - "!= from Half Isocenter" - IF((NY=1|NY=2) & NZ<=4) [ZLHS=1; ZRHS=5;] - "!= from Half Isocenter" - ELSEIF((NY=1|NY=2) & (NZ=5)) [ZLHS=5; ZRHS=6;] - ELSEIF(NZ=6) [ZLHS=6; ZRHS=7;] - ELSEIF(NY<=4 & NZ=7) [ZLHS=7; ZRHS=8;] - ELSEIF(NY=1 & NZ>=8) [ZLHS=8; ZRHS=10;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=8) [ZLHS=8; ZRHS=9;] - ELSEIF((NY=2|NY=3|NY=4) & NZ=9) [ZLHS=9; ZRHS=10;] - ELSEIF(NY=3 & NZ=1) [ZLHS=1; ZRHS=2;] - ELSEIF(NY=3 & (NZ=2|NZ=3|NZ=4|NZ=5)) [ZLHS=2; ZRHS=6;] - ELSEIF((NY=4|NY=5) & NZ<=2) [ZLHS=1; ZRHS=3;] - ELSEIF((NY=4|NY=5) & (NZ=3|NZ=4|NZ=5)) [ZLHS=3; ZRHS=6;] - ELSEIF((NY=5|NY=6) & NZ>=7) [ZLHS=7; ZRHS=10;] - "!= from Half Isocenter" - ELSEIF(NY=6 & NZ<=3) [ZLHS=1; ZRHS=4;] - "!= from Half Isocenter" - ELSEIF(NY=6 & (NZ=4|NZ=5)) [ZLHS=4; ZRHS=6;] - ] - - IF(W(NP)~=0) [ - ZP = (ZREG_$SYNCHDMLC(LEAFIS,ZRHS)-ZFL)/W(NP); - ZN = (ZREG_$SYNCHDMLC(LEAFIS,ZLHS)-ZFL)/W(NP); - IF( (ZP>=0.0) & (ZN>=0.0) ) [ ZDIST =MIN(ZP, ZN); ] - ELSE [ ZDIST = MAX(ZP, ZN); ] - ] - ELSE [ ZDIST = 1.0E20; ]; - IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ +"Macro to find I, LHS, J, RHS, indices of boundaries in Y-direction" +"Put in a separate macro to prevent the parent macro from getting too long" +REPLACE {$SYNCHDMLC_FIND_Y_BOUNDS;} WITH{; +IF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=2 | LEAFTYPE_$SYNCHDMLC(LEAFIS)=4) [ "Target leaf" - IF(NZ=1 & NY<=5) [ - LHS=1; J=LEAFIS; - RHS=6; I=LEAFIS; - ] ELSEIF(NZ=1 & NY=6) [ - LHS=6; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=3; I=LEAFIS+1;] - ] ELSEIF(NZ=2 & NY<=2) [ - LHS=1; J=LEAFIS; - RHS=3; I=LEAFIS; - ] ELSEIF(NZ=2 & NY>=3) [ - LHS=3; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=3; I=LEAFIS+1;] - ] ELSEIF(NZ=3|NZ=4|NZ=5) [ - LHS=1; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NY=1 & (NZ=6|NZ=7)) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=7; J=LEAFIS-1;] - RHS=2; I=LEAFIS; - ] ELSEIF(NY>=2 & NZ=6) [ - LHS=2; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NZ=7 & (NY=2|NY=3|NY=4)) [ - LHS=2; J=LEAFIS; - RHS=5; I=LEAFIS; - ] ELSEIF((NZ=7|NZ=8) & NY>=5) [ - LHS=5; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF(NZ=8 & NY<=3) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=7; J=LEAFIS-1;] - RHS=4; I=LEAFIS; - ] ELSEIF(NZ=8 & NY=4) [ - LHS=4; J=LEAFIS; - RHS=5; I=LEAFIS; - ] ELSEIF(NZ=9) [ + IF(NZ=1) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + LHS=1; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ELSE [ + IF(NY<=5) [ + LHS=1; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE [ + LHS=6; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=3; I=LEAFIS+1;] + ] + ] + ] + ELSEIF(NZ=2) [ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,4)=1) [ + IF(NY<=2) [ + LHS=1; J=LEAFIS; + RHS=3; I=LEAFIS; + ] + ELSE[ + LHS=3; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=3; I=LEAFIS+1;] + ] + ] + ELSE[ + IF(NY<=3) [ + LHS=1; J=LEAFIS; + RHS=4; I=LEAFIS; + ] + ELSE[ + LHS=4; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=3; I=LEAFIS+1;] + ] + ] + ] + ELSEIF(NZ=3)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + LHS=1; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=1; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ELSEIF(NZ=4)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + LHS=1; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=1; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ELSEIF(NZ=5)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + LHS=1; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=1; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ELSEIF(NZ=6)[ + IF(NY=1)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=2; I=LEAFIS; + ] + ELSE[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,6)=1) [ + LHS=2; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=2; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ] + ELSEIF(NZ=7)[ + IF(NY=1)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=2; I=LEAFIS; + ] + ELSEIF(NY<=4)[ + LHS=2; J=LEAFIS; + RHS=5; I=LEAFIS; + ] + ELSE[ + LHS=5; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=1; I=LEAFIS+1;] + ] + ] + ELSEIF(NZ=8)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(LEAFTYPE_$SYNCHDMLC(LEAFIS),1,4)=1) [ + IF(NY<=3)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=4; I=LEAFIS; + ] + ELSEIF(NY=4)[ + LHS=4; J=LEAFIS; + RHS=5; I=LEAFIS; + ] + ELSE[ + LHS=5; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=1; I=LEAFIS+1;] + ] + ] + ELSE[ + IF(NY<=2)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=3; I=LEAFIS; + ] + ELSEIF(NY<=4)[ + LHS=3; J=LEAFIS; + RHS=5; I=LEAFIS; + ] + ELSE[ + LHS=5; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=1; I=LEAFIS+1;] + ] + ] + ] + ELSEIF(NZ=9)[ IF(LEAFIS=1) [LHS=1; J=LEAFIS;] ELSE [LHS=7; J=LEAFIS-1;] IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] ELSE [RHS=1; I=LEAFIS+1;] - ] - ] + ] + ] ELSEIF(LEAFTYPE_$SYNCHDMLC(LEAFIS)=1) ["full leaf" IF(NZ=1) [IF(LEAFIS=1) [LHS=1; J=LEAFIS;] ELSE [LHS=6; J=LEAFIS-1;] @@ -864,97 +1061,329 @@ REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; "boundaries in Z direction" IF(NZ=1) [ IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] ELSE [LHS=7; J=LEAFIS-1;] + "possibly use LHS=6?" IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF((NZ=2|NZ=3) & (NY=1|NY=2)) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=7; J=LEAFIS-1;] - RHS=3; I=LEAFIS; - ] ELSEIF(NZ=2 & NY=3) [ - LHS=3; J=LEAFIS; - RHS=4; I=LEAFIS; - ] ELSEIF(NZ=2 & NY>=4) [ - LHS=4; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF(NZ=3 & (NY=3|NY=4|NY=5)) [ - LHS=3; J=LEAFIS; - RHS=6; I=LEAFIS; - ] ELSEIF((NZ=3|NZ=4) & NY=6) [ - LHS=6; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF(NZ=4 & NY<=5) [ - LHS=1; J=LEAFIS; - RHS=6; I=LEAFIS; - ] ELSEIF(NZ=5|NZ=6|NZ=7) [ - LHS=1; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NZ=8 & NY<=4) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=5; J=LEAFIS-1;] - RHS=5; I=LEAFIS; - ] ELSEIF(NZ=8 & NY>=5) [ - LHS=5; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NZ=9 & NY=1) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=5; J=LEAFIS-1;] - RHS=2; I=LEAFIS; - ] ELSEIF(NZ=9 & NY>=2) [ - LHS=2; J=LEAFIS; - RHS=7; I=LEAFIS; ] - ] ELSE [ + ELSEIF(NZ=2)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=3; I=LEAFIS; + ] + IF(NY=3)[ + LHS=3; J=LEAFIS; + RHS=4; I=LEAFIS; + ] + ELSE[ + LHS=4; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=1; I=LEAFIS+1;] + ] + ] + ELSEIF(NZ=3)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] + ELSE [ + J=LEAFIS-1; + IF(ZFL>ZREG_$SYNCHDMLC(J,7))[ + LHS = 5; + ] + ELSE[ + LHS = 7; + ] + ] + RHS=3; I=LEAFIS; + ] + IF(NY<=5)[ + LHS=3; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=6; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [ + I=LEAFIS+1; + IF(ZFLZtip(LEAFIS-1) but should be okay" + RHS=2; I=LEAFIS; + ] + ELSE[ + LHS=2; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ] + ] + ELSE[ "Isocenter Quarter" IF(NZ=1) [ IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] ELSE [LHS=7; J=LEAFIS-1;] + "possibly use LHS=6?" IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF((NZ=2|NZ=3|NZ=4) & (NY=1|NY=2)) [ - "!= from Half Isocenter - Block 2" - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=7; J=LEAFIS-1;] - RHS=3; I=LEAFIS; - ] ELSEIF(NZ=2 & NY=3) [ - LHS=3; J=LEAFIS; - RHS=4; I=LEAFIS; - ] ELSEIF(NZ=2 & NY>=4) [ - LHS=4; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF(NZ=3 & (NY=3|NY=4|NY=5)) [ - LHS=3; J=LEAFIS; - RHS=6; I=LEAFIS; - ] ELSEIF(NZ=3 & NY=6) [ - "!= from Half Isocenter - Block 5" - LHS=6; J=LEAFIS; - IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] - ELSE [RHS=1; I=LEAFIS+1;] - ] ELSEIF(NZ=4 & (NY>=3)) [ - "!= from Half Isocenter - Block 7" - LHS=3; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NZ=5|NZ=6|NZ=7) [ + ] + ELSEIF(NZ=2)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] + ELSE [LHS=7; J=LEAFIS-1;] + RHS=3; I=LEAFIS; + ] + IF(NY=3)[ + LHS=3; J=LEAFIS; + RHS=4; I=LEAFIS; + ] + ELSE[ + LHS=4; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [RHS=1; I=LEAFIS+1;] + ] + ] + ELSEIF(NZ=3)[ + IF(NY<=2)[ + IF(LEAFIS=1) [ LHS=1; J=LEAFIS;] + ELSE [ + J=LEAFIS-1; + IF(ZFL>ZREG_$SYNCHDMLC(J,7))[ + LHS = 5; + ] + ELSE[ + LHS = 7; + ] + ] + RHS=3; I=LEAFIS; + ] + IF(NY<=5)[ + LHS=3; J=LEAFIS; + RHS=6; I=LEAFIS; + ] + ELSE[ + LHS=6; J=LEAFIS; + IF(LEAFIS=TOT_LEAF_$SYNCHDMLC) [RHS=7; I=LEAFIS;] + ELSE [ + I=LEAFIS+1; + IF(ZFLZREG_$SYNCHDMLC(J,7))[ + LHS = 5; + ] + ELSE[ + LHS = 7; + ] + ] + RHS=3; I=LEAFIS; + ] + ELSE[ + LHS=3; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ] + ELSEIF(NZ<=7)[ LHS=1; J=LEAFIS; RHS=7; I=LEAFIS; - ] ELSEIF(NZ=8 & NY<=4) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=5; J=LEAFIS-1;] - RHS=5; I=LEAFIS; - ] ELSEIF(NZ=8 & NY>=5) [ - LHS=5; J=LEAFIS; - RHS=7; I=LEAFIS; - ] ELSEIF(NZ=9 & NY=1) [ - IF(LEAFIS=1) [LHS=1; J=LEAFIS;] - ELSE [LHS=5; J=LEAFIS-1;] - RHS=2; I=LEAFIS; - ] ELSEIF(NZ=9 & NY>=2) [ - LHS=2; J=LEAFIS; - RHS=7; I=LEAFIS; ] - ]; + ELSEIF(NZ=8)[ + IF(NY<=4)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=5; J=LEAFIS-1;] + RHS=5; I=LEAFIS; + ] + ELSE[ + LHS=5; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ELSEIF(NZ=9)[ + IF(I_LEAF_ALT_DEF_$SYNCHDMLC(5,1,2)=1) [ + IF(NY<=2)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=5; J=LEAFIS-1;] + RHS=3; I=LEAFIS; + ] + ELSE[ + LHS=3; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ELSE[ + IF(NY=1)[ + IF(LEAFIS=1) [LHS=1; J=LEAFIS;] + ELSE [LHS=5; J=LEAFIS-1;] + RHS=2; I=LEAFIS; + ] + ELSE[ + LHS=2; J=LEAFIS; + RHS=7; I=LEAFIS; + ] + ] + ] +]; +}; + +" $SYNCHDMLC_MINDISTANCE; " +"=============================== " +" The following macro will give the nearest distance the particle" +" can travel along its given direction before it strikes the boundary" +" in the x, y or z direction." +"{P1}: The change value for ir region #" + +REPLACE {$SYNCHDMLC_MINDISTANCE(#);} WITH {; + + $SYNCHDMLC_FIND_Z_BOUNDS; + + IF(W(NP)~=0) [ + ZP = (ZREG_$SYNCHDMLC(LEAFIS,ZRHS)-ZFL)/W(NP); + ZN = (ZREG_$SYNCHDMLC(LEAFIS,ZLHS)-ZFL)/W(NP); + IF( (ZP>=0.0) & (ZN>=0.0) ) [ ZDIST =MIN(ZP, ZN); ] + ELSE [ ZDIST = MAX(ZP, ZN); ] + ] + ELSE [ ZDIST = 1.0E20; ]; + + $SYNCHDMLC_FIND_Y_BOUNDS; + IF((UVL(1)-SURPARA1_$SYNCHDMLC(I,RHS)*W(NP))~ = 0 ) [ YP = (SURPARA1_$SYNCHDMLC(I,RHS)*(ZFL-ZFOCUS_$SYNCHDMLC(1))-XYFL(1)); YP = YP/(UVL(1) - SURPARA1_$SYNCHDMLC(I,RHS)*W(NP)); diff --git a/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl b/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl index 69ea67cae..d0e19c92e 100644 --- a/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl +++ b/HEN_HOUSE/omega/progs/gui/beamnrc/synchdmlc.tcl @@ -296,9 +296,9 @@ proc edit_SYNCHDMLC { id zmax } { set top .synchdmlc$id.top - label $top.mainlabel -text "Multi-leaf collimator $cm_ident($id)" \ - -font $helvfont - pack $top.mainlabel -side top -padx 10 + #label $top.mainlabel -text "Multi-leaf collimator $cm_ident($id)" \ +# -font $helvfont + # pack $top.mainlabel -side top -padx 10 # SYNCHDMLC_macros.mortran:REPLACE {$MAXLEAF} WITH {64} # read the macro file for CM SYNCHDMLC to get defaults and put a label on the @@ -330,9 +330,9 @@ proc edit_SYNCHDMLC { id zmax } { tk_dialog .nope "Too bad" "Couldn't get the defaults" info 0 OK } - label $top.default1 -text "The default maximum number\ - of leaves is $default1." -font $helvfont - pack $top.default1 -side top + # label $top.default1 -text "The default maximum number\ +# of leaves is $default1." -font $helvfont + # pack $top.default1 -side top label $top.zmax -text $zmax -font $helvfont pack $top.zmax -pady 5 @@ -345,14 +345,30 @@ proc edit_SYNCHDMLC { id zmax } { # for range rejection in leaves frame $top.inp2 -bd 2 frame $top.inp2.left - radiobutton $top.inp2.left.r1 -text "Leaves parallel to y"\ + frame $top.inp2.left.ll + checkbutton $top.inp2.left.ll.help -bitmap @$GUI_DIR/help_icon.xbm \ + -command "help_leaf_mfg_specs_synchdmlc [winfo parent $top.inp2.left]" + pack $top.inp2.left.ll.help -padx 5 + frame $top.inp2.left.l + label $top.inp2.left.l.l1 -text {Leaves || to Y} + label $top.inp2.left.l.l2 -text {Leaves || to X} + pack $top.inp2.left.l.l1 $top.inp2.left.l.l2 -side top + frame $top.inp2.left.m + radiobutton $top.inp2.left.m.r1 -text "default orient."\ -variable cmval($id,2,0) -value 0 - radiobutton $top.inp2.left.r2 -text "Leaves parallel to x"\ + radiobutton $top.inp2.left.m.r2 -text "default orient."\ -variable cmval($id,2,0) -value 1 - pack $top.inp2.left.r1 $top.inp2.left.r2 -side top + pack $top.inp2.left.m.r1 $top.inp2.left.m.r2 -side top + frame $top.inp2.left.r + radiobutton $top.inp2.left.r.r1 -text "mfg orient."\ + -variable cmval($id,2,0) -value 2 + radiobutton $top.inp2.left.r.r2 -text "mfg orient."\ + -variable cmval($id,2,0) -value 3 + pack $top.inp2.left.r.r1 $top.inp2.left.r.r2 -side top + pack $top.inp2.left.ll $top.inp2.left.l $top.inp2.left.m $top.inp2.left.r -side left + frame $top.inp2.right - checkbutton $top.inp2.right.c1 -text "Ignore air gaps for range \ - rejection in leaves" -variable cmval($id,17,4) + checkbutton $top.inp2.right.c1 -text "Ignore air gaps for range rejection" -variable cmval($id,17,4) button $top.inp2.right.help -bitmap @$GUI_DIR/help_icon.xbm \ -command "help_ignoregaps_synchdmlc [winfo parent $top.inp2.right]" pack $top.inp2.right.help $top.inp2.right.c1 -side right @@ -481,11 +497,11 @@ proc edit_SYNCHDMLC { id zmax } { pack $top.openings.label $top.openings.inps -side top pack $top.openings -side top -fill x - pack $top -side top -pady 5 + pack $top -side top -pady 0 #now get ecut,pcut,materials,etc - frame .synchdmlc$id.bottom -bd 4 + frame .synchdmlc$id.bottom -bd 0 frame .synchdmlc$id.bottom.ecut button .synchdmlc$id.bottom.ecut.b -text "?" -command \ @@ -597,7 +613,7 @@ proc edit_SYNCHDMLC { id zmax } { pack .synchdmlc$id.bottom -side top -pady 5 - frame .synchdmlc$id.buts -bd 4 + frame .synchdmlc$id.buts -bd 1 button .synchdmlc$id.buts.okb -text "OK" -command "destroy .synchdmlc$id"\ -relief groove -bd 8 button .synchdmlc$id.buts.helpb -text "Help" -command\ @@ -735,7 +751,7 @@ proc define_synchdmlc_leaves { id } { frame $top.f -bd 10 set w $top.f - if $cmval($id,2,0)==1 { + if {$cmval($id,2,0)==1 || $cmval($id,2,0)==3} { set porient X set xorient Y } else { @@ -1938,7 +1954,7 @@ proc define_synchdmlc_openings { id } { frame $top.f -bd 10 set w $top.f - if $cmval($id,2,0)==1 { + if {$cmval($id,2,0)==1 || $cmval($id,2,0)==3} { set orientation X } else { set orientation Y @@ -2315,7 +2331,7 @@ proc draw_SYNCHDMLC { id } { # put the canvas up set ncan 3 - set width 200.0 + set width 180.0 set canwidth [expr $width+150.0] set scrlheight [expr 2*$canwidth] set scrlwidth [expr 2*$canwidth] @@ -2341,7 +2357,7 @@ proc draw_SYNCHDMLC { id } { # Put some text in the upper left corner, just to fill the gap. if {$cmval($id,2,2)==1 | $cmval($id,2,2)==2} { - .synchdmlc$id.show.frm.can create text 225 225 -text "xz\ + .synchdmlc$id.show.frm.can create text 160 160 -text "xz\ cross-section shows only those leaves that\ are intersected by y=0, and yz cross-section shows only those\ leaves intersected by x=0. In the case where only a portion\ @@ -2355,7 +2371,7 @@ NOTE: This is a dynamic or step-and-shoot delivery, with leaf opening\ first field defined in this file."\ -font $helvfont -width 300 } else { - .synchdmlc$id.show.frm.can create text 225 225 -text "xz\ + .synchdmlc$id.show.frm.can create text 160 160 -text "xz\ cross-section shows only those leaves that\ are intersected by y=0, and yz cross-section shows only those\ leaves intersected by x=0. In the case where only a portion\ @@ -2416,7 +2432,7 @@ NOTE: This is a dynamic or step-and-shoot delivery, with leaf opening\ add_air $id .synchdmlc$id.show.frm.can.two $xrange(0) $zrange(0)\ $xscale $zscale $l $m - if $cmval($id,2,0)==0 { + if {$cmval($id,2,0)==0 || $cmval($id,2,0)==2} { add_SYNCHDMLC_sides $id $xscale $zscale $xrange(0) $zrange(0) $zrange(1)\ $l $m .synchdmlc$id.show.frm.can.two } else { @@ -2458,7 +2474,7 @@ NOTE: This is a dynamic or step-and-shoot delivery, with leaf opening\ add_air $id .synchdmlc$id.show.frm.can.three $yrange(0) $zrange(0)\ $yscale $zscale $l $m - if $cmval($id,2,0)==0 { + if {$cmval($id,2,0)==0 || $cmval($id,2,0)==2} { add_SYNCHDMLC_ends $id $yscale $zscale $yrange(0) $zrange(0) $zrange(1)\ $l $m .synchdmlc$id.show.frm.can.three } else { @@ -2577,6 +2593,17 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { } incr i } + #now flip leaf opening sequence if ORIENT=2 or 3 + if {$cmval($id,2,0) == 2 || $cmval($id,2,0) == 3} { + for {set i 1} {$i <= $nleaf($id)/2} {incr i} { + set tmp_coord $neg($i) + set neg($i) $neg([expr $nleaf($id)-$i+1]) + set neg([expr $nleaf($id)-$i+1]) $tmp_coord + set tmp_coord $pos($i) + set pos($i) $pos([expr $nleaf($id)-$i+1]) + set pos([expr $nleaf($id)-$i+1]) $tmp_coord + } + } set color [lindex $colorlist $med(leaves)] @@ -2635,7 +2662,7 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { set wg(5) $cmval($id,31,2) set wtot(5) [expr $cmval($id,31,0)+$cmval($id,31,1)] } - if {$cmval($id,2,0)==1} { + if {$cmval($id,2,0)==1 || $cmval($id,2,0)==3} { # leaves parallel to x set lstart $cmval($id,9) set rmin [expr (-$cmval($id,0)-$xmin)*$xscale+$l] @@ -2645,9 +2672,17 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { set color [lindex $colorlist $med(leaves)] set a [expr ($neg($i)-$xmin)*$xscale+$l] - set b [expr ($lstart-$ymin)*$yscale+$m] + if {$cmval($id,2,0)==3} { + set b [expr (-$lstart-$ymin)*$yscale+$m] + } else { + set b [expr ($lstart-$ymin)*$yscale+$m] + } set c [expr ($pos($i)-$xmin)*$xscale+$l] - set d [expr ($lstart+$wtot($type($i))-$ymin)*$yscale+$m] + if {$cmval($id,2,0)==3} { + set d [expr (-($lstart+$wtot($type($i)))-$ymin)*$yscale+$m] + } else { + set d [expr ($lstart+$wtot($type($i))-$ymin)*$yscale+$m] + } $parent_w create rectangle $rmin $b $a $d -fill $color -outline black $parent_w create rectangle $rmax $b $c $d -fill $color -outline black @@ -2657,10 +2692,19 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { #draw the air space set color [lindex $colorlist $med(in)] set a [expr ($neg($i)-$xmin)*$xscale+$l] - set b [expr ($lstart+$wtot($type($i))-$ymin)*$yscale+$m] + if {$cmval($id,2,0)==3} { + set b [expr (-($lstart+$wtot($type($i)))-$ymin)*$yscale+$m] + } else { + set b [expr ($lstart+$wtot($type($i))-$ymin)*$yscale+$m] + } set c [expr ($pos($i)-$xmin)*$xscale+$l] - set d [expr ($lstart+$wtot($type($i))+$cmval($id,10) \ + if {$cmval($id,2,0)==3} { + set d [expr (-($lstart+$wtot($type($i))+$cmval($id,10) \ + -$wt($type([expr $i+1])))-$ymin)*$yscale+$m] + } else { + set d [expr ($lstart+$wtot($type($i))+$cmval($id,10) \ -$wt($type([expr $i+1]))-$ymin)*$yscale+$m] + } $parent_w create rectangle $rmin $b $a $d -fill $color -outline {} $parent_w create rectangle $rmax $b $c $d -fill $color -outline {} } @@ -2678,9 +2722,17 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { # now make rectangles for the top view of the leaf set a [expr ($neg($i)-$ymin)*$yscale+$m] - set b [expr ($lstart-$xmin)*$xscale+$l] + if {$cmval($id,2,0)==2} { + set b [expr (-$lstart-$xmin)*$xscale+$l] + } else { + set b [expr ($lstart-$xmin)*$xscale+$l] + } set c [expr ($pos($i)-$ymin)*$yscale+$m] - set d [expr ($lstart+$wtot($type($i))-$xmin)*$xscale+$l] + if {$cmval($id,2,0)==2} { + set d [expr (-($lstart+$wtot($type($i)))-$xmin)*$xscale+$l] + } else { + set d [expr ($lstart+$wtot($type($i))-$xmin)*$xscale+$l] + } $parent_w create rectangle $b $rmax $d $c -fill $color -outline black $parent_w create rectangle $b $a $d $rmin -fill $color -outline black if {$i<$nleaf($id)} { @@ -2689,10 +2741,19 @@ proc add_SYNCHDMLC_xy {id xscale yscale xmin ymin l m parent_w} { #draw the air space set color [lindex $colorlist $med(in)] set a [expr ($neg($i)-$ymin)*$yscale+$m] - set b [expr ($lstart-$xmin)*$xscale+$l] + if {$cmval($id,2,0)==2} { + set b [expr (-$lstart-$xmin)*$xscale+$l] + } else { + set b [expr ($lstart-$xmin)*$xscale+$l] + } set c [expr ($pos($i)-$ymin)*$yscale+$m] - set d [expr ($lstart+$wtot($type($i))+$cmval($id,10) \ + if {$cmval($id,2,0)==2} { + set d [expr (-($lstart+$wtot($type($i))+$cmval($id,10) \ + -$wt($type([expr $i+1])))-$xmin)*$xscale+$l] + } else { + set d [expr ($lstart+$wtot($type($i))+$cmval($id,10) \ -$wt($type([expr $i+1]))-$xmin)*$xscale+$l] + } $parent_w create rectangle $b $rmax $d $c -fill $color -outline {} $parent_w create rectangle $b $a $d $rmin -fill $color -outline {} } @@ -2792,6 +2853,17 @@ proc add_SYNCHDMLC_ends {id xscale zscale xmin zmin zmax l m parent_w} { } incr i } + #now flip leaf opening sequence if ORIENT=2 or 3 + if {$cmval($id,2,0) == 2 || $cmval($id,2,0) == 3} { + for {set i 1} {$i <= $nleaf($id)/2} {incr i} { + set tmp_coord $neg($i) + set neg($i) $neg([expr $nleaf($id)-$i+1]) + set neg([expr $nleaf($id)-$i+1]) $tmp_coord + set tmp_coord $pos($i) + set pos($i) $pos([expr $nleaf($id)-$i+1]) + set pos([expr $nleaf($id)-$i+1]) $tmp_coord + } + } #set up an array of widths and Z positions for the leaf types #FULL leaf @@ -3170,6 +3242,17 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { } incr i } + #now flip leaf opening sequence if ORIENT=2 or 3 + if {$cmval($id,2,0) == 2 || $cmval($id,2,0) == 3} { + for {set i 1} {$i <= $nleaf($id)/2} {incr i} { + set tmp_coord $neg($i) + set neg($i) $neg([expr $nleaf($id)-$i+1]) + set neg([expr $nleaf($id)-$i+1]) $tmp_coord + set tmp_coord $pos($i) + set pos($i) $pos([expr $nleaf($id)-$i+1]) + set pos([expr $nleaf($id)-$i+1]) $tmp_coord + } + } # set up an array of leaf types set k 0; #leaf k @@ -3542,6 +3625,11 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { set y($j) [max_nrc $rmin $y($j)] set y($j) [min_nrc $rmax $y($j)] + #flip cross-sections around Z if ORIENT = 2 or 3 (hope this works!) + if {$cmval($id,2,0)==2 || $cmval($id,2,0)==3} { + set y($j) [expr -1*$y($j)] + } + # set y and z scale and relative position set y($j) [expr ($y($j)-$ymin)*$yscale+$l] set z($j) [expr ($z($j)-$zmin)*$zscale+$m] @@ -3563,6 +3651,9 @@ proc add_SYNCHDMLC_sides {id yscale zscale ymin zmin zmax l m parent_w} { set y($j) [expr ($ls+$hy($type($i),$j))*($z($j)-$zf)/($ztop-$zf)] set y($j) [max_nrc $rmin $y($j)] set y($j) [min_nrc $rmax $y($j)] + if {$cmval($id,2,0)==2 || $cmval($id,2,0)==3} { + set y($j) [expr -1*$y($j)] + } # set y and z scale and relative position set y($j) [expr ($y($j)-$ymin)*$yscale+$l] @@ -3638,6 +3729,23 @@ to have exact transport throughout the entire multi-leaf collimator.} help_dialog $w.help "Help" $text info 0 OK } +proc help_leaf_mfg_specs_synchdmlc { w } { + + set text { +Choose "default orientation" for leaf cross-sections and numbering as shown in\ +the BEAMnrc manual for leaves parallel to Y (ORIENT=0) or X (ORIENT=1). Choose\ +"mfg orientation" to reflect leaves parallel to Y about the X-axis (ORIENT=2)\ +or to reflect leaves parallel to X about the Y-axis (ORIENT=3). The\ +"mfg orientation" option effectively reflects leaf banks so that the MLC\ +coordinate system accords with that used in the manufacturer (Varian)\ +specifications for the 120MLC and HD120 multileaf collimators.\ +Note that because the leaf banks have been reflected, leaf opening sequences\ +are automaticaly "flipped," so that opening coordinates for leaf i are instead\ +applied to leaf N-i+1, where N is the total no. of leaves. See the BEAMnrc\ +Manual for more details.} + help_dialog $w.help "Help" $text info 0 OK +} + proc help_screwdist { w } { # help procedure put here because it is only for SYNCHDMLC