Index: trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 7846)
+++ trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C	(revision 7847)
@@ -131,8 +131,15 @@
     }
 
-    MHCamera *hilo = (MHCamera*)arr.FindObjectInCanvas("HiLoOff;avg", "MHCamera", "HiLoOff");
-    if (!hilo)
+    MHCamera *hilooff = (MHCamera*)arr.FindObjectInCanvas("HiLoOff;avg", "MHCamera", "HiLoOff");
+    if (!hilooff)
     {
         cout << "WARNING - Reading of HiLoOff failed." << endl;
+        return 2;
+    }
+
+    MHCamera *hilocal = (MHCamera*)arr.FindObjectInCanvas("HiLoCal;avg", "MHCamera", "HiLoCal");
+    if (!hilocal)
+    {
+        cout << "WARNING - Reading of HiLoCal failed." << endl;
         return 2;
     }
@@ -207,6 +214,9 @@
     Double_t rmsoff  = TMath::Nint(pullo->GetRMS() *100.)/100.;
  */
-    Double_t meanoff = TMath::Nint(hilo->GetMean()*100.)/100.;
-    Double_t rmsoff  = TMath::Nint(hilo->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.;
 
     //get sequence number from the filename
@@ -237,4 +247,6 @@
     TString meanpuloff   =Form("%6.2f", meanoff);
     TString rmspuloff    =Form("%6.2f", rmsoff);
+    TString meanhilocal  =Form("%6.2f", meancal);
+    TString rmshilocal   =Form("%6.2f", rmscal);
 
     if (meanextpul<0 && rmsextpul<0)
@@ -258,5 +270,6 @@
 //    cout << "  Mean ext.HiGain PulsePos " << meanpulhi     << " +- " << rmspulhi     << endl;
 //    cout << "  Mean ext.LoGain PulsePos " << meanpullo     << " +- " << rmspullo     << endl;
-    cout << "  Lo-Hi gain offset:       " << meannpuloff   << " +- " << rmspuloff    << endl;
+    cout << "  Lo-Hi gain offset:       " << meanpuloff    << " +- " << rmspuloff    << endl;
+    cout << "  Hi/Lo gain ratio:        " << meanhilocal   << " +- " << rmshilocal   << endl;
     cout << endl;
 
@@ -266,11 +279,12 @@
     // and so the table Calibration is always updated
     TString query = Form("UPDATE Calibration SET "
-                         " fMeanPedRmsInner=%s,   fMeanPedRmsOuter=%s, "
-                         " fMeanSignalInner=%s,   fMeanSignalOuter=%s, "
-                         " fPulsePosMean=%s,      fPulsePosRms=%s,     "
-                         " fPulsePosCheckMean=%s, fPulsePosCheckRms=%s "
-                         //" fPulsePosHiMean=%s,    fPulsePosHiRms=%s,   "
-                         //" fPulsePosLoMean=%s,    fPulsePosLoRms=%s,   "
-                         " fPulsePosOffMean=%s,   fPulsePosOffRms=%s,  "
+                         " fMeanPedRmsInner=%s,   fMeanPedRmsOuter=%s,  "
+                         " fMeanSignalInner=%s,   fMeanSignalOuter=%s,  "
+                         " fPulsePosMean=%s,      fPulsePosRms=%s,      "
+                         " fPulsePosCheckMean=%s, fPulsePosCheckRms=%s  "
+                         //" fPulsePosHiMean=%s,    fPulsePosHiRms=%s,    "
+                         //" fPulsePosLoMean=%s,    fPulsePosLoRms=%s,    "
+                         " fPulsePosOffMean=%s,   fPulsePosOffRms=%s,   "
+                         " fHiLoGainRatioMean=%s, fHiLoGainRatioRms=%s, "
                          " WHERE fSequenceFirst='%d' ",
                          meanrmsinner.Data(),  meanrmsouter.Data(),
@@ -281,4 +295,5 @@
                          //meanpullo.Data(),     rmspullo.Data(),
                          meanpuloff.Data(),    rmspuloff.Data(),
+                         meanhilocal.Data(),   rmshilocal.Data(),
                          seq);
 
