Index: /BAORadio/AmasNancay/trunk/etude_mergeAna.pic
===================================================================
--- /BAORadio/AmasNancay/trunk/etude_mergeAna.pic	(revision 581)
+++ /BAORadio/AmasNancay/trunk/etude_mergeAna.pic	(revision 582)
@@ -1,2 +1,31 @@
+
+
+set source  $1
+set ncycles $2
+
+
+#set fcalib $3
+#set f1420low $4
+#set f1420high $5
+
+set fcalib 1410
+set f1420low 1420.2
+set f1420high 1420.6
+
+
+
+nbins1420 = floor((${f1420high}-${f1420low})/250*8192)
+
+echo $nbins1420
+
+
+
+clearscript diffOnOff
+clearscript evolAt1420Freq
+clearscript evolAt1420SideFreq
+clearscript IntAt1420
+clearscript sigmaRaw1420Side
+############################################################################
+
 defscript evolAtCalibFreq
 
@@ -56,5 +85,5 @@
 
 
-#Follow up of the intensity arround the (1420.4 +/- 2) MHz frequency in different calibration conditions
+#Follow up of the intensity arround the [1420,1421]MHz frequency in different calibration conditions
 # NO calibration
 # Calibration coeff. mean per Run
@@ -68,5 +97,5 @@
 settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
 n/pl onoffevol.onoffRaw11420%cycle ! ! "red cpts notit nsta"
-setaxelabels "cycle" "I[1420.4MHz +/- 2MHz] Raw (a.u)" $axedefatt
+setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Raw (a.u)" $axedefatt
 
 
@@ -75,5 +104,5 @@
 settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
 n/pl onoffevol.onoffRun11420%cycle ! ! "red cpts notit nsta"
-setaxelabels "cycle" "I[1420.4MHz +/- 2MHz] Run (a.u)" $axedefatt
+setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Run (a.u)" $axedefatt
 
 
@@ -82,13 +111,13 @@
 settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
 n/pl onoffevol.onoffCycle11420%cycle ! ! "red cpts notit nsta"
-setaxelabels "cycle" "I[1420.4MHz +/- 2MHz] Cycle (a.u)" $axedefatt
-
-
-newh1d hSigmaRaw0 -0.02 0.02 50
-newh1d hSigmaRaw1 -0.02 0.02 50
-newh1d hSigmaRun0 -0.02 0.02 50
-newh1d hSigmaRun1 -0.02 0.02 50
-newh1d hSigmaCycl0 -0.02 0.02 50
-newh1d hSigmaCycl1 -0.02 0.02 50
+setaxelabels "cycle" "I[${f1420low},${f1420high}]MHz Cycle (a.u)" $axedefatt
+
+
+newh1d hSigmaRaw0 -0.01 0.01 25
+newh1d hSigmaRaw1 -0.01 0.01 25
+newh1d hSigmaRun0 -0.01 0.01 25
+newh1d hSigmaRun1 -0.01 0.01 25
+newh1d hSigmaCycl0 -0.01 0.01 25
+newh1d hSigmaCycl1 -0.01 0.01 25
 
 graphicatt ""
@@ -98,5 +127,5 @@
 n/proj hSigmaRaw1 onoffevol.onoffRaw11420 ! ! ! "same red cpts notit"
 settitle "Raw ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
-setaxelabels "(a.u)" "I[1420.4MHz +/- 2MHz] Raw" $axedefatt
+setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Raw" $axedefatt
 
 newwin 1 1
@@ -104,5 +133,5 @@
 n/proj hSigmaRun1 onoffevol.onoffRun11420 ! ! ! "same red cpts notit"
 settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
-setaxelabels "(a.u)" "I[1420.4MHz +/- 2MHz] Run" $axedefatt
+setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Run" $axedefatt
 
 
@@ -111,5 +140,188 @@
 n/proj hSigmaCycl1 onoffevol.onoffCycle11420 ! ! ! "same red cpts notit"
 settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
