Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8956)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8957)
@@ -89,4 +89,22 @@
        the default was not correctly treated because char* was 
        compared with char*
+
+   * mbase/MLog.cc, mbase/MMath.cc, mbase/MParContainer.cc,
+     mcalib/MCalibrateData.cc, mcalib/MCalibrationPulseTimeCam.cc,
+     mhbase/MBinning.h, mhbase/MH.cc, mhbase/MHMatrix.cc,
+     mhbase/MHn.cc, mhcalib/MHCalibrationChargeCam.cc, mhflux/MHDisp.cc,
+     mimage/MCameraSmooth.cc, mimage/MConcentration.cc,
+     mjobs/MJCalibration.cc, mjoptim/MJOptimize.cc,
+     mjtrain/MJTrainSeparation.cc, mmuon/MMuonSearchPar.cc,
+     mreport/MReportCurrents.cc, mreport/MReportRun.cc,
+     mtools/MChisqEval.cc:
+     - fixed some cast-away constness warnings
+     - fixed some shadow declarations
+
+   * mhbase/MH.[h,cc]:
+     - removed an old obsolete workaround (ProjectionX/Y)
+
+   * mimage/Makefile, mimage/IMageLinkDef.h:
+     - removed MCameraSmooth
 
 
Index: trunk/MagicSoft/Mars/mbase/MLog.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mbase/MLog.cc	(revision 8957)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MLog.cc,v 1.59 2008-01-11 10:37:01 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MLog.cc,v 1.60 2008-06-14 15:55:50 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -663,5 +663,5 @@
 {
     // gcc 3.2:
-    char *txt = (char*)"logXXXXXX";
+    const char *txt = "logXXXXXX";
 
     TString n(fname ? fname : txt);
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8957)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.37 2007-08-17 10:53:48 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.38 2008-06-14 15:55:50 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -128,4 +128,30 @@
 }
 
+/*
+Double_t MMath::SignificanceLiMaErr(Double_t s, Double_t b, Double_t alpha)
+{
+    Double_t S = SignificanceLiMa(s, b, alpha);
+    if (S<0)
+        return -1;
+
+    const Double_t sum = s+b;
+
+
+    Double_t l = TMath::Log(s/sum*(alpha+1)/alpha)/TMath::Sqrt(2*S);
+    Double_t m = TMath::Log(s/sum*(alpha+1)/alpha)/TMath::Sqrt(2*S);
+
+
+    const Double_t sum = s+b;
+
+    if (s<0 || b<0 || alpha<=0)
+        return -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);
+}
+*/
+
 // --------------------------------------------------------------------------
 //
@@ -752,10 +778,10 @@
         static const Double_t sqrt3 = TMath::Sqrt(3.);
 
-        const Double_t s = TMath::Sin(t)*sqrt3;
-        const Double_t c = TMath::Cos(t);
-
-        x1 = 2*sqrtq *      c  - a/3;
-        x2 =  -sqrtq * (s + c) - a/3;
-        x3 =   sqrtq * (s - c) - a/3;
+        const Double_t sn = TMath::Sin(t)*sqrt3;
+        const Double_t cs = TMath::Cos(t);
+
+        x1 = 2*sqrtq *       cs  - a/3;
+        x2 =  -sqrtq * (sn + cs) - a/3;
+        x3 =   sqrtq * (sn - cs) - a/3;
 
         /* --- Easier to understand but slower ---
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 8957)
@@ -359,5 +359,5 @@
         return kFALSE;
 
-    /*const*/ TMethodCall *call = ((TDataMember*)member)->GetterMethod(); //FIXME: Root
+    /*const*/ TMethodCall *call = const_cast<TDataMember*>(member)->GetterMethod(); //FIXME: Root
     if (!call)
     {
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 8957)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.70 2007-07-18 19:30:12 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.71 2008-06-14 15:55:51 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -558,10 +558,10 @@
                 // Correct for global shifts in light emission
                 // 
-                const MCalibrationChargePix &ugpix = (MCalibrationChargePix&)updatecam->GetAverageArea(0);
+                const MCalibrationChargePix &ugpix = static_cast<const MCalibrationChargePix&>(updatecam->GetAverageArea(0));
 
                 const Float_t globmean = avpix.GetConvertedMean();
                 calibUpdate = globmean==0 ? 1 : ugpix.GetConvertedMean()/globmean;
 
