1

Calc scalefactor from magnet strength::(see note book p146)

2



3

thet = B*L/(Beta*Roh)

4

thet(defection) = Radians

5

B*L = field flux = TM = Teslar * Meter = Gauss * Meter * 10E4 = GM * 10E4

6

Beta*Roh = 3.3356 * P, P in GeV/C

7


8

For MIh corrector 'G/A' 233.497 (Gauss.foot/amp)

9

convert to 0.007117 Teslar.meter/amp

10

At p = 10 GeV/C

11

Theta/Amp = 0.007117 / (3.3356*p) = 0.00021336 Rad/Amp = 213.36 uRad/Amp

12

Gtable raw setting 1 lsb(G1lsb) 2/3276.8 amp to produce 0.1302 uRad

13

with scalefactor value sf = 1/.1302 = 7.679 G1lsb produce 1 uRad.

14


15

For MIv corrector 'G/A' 103.314 (Gauss.foot/amp)

16

with scalefactor value sf = 1/.0576 = 17.36 G1lsb produce 1 uRad.

17


18


19


20

Code in PA1666

21



22

if (spars.if_3bump==0) sts = alg_3bump1();

23

else if (spars.if_3bump==1) sts = alg_svd();

24

else sts = alg_lssol();

25



26

alg_lssol calls:

27

sts = sorbit_ls_lssol(nced,nbpm,betac, betab,psic,psib,

28

tune[pl],cor>stepcut,dx1,lb,ub,

29

dthet,dx2,&status);

30

input dx1 in mm

31

output dthet in mRad(milliradians)

32



33

Read gtable in cards before apply corrections

34

In corr3_g1

35

sts = c453_td(GET,cor>plane,MDAT_GTABLE,spars.gtable_num,

36

spars.slot+1,1,cor>g1.x.shorts,&ndis);

37



38

add dthet in uRad:

39

for (i = 0; i < RING_SIZE; i++) {

40

if (cor>useced) cor>g2[i] = (short)(cor>g1.x.shorts[i] +

41

cor>dthet[i] * 1000. * p_scale);

42

/* '1000' to convert to uR,p scaled to 10 Gev/c where s.f. is defined */

43

}

44



45


46

sts = c453_td(SET,cor>plane,MDAT_GTABLE,spars.gtable_num,

47

spars.slot+1,1,cor>g2,&ndis);

48


49

See arguments in c453_td: scale = FALSE, slot_use = SLOT_WHOLE

50

set values in cor>g2 are in raw unit(1 raw input => 1 uRad,

51

with the help from scale factor)
