Index: /trunk/Mars/fact/analysis/gain/fit_spectra.C
===================================================================
--- /trunk/Mars/fact/analysis/gain/fit_spectra.C	(revision 19873)
+++ /trunk/Mars/fact/analysis/gain/fit_spectra.C	(revision 19874)
@@ -23,4 +23,5 @@
 
 // --------------------------------------------------------------------------
+// After fit_spectra_bt2b.C
 
 // Fit function for a single pe spectrum
@@ -35,4 +36,6 @@
     const Double_t expo  = par[6];
 
+    const Double_t P = cross*TMath::Exp(-cross);
+
     Double_t y = 0;
     for (int N=1; N<14; N++)
@@ -41,5 +44,6 @@
         const Double_t sigN = TMath::Sqrt(N*sigma*sigma + noise*noise);
 
-        const Double_t p = TMath::Power(cross, N-1) * TMath::Power(N, -expo);
+        const Double_t p =
+            TMath::Power(N*P, N-1)/TMath::Power(TMath::Factorial(N-1), expo);
 
         y += TMath::Gaus(xx[0], muN, sigN) * p / sigN;
@@ -56,7 +60,10 @@
     Double_t expo  = f.GetParameter(6);
 
+    const Double_t P = cross*TMath::Exp(-cross);
+
     Double_t y = 0;
     for (int N=2; N<14; N++)
-        y +=  TMath::Power(cross,  N-1) * TMath::Power(N, -expo);
+        y += 
+            TMath::Power(N*P, N-1)/TMath::Power(TMath::Factorial(N-1), expo);
 
     return y / (y + 1);
@@ -71,7 +78,10 @@
     const Double_t expo  = func.GetParameter(6);
 
+    const Double_t P = cross*TMath::Exp(-cross);
+
     Double_t sum = 0;
     for (int N=1; N<14; N++)
-        sum += TMath::Power(cross, N-1) * TMath::Power(N, -expo);
+        sum +=
+            TMath::Power(N*P, N-1)/TMath::Power(TMath::Factorial(N-1), expo);
 
     const Double_t scale = hist.GetBinWidth(1);
@@ -383,4 +393,5 @@
     if (!fixednoise)
         func.SetParLimits(5, 0, 150);          // Noise
+    func.SetParLimits(6, 0, 2);            // Expo
 
     func.SetParameter(0, ampl);                         // Amplitude
@@ -394,5 +405,5 @@
         func.SetParameter(5, 0.1*maxpos);               // Noise
 
-    func.SetParameter(6, 0.4);                          // Expo
+    func.SetParameter(6, 0.95);                         // Expo
 
     func.SetRange(fitmin, fitmax);
