Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2324)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2325)
@@ -12,7 +12,21 @@
        reason for the discrepancies in the gamma/hadron separation 
        results we were observing lately. The meaning of Size was 
-       different among the different people working on the matter, and 
+       different among the different people working on the subject, and 
        hence, when we compared samples with a given Size cut we were
        actually comparing different energy ranges.
+
+     - Turned fSumQuadWeights to its original meaning, the quadratic 
+       sum (square root of the sum of the squares) of the values in the 
+       fWeight array. Why was this changed?? (sqrt removed) Only because 
+       of the name of the variable??
+
+     - Changed the calculation of the mean pedestal to fit the meaning
+       of fSumQuadWeights.
+
+     - Moved the call to ScalePedestals() to the end of the ReInit 
+       function. Formerly it was called before the setting of the 
+       variable fEnableFix, and then the mean pedestal in each FADC 
+       slice was wrong by 0.5 units... once more: please Thomas B, 
+       be careful with these kind of changes.
 
 
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2324)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc	(revision 2325)
@@ -151,6 +151,4 @@
         return kTRUE;
 
-    ScalePedestals();
-
     MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     if (!mcrunheader)
@@ -161,7 +159,10 @@
 
     fEnableFix = kFALSE;
+
     if (mcrunheader->GetCamVersion() <= 40)
         fEnableFix = kTRUE;
 
+    ScalePedestals();
+
     return kTRUE;
 }
@@ -175,6 +176,12 @@
         MPedestalPix &ped = (*fPedestals)[idx];
 
+	// This converts the pedestal info contained in ped  from the pedestal 
+	// of each FADC slice to the pedesal of the pixel signal (depends on
+	// how many FADC slices are added up).
+
         const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal();
-        ped.Set(offset, ped.GetPedestalRms()*sqrt(fSumQuadWeights));
+
+        ped.Set(offset*fSumQuadWeights*fSumQuadWeights,
+		ped.GetPedestalRms()*fSumQuadWeights);
     }
 
