Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8976)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8977)
@@ -23,4 +23,5 @@
    * mjobs/MJSpectrum.cc:
      - small improvement to output
+     - handle underflow bin of effective on-time more accurate
 
 
Index: /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8976)
+++ /trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc	(revision 8977)
@@ -242,7 +242,6 @@
     }
 
-    TH1D *vstime = (TH1D*)arr.FindObjectInCanvas("Theta",      "TH1D", "OnTime");
-    TH1D *size   = (TH1D*)arr.FindObjectInCanvas("Excess",     "TH1D", "Hist");
-    TH1D *time   = (TH1D*)arr.FindObjectInCanvas("ExcessTime", "TH1D", "Hist");
+    TH1D *vstime = (TH1D*)arr.FindObjectInCanvas("Theta",  "TH1D", "OnTime");
+    TH1D *size   = (TH1D*)arr.FindObjectInCanvas("Excess", "TH1D", "Hist");
     if (!vstime)
     {
@@ -253,9 +252,4 @@
     {
         *fLog << err << dbginf << "ERROR - Excess [TH1D] not found in Hist-tab... abort." << endl;
-        return -1;
-    }
-    if (!size)
-    {
-        *fLog << err << dbginf << "ERROR - ExcessTime [TH1D] not found in Hist-tab... abort." << endl;
         return -1;
     }
@@ -297,24 +291,39 @@
         return -1;
 
-    if (vstime->GetBinContent(0)>0)
-    {
-        *fLog << err << "ERROR - Undeflow bin of OnTime histogram not empty as it ought to be." << endl;
+    const Double_t ufl = vstime->GetBinContent(0);
+    if (ufl>0)
+    {
+        if (vstime->GetBinLowEdge(1)<=0)
+        {
+            *fLog << err << "ERROR - Undeflow bin of OnTime histogram not empty as it ought to be." << endl;
+            return -1;
+        }
+        *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ufl/eff, ufl) << " of the eff. observation time is in the underflow bin." << endl;
+    }
+
+    const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1);
+    const Double_t eff = vstime->Integral()+ufl+ofl;
+    if (ofl>0)
+        *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ofl/eff, ofl) << " of the eff. observation time is in the overflow bin." << endl;
+
+    if (!fForceRunTime)
+        return eff;
+
+    TH1D *time   = (TH1D*)arr.FindObjectInCanvas("ExcessTime", "TH1D", "Hist");
+    if (!size)
+    {
+        *fLog << err;
+        *fLog << "ERROR - ExcessTime [TH1D] not found in Hist-tab... abort." << endl;
+        *fLog << "        Did you try to process Monte Carlos with --force-runtime?" <<endl;
         return -1;
     }
 
-    const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1);
-    const Double_t eff = vstime->Integral()+ofl;
-    if (ofl>0)
-        *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ofl/eff, ofl) << " of the eff. observation time is out of histogram range." << endl;
-
     const Double_t obs = time->GetXaxis()->GetXmax()-time->GetXaxis()->GetXmin();
-    if (fForceRunTime)
-    {
-        *fLog << inf;
-        *fLog << "Total run time: " << obs/60 << "min" << endl;
-        *fLog << "Eff. obs. time: " << eff/60 << "min  (" << Form("%.1f%%", 100*eff/obs) << ")" << endl;
-    }
-
-    return fForceRunTime ? obs : eff;
+
+    *fLog << inf;
+    *fLog << "Total run time: " << obs/60 << "min" << endl;
+    *fLog << "Eff. obs. time: " << eff/60 << "min  (" << Form("%.1f%%", 100*eff/obs) << ")" << endl;
+
+    return obs;
 }
 