-setaxelabels "(a.u)" "I[1420.4MHz +/- 2MHz] Cycle" $axedefatt
+setaxelabels "(a.u)" "I[${f1420low},${f1420high}]MHz Cycle" $axedefatt
+
+
+endscript
+##################################################
+defscript sigmaRaw1420Side
+
+
+newh1d hSigRaw0All -0.01 0.01 25
+newh1d hSigRaw1All -0.01 0.01 25
+
+n/proj hSigRaw0All onoffevol.onoffRaw01420side
+n/proj hSigRaw1All onoffevol.onoffRaw11420side
+
+echo "Resultats sur ${ncycles} cycles (Ch0, Ch1): mean (${hSigRaw0All.mean}, ${hSigRaw1All.mean}) sigma (${hSigRaw0All.sigma}, ${hSigRaw1All.sigma})"
+
+newwin 1 1
+disp  hSigRaw0All "blue cpts notit"
+disp  hSigRaw1All "red same cpts notit"
+settitle "Mean and Sigma for 1 cycle"
+
+#Ts les 10cycles
+n10cycles = floor(${ncycles}/10)
+x10min = ${hSigRaw0All.xmin}
+x10max = ${hSigRaw0All.xmax}
+n10bin = ${hSigRaw0All.nbin}
+
+	
+for i 0:${n10cycles}
+ ic = ${i}*10+1
+ jc = ${ic}+9
+ newh1d hSigRaw010c${i} ${x10min} ${x10max} ${n10bin}
+ newh1d hSigRaw110c${i} ${x10min} ${x10max} ${n10bin}
+
+ n/proj hSigRaw010c${i}  onoffevol.onoffRaw01420side (cycle>=${ic})&&(cycle<=${jc})
+ cp hSigRaw010c${i} h0
+ mSig010c[i] = ${h0.mean}
+
+ n/proj hSigRaw110c${i}  onoffevol.onoffRaw11420side (cycle>=${ic})&&(cycle<=${jc}) 
+ cp hSigRaw110c${i} h1
+ mSig110c[i] = ${h1.mean}
+end
+
+
+line2vec hSigRaw010c $mSig010c
+line2vec hSigRaw110c $mSig110c
+
+
+
+
+newwin 1 1
+disp  hSigRaw010c "blue cpts notit"
+disp  hSigRaw110c "red same cpts notit"
+settitle "Mean and Sigma for 10 cycles"
+
+
+endscript
+###########################################
+defscript evolAt1420SideFreq
+
+
+#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz frequency in different calibration conditions
+# NO calibration
+# Calibration coeff. mean per Run
+# Calibration coeff. per cycles
+
+
+graphicatt "xylimits=0,500,-0.01,0.01"
+
+newwin 1 2
+n/pl onoffevol.onoffRaw01420side%cycle ! ! "blue cpts notit nsta"
+settitle "Raw ON-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
+
+
+newwin 1 2
+n/pl onoffevol.onoffRun01420side%cycle ! ! "blue cpts notit nsta"
+settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+n/pl onoffevol.onoffRun11420side%cycle ! ! "red cpts notit nsta"
+setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Run (a.u)" $axedefatt
+
+
+newwin 1 2
+n/pl onoffevol.onoffCycle01420side%cycle ! ! "blue cpts notit nsta"
+settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+n/pl onoffevol.onoffCycle11420side%cycle ! ! "red cpts notit nsta"
+setaxelabels "cycle" "I[1418,1419]U[1422,1423]MHz Cycle (a.u)" $axedefatt
+
+
+newh1d hSigmaSideRaw0 -0.01 0.01 25
+newh1d hSigmaSideRaw1 -0.01 0.01 25
+newh1d hSigmaSideRun0 -0.01 0.01 25
+newh1d hSigmaSideRun1 -0.01 0.01 25
+newh1d hSigmaSideCycl0 -0.01 0.01 25
+newh1d hSigmaSideCycl1 -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  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
+setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Raw" $axedefatt
+
+newwin 1 1
+n/proj hSigmaSideRun0 onoffevol.onoffRun01420side ! ! ! "blue cpts notit"
+n/proj hSigmaSideRun1 onoffevol.onoffRun11420side ! ! ! "same red cpts notit"
+settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Run" $axedefatt
+
+
+newwin 1 1
+n/proj hSigmaSideCycl0 onoffevol.onoffCycle01420side ! ! ! "blue cpts notit"
+n/proj hSigmaSideCycl1 onoffevol.onoffCycle11420side ! ! ! "same red cpts notit"
+settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+setaxelabels "(a.u)" "I[1418,1419]U[1422,1423]MHz Cycle" $axedefatt
+
+
+endscript
+
+###########################################
+defscript IntAt1420
+
+
+#Follow up of the intensity arround the [${f1420low},${f1420high}]MHz 
+#frequency in different calibration conditions with baseline removed
+# NO calibration
+# Calibration coeff. mean per Run
+# Calibration coeff. per cycles
+
+
+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  ${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
+
+
+newwin 1 2
+n/pl onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side)%cycle ! ! "blue cpts notit nsta"
+settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+n/pl onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side)%cycle ! ! "red cpts notit nsta"
+setaxelabels "cycle" "I 1420MHz Run (a.u)" $axedefatt
+
+
+newwin 1 2
+n/pl onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side)%cycle ! ! "blue cpts notit nsta"
+settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+n/pl onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side)%cycle ! ! "red cpts notit nsta"
+setaxelabels "cycle" "I 1420MHz Cycle (a.u)" $axedefatt
+
+
+newh1d h1420IntRaw0 -0.1 0.1 25
+newh1d h1420IntRaw1 -0.1 0.1 25
+newh1d h1420IntRun0 -0.1 0.1 25
+newh1d h1420IntRun1 -0.1 0.1 25
+newh1d h1420IntCycl0 -0.1 0.1 25
+newh1d h1420IntCycl1 -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  ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles " ' ' $defatt
+setaxelabels "(a.u)" "I 1420MHz Raw" $axedefatt
+
+newwin 1 1
+n/proj h1420IntRun0 onoffevol.${nbins1420}*(onoffRun01420-onoffRun01420side) ! ! ! "blue cpts notit"
+n/proj h1420IntRun1 onoffevol.${nbins1420}*(onoffRun11420-onoffRun11420side) ! ! ! "same red cpts notit"
+settitle "ON-OFF Calib Run ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+setaxelabels "(a.u)" "I 1420MHz Run" $axedefatt
+
+
+
+newwin 1 1
+n/proj h1420IntCycl0 onoffevol.${nbins1420}*(onoffCycle01420-onoffCycle01420side) ! ! ! "blue cpts notit"
+n/proj h1420IntCycl1 onoffevol.${nbins1420}*(onoffCycle11420-onoffCycle11420side) ! ! ! "same red cpts notit"
+settitle "ON-OFF Calib Cycle ${source} Ch 0 (blue) Ch 1 (red) ${ncycles}cycles" ' ' $defatt
+setaxelabels "(a.u)" "I 1420MHz Cycle" $axedefatt
+
 
 
@@ -164,7 +376,6 @@
 #use minuscule for source label
 
