#source should be in minuscule letters # gain = 1 if on,off have been divided by gain set source $1 set ncycles $2 set gain $3 #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 path "/sps/baoradio/AmasNancay/AST" if ( $gain == "0" ) then openppf ${path}/rawOnOffDiffNoGain_${source}-${ncycles}Cycles.ppf echo "Opening file ${path}/rawOnOffDiffNoGain_${source}-${ncycles}Cycles.ppf" else openppf ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf echo "Opening file ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf" endif # Abell 85, 500 cycles if ( ${source} == "abell85" ) then set f1420low 1420.2 set f1420high 1420.6 set packVal "1 10 25 50 100" endif # Abell 1205, 600, 750 cycles if ( ${source} == "abell1205" ) then set f1420low 1420.1 set f1420high 1420.6 if ( $ncycles == 600 ) then set packVal "1 10 25 50 100 120" else set packVal "1 10 15 50 75 125 150" endif endif # Abell 2440, 210 cycles if ( ${source} == "abell2440" ) then set f1420low 1420.4 set f1420high 1420.7 set packVal "1 10 25 42" endif # All clusters, 1549 cycles if ( ${source} == "abell85-abell2440-abell1205" ) then set f1420low 1420.1 set f1420high 1420.7 set packVal "1 10 25 50 100 260" endif echo "f1420low=${f1420low}, f1420high=${f1420high}" echo "Packing values="${packVal} nbins1420 = floor((${f1420high}-${f1420low})/250*8192) #echo $nbins1420 clearscript evolAt1420Freq clearscript evolAt1420SideFreq clearscript evolAt1410a1415OffOn clearscript sigmaRaw1420Side clearscript sigmaRaw1410a1415 clearscript sigmaRawBand 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 ########################################### # Old function sigmaRaw1400a1420 defscript sigmaRawBand # flow,fhigh = frequency limits for integration band # offFilt = 1 we divide on-off by filtered Off set flow $1 set fhigh $2 set offFilt $3 set nclusters $4 graphicatt "" if ( $nclusters == 1 ) then ## Individual clusters (update of mergeAnaFiles.cc on 09/01/2012) ## mergeAnaFiles.cc -> meanRawDiffOnOffCycles -> rawOnOffDiff_[source]-[n]Cycles.ppf ## Frequency bands [1405,1415], [1405,1410], [1410,1415] MHz ## [1405,1415]: col 11,12 = onoffRaw[0,1]f14051415 Ch[0,1] (ON-OFF)/OFF_filt ## [1405,1410]: col 13,14 = onoffRaw[0,1]f14051410 Ch[0,1] ## [1410,1415]: col 5, 6 = onoffRaw[0,1]f14101415 Ch[0,1] ## [1405,1415]: col 15,16 = diffonoffRaw[0,1]f14051415 Ch[0,1] (ON-OFF) ## [1405,1410]: col 17,18 = diffonoffRaw[0,1]f14051410 Ch[0,1] ## [1410,1415]: col 19,20 = diffonoffRaw[0,1]f14101415 Ch[0,1] if ( $flow == 1405 ) then if ( $fhigh == 1415 ) then if ( $offFilt == 1 ) then set col0 11 set col1 12 else set col0 15 set col1 16 endif endif if ( $fhigh == 1410 ) then if ( $offFilt == 1 ) then set col0 13 set col1 14 else set col0 17 set col1 18 endif endif endif if ( $flow == 1410 ) then if ( $fhigh == 1415 ) then if ( $offFilt == 1 ) then set col0 5 set col1 6 else set col0 19 set col1 20 endif endif endif ntcol2var onoffevol $col0 linCh0All line2vec vecCh0All $linCh0All ntcol2var onoffevol $col1 linCh1All line2vec vecCh1All $linCh1All else ## Execute if analysing All Clusters abell85-abell2440-abell1205 ## mergeAnaFiles.cc -> MeanRawDiffOnOffAllClusters -> rawOnOffDiff_[sources]-[n]Cycles.ppf ## Shifts the distribution of each cluster to mean~0, to avoid ## offset problems when regrouping values ## col 5,6 = onoffRaw0f14101415 Ch 0,1 [1410,1415]MHz ## col 7,8 = onoffRaw1f141014125 Ch 0,1 [1410,1412.5]MHz ## col 9,10 = onoffRaw1f14101411 Ch 0,1 [1410,1411]MHz if ( $flow == 1410 ) then if ( $fhigh == 1415 ) then set col0 5 set col1 6 endif if ( $fhigh == 14125 ) then set col0 7 set col1 8 endif if ( $fhigh == 1411 ) then set col0 9 set col1 10 endif endif echo Analysing ntuple columns $col0, $col1 ntcol2var onoffevol $col0 linCh0All line2vec invecCh0All $linCh0All ntcol2var onoffevol $col1 linCh1All line2vec invecCh1All $linCh1All del v85 v2440 v1205 exptovec v85 onoffevol cycletot-1 srcID==85 set v85_first ${v85.min} set v85_last ${v85.max} exptovec v2440 onoffevol cycletot-1 srcID==2440 set v2440_first ${v2440.min} set v2440_last ${v2440.max} exptovec v1205 onoffevol cycletot-1 srcID==1205 set v1205_first ${v1205.min} set v1205_last ${v1205.max} del vecCh085 vecCh02440 vecCh01205 vecCh185 vecCh12440 vecCh11205 vecCh0All vecCh1All h/copy invecCh0All vecCh085 ${v85_first}:${v85_last} h/copy invecCh0All vecCh02440 $v2440_first:$v2440_last h/copy invecCh0All vecCh01205 $v1205_first:$v1205_last h/copy invecCh1All vecCh185 $v85_first:$v85_last h/copy invecCh1All vecCh12440 $v2440_first:$v2440_last h/copy invecCh1All vecCh11205 $v1205_first:$v1205_last c++exec double m,s; int l=-1; \ MeanSigma(vecCh085,m,s) ; vecCh085 -= m;\ MeanSigma(vecCh02440,m,s); vecCh02440 -= m;\ MeanSigma(vecCh01205,m,s); vecCh01205 -= m;\ MeanSigma(vecCh185,m,s) ; vecCh185 -= m;\ MeanSigma(vecCh12440,m,s); vecCh12440 -= m;\ MeanSigma(vecCh11205,m,s); vecCh11205 -= m;\ TVector vecCh0All(invecCh0All.NElts()); KeepObj(vecCh0All); \ TVector vecCh1All(invecCh1All.NElts()); KeepObj(vecCh1All); \ for (int i=0;i0 "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 ##################################################