Index: trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 1951)
@@ -17,5 +17,6 @@
 !
 !   Author(s): Robert Wagner 10/2002 <mailto:magicsoft@rwagner.de>
-!   Copyright: MAGIC Software Development, 2000-2002
+!
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -79,23 +80,25 @@
   if (!fPedestalCam)
     {
-      *fLog << err << dbginf << "MHSigmaPixel: MPedestalCam not found... aborting." << endl;
+      *fLog << err << "MPedestalCam not found... aborting." << endl;
       return kFALSE;
     }
   
   MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigma");
-  MBinning* binspixel = new MBinning();
-  binspixel->SetEdges(fPedestalCam->GetSize(), -0.5, -0.5+fPedestalCam->GetSize());
-  
   if (!binssigma)
     {
-      *fLog << err << dbginf << "MHSigmaPixel: BinningSigma not found... aborting." << endl;
+      *fLog << err << "BinningSigma [MBinning] not found... aborting." << endl;
       return kFALSE;      
-   }
+    }
 
-   SetBinning(&fHist, binspixel, binssigma);
+  const Int_t n = fPedestalCam->GetSize();
 
-   fHist.Sumw2(); 
+  MBinning binspixel;
+  binspixel.SetEdges(n, -0.5, -0.5+n);
 
-   return kTRUE;
+  SetBinning(&fHist, &binspixel, binssigma);
+
+  fHist.Sumw2();
+
+  return kTRUE;
 }
 
@@ -106,9 +109,9 @@
 Bool_t MHSigmaPixel::Fill(const MParContainer *par)
 {
-  MPedestalCam &ped = *(MPedestalCam*)par;
+    const MPedestalCam &ped = *(MPedestalCam*)par;
     for (Int_t i=0;i<(ped.GetSize());i++)
     {
-      const MPedestalPix pix = ped[i];       
-      fHist.Fill(i, pix.GetSigma());
+        const MPedestalPix pix = ped[i];
+        fHist.Fill(i, pix.GetSigma());
     }
     return kTRUE;
Index: trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h	(revision 1951)
@@ -19,5 +19,6 @@
 {
 private:
-    MPedestalCam *fPedestalCam;
+    MPedestalCam *fPedestalCam; //!
+
     TH2D fHist;
 
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1951)
@@ -96,5 +96,5 @@
   if (!fMcEvt)
     {
-       *fLog << err << dbginf << "MHSigmaTheta::SetupFill : MMcEvt not found... aborting." << endl;
+       *fLog << err << "MMcEvt not found... aborting." << endl;
        return kFALSE;
      }
@@ -103,5 +103,5 @@
    if (!fPed)
      {
-       *fLog << dbginf << "MHSigmaTheta::SetupFill : MPedestalCam not found... aborting." << endl;
+       *fLog << err << "MPedestalCam not found... aborting." << endl;
        return kFALSE;
      }
@@ -110,5 +110,5 @@
    if (!fCam)
      {
-       *fLog << dbginf << "MHSigmaTheta::SetupFill : MGeomCam not found (no geometry information available)... aborting." << endl;
+       *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
        return kFALSE;
      }
@@ -117,5 +117,5 @@
    if (!fEvt)
      {
-       *fLog << dbginf << "MHSigmaTheta::SetupFill : MCerPhotEvt not found... aborting." << endl;
+       *fLog << err << "MCerPhotEvt not found... aborting." << endl;
        return kFALSE;
      }
@@ -124,5 +124,5 @@
    if (!fSigmabar)
      {
-       *fLog << dbginf << "MHSigmaTheta::SetupFill : MSigmabar not found... aborting." << endl;
+       *fLog << err << "MSigmabar not found... aborting." << endl;
        return kFALSE;
      }
@@ -132,13 +132,13 @@
    if (!binstheta)
      {
-       *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningTheta not found... aborting." << endl;
+       *fLog << err << "BinningTheta [MBinning] not found... aborting." << endl;
        return kFALSE;      
      }
 
    // Get Sigmabar binning  
-   MBinning* binssigma  = (MBinning*)plist->FindObject("BinningSigmabar");
+   MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigmabar");
    if (!binssigma)
      {
-       *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningSigmabar not found... aborting." << endl;
+       *fLog << err << "BinningSigmabar [MBinning] not found... aborting." << endl;
        return kFALSE;      
      }
@@ -148,5 +148,5 @@
    if (!binsdiff)
      {
-       *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningDiffsigma2 not found... aborting." << endl;
+       *fLog << err << "BinningDiffsigma2 [MBinning] not found... aborting." << endl;
        return kFALSE;      
      }
@@ -154,14 +154,14 @@
 
    // Set binnings in histograms
-   SetBinning(&fSigmaTheta,    binstheta, binssigma);
+   SetBinning(&fSigmaTheta, binstheta, binssigma);
 
    // Get binning for pixel number
-   UInt_t npix = fPed->GetSize();
+   const UInt_t npix = fPed->GetSize();
+
    MBinning binspix("BinningPixel");
-   MBinning* binspixel = &binspix;
-   binspixel->SetEdges(npix, -0.5, ((float)npix)-0.5 ); 
-
-   SetBinning(&fSigmaPixTheta, binstheta, binspixel, binssigma);
-   SetBinning(&fDiffPixTheta,  binstheta, binspixel, binsdiff);
+   binspix.SetEdges(npix, -0.5, -0.5+npix );
+
+   SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma);
+   SetBinning(&fDiffPixTheta,  binstheta, &binspix, binsdiff);
 
    return kTRUE;