-set source  $1
-set ncycles $2
-set fcalib $3
+
+
 
 openppf onoffsurvey_${source}-${ncycles}Cycles.ppf
@@ -181,7 +392,6 @@
 
 
-
 #diffOnOff
-
-
-evolAt1420Freq
+#evolAt1420Freq
+#evolAt1420SideFreq
+#IntAt1420
Index: /BAORadio/AmasNancay/trunk/mergeAnaFiles.cc
===================================================================
--- /BAORadio/AmasNancay/trunk/mergeAnaFiles.cc	(revision 581)
+++ /BAORadio/AmasNancay/trunk/mergeAnaFiles.cc	(revision 582)
@@ -251,5 +251,5 @@
 //Compute the mean of Diff ON-OFF BAO-calibrated spectra and also the mean/sigma of rebinned spectra 
 //
-void meanCalibBAODiffOnOffCycles() throw(string) {
+void 1meanCalibBAODiffOnOffCycles() throw(string) {
 
   list<string> listOfFiles;
@@ -286,6 +286,6 @@
   sa_size_t chCalibHigh = freqToChan(para.rcalibFreq_ + (para.rcalibBandFreq_*0.5));
   //Lower and Higher freq.  just arround 1420.4MHz Freq. bin to perform mean follow up
-  sa_size_t ch1420Low  = freqToChan(1420);
-  sa_size_t ch1420High = freqToChan(1421);
+  sa_size_t ch1420Low  = freqToChan(1420.4-0.2);
+  sa_size_t ch1420High = freqToChan(1420.4+0.2);
 
   //Lower and Higher freq. on the sides of 1420.4Mhz Freq. bin to perform mean follow up
@@ -296,7 +296,9 @@
 
 
-  if (para.debuglev_>90){
+  if (para.debuglev_>0){
     cout << "freq. band for follow up [" <<  chCalibLow << ", "<< chCalibHigh << "]" << endl;
     cout << "freq. band for follow up [" <<  ch1420Low << ", "<< ch1420High << "]" << endl;
+    cout << "freq. band for follow up [" <<  ch1420aLow << ", "<< ch1420aHigh << "]" << endl;
+    cout << "freq. band for follow up [" <<  ch1420bLow << ", "<< ch1420bHigh << "]" << endl;
   }
   
