Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2847)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2848)
@@ -5,5 +5,17 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2004/01/19: Thomas Bretz
+
+   * manalysis/MPedPhotCalc.[cc,h]:
+     - fixed order of includes
+     - removed obsolete forward declarations
+     - removed obsolete data member fNumPixels (stored already twice in
+       the two TArrayF)
+     - fixed some small bugs in the documentation
+
+
+
  2004/01/19: Javier Rico
+
    * macros/dohtml.C, NEWS
      - include some missing info
@@ -12,4 +24,5 @@
 
  2004/01/19: Abelardo Moralejo
+
    * manalysis/MExtractedSignalPix.h
      - added GetNumLoGainSaturated()
Index: /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.cc	(revision 2847)
+++ /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.cc	(revision 2848)
@@ -16,7 +16,6 @@
 !
 !
-!   Author(s): Josep Flix  <mailto:jflix@ifae.es>
-!              Javier Rico <mailto:jrico@ifae.es> 
-!              (01/04)
+!   Author(s): Josep Flix 1/2004 <mailto:jflix@ifae.es>
+!   Author(s): Javier Rico 1/2004 <mailto:jrico@ifae.es>
 !
 !   Copyright: MAGIC Software Development, 2000-2004
@@ -26,30 +25,31 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//   MPedPhotCalc                                                          //
-//                                                                         //  
-//  This is a Task class to compute, for each pixel, the signal mean and   //
-//  rms from a pedestal run file that has undergone the standard signal    //
-//  extration  and calibration procedure. The signal rms can be used as    //
-//  reference to compute the significance of the measured signals in the   //
-//  following data runs (e.g. during the image cleaning).                  //
-//                                                                         //
-//  Input Containers:                                                      //
-//   MCerPhotEvt                                                           //
-//                                                                         //
-//  Output Containers:                                                     //
-//   MPedPhotCam 
-//                                                                         //
-//                                                                         //
+//
+//   MPedPhotCalc
+//
+//  This is a Task class to compute, for each pixel, the signal mean and
+//  rms from a pedestal run file that has undergone the standard signal
+//  extration  and calibration procedure. The signal rms can be used as
+//  reference to compute the significance of the measured signals in the
+//  following data runs (e.g. during the image cleaning).
+//
+//  Input Containers:
+//   MCerPhotEvt
+//
+//  Output Containers:
+//   MPedPhotCam
+//
 /////////////////////////////////////////////////////////////////////////////
+#include "MPedPhotCalc.h"
 
 #include "MLog.h"
 #include "MLogManip.h"
 
-#include "MPedPhotCalc.h"
 #include "MParList.h"
-#include "MRawRunHeader.h"  
+#include "MRawRunHeader.h"
+
 #include "MCerPhotPix.h"
 #include "MCerPhotEvt.h"
+
 #include "MPedPhotPix.h"
 #include "MPedPhotCam.h"
@@ -96,14 +96,14 @@
   
 
-  fNumPixels = fPedestals->GetSize();
-
   // Initialize arrays
   if(fSumx.GetSize()==0)
     {
-      fSumx.Set(fNumPixels);
-      fSumx2.Set(fNumPixels);
-  
-      memset(fSumx.GetArray(),  0, sizeof(Float_t)*fNumPixels);
-      memset(fSumx2.GetArray(), 0, sizeof(Float_t)*fNumPixels);
+        const UShort_t num = fPedestals->GetSize();
+
+        fSumx.Set(num);
+        fSumx2.Set(num);
+
+        memset(fSumx.GetArray(),  0, sizeof(Float_t)*num);
+        memset(fSumx2.GetArray(), 0, sizeof(Float_t)*num);
     }
 
@@ -115,7 +115,8 @@
   for(UInt_t i=0;i<fCerPhot->GetNumPixels();i++)
     {
-      MCerPhotPix &pix = (*fCerPhot)[i];
-      Float_t nphot = pix.GetNumPhotons();
-      Int_t idx     = pix.GetPixId();
+      const MCerPhotPix &pix = (*fCerPhot)[i];
+
+      const Float_t nphot = pix.GetNumPhotons();
+      const Int_t idx     = pix.GetPixId();
       
       fSumx[idx]  += nphot;
@@ -131,10 +132,11 @@
   {
     // Compute pedestals and rms from fSumx and fSumx2 arrays
-    const Int_t n  = GetNumExecutions();
+    const Int_t n    = GetNumExecutions();
+    const Int_t npix = fSumx.GetSize();
 
-    for(Int_t i=0;i<fNumPixels;i++)
+    for(Int_t i=0; i<npix; i++)
       {
-        const Float_t sum  = fSumx.At(i);
-	const Float_t sum2 = fSumx2.At(i);
+        const Float_t sum  = fSumx[i];
+	const Float_t sum2 = fSumx2[i];
 	
         const Float_t photped = sum/n;
Index: /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.h	(revision 2847)
+++ /trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.h	(revision 2848)
@@ -1,12 +1,4 @@
 #ifndef MARS_MPedPhotCalc
 #define MARS_MPedPhotCalc
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedPhotCalc                                                            //
-//                                                                         //
-// Evaluate the pedestals from pedestal runs using charge extraction       //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
 
 #ifndef MARS_MTask
@@ -14,14 +6,13 @@
 #endif
 
+#ifndef ROOT_TArrayF
 #include <TArrayF.h>
+#endif
 
 class MPedPhotCam;
-class MRawEvtData;
 class MCerPhotEvt;
 
 class MPedPhotCalc : public MTask
 {
-    UShort_t fNumPixels;
-
     MPedPhotCam  *fPedestals;  // Pedestals of all pixels in the camera
     MCerPhotEvt  *fCerPhot;
@@ -39,5 +30,5 @@
     MPedPhotCalc(const char *name=NULL, const char *title=NULL);
 
-    ClassDef(MPedPhotCalc, 0)   // Task to calculate pedestals from pedestal runs raw data
+    ClassDef(MPedPhotCalc, 0)//Task to calculate pedestals from the charge computed from pedestal runs (in units of photons)
 };
 
