Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7058)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7059)
@@ -62,5 +62,6 @@
      - for some sceen output the manipulator (inf) was missing
 
-   * msignal/MExtractPINDiode.cc:
+   * msignal/MExtractPINDiode.cc, mcalib/MCalibrationChargeCalc.cc,
+     mcalib/MCalibrationChargeCam.cc:
      - fixed a problem with the fit (it always tried to display
        the fit-function somewhere)
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7058)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 7059)
@@ -1247,5 +1247,5 @@
 
       TH1D *hist = camphes.ProjectionS(TArrayI(),TArrayI(1,&i),"_py",100);
-      hist->Fit("gaus","Q");
+      hist->Fit("gaus","Q0");
       const Float_t mean  = hist->GetFunction("gaus")->GetParameter(1);
       const Float_t sigma = hist->GetFunction("gaus")->GetParameter(2);
@@ -1771,5 +1771,5 @@
 
       TH1D *hist = camffactor.ProjectionS(TArrayI(),area,"_py",100);
-      hist->Fit("gaus","Q");
+      hist->Fit("gaus","Q0");
       const Float_t mean  = hist->GetFunction("gaus")->GetParameter(1);
       const Float_t sigma = hist->GetFunction("gaus")->GetParameter(2);
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 7058)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 7059)
@@ -768,11 +768,11 @@
       // Fix the ranges, as found by Nadia
       if(aidx == 0)
-        {h->Fit("fit","REQ", "",0.4,1.5);}
+        h->Fit(fit, "REQ0", "",0.4,1.5);
       else
-        {h->Fit("fit","REQ", "",1.,5.);}
+        h->Fit(fit ,"REQ0", "",1.,5.);
     }
   else
     {
-      h->Fit("gaus","Q");
+      h->Fit("gaus","Q0");
       fit = h->GetFunction("gaus");
     }
@@ -787,11 +787,11 @@
           // Fix the ranges, as found by Nadia
           if(aidx == 0)
-            {h->Fit("fit","REQ", "",0.4,1.5);}
+            h->Fit(fit, "REQ0", "",0.4,1.5);
           else
-            {h->Fit("fit","REQ", "",1.,5.);}
+            h->Fit(fit, "REQ0", "",1.,5.);
         }
       else
         {
-          h->Fit("gaus","MREQ");
+          h->Fit("gaus","MREQ0");
           fit = h->GetFunction("gaus");
         }
@@ -896,11 +896,11 @@
       // Fix the ranges, as found by Nadia
       if(aidx == 0)
-        {h->Fit("fit","REQ", "",0.07,0.3);}
+        {h->Fit("fit","REQ0", "",0.07,0.3);}
       else
-        {h->Fit("fit","REQ", "",0.15,1.0);}
+        {h->Fit("fit","REQ0", "",0.15,1.0);}
     }
   else
     {
-      h->Fit("gaus","Q");
+      h->Fit("gaus","Q0");
       fit = h->GetFunction("gaus");
     }
@@ -915,11 +915,11 @@
           // Fix the ranges, as found by Nadia
           if(aidx == 0)
-            {h->Fit("fit","REQ", "",0.07,0.3);}
+            {h->Fit("fit","REQ0", "",0.07,0.3);}
           else
-            {h->Fit("fit","REQ", "",0.15,1.0);}
+            {h->Fit("fit","REQ0", "",0.15,1.0);}
         }
       else
         {
-          h->Fit("gaus","MREQ");
+          h->Fit("gaus","MREQ0");
           fit = h->GetFunction("gaus");
         }
Index: /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 7058)
+++ /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 7059)
@@ -354,9 +354,8 @@
     }
 
-  // Must be created manually. Otherwise we cannot use N-option
-  TF1 gaus("func", "gaus");
-
-  fSlices->Fit(&gaus, "QN", "", maxpos-fLowerFitLimit,maxpos+fUpperFitLimit);
-  
+  fSlices->Fit("gaus", "Q0", "", maxpos-fLowerFitLimit,maxpos+fUpperFitLimit);
+
+  TF1 &gaus = *fSlices->GetFunction("gaus");
+
   fPINDiode->SetExtractedSignal(gaus.GetParameter(0), gaus.GetParError(0));
   fPINDiode->SetExtractedTime  (gaus.GetParameter(1), gaus.GetParError(1));
