Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 4903)
+++ trunk/MagicSoft/Mars/Changelog	(revision 4904)
@@ -60,4 +60,5 @@
    * mcalib/MHCalibrationTestPix.[h,cc]
    * mcalib/MHCalibrationTestTimePix.[h,cc]
+   * manalysis/MHPedestalPix.[h,cc]
      - derive from MHCalibrationPix
      - new functions Reset()
Index: trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h	(revision 4903)
+++ trunk/MagicSoft/Mars/manalysis/MHPedestalPix.h	(revision 4904)
@@ -2,9 +2,9 @@
 #define MARS_MHPedestalPix
 
-#ifndef MARS_MHGausEvents
-#include "MHGausEvents.h"
+#ifndef MARS_MHCalibrationPix
+#include "MHCalibrationPix.h"
 #endif
 
-class MHPedestalPix : public MHGausEvents
+class MHPedestalPix : public MHCalibrationPix
 {
 
Index: trunk/MagicSoft/Mars/mcalib/MHCalibrationTestTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MHCalibrationTestTimeCam.cc	(revision 4903)
+++ trunk/MagicSoft/Mars/mcalib/MHCalibrationTestTimeCam.cc	(revision 4904)
@@ -49,12 +49,12 @@
 // the fit is declared valid.
 // Otherwise, the fit is repeated within ranges of the previous mean 
-// +- MHGausEvents::fPickupLimit (default: 5) sigma (see MHGausEvents::RepeatFit())
+// +- MHCalibrationPix::fPickupLimit (default: 5) sigma (see MHCalibrationPix::RepeatFit())
 // In case this does not make the fit valid, the histogram means and RMS's are 
-// taken directly (see MHGausEvents::BypassFit()) and the following flags are set:
+// taken directly (see MHCalibrationPix::BypassFit()) and the following flags are set:
 // - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainNotFitted ) and
 // - MBadPixelsPix::SetUnsuitable(   MBadPixelsPix::kUnreliableRun    ) 
 // 
-// Outliers of more than MHGausEvents::fPickupLimit (default: 5) sigmas 
-// from the mean are counted as Pickup events (stored in MHGausEvents::fPickup) 
+// Outliers of more than MHCalibrationPix::fPickupLimit (default: 5) sigmas 
+// from the mean are counted as Pickup events (stored in MHCalibrationPix::fPickup) 
 //
 // The class also fills arrays with the signal vs. event number, creates a fourier 
@@ -85,4 +85,6 @@
 #include "MHCalibrationTestTimePix.h"
 
+#include "MHCalibrationPix.h"
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -125,8 +127,8 @@
 //
 // Initializes, if empty to MGeomCam::GetNumAreas() for:
-// - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas
+// - MHCalibrationCam::fAverageHiGainAreas
 //
 // Initializes, if empty to MGeomCam::GetNumSectors() for:
-// - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors
+// - MHCalibrationCam::fAverageHiGainSectors
 // 
 // Calls MHCalibrationCam::InitHists() for every entry in:
@@ -168,16 +170,4 @@
   }
 
-  if (fLoGainArray->GetEntries()==0)
-  {
-      fLoGainArray->Expand(npixels);
-      for (Int_t i=0; i<npixels; i++)
-      {
-	  (*fLoGainArray)[i] = new MHCalibrationTestTimePix("Calibrated Events Time",
-                                                "TestTime Calibration Pixel");
-          InitHists((*this)(i),(*fBadPixels)[i],i);
-      }
-  }
-
-
   if (fAverageHiGainAreas->GetEntries()==0)
   {
@@ -203,23 +193,4 @@
   }
 
-  if (fAverageLoGainAreas->GetEntries()==0)
-  {
-    fAverageLoGainAreas->Expand(nareas);
-    
-    for (Int_t j=0; j<nareas; j++)
-      {
-        (*fAverageLoGainAreas)[j] = 
-          new MHCalibrationTestTimePix("MHCalibrationTestTimeAverageArea",
-                           "Average TestTime Calibrations Area Idx ");
-
-        GetAverageLoGainArea(j).GetHGausHist()->SetTitle("TestTime Calibrations Area Idx ");
-        GetAverageLoGainArea(j).SetNbins(fAverageNbins);
-        GetAverageLoGainArea(j).InitBins();
-        GetAverageLoGainArea(j).ChangeHistId(j);
-        GetAverageLoGainArea(j).SetEventFrequency(fPulserFrequency);
-
-      }
-  }
-
 
   if (fAverageHiGainSectors->GetEntries()==0)