-                MBadPixelsPix &ubad  = (MBadPixelsPix&)updatecam->GetAverageBadArea(0);
+                const MBadPixelsPix &ubad  = static_cast<const MBadPixelsPix&>(updatecam->GetAverageBadArea(0));
                 if (ubad.IsUncalibrated(MBadPixelsPix::kChargeIsPedestal))
                   {
@@ -698,7 +698,7 @@
 // shall be calibrated, respectively. 
 //
-Int_t MCalibrateData::Calibrate(Bool_t data, Bool_t pedestal) const
-{
-    if (!data && !pedestal)
+Int_t MCalibrateData::Calibrate(Bool_t data, Bool_t doped) const
+{
+    if (!data && !doped)
         return kTRUE;
 
@@ -763,5 +763,5 @@
         } /* if (data) */
       
-        if (pedestal)
+        if (doped)
         {
             TIter NextPed(&fPedestalCams);
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationPulseTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationPulseTimeCam.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationPulseTimeCam.cc	(revision 8957)
@@ -199,8 +199,8 @@
   Float_t area = cam[idx].GetA();
 
- if (area == 0)
+  if (area == 0)
     return kFALSE;
 
- MCalibrationPix &pix = (MCalibrationPix&)(*this)[idx];
+  const MCalibrationPix &pix = static_cast<const MCalibrationPix&>((*this)[idx]);
 
   switch (type)
Index: trunk/MagicSoft/Mars/mhbase/MBinning.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 8956)
+++ trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 8957)
@@ -94,5 +94,5 @@
     Int_t GetNumBins() const   { return fEdges.GetSize()-1; }
 
-    Double_t *GetEdges() const { return (Double_t*)fEdges.GetArray(); }
+    const Double_t *GetEdges() const { return fEdges.GetArray(); }
     const TArrayD &GetEdgesD() const { return fEdges; }
 
Index: trunk/MagicSoft/Mars/mhbase/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 8957)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.38 2008-06-02 17:21:24 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.39 2008-06-14 15:55:52 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -554,5 +554,5 @@
     if (h->InheritsFrom(TH3::Class()) && x->InheritsFrom(TH3::Class()))
     {
-        SetBinning((TH3*)h, ((TH1*)x)->GetXaxis(), ((TH1*)x)->GetYaxis(), ((TH1*)x)->GetZaxis());
+        SetBinning((TH3*)h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis());
         return;
     }
@@ -561,5 +561,5 @@
     if (h->InheritsFrom(TH2::Class()) && x->InheritsFrom(TH2::Class()))
     {
-        SetBinning((TH2*)h, ((TH1*)x)->GetXaxis(), ((TH1*)x)->GetYaxis());
+        SetBinning((TH2*)h, x->GetXaxis(), x->GetYaxis());
         return;
     }
@@ -568,5 +568,5 @@
     if (h->InheritsFrom(TH1::Class()) && x->InheritsFrom(TH1::Class()))
     {
-        SetBinning(h, ((TH1*)x)->GetXaxis());
+        SetBinning(h, x->GetXaxis());
         return;
     }
@@ -869,5 +869,5 @@
     // Draw first histogram
     //
-    TH1 *h1 = ((TH1&)hist1).DrawCopy();
+    TH1 *h1 = hist1.DrawCopy();
     gPad->SetBorderMode(0);
     gPad->Update();
@@ -921,5 +921,5 @@
     // Draw second histogram
     //
-    TH1 *h2 = ((TH1&)hist2).DrawCopy("sames");
+    TH1 *h2 = hist2.DrawCopy("sames");
     gPad->Update();
 
@@ -1208,104 +1208,4 @@
 }
 
