#source should be in minuscule letters set source $1 set ncycles $2 #c++compile meanSigSum #c++link meanSigSum.so meanSigSum set defatt "font=helvetica,bold,20 fixedfonsize" set axedefatt "font=helvetica,bold,30 fixedfonsize grid" set defatt "" set axedefatt "grid" graphicatt "" setaxesatt "$axedefatt" set f1420low 1420.2 set f1420high 1420.6 nbins1420 = floor((${f1420high}-${f1420low})/250*8192) set path "/sps/baoradio/AmasNancay/JEC" openppf ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf clearscript evolAt1420Freq clearscript evolAt1420SideFreq clearscript evolAt1410a1415OffOn clearscript sigmaRaw1420Side clearscript sigmaRaw1410a1415 clearscript IntAt1420 clearscript diffOnOff ########################################### defscript evolAt1420Freq #Follow up of the intensity arround the [1420,1421]MHz frequency in different calibration conditions # NO calibration graphicatt "xylimits=0,500,-0.01,0.01" newwin 1 2 n/pl onoffevol.onoffRaw01420%cycle ! ! "blue cpts notit nsta" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.onoffRaw11420%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Raw (a.u)" $axedefatt newh1d hSigmaRaw0 -0.01 0.01 25 newh1d hSigmaRaw1 -0.01 0.01 25 graphicatt "" newwin 1 1 n/proj hSigmaRaw0 onoffevol.onoffRaw01420 ! ! ! "blue cpts notit" n/proj hSigmaRaw1 onoffevol.onoffRaw11420 ! ! ! "same red cpts notit" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Raw" $axedefatt endscript ################################################## defscript sigmaRaw1420Side c++compile rebining c++link rebining.so dorebin #col 3 = onoffRaw01420side Ch 0 #col 4 = onoffRaw11420side Ch 1 ntcol2var onoffevol 3 linCh0All line2vec vecCh0All $linCh0All ntcol2var onoffevol 4 linCh1All line2vec vecCh1All $linCh1All #packing values only valid for 500 cycles... set packVal "1 10 25 50 100" set sigmaCh0 "" set errsigCh0 "" set sigmaCh1 "" set errsigCh1 "" foreach ipack ( $packVal ) #Packing per ipack del invec del outvec cp vecCh0All invec call dorebin $ipack mean0 = ${outvec.sum}/${outvec.size} sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0}) errsig0 = ${sigma0}/sqrt(2*${outvec.size}) set sigmaCh0 "${sigmaCh0} ${sigma0}" set errsigCh0 "${errsigCh0} ${errsig0}" # del invec del outvec cp vecCh1All invec call dorebin $ipack mean1 = ${outvec.sum}/${outvec.size} sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1}) errsig1 = ${sigma1}/sqrt(2*${outvec.size}) set sigmaCh1 "${sigmaCh1} ${sigma1}" set errsigCh1 "${errsigCh1} ${errsig1}" end newnt nt0 x y ey newnt nt1 x y ey set x0 ( $packVal ) set y0 ( $sigmaCh0 ) set ey0 ( $errsigCh0 ) set x1 ( $packVal ) set y1 ( $sigmaCh1 ) set ey1 ( $errsigCh1 ) for i 0:$#x0 line2nt nt0 $x0[i] $y0[i] $ey0[i] line2nt nt1 $x1[i] $y1[i] $ey1[i] end newwin 1 1 plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta" plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta" n = ${#x0}-1 func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same" settitle "Sigma [1418,1419]U[1422,1423]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt endscript ################################################## defscript sigmaRaw1410a1415 c++compile rebining c++link rebining.so dorebin #col 5 = onoffRaw0f14101415 Ch 0 #col 6 = onoffRaw1f14101415 Ch 1 ntcol2var onoffevol 5 linCh0All line2vec vecCh0All $linCh0All ntcol2var onoffevol 6 linCh1All line2vec vecCh1All $linCh1All #packing values only valid for 500 cycles... set packVal "1 10 25 50 100" set sigmaCh0 "" set errsigCh0 "" set sigmaCh1 "" set errsigCh1 "" foreach ipack ( $packVal ) #Packing per ipack del invec del outvec cp vecCh0All invec call dorebin $ipack mean0 = ${outvec.sum}/${outvec.size} sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0}) errsig0 = ${sigma0}/sqrt(2*${outvec.size}) set sigmaCh0 "${sigmaCh0} ${sigma0}" set errsigCh0 "${errsigCh0} ${errsig0}" # del invec del outvec cp vecCh1All invec call dorebin $ipack mean1 = ${outvec.sum}/${outvec.size} sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1}) errsig1 = ${sigma1}/sqrt(2*${outvec.size}) set sigmaCh1 "${sigmaCh1} ${sigma1}" set errsigCh1 "${errsigCh1} ${errsig1}" end newnt nt0 x y ey newnt nt1 x y ey set x0 ( $packVal ) set y0 ( $sigmaCh0 ) set ey0 ( $errsigCh0 ) set x1 ( $packVal ) set y1 ( $sigmaCh1 ) set ey1 ( $errsigCh1 ) for i 0:$#x0 line2nt nt0 $x0[i] $y0[i] $ey0[i] line2nt nt1 $x1[i] $y1[i] $ey1[i] end newwin 1 1 plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta" plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta" n = ${#x0}-1 func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same" settitle "Sigma [1410,1415]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt endscript ########################################### defscript evolAt1410a1415OffOn graphicatt "xylimits=0,${ncycles},0.99,1.02" newwin 1 1 n/pl onoffevol.offRaw0f14101415%cycle ! ! "blue cpts notit nsta" n/pl onoffevol.offRaw1f14101415%cycle ! ! "same red cpts notit nsta" n/pl onoffevol.onRaw0f14101415%cycle ! ! "same cyan cpts notit nsta" n/pl onoffevol.onRaw1f14101415%cycle ! ! "same orange cpts notit nsta" settitle "Raw (OFF,ON)/OFF ${source} Ch 0 (blue/cyan) Ch 1 (red/orange) ${ncycles}cycles " ' ' $defatt setaxelabels "cycle" "I[1410,1415]MHz Raw (a.u)" $axedefatt graphicatt "xylimits=0,${ncycles},-0.005,0.005" newwin 1 1 n/pl onoffevol.(onRaw0f14101415-offRaw0f14101415)%cycle ! ! "blue cpts notit nsta" n/pl onoffevol.(onRaw1f14101415-offRaw1f14101415)%cycle ! ! "same red cpts notit nsta" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "cycle" "DI [1410,1415]MHz Raw (a.u)" $axedefatt endscript ########################################### defscript evolAt1420SideFreq #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions # NO calibration graphicatt "xylimits=0,500,-0.01,0.01" newwin 1 2 n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.onoffRaw11420side%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Raw (a.u)" $axedefatt newh1d hSigmaSideRaw0 -0.01 0.01 25 newh1d hSigmaSideRaw1 -0.01 0.01 25 graphicatt "" newwin 1 1 n/proj hSigmaSideRaw0 onoffevol.onoffRaw01420side ! ! ! "blue cpts notit" n/proj hSigmaSideRaw1 onoffevol.onoffRaw11420side ! ! ! "same red cpts notit" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt endscript ########################################### defscript IntAt1420 #Follow up of the intensity arround the [${f1420low},${f1420high}]MHz #frequency in different calibration conditions with baseline removed # NO calibration graphicatt "xylimits=0,500,-0.1,0.1" newwin 1 2 n/pl onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side)%cycle ! ! "blue cpts notit nsta" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt n/pl onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side)%cycle ! ! "red cpts notit nsta" setaxelabels "cycle" "I 1420MHz Raw (a.u)" $axedefatt newh1d h1420IntRaw0 -0.1 0.1 25 newh1d h1420IntRaw1 -0.1 0.1 25 graphicatt "" newwin 1 1 n/proj h1420IntRaw0 onoffevol.${nbins1420}*(onoffRaw01420-onoffRaw01420side) ! ! ! "blue cpts notit" n/proj h1420IntRaw1 onoffevol.${nbins1420}*(onoffRaw11420-onoffRaw11420side) ! ! ! "same red cpts notit" settitle "Raw (ON-OFF)/OFF ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt endscript ################################################## defscript diffOnOff graphicatt "xylimits=1250,1500,-0.01,0.01" del s0 s1 objaoper meanOvOffNoCalib row 0 s0 objaoper meanOvOffNoCalib row 1 s1 newwin plot2d s0 (n/8192)*250+1250 val n>0 "cpts blue notit nsta" plot2d s1 (n/8192)*250+1250 val n>0 "same cpts red notit nsta" settitle "plot Raw (ON-OFF)/OFF ${source} ${ncycles} cycles, Ch 0 (blue) Ch 1 (red)" setaxelabels "Freq. (MHz)" "I (a.u)" del stot c++exec TVector stot=s0+s1; stot/=2.; KeepObj(stot); newwin plot2d stot (n/8192)*250+1250 val n>0 "cpts blue notit nsta" settitle "Mean Raw (ON-OFF)/OFF ${source} ${ncycles} cycles" setaxelabels "Freq. (MHz)" "I (a.u)" endscript ##################################################