Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 4151)
+++ trunk/MagicSoft/Mars/Changelog	(revision 4152)
@@ -26,4 +26,8 @@
 	
  2004/05/24: Markus Gaug
+
+   * mcalib/MHCalibrationTestCam.[h,cc]
+     - number of photons/area are now stored in TArray's in order to 
+       retrieve them easier in later processing from stored files.
 
    * mcalib/MCalibrationCam.cc
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.cc	(revision 4151)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.cc	(revision 4152)
@@ -263,6 +263,11 @@
       }
   }
-    
-
+
+
+  fMeanMeanPhotPerArea.Set(nareas);   
+  fRmsMeanPhotPerArea .Set(nareas); 
+  fMeanSigmaPhotPerArea.Set(nareas);  
+  fRmsSigmaPhotPerArea.Set(nareas);
+ 
   return kTRUE;
 }
@@ -359,4 +364,7 @@
 {
 
+  TArrayI numaidx;
+  numaidx.Set(fGeom->GetNumAreas());
+
   for (Int_t i=0; i<fHiGainArray->GetSize(); i++)
     {
@@ -378,6 +386,15 @@
       hist.CreateFourierSpectrum();
       
-    }
-  
+      const Float_t area = (*fGeom)[i].GetA();
+      const Int_t   aidx = (*fGeom)[i].GetAidx();
+
+      fMeanMeanPhotPerArea[aidx]  += hist.GetMean() / area;
+      fRmsMeanPhotPerArea [aidx]  += hist.GetMean() / area * hist.GetMean()  / area;
+      fMeanSigmaPhotPerArea[aidx] += hist.GetSigma()/ area;
+      fRmsSigmaPhotPerArea [aidx] += hist.GetSigma()/ area * hist.GetSigma() / area;
+      numaidx[aidx]++;
+    }
+
+
   for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++)
     {
@@ -395,5 +412,11 @@
       hist.CreateFourierSpectrum();
       
-
+      fRmsMeanPhotPerArea [j]  -= fMeanMeanPhotPerArea [j]*fMeanMeanPhotPerArea [j]/numaidx[j];
+      fRmsSigmaPhotPerArea[j]  -= fMeanSigmaPhotPerArea[j]*fMeanSigmaPhotPerArea[j]/numaidx[j];
+
+      fMeanMeanPhotPerArea [j]  /=  numaidx[j];
+      fMeanSigmaPhotPerArea[j]  /=  numaidx[j];
+      fRmsMeanPhotPerArea  [j]  /=  numaidx[j]-1.;
+      fRmsSigmaPhotPerArea [j]  /=  numaidx[j]-1.; 
   }
 
@@ -455,7 +478,7 @@
 // =================
 //
-// 7:  Fitted Mean Test Calibration (MHGausEvents::GetMean()) by MGeomPix::GetA()
-// 8:  Fitted Mean Error Calibration (MHGausEvents::GetMeanErr()) by MGeomPix::GetA()
-// 9:  Fitted Sigma Test Calibration (MHGausEvents::GetSigma()) by MGeomPix::GetA()
+// 7:  Fitted Mean Test Calibration   (MHGausEvents::GetMean())     by MGeomPix::GetA()
+// 8:  Fitted Mean Error Calibration  (MHGausEvents::GetMeanErr())  by MGeomPix::GetA()
+// 9:  Fitted Sigma Test Calibration  (MHGausEvents::GetSigma())    by MGeomPix::GetA()
 // 10: Fitted Sigma Error Calibration (MHGausEvents::GetSigmaErr()) by MGeomPix::GetA()
 //
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.h	(revision 4151)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.h	(revision 4152)
@@ -4,4 +4,7 @@
 #ifndef MARS_MHCalibrationCam
 #include "MHCalibrationCam.h"
+#endif
+#ifndef ROOT_TArrayF
+#include "TArrayF.h"
 #endif
 
@@ -12,4 +15,9 @@
 private:
 
+  TArrayF fMeanMeanPhotPerArea;
+  TArrayF fRmsMeanPhotPerArea   ;
+  TArrayF fMeanSigmaPhotPerArea;
+  TArrayF fRmsSigmaPhotPerArea   ;
+  
   Bool_t ReInitHists(MParList *pList);
   Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
@@ -25,4 +33,9 @@
   void DrawPixelContent(Int_t idx) const;
 
+  const Float_t GetMeanMeanPhotPerArea       ( const Int_t aidx ) const   { return fMeanMeanPhotPerArea [aidx]; }
+  const Float_t GetRmsMeanPhotPerArea        ( const Int_t aidx ) const   { return fRmsMeanPhotPerArea  [aidx]; }
+  const Float_t GetMeanSigmaPhotPerArea      ( const Int_t aidx ) const   { return fMeanSigmaPhotPerArea [aidx]; }
+  const Float_t GetRmsSigmaPhotPerArea       ( const Int_t aidx ) const   { return fRmsSigmaPhotPerArea  [aidx]; }
+
   void CalcAverageSigma();
   