-void MH::ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin, Int_t lastybin)
-{
-    //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-*
-    //*-*      ====================================================
-    //
-    //   The projection dest is always of the type TH1D.
-    //   The projection is made from the channels along the Y axis
-    //   ranging from firstybin to lastybin included.
-    //   By default, bins 1 to ny are included
-    //   When all bins are included, the number of entries in the projection
-    //   is set to the number of entries of the 2-D histogram, otherwise
-    //   the number of entries is incremented by 1 for all non empty cells.
-    //
-    //   if Sumw2() was called for dest, the errors are computed.
-    //
-    TAxis &axex = *((TH2&)src).GetXaxis();
-    TAxis &axey = *((TH2&)src).GetYaxis();
-
-    const Int_t nx = axex.GetNbins();
-    const Int_t ny = axey.GetNbins();
-    if (firstybin < 0)
-        firstybin = 1;
-    if (lastybin > ny)
-        lastybin = ny;
-
-    dest.Reset();
-    SetBinning(&dest, &axex);
-
-    // Create the projection histogram
-    const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0;
-
-    // Fill the projected histogram
-    for (Int_t binx=0; binx<=nx+1; binx++)
-    {
-        Double_t err2 = 0;
-        for (Int_t biny=firstybin; biny<=lastybin; biny++)
-        {
-            const Double_t cont = src.GetCellContent(binx,biny);
-            const Double_t err1 = src.GetCellError(binx,biny);
-            err2 += err1*err1;
-            if (cont)
-                dest.Fill(axex.GetBinCenter(binx), cont);
-        }
-        if (computeErrors)
-            dest.SetBinError(binx, TMath::Sqrt(err2));
-    }
-    if (firstybin <=1 && lastybin >= ny)
-        dest.SetEntries(src.GetEntries());
-}
-
-void MH::ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin, Int_t lastxbin)
-{
-    //*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-*
-    //*-*      ====================================================
-    //
-    //   The projection dest is always of the type TH1D.
-    //   The projection is made from the channels along the Y axis
-    //   ranging from firstybin to lastybin included.
-    //   By default, bins 1 to ny are included
-    //   When all bins are included, the number of entries in the projection
-    //   is set to the number of entries of the 2-D histogram, otherwise
-    //   the number of entries is incremented by 1 for all non empty cells.
-    //
-    //   if Sumw2() was called for dest, the errors are computed.
-    //
-    TAxis &axex = *((TH2&)src).GetXaxis();
-    TAxis &axey = *((TH2&)src).GetYaxis();
-
-    const Int_t nx = axex.GetNbins();
-    const Int_t ny = axey.GetNbins();
-    if (firstxbin < 0)
-        firstxbin = 1;
-    if (lastxbin > nx)
-        lastxbin = nx;
-
-    dest.Reset();
-    SetBinning(&dest, &axey);
-
-    // Create the projection histogram
-    const Bool_t computeErrors = dest.GetSumw2N() ? 1 : 0;
-
-    // Fill the projected histogram
-    for (Int_t biny=0; biny<=ny+1; biny++)
-    {
-        Double_t err2 = 0;
-        for (Int_t binx=firstxbin; binx<=lastxbin; binx++)
-        {
-            const Double_t cont = src.GetCellContent(binx,biny);
-            const Double_t err1 = src.GetCellError(binx,biny);
-            err2 += err1*err1;
-            if (cont)
-                dest.Fill(axey.GetBinCenter(biny), cont);
-        }
-        if (computeErrors)
-            dest.SetBinError(biny, TMath::Sqrt(err2));
-    }
-    if (firstxbin <=1 && lastxbin >= nx)
-        dest.SetEntries(src.GetEntries());
-}
-
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhbase/MH.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MH.h	(revision 8956)
+++ trunk/MagicSoft/Mars/mhbase/MH.h	(revision 8957)
@@ -119,7 +119,4 @@
                               const char* name="ProjectArray", const char* title="Projected Array");
     
-    static void ProjectionX(TH1D &dest, const TH2 &src, Int_t firstybin=-1, Int_t lastybin=9999);
-    static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999);
-
     static void GetRangeUser(const TH1 &hist, Axis_t &lo, Axis_t &hi);
     static void GetRangeUserX(const TH1 &hist, Axis_t &lo, Axis_t &hi);
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 8957)
@@ -783,14 +783,14 @@
 
     th1->cd(1);
-    ((TH1&)hth).DrawCopy();   // real histogram before
+    hth.DrawCopy();   // real histogram before
 
     th1->cd(2);
-    ((TH1&)hta).DrawCopy();   // histogram after
+    hta.DrawCopy();   // histogram after
 
     th1->cd(3);
