Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7869)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7870)
@@ -22,4 +22,7 @@
    * mbase/MMath.cc:
      - changed MedianDev to support 68% division instead of 0.5%
+
+   * datacenter/macros/fillsignal.C:
+     - adapted to use Median for Pulse Offset and Gain
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7869)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7870)
@@ -10,6 +10,6 @@
 
    - general: Added a function to MMath which returns the Median of
-     the distribution abs(y[i]-median), which is somehow the median
-     counterpart of the rms.
+     the distribution abs(y[i]-median) but at 68:32 division instead 
+     of 50:50, which is somehow the mediani counterpart of the rms.
 
    - showplot:
Index: trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 7869)
+++ trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 7870)
@@ -213,10 +213,13 @@
     Double_t meanoff = TMath::Nint(pullo->GetMean()*100.)/100.;
     Double_t rmsoff  = TMath::Nint(pullo->GetRMS() *100.)/100.;
- */
-    Double_t meanoff = TMath::Nint(hilooff->GetMean()*100.)/100.;
-    Double_t rmsoff  = TMath::Nint(hilooff->GetRMS() *100.)/100.;
-
-    Double_t meancal = TMath::Nint(hilocal->GetMean()*100.)/100.;
-    Double_t rmscal  = TMath::Nint(hilocal->GetRMS() *100.)/100.;
+    */
+
+    // USE MEDIAN INSTEAD? GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0);
+
+    Double_t medoff = TMath::Nint(hilooff->GetMedian()   *10000)/10000.;
+    Double_t devoff = TMath::Nint(hilooff->GetMedianDev()*10000)/10000.;
+
+    Double_t medcal = TMath::Nint(hilocal->GetMedian()   *100)/100.;
+    Double_t devcal = TMath::Nint(hilocal->GetMedianDev()*100)/100.;
 
     //get sequence number from the filename
@@ -245,8 +248,8 @@
     TString rmspullo     =Form("%6.2f", rmslo);
     */
-    TString meanpuloff   =Form("%6.2f", meanoff);
-    TString rmspuloff    =Form("%6.2f", rmsoff);
-    TString meanhilocal  =Form("%6.2f", meancal);
-    TString rmshilocal   =Form("%6.2f", rmscal);
+    TString medpuloff    =Form("%7.4f", medoff);
+    TString devpuloff    =Form("%7.4f", devoff);
+    TString medhilocal   =Form("%6.2f", medcal);
+    TString devhilocal   =Form("%6.2f", devcal);
 
     if (meanextpul<0 && rmsextpul<0)
@@ -270,6 +273,6 @@
 //    cout << "  Mean ext.HiGain PulsePos " << meanpulhi     << " +- " << rmspulhi     << endl;
 //    cout << "  Mean ext.LoGain PulsePos " << meanpullo     << " +- " << rmspullo     << endl;
-    cout << "  Lo-Hi gain offset:       " << meanpuloff    << " +- " << rmspuloff    << endl;
-    cout << "  Hi/Lo gain ratio:        " << meanhilocal   << " +- " << rmshilocal   << endl;
+    cout << "  Lo-Hi gain offset:      " << medpuloff    << " +-  " << devpuloff    << endl;
+    cout << "  Hi/Lo gain ratio:        " << medhilocal   << " +- " << devhilocal   << endl;
     cout << endl;
 
@@ -285,6 +288,6 @@
                          //" fPulsePosHiMean=%s,    fPulsePosHiRms=%s,    "
                          //" fPulsePosLoMean=%s,    fPulsePosLoRms=%s,    "
-                         " fPulsePosOffMean=%s,   fPulsePosOffRms=%s,   "
-                         " fHiLoGainRatioMean=%s, fHiLoGainRatioRms=%s "
+                         " fPulsePosOffMed=%s,    fPulsePosOffDev=%s,   "
+                         " fHiLoGainRatioMed=%s,  fHiLoGainRatioDev=%s  "
                          " WHERE fSequenceFirst='%d' ",
                          meanrmsinner.Data(),  meanrmsouter.Data(),
@@ -294,6 +297,6 @@
                          //meanpulhi.Data(),     rmspulhi.Data(),
                          //meanpullo.Data(),     rmspullo.Data(),
-                         meanpuloff.Data(),    rmspuloff.Data(),
-                         meanhilocal.Data(),   rmshilocal.Data(),
+                         medpuloff.Data(),    devpuloff.Data(),
+                         medhilocal.Data(),   devhilocal.Data(),
                          seq);
 
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7869)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7870)
@@ -181,6 +181,6 @@
 
     // FIXME: GausProb() is a workaround. It should be taken into account in Median!
-    return TMath::Median(n, arr);
-    /*
+    //return TMath::Median(n, arr);
+    
     // Sort distribution
     Long64_t idx[n];
@@ -199,5 +199,4 @@
 
     return dev;
-*/
 }
 
