Index: trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc	(revision 7409)
+++ trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc	(revision 7442)
@@ -47,4 +47,5 @@
 
 #include <TRandom.h>
+#include <TFeldmanCousins.h>
 
 #include <TLine.h>
@@ -256,4 +257,24 @@
 
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Calculate the upper limit for fEventsSignal number of observed events
+// and fEventsBackground number of background events.
+//
+// Therefor TFeldmanCousin is used.
+//
+// The Feldman-Cousins method as described in PRD V57 #7, p3873-3889
+//
+Double_t MAlphaFitter::CalcUpperLimit() const
+{
+    // get a FeldmanCousins calculation object with the default limits
+    // of calculating a 90% CL with the minimum signal value scanned
+    // = 0.0 and the maximum signal value scanned of 50.0
+    TFeldmanCousins f;
+    f.SetMuStep(0.05);
+    f.SetMuMax(100);
+    return f.CalculateUpperLimit(fEventsSignal, fEventsBackground);
 }
 
@@ -315,6 +336,6 @@
     TF1 *fcn = f.fFunc;
     f.fFunc = new TF1(*fFunc);
+    f.fFunc->SetName("Dummy");
     gROOT->GetListOfFunctions()->Remove(f.fFunc);
-    f.fFunc->SetName("Dummy");
     delete fcn;
 }
Index: trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h	(revision 7409)
+++ trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h	(revision 7442)
@@ -53,6 +53,6 @@
     SignalFunc_t fSignalFunc;   // Type of signal function
     // Result
-    Double_t fSignificance;     // significance of signal
-    Double_t fSignificanceExc;  // significance of excess
+    Double_t fSignificance;     // significance of an unknown signal (Li/Ma 17)
+    Double_t fSignificanceExc;  // significance of a known excess    (Li/Ma 5)
     Double_t fEventsExcess;     // calculated number of excess events (signal-bg)
     Double_t fEventsSignal;     // calculated number of signal events
@@ -88,6 +88,6 @@
         fTitle = title ? title : "Fit alpha";
 
+        fFunc->SetName("Dummy");
         gROOT->GetListOfFunctions()->Remove(fFunc);
-        fFunc->SetName("Dummy");
 
         Clear();
@@ -147,6 +147,6 @@
         }
         fSignalFunc=func;
+        fFunc->SetName("Dummy");
         gROOT->GetListOfFunctions()->Remove(fFunc);
-        fFunc->SetName("Dummy");
         fCoefficients.Set(3+fPolynomOrder+1);
         fCoefficients.Reset();
@@ -175,4 +175,6 @@
     Double_t Eval(Double_t d) const { return fFunc ? fFunc->Eval(d) : 0; }
 
+    Double_t CalcUpperLimit() const;
+
     // Interface to fit
     Bool_t Fit(TH1D &h, Bool_t paint=kFALSE);