-    ((TH1&)hthd).DrawCopy();  // correction factors
+    hthd.DrawCopy();  // correction factors
 
     th1->cd(4);
-    ((TH1&)thsh).DrawCopy();  // target
+    thsh.DrawCopy();  // target
 }
 
@@ -895,5 +895,5 @@
     SetBinning(&hthd, &thsh);
     hthd.SetDirectory(NULL);
-    hthd.Divide((TH1F*)&thsh, &hth, 1, 1);
+    hthd.Divide(&thsh, &hth, 1, 1);
 
     if (hthd.GetMaximum() <= 0)
Index: trunk/MagicSoft/Mars/mhbase/MHn.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHn.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mhbase/MHn.cc	(revision 8957)
@@ -584,10 +584,10 @@
     for (int i=0; i<fNum; i++)
     {
-        TString opt(fDrawOption[i]);
+        TString dopt(fDrawOption[i]);
         if (same)
-            opt += " same";
+            dopt += " same";
 
         pad->cd(i+1);
-        fHist[i]->Draw(opt);
-    }
-}
+        fHist[i]->Draw(dopt);
+    }
+}
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 8957)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.60 2007-06-12 20:50:30 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.61 2008-06-14 15:55:53 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -743,7 +743,7 @@
   }
 
-  const Int_t npix = fRawEvt->GetNumPixels();
-  const Int_t nhi  = fRunHeader->GetNumSamplesHiGain();
-  for (int pixid=0; pixid<npix; pixid++)
+  const Int_t num = fRawEvt->GetNumPixels();
+  const Int_t nhi = fRunHeader->GetNumSamplesHiGain();
+  for (int pixid=0; pixid<num; pixid++)
   {
       MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)(*this)[pixid];
Index: trunk/MagicSoft/Mars/mhflux/MHDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHDisp.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mhflux/MHDisp.cc	(revision 8957)
@@ -243,5 +243,5 @@
     const Int_t    bz     = fHist.GetZaxis()->FindFixBin(0);
 
-    TH2 &bg = fHalf ? fHistBg1 : fHistBg2;
+    TH2 &hbg = fHalf ? fHistBg1 : fHistBg2;
 
     const Bool_t smear = fSmearing>0;