@@ -245,23 +216,5 @@
   }
 
-
-  if (fAverageLoGainSectors->GetEntries()==0)
-  {
-      fAverageLoGainSectors->Expand(nsectors);
-
-      for (Int_t j=0; j<nsectors; j++)
-      {
-	  (*fAverageLoGainSectors)[j] = 
-            new MHCalibrationTestTimePix("MHCalibrationTestTimeAverageSector",
-                             "Average TestTime Calibrations Sector ");
-
-          GetAverageLoGainSector(j).GetHGausHist()->SetTitle("TestTime Calibrations Sector ");
-          GetAverageLoGainSector(j).SetNbins(fAverageNbins);
-          GetAverageLoGainSector(j).InitBins();
-          GetAverageLoGainSector(j).ChangeHistId(j);
-          GetAverageLoGainSector(j).SetEventFrequency(fPulserFrequency);
-      }
-  }
-    
+  fLoGain = kFALSE;
 
   return kTRUE;
@@ -278,7 +231,7 @@
 // - number of sectors
 //
-// Fills HiGain or LoGain histograms (MHGausEvents::FillHistAndArray()), respectively
-// depending on MCerPhotPix::IsLoGainUsed(), with:
-// - MCerPhotPix::GetArrivalTime(pixid) - MCerPhotPix::GetArrivalTime(1);
+// Fills HiGain histograms (MHGausEvents::FillHistAndArray())
+// with:
+// - MArrivalTime::GetArrivalTime(pixid) - MArrivalTime::GetArrivalTime(1);
 //   (i.e. the time difference between pixel i and pixel 1 (hardware number: 2) )
 //
@@ -305,5 +258,5 @@
     {
 
-      MHGausEvents &histhi = (*this)[i];
+      MHCalibrationPix &histhi = (*this)[i];
 
       if (histhi.IsExcluded())
@@ -323,5 +276,5 @@
   for (Int_t j=0; j<nareas; j++)
     {
-      MHGausEvents &histhi = GetAverageHiGainArea(j);
+      MHCalibrationPix &histhi = GetAverageHiGainArea(j);
       histhi.FillHistAndArray(numareahi[j] == 0 ? 0. : sumareahi[j]/numareahi[j]);
 
@@ -330,5 +283,5 @@
   for (Int_t j=0; j<nsectors; j++)
     {
-      MHGausEvents &histhi = GetAverageHiGainSector(j);
+      MHCalibrationPix &histhi = GetAverageHiGainSector(j);
       histhi.FillHistAndArray(numsectorhi[j] == 0 ? 0. : sumsectorhi[j]/numsectorhi[j]);
 
@@ -347,5 +300,5 @@
     {
       
-      MHGausEvents &hist = (*this)[i];
+      MHCalibrationPix &hist = (*this)[i];
       
       if (hist.IsExcluded())
@@ -368,5 +321,5 @@
     {
       
-      MHGausEvents     &hist = GetAverageHiGainArea(j);      
+      MHCalibrationPix     &hist = GetAverageHiGainArea(j);      
       if (hist.IsEmpty())
         continue;
@@ -386,5 +339,5 @@
     {
       
-      MHGausEvents     &hist = GetAverageHiGainSector(j);      
+      MHCalibrationPix     &hist = GetAverageHiGainSector(j);      
       if (hist.IsEmpty())
         continue;
@@ -439,5 +392,5 @@
     return kFALSE;
 
-  const MHGausEvents &pix = (*this)[idx];
+  const MHCalibrationPix &pix = (*this)[idx];
 
   if (pix.IsExcluded())
@@ -477,5 +430,5 @@
 // --------------------------------------------------------------------------
 //
-// Calls MHGausEvents::DrawClone() for pixel idx
+// Calls MHCalibrationPix::DrawClone() for pixel idx
 //
 void MHCalibrationTestTimeCam::DrawPixelContent(Int_t idx) const
@@ -496,5 +449,5 @@
     {
   
-      MHGausEvents &hist    = GetAverageHiGainArea(j);
+      MHCalibrationPix &hist    = GetAverageHiGainArea(j);
 
       const Float_t numsqr    = TMath::Sqrt((Float_t)fAverageAreaNum[j]);
