Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7671)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7672)
@@ -25,4 +25,8 @@
      - fixed the auto training (still far from working well)
      - improved result plots
+
+   * mbase/MMath.cc:
+     - fixed SignificanceLiMa such that it allows basically zero
+       signal- and/or background events
 
 
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7671)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7672)
@@ -78,6 +78,5 @@
 //  The significance has the same (positive!) value for s>b and b>s.
 //
-//  Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0
-//  Returns  0 if s+b==0, s==0 or b==0
+//  Returns -1 if s<0 or b<0 or alpha<0 or the argument of sqrt<0
 //
 // Here is some eMail written by Daniel Mazin about the meaning of the arguments:
@@ -107,12 +106,9 @@
     const Double_t sum = s+b;
 
-    if (s==0 || b==0 || sum==0)
-        return 0;
-
-    if (sum<0 || alpha<=0)
+    if (s<0 || b<0 || alpha<=0)
         return -1;
 
-    const Double_t l = s*TMath::Log(s/sum*(alpha+1)/alpha);
-    const Double_t m = b*TMath::Log(b/sum*(alpha+1)      );
+    const Double_t l = s==0 ? 0 : s*TMath::Log(s/sum*(alpha+1)/alpha);
+    const Double_t m = b==0 ? 0 : b*TMath::Log(b/sum*(alpha+1)      );
 
     return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);
Index: trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 7671)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 7672)
@@ -370,5 +370,5 @@
     // Target spectrum
     TF1 flx("Flux", "[0]/1000*(x/1000)^(-2.6)", min, max);
-    flx.SetParameter(0, 1e-6);
+    flx.SetParameter(0, 2e-7);
 
     // Number n0 of events this spectrum would produce per s and m^2