@@ -249,5 +249,5 @@
     {
         if (!fHistOff)
-            bg.Fill(pos1.X(), pos1.Y(), w*w0);
+            hbg.Fill(pos1.X(), pos1.Y(), w*w0);
         else
             fHist.Fill(pos1.X(), pos1.Y(), 0.0, w*w0);
@@ -276,5 +276,5 @@
                         const Double_t rc = TMath::Exp(-dp)/normg;
                         if (!fHistOff)
-                            bg.AddBinContent(bg.GetBin(x, y), rc);
+                            hbg.AddBinContent(hbg.GetBin(x, y), rc);
                         else
                             fHist.AddBinContent(fHist.GetBin(x, y, bz), rc);
@@ -310,5 +310,5 @@
 
     if (!fHistOff)
-        bg.SetEntries(bg.GetEntries()+1);
+        hbg.SetEntries(hbg.GetEntries()+1);
     else
         fHist.SetEntries(fHist.GetEntries()+1);
Index: trunk/MagicSoft/Mars/mimage/ImageLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/ImageLinkDef.h	(revision 8956)
+++ trunk/MagicSoft/Mars/mimage/ImageLinkDef.h	(revision 8957)
@@ -6,5 +6,4 @@
 
 #pragma link C++ class MImgCleanStd+;
-#pragma link C++ class MCameraSmooth+;
 
 #pragma link C++ class MHillas+;
Index: trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc	(revision 8957)
@@ -110,5 +110,5 @@
             const MGeomPix &gpix = (*fGeomCam)[i];
 
-            const Int_t n = gpix.GetNumNeighbors();
+            const Int_t nn = gpix.GetNumNeighbors();
 
             Int_t num  = fUseCentralPixel ? 1 : 0;
@@ -116,5 +116,5 @@
             errors[i]  = fUseCentralPixel ? pix.GetErrorPhot()  : 0;
 
-            for (int j=0; j<n; j++)
+            for (int j=0; j<nn; j++)
             {
                 const UShort_t nid = gpix.GetNeighbor(j);
Index: trunk/MagicSoft/Mars/mimage/MConcentration.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MConcentration.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mimage/MConcentration.cc	(revision 8957)
@@ -111,11 +111,11 @@
 
    const UInt_t npix = evt.GetNumPixels();
-   for (UInt_t i=0; i<npix; i++)
+   for (UInt_t j=0; j<npix; j++)
    {
-       const MSignalPix &pix = evt[i];
+       const MSignalPix &pix = evt[j];
        if (!pix.IsPixelUsed())
            continue;
 
-        const Double_t nphot = pix.GetNumPhotons()* geom.GetPixRatio(i);
+        const Double_t nphot = pix.GetNumPhotons()* geom.GetPixRatio(j);
 
 	// Get number of photons in the 8 most populated pixels	
@@ -134,6 +134,6 @@
                 continue;
 
-            for(int j=0;j<i-1;j++)
-                maxpix[7-j]=maxpix[6-j];                 // [#phot]
+            for(int k=0;k<i-1;k++)
+                maxpix[7-k]=maxpix[6-k];                 // [#phot]
 
             maxpix[8-i]=nphot;
Index: trunk/MagicSoft/Mars/mimage/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mimage/Makefile	(revision 8956)
+++ trunk/MagicSoft/Mars/mimage/Makefile	(revision 8957)
@@ -27,5 +27,4 @@
 
 SRCFILES = MImgCleanStd.cc \
-           MCameraSmooth.cc \
            MHillas.cc \
            MHillasSrc.cc \
Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 8957)
@@ -917,19 +917,19 @@
           gPad->SetBorderMode(0);
           gPad->SetTicks();
-          MHCamera *obj10=(MHCamera*)disp30.DrawCopy("hist");
+          MHCamera *obj12=(MHCamera*)disp30.DrawCopy("hist");
           //
           // for the datacheck, fix the ranges!!
           //
-          obj10->SetMinimum(fTimeOffsetMin);
-          obj10->SetMaximum(fTimeOffsetMax);
+          obj12->SetMinimum(fTimeOffsetMin);
+          obj12->SetMaximum(fTimeOffsetMax);
           //
           // Set the datacheck sizes:
           //
-          FixDataCheckHist((TH1D*)obj10);
-          obj10->SetStats(kFALSE);
+          FixDataCheckHist((TH1D*)obj12);
+          obj12->SetStats(kFALSE);
           //
           // set reference lines
           //
-          DisplayReferenceLines(obj10,5);
+          DisplayReferenceLines(obj12,5);
       
           c5.cd(3);
@@ -949,24 +949,24 @@
           gPad->SetBorderMode(0);
           gPad->SetTicks();
-          MHCamera *obj11=(MHCamera*)disp31.DrawCopy("hist");
+          MHCamera *obj13=(MHCamera*)disp31.DrawCopy("hist");
           //
           // for the datacheck, fix the ranges!!
           //
-          obj11->SetMinimum(fTimeResolutionMin);
-          obj11->SetMaximum(fTimeResolutionMax);
+          obj13->SetMinimum(fTimeResolutionMin);
+          obj13->SetMaximum(fTimeResolutionMax);
           //
           // Set the datacheck sizes:
           //
-          FixDataCheckHist((TH1D*)obj11);
-          obj11->SetStats(kFALSE);
+          FixDataCheckHist((TH1D*)obj13);
+          obj13->SetStats(kFALSE);
           //
           // set reference lines
           //
-          DisplayReferenceLines(obj11,6);
+          DisplayReferenceLines(obj13,6);
           
           c5.cd(4);
           gPad->SetBorderMode(0);
-          obj11->SetPrettyPalette();
-          obj11->Draw();
+          obj13->SetPrettyPalette();
+          obj13->Draw();
           
           c5.cd(6);
@@ -1151,10 +1151,10 @@
             disp34.CamDraw(c32, 2, 2, 0);
 
-            MHCalibrationCam *cam = (MHCalibrationCam*)plist.FindObject("MHCalibrationRelTimeCam");
+            MHCalibrationCam *ccam = (MHCalibrationCam*)plist.FindObject("MHCalibrationRelTimeCam");
             
-            for (Int_t sector=1;sector<cam->GetAverageSectors();sector++)
+            for (Int_t sector=1;sector<ccam->GetAverageSectors();sector++)
             {
-                cam->GetAverageHiGainSector(sector).DrawClone("fourierevents");
-                cam->GetAverageLoGainSector(sector).DrawClone("fourierevents");
+                ccam->GetAverageHiGainSector(sector).DrawClone("fourierevents");
+                ccam->GetAverageLoGainSector(sector).DrawClone("fourierevents");
             }
 
Index: trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc
===================================================================
--- trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8957)
@@ -413,9 +413,9 @@
 Int_t MJOptimize::Minuit(TMinuit &minuit, const char *cmd) const
 {
-    Int_t err;
+    Int_t er;
     Double_t tmp[2] = { fNumMaxCalls, fTolerance };
-    minuit.mnexcm(cmd, tmp, 2, err);
-
-    switch (err)
+    minuit.mnexcm(cmd, tmp, 2, er);
+
+    switch (er)
     {
     case 0:
@@ -461,5 +461,5 @@
     }
 
-    return err;
+    return er;
 }
 
Index: trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 8957)
@@ -227,9 +227,9 @@
         const Float_t s = gx->Integral(1, y+1);
         const Float_t b = hx->Integral(1, y+1);