@@ -176,9 +176,8 @@
   //*fLog << "entry Fill" << endl;
 
-    Double_t Theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
+    Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
     Double_t mySig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
-    fSigmaTheta.Fill(Theta, mySig);
-
-    //*fLog << "Theta, mySig = " << Theta << ",  " << mySig << endl;
+
+    fSigmaTheta.Fill(theta, mySig);
 
     const UInt_t npix = fEvt->GetNumPixels();
@@ -189,29 +188,20 @@
         continue;
 
+      /*
       if (cerpix.GetNumPhotons() == 0)
         continue;
-
-      Int_t j = cerpix.GetPixId();
-      const MPedestalPix pix = fPed->operator[](j);
-
-      Double_t Sigma = pix.GetMeanRms();
-      Double_t Area  = fCam->GetPixRatio(j);
-
-      fSigmaPixTheta.Fill(Theta, (Double_t)j, Sigma);
-
-      Double_t Diff = Sigma*Sigma/Area - mySig*mySig;
-      fDiffPixTheta.Fill (Theta, (Double_t)j, Diff);
+        */
+
+      const Int_t id = cerpix.GetPixId();
+      const MPedestalPix &pix = (*fPed)[id];
+
+      const Double_t sigma = pix.GetMeanRms();
+      const Double_t area  = fCam->GetPixRatio(id);
+
+      fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
+
+      const Double_t diff = sigma*sigma/area - mySig*mySig;
+      fDiffPixTheta.Fill(theta, (Double_t)id, diff);
     }
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-//  Plot the results
-//
-Bool_t MHSigmaTheta::Finalize()
-{
-    DrawClone();
 
     return kTRUE;
@@ -329,6 +319,5 @@
 {
     if (!gPad)
-        MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta",
-                       600, 600);
+        MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta", 600, 600);
 
     TH1D *h;
@@ -358,6 +347,4 @@
     fSigmaTheta.DrawCopy(opt);
 
-
-
     gPad->Modified();
     gPad->Update();
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 1951)
@@ -14,8 +14,4 @@
 #endif
 
-#ifndef ROOT_TProfile2D
-#include "TProfile2D.h"
-#endif
-
 class MGeomCam;
 class MCerPhotEvt;
