Index: trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.cc	(revision 5348)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.cc	(revision 5349)
@@ -367,4 +367,29 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Set the upper and lower limit for the background region in the alpha plot
+// to estimate the number of background events
+//
+void MSkyPlot::SetAlphaBGLimits(Float_t alphalow, Float_t alphaup)
+{
+    Float_t alphatemp;
+    if (alphalow<0)
+        *fLog << warn << "Alpha<0... taking absolute value." << endl;
+
+    if (alphaup<0)
+        *fLog << warn << "Alpha<0... taking absolute value." << endl;
+
+    if (TMath::Abs(alphaup)<TMath::Abs(alphalow)) {
+        *fLog << warn << "AlphaLow > AlphaUp... exchanging limits." << endl;
+	alphatemp = alphaup;
+	alphaup = alphalow;
+	alphalow = alphatemp;
+    }
+
+    fAlphaBgLow = TMath::Abs(alphalow);
+    fAlphaBgUp  = TMath::Abs(alphaup);
+}
+
 // calculate the values for the cuts:
 Double_t MSkyPlot::CalcLimit(Double_t *a, Double_t ls, Double_t ls2, Double_t dd2)
@@ -701,5 +726,5 @@
 
          // fit parabola to a background region
-         (*alpha_iterator).Fit(fitbgpar,"NWR");  // NWR OK?????????????????????????
+         (*alpha_iterator).Fit(fitbgpar,"EQRN");  // NWR OK?????????????????????????
          // get Chi2
          chisquarefit = fitbgpar->GetChisquare();
Index: trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.h	(revision 5348)
+++ trunk/MagicSoft/Mars/mtemp/mmpi/MSkyPlot.h	(revision 5349)
@@ -144,4 +144,5 @@
 
     void SetAlphaCut(Float_t alpha); 
+    void SetAlphaBGLimits(Float_t alphalow, Float_t alphalup); 
 
     //std::vector <TH1D>::iterator  GetAlphaPlots()      { std::vector <TH1D>::iterator iter; return  iter = fHistAlpha.begin()  ; }