-        const Float_t sig1 = MMath::SignificanceLiMa(s+b, b);
-        const Float_t sig2 = s<1 ? 0 : MMath::SignificanceLiMa(s+b, b)*TMath::Log10(s);
-
-        gr3.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sig1);
-        gr4.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sig2);
+        const Float_t sg1 = MMath::SignificanceLiMa(s+b, b);
+        const Float_t sg2 = s<1 ? 0 : MMath::SignificanceLiMa(s+b, b)*TMath::Log10(s);
+
+        gr3.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sg1);
+        gr4.SetPoint(y, h.GetYaxis()->GetBinLowEdge(y+2), sg2);
     }
     delete hx;
Index: trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc
===================================================================
--- trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 8957)
@@ -228,7 +228,7 @@
 
     // Perform Simplex minimization
-    Int_t err;
+    Int_t er;
     Double_t tmp[2] = { 0, 0 };
-    minuit.mnexcm("simplex", tmp, 2, err);
+    minuit.mnexcm("simplex", tmp, 2, er);
 
     // Get resulting parameters
Index: trunk/MagicSoft/Mars/mreport/MReportCurrents.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mreport/MReportCurrents.cc	(revision 8957)
@@ -94,6 +94,6 @@
         pos += 4;
 
-        const Int_t n=sscanf(hex, "%4x", &c);
-        if (n!=1)
+        const Int_t nn=sscanf(hex, "%4x", &c);
+        if (nn!=1)
         {
             *fLog << warn << "WARNING - Reading hexadecimal DC information." << endl;
Index: trunk/MagicSoft/Mars/mreport/MReportRun.cc
===================================================================
--- trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mreport/MReportRun.cc	(revision 8957)
@@ -85,7 +85,6 @@
     if (ver>=200805190)
     {
-        Int_t len;
-        const Int_t n=sscanf(str.Data(), "%d %n", &file, &len);
-        if (n!=1)
+        const Int_t nn=sscanf(str.Data(), "%d %n", &file, &len);
+        if (nn!=1)
         {
             *fLog << warn << "WARNING - Wrong number of arguments." << endl;
Index: trunk/MagicSoft/Mars/mtools/MChisqEval.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 8956)
+++ trunk/MagicSoft/Mars/mtools/MChisqEval.cc	(revision 8957)
@@ -146,10 +146,10 @@
     const Double_t y2 = fData1 ? fData1->GetValue() : 0;
 
-    const Double_t dy  = y2-y1;
-    const Double_t err = fData1 ? y1*y2 : 1;
+    const Double_t dy = y2-y1;
+    const Double_t er = fData1 ? y1*y2 : 1;
 
-    const Double_t w   = fWeight ? fWeight->GetVal() : 1;
+    const Double_t w  = fWeight ? fWeight->GetVal() : 1;
 
-    fChisq += w*dy*dy/err;
+    fChisq += w*dy*dy/er;
     fSumW  += w;
 