@@ -30,15 +26,13 @@
 {
 private:
-    const MGeomCam *fCam; 
-    MPedestalCam   *fPed;
-    MCerPhotEvt    *fEvt; 
-    MSigmabar      *fSigmabar;
-    MMcEvt         *fMcEvt;
+    const MGeomCam *fCam;        //!
+    MPedestalCam   *fPed;        //!
+    MCerPhotEvt    *fEvt;        //!
+    MSigmabar      *fSigmabar;   //!
+    MMcEvt         *fMcEvt;      //!
  
-    TH2D           fSigmaTheta;   // 2D-distribution sigmabar versus Theta;
-                                  // sigmabar is the average pedestasl sigma
-                                  // in an event
-    TH3D           fSigmaPixTheta;// 3D-distr.:Theta, pixel, pedestal sigma
-    TH3D           fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
+    TH2D fSigmaTheta;    // 2D-distribution sigmabar versus Theta; sigmabar is the average pedestasl sigma in an event
+    TH3D fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma
+    TH3D fDiffPixTheta;  // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
 
 
@@ -46,7 +40,6 @@
     MHSigmaTheta(const char *name=NULL, const char *title=NULL);
 
-    virtual Bool_t SetupFill(const MParList *plist);
-    virtual Bool_t Fill(const MParContainer *par);
-    virtual Bool_t Finalize();
+    Bool_t SetupFill(const MParList *plist);
+    Bool_t Fill(const MParContainer *par);
 
     const TH2D *GetSigmaTheta() { return &fSigmaTheta; }
Index: trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 1951)
@@ -76,5 +76,5 @@
    if (!fMcEvt)
    {
-       *fLog << err << dbginf << "MHSigmabarTheta : MMcEvt not found... aborting." << endl;
+       *fLog << err << "MMcEvt not found... aborting." << endl;
        return kFALSE;
    }
@@ -83,13 +83,18 @@
    if (!fSigmabar)
    {
-       *fLog << err << dbginf << "MHSigmabarTheta : MSigmabar not found... aborting." << endl;
+       *fLog << err << "MSigmabar not found... aborting." << endl;
        return kFALSE;
    }
 
+   MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta");
+   if (!binstheta)
+   {
+       *fLog << err << "BinningTheta [MBinning] not found... aborting." << endl;
+       return kFALSE;      
+   }
    MBinning* binssigmabar = (MBinning*)plist->FindObject("BinningSigmabar");
-   MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta");
-   if (!binssigmabar || !binstheta)
+   if (!binssigmabar)
    {
-       *fLog << err << dbginf << "MHSigmabarTheta : At least one MBinning not found... aborting." << endl;
+       *fLog << err << "BinningSigmabar [MBinning] not found... aborting." << endl;
        return kFALSE;      
    }
Index: trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h	(revision 1951)
@@ -19,6 +19,6 @@
 {
 private:
-    MMcEvt    *fMcEvt;
-    MSigmabar *fSigmabar;
+    MMcEvt    *fMcEvt;        //!
+    MSigmabar *fSigmabar;     //!
 
     TH2D fHist;
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1948)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1951)
@@ -156,6 +156,5 @@
     const float sind = sqrt(1.0-cosd*cosd);
 
-
-    float t = h.GetMeanY() - m*h.GetMeanX();
+    const float t = h.GetMeanY() - m*h.GetMeanX();
 
     if (!fUseMmScale)
@@ -163,15 +162,16 @@
 
     // get step size ds along the main axis of the ellipse
-    TAxis &axe = *fStarMap->GetXaxis();
+    const TAxis &axe = *fStarMap->GetXaxis();
     const int   N    = axe.GetNbins();
-    const float xmin = axe.GetBinLowEdge(1);
-    const float xmax = axe.GetBinLowEdge(N+1);
+    const float xmin = axe.GetXmin();
+    const float xmax = axe.GetXmax();
+    // FIXME: Fixed number?
     const float ds   = (xmax-xmin) / 200.0;
 
     if (m>-1 && m<1)
     {
-        float dx = ds * cosd;
-        float  x = xmin + dx/2.0;
-        int   N1 = (int) ((xmax-xmin)/dx+1.0);
+        const float dx = ds * cosd;
+        const float  x = xmin + dx/2.0;
+        const int   N1 = (int) ((xmax-xmin)/dx+1.0);
 
         for (int i=0; i<N1; i++)
@@ -184,12 +184,12 @@
     else
     {
-        TAxis &axe = *fStarMap->GetYaxis();
+        const TAxis &axe = *fStarMap->GetYaxis();
         const int   M    = axe.GetNbins();
-        const float ymin = axe.GetBinLowEdge(1);
-        const float ymax = axe.GetBinLowEdge(M+1);
-
-        float dy = ds * sind;
-        float  y = ymin + dy/2.0;
-        int   M1 = (int) ((ymax-ymin)/dy+1.0);
+        const float ymin = axe.GetXmin();
+        const float ymax = axe.GetXmax();
+
+        const float dy = ds * sind;
+        const float  y = ymin + dy/2.0;
+        const int   M1 = (int) ((ymax-ymin)/dy+1.0);
 
         for (int i=0; i<M1; i++)
