Fix calculation of ap_limit in collimator anticollision code.

This commit is contained in:
Ferdi Franceschini
2015-02-26 10:47:56 +11:00
parent 52ba801f28
commit 243dddc9a3

View File

@ -3,16 +3,13 @@
fileeval $cfPath(anticollider)/anticollider_common.tcl fileeval $cfPath(anticollider)/anticollider_common.tcl
namespace eval ::anticollider { namespace eval ::anticollider {
set guide_posit 1
set aperture_posit 2
set apD10_posit 1
set coltol 0.5 set coltol 0.5
set aptol 0.1 set aptol 0.1
for {set n 1} {$n <= 8} {incr n} { for {set n 1} {$n <= 8} {incr n} {
foreach {col ap} "pc$n ap$n" { foreach {col ap} "pc$n ap$n" {
set col_limit [expr [SplitReply [$col posit2unit $aperture_posit]] - $coltol] set col_limit [expr [SplitReply [$col posit2unit apertures]] - $coltol]
set ap_limit [expr [SplitReply [$ap posit2unit $apD10_posit]] - $aptol] set ap_limit [expr [SplitReply [$ap posit2unit out]] + $aptol]
set acrule [subst {forbid {5 inf} for $ap when $col in {-inf $col_limit} }] set acrule [subst {forbid {5 inf} for $ap when $col in {-inf $col_limit} }]
lappend ::anticollider::veto_rules $acrule lappend ::anticollider::veto_rules $acrule
set acrule [subst {forbid {-inf $col_limit} for $col when $ap in {$ap_limit inf} }] set acrule [subst {forbid {-inf $col_limit} for $col when $ap in {$ap_limit inf} }]