Index: trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1552)
+++ trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1557)
@@ -21,5 +21,5 @@
 #pragma link C++ class MMcPedestalNSBAdd+;
 
-#pragma link C++ class MHadroness+;
+#pragma link C++ class MHadronness+;
 
 #pragma link C++ class MCompProbCalc+;
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc	(revision 1552)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc	(revision 1557)
@@ -123,5 +123,5 @@
 
     while (pixel.Next())
-      {
+    {
 	Byte_t *ptr = pixel.GetHiGainSamples();
 	const Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples();
@@ -134,43 +134,49 @@
 	Int_t slicelocal=0;
 
-	Float_t nphot;
-	Float_t pedes, sigmaped;
-
-	do 
-	  {
-	    sumlocal = 0;
-	    for(Int_t i = 0; i<5;i++)
-	      sumlocal+=*(ptr+i);
-	    if (sumpeak < sumlocal){
-	      slice=slicelocal;
-	      sumpeak = sumlocal;
-	    }
-	    slicelocal++;
+	do
+        {
+            sumlocal = 0;
+            for (Int_t i = 0; i<5;i++)
+                sumlocal += *(ptr+i);
+
+            if (sumpeak < sumlocal)
+            {
+                slice=slicelocal;
+                sumpeak = sumlocal;
+            }
+
+            slicelocal++;
 	    sum += *ptr;
-	  }
-	while (++ptr != limit);
-
-	do sum += *ptr;
-	while (++ptr != end);
-
-	pedes = (Float_t)(sum-sumpeak)/(fRawEvt->GetNumHiGainSamples()-5);
-	nphot=(Float_t)sumpeak - 5.0*pedes;
-	sigmaped=0;
-	sumlocal=0;
-	slicelocal=0;
+        } while (++ptr != limit);
+
+        do sum += *ptr;
+        while (++ptr != end);
+
+        Float_t pedes = (Float_t)(sum-sumpeak)/(fRawEvt->GetNumHiGainSamples()-5);
+        Float_t nphot = (Float_t)sumpeak - 5.0*pedes;
+
+        Float_t sigmaped=0;
+
+        slicelocal=0;
+        sumlocal = 0;
 
 	ptr = pixel.GetHiGainSamples();
-	do {
-	  if (slicelocal==slice)
-	    ptr+=4;
-	  else{
-	    sumlocal=*ptr;
-	    sigmaped+=((Float_t)sumlocal-pedes)*((Float_t)sumlocal-pedes);
-	  }
-	  slicelocal++;
+        do
+        {
+            if (slicelocal==slice)
+                ptr += 4;
+            else
+            {
+                sumlocal = *ptr;
+
+                const Float_t d = (Float_t)sumlocal-pedes;
+                sigmaped += d*d;
+            }
+            slicelocal++;
 	}
-	while(++ptr != end);
-	sigmaped/=(fRawEvt->GetNumHiGainSamples()-5);
-	sigmaped=sqrt(sumlocal);
+        while (++ptr != end);
+
+	sigmaped /= (fRawEvt->GetNumHiGainSamples()-5);
+	sigmaped = sqrt(sumlocal);
 
 	const UInt_t pixid = pixel.GetPixelId();
@@ -188,5 +194,5 @@
 
         fCerPhotEvt->AddPixel(pixid, nphot, sigmaped/2.236);
-	ped.SetPedestal(pedes,sigmaped);
+	ped.SetPedestal(pedes, sigmaped);
 	ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5),
 			   sigmaped/sqrt(2*(fRawEvt->GetNumHiGainSamples()-5)));
Index: trunk/MagicSoft/Mars/manalysis/MHadroness.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadroness.cc	(revision 1552)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * This file is part of MARS, the MAGIC Analysis and Reconstruction
-! * Software. It is distributed to you in the hope that it can be a useful
-! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
-! * It is distributed WITHOUT ANY WARRANTY.
-! *
-! * Permission to use, copy, modify and distribute this software and its
-! * documentation for any purpose is hereby granted without fee,
-! * provided that the above copyright notice appear in all copies and
-! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Thomas Bretz 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHadroness
-//
-// The Value must be in the range [0,1]
-// It should be the value used for gamma/hadron seperation.
-// For quality histograms look at MHHadroness
-//
-/////////////////////////////////////////////////////////////////////////////
-#include "MHadroness.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MHadroness);
-
-// --------------------------------------------------------------------------
-//
-// Default constructor.
-//
-MHadroness::MHadroness(const char *name, const char *title)
-    : fHadroness(-1)
-{
-    fName  = name  ? name  : "MHadroness";
-    fTitle = title ? title : "Storage container for hadroness value";
-}
-
-// --------------------------------------------------------------------------
-//
-// Reset hadroness, -1 indicates: invalid value
-//
-void MHadroness::Reset()
-{
-    fHadroness = -1;
-}
-
-// --------------------------------------------------------------------------
-//
-// Print the hillas Parameters to *fLog
-//
-void MHadroness::Print(Option_t *) const
-{
-    *fLog << all << GetDescriptor() << ": Hadroness = " << fHadroness << endl;
-}
-
Index: trunk/MagicSoft/Mars/manalysis/MHadroness.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadroness.h	(revision 1552)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#ifndef MARS_MHadroness
-#define MARS_MHadroness
-
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
-#endif
-
-class MHadroness : public MParContainer
-{
-private:
-    Double_t fHadroness; // [0,1] Hadroness
-
-public:
-    MHadroness(const char *name=NULL, const char *title=NULL);
-
-    void Reset();
-
-    virtual void Print(Option_t *opt=NULL) const;
-
-    Double_t GetHadroness() const { return fHadroness; }
-    void     SetHadroness(Double_t h) { fHadroness = h; }
-
-    ClassDef(MHadroness, 1) // Storage Container for the hadroness
-};
-
-#endif
Index: trunk/MagicSoft/Mars/manalysis/MHadronness.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadronness.cc	(revision 1557)
+++ trunk/MagicSoft/Mars/manalysis/MHadronness.cc	(revision 1557)
@@ -0,0 +1,69 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MHadronness
+//
+// The Value must be in the range [0,1]
+// It should be the value used for gamma/hadron seperation.
+// For quality histograms look at MHHadronness
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MHadronness.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHadronness);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MHadronness::MHadronness(const char *name, const char *title)
+    : fHadronness(-1)
+{
+    fName  = name  ? name  : "MHadronness";
+    fTitle = title ? title : "Storage container for hadroness value";
+}
+
+// --------------------------------------------------------------------------
+//
+// Reset hadroness, -1 indicates: invalid value
+//
+void MHadronness::Reset()
+{
+    fHadronness = -1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the hillas Parameters to *fLog
+//
+void MHadronness::Print(Option_t *) const
+{
+    *fLog << all << GetDescriptor() << ": Hadronness = " << fHadronness << endl;
+}
+
Index: trunk/MagicSoft/Mars/manalysis/MHadronness.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHadronness.h	(revision 1557)
+++ trunk/MagicSoft/Mars/manalysis/MHadronness.h	(revision 1557)
@@ -0,0 +1,26 @@
+#ifndef MARS_MHadronness
+#define MARS_MHadronness
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MHadronness : public MParContainer
+{
+private:
+    Double_t fHadronness; // [0,1] Hadronness
+
+public:
+    MHadronness(const char *name=NULL, const char *title=NULL);
+
+    void Reset();
+
+    virtual void Print(Option_t *opt=NULL) const;
+
+    Double_t GetHadronness() const { return fHadronness; }
+    void     SetHadronness(Double_t h) { fHadronness = h; }
+
+    ClassDef(MHadronness, 1) // Storage Container for the hadroness
+};
+
+#endif
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 1552)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 1557)
@@ -54,5 +54,5 @@
 #include "MDataArray.h"
 
-#include "MHadroness.h"
+#include "MHadronness.h"
 
 ClassImp(MMultiDimDistCalc);
@@ -149,6 +149,6 @@
     }
 
-    fHadroness = (MHadroness*)plist->FindCreateObj("MHadroness");
-    if (!fHadroness)
+    fHadronness = (MHadronness*)plist->FindCreateObj("MHadronness");
+    if (!fHadronness)
         return kFALSE;
 
@@ -200,6 +200,6 @@
     Double_t dh = fMHadrons->CalcDist(event, numh);
 
-    //fHadroness->SetHadroness(dg/(dg+dh));
-    fHadroness->SetHadroness(exp(-dh/dg));
+    //fHadronness->SetHadronness(dg/(dg+dh));
+    fHadronness->SetHadronness(exp(-dh/dg));
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h	(revision 1552)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h	(revision 1557)
@@ -8,19 +8,19 @@
 class MHMatrix;
 class MParList;
-class MHadroness;
 class MDataArray;
+class MHadronness;
 
 class MMultiDimDistCalc : public MTask
 {
 private:
-    Int_t  fNum;            // number of distances used for an avarage
-    Bool_t fUseKernel;      // Flag whether kernel method should be used
+    Int_t  fNum;              // number of distances used for an avarage
+    Bool_t fUseKernel;        // Flag whether kernel method should be used
 
-    MHMatrix   *fMGammas;   //! Gammas describing matrix
-    MHMatrix   *fMHadrons;  //! Hadrons (non gammas) describing matrix
+    MHMatrix   *fMGammas;     //! Gammas describing matrix
+    MHMatrix   *fMHadrons;    //! Hadrons (non gammas) describing matrix
 
-    MHadroness *fHadroness; //! Output container for calculated hadroness
+    MHadronness *fHadronness; //! Output container for calculated hadroness
 
-    MDataArray *fData;      //! Used to store the MDataChains to get the event values
+    MDataArray *fData;        //! Used to store the MDataChains to get the event values
 
     void StreamPrimitive(ofstream &out) const;
Index: trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1552)
+++ trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1557)
@@ -39,5 +39,5 @@
            MSrcPosCam.cc \
            MCameraSmooth.cc \
-           MHadroness.cc \
+           MHadronness.cc \
            MMatrixLoop.cc \
            MCompProbCalc.cc \
