### Profile

 1 ```Calc scale-factor from magnet strength::(see note book p146) ``` ```-------------------------------------------------- ``` ```thet = B*L/(Beta*Roh) ``` ```thet(defection) = Radians ``` ```B*L = field flux = TM = Teslar * Meter = Gauss * Meter * 10E-4 = GM * 10E-4 ``` ```Beta*Roh = 3.3356 * P, P in GeV/C ``` ```For MI-h corrector 'G/A' 233.497 (Gauss.foot/amp) ``` ```convert to 0.007117 Teslar.meter/amp ``` ```At p = 10 GeV/C ``` ```Theta/Amp = 0.007117 / (3.3356*p) = 0.00021336 Rad/Amp = 213.36 uRad/Amp ``` ```G-table raw setting 1 lsb(G-1-lsb) 2/3276.8 amp to produce 0.1302 uRad ``` ```with scale-factor value sf = 1/.1302 = 7.679 G-1-lsb produce 1 uRad. ``` ```For MI-v corrector 'G/A' 103.314 (Gauss.foot/amp) ``` ```with scale-factor value sf = 1/.0576 = 17.36 G-1-lsb produce 1 uRad. ``` ```Code in PA1666 ``` ```-------------- ``` ``` if (spars.if_3bump==0) sts = alg_3bump1(); ``` ``` else if (spars.if_3bump==1) sts = alg_svd(); ``` ``` else sts = alg_lssol(); ``` ```-------------- ``` ```alg_lssol calls: ``` ``` sts = sorbit_ls_lssol(nced,nbpm,betac, betab,psic,psib, ``` ``` tune[pl],cor->stepcut,dx1,lb,ub, ``` ``` dthet,dx2,&status); ``` ``` input dx1 in mm ``` ``` output dthet in mRad(milli-radians) ``` ```-------------- ``` ```Read g-table in cards before apply corrections ``` ```In corr3_g1 ``` ``` sts = c453_td(GET,cor->plane,MDAT_GTABLE,spars.gtable_num, ``` ``` spars.slot+1,1,cor->g1.x.shorts,&ndis); ``` ```-------------- ``` ```add dthet in uRad: ``` ``` for (i = 0; i < RING_SIZE; i++) { ``` ``` if (cor->useced) cor->g2[i] = (short)(cor->g1.x.shorts[i] + ``` ``` cor->dthet[i] * 1000. * p_scale); ``` ``` /* '1000' to convert to uR,p scaled to 10 Gev/c where s.f. is defined */ ``` ``` } ``` ```-------------- ``` ``` sts = c453_td(SET,cor->plane,MDAT_GTABLE,spars.gtable_num, ``` ``` spars.slot+1,1,cor->g2,&ndis); ``` ```See arguments in c453_td: scale = FALSE, slot_use = SLOT_WHOLE ``` ```set values in cor->g2 are in raw unit(1 raw input => 1 uRad, ``` ```with the help from scale factor) ```