Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8156)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8157)
@@ -52,4 +52,11 @@
      - added MPedestalSubtractedEvt
      - removed MPedCalcFromData
+
+   * mpedestal/MHPedestalCor.[h,cc], mpedestal/MPedestalSubtract.[h,cc],
+     mpedestal/MPedestalSubtractEct.[h,cc]:
+     - added
+
+   * mpedestal/MPedCalcFromData.[h,cc]:
+     - removed
 
    * msignal/MExtractTime.[h,cc]:
Index: unk/MagicSoft/Mars/mpedestal/MPedCalcFromData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mpedestal/MPedCalcFromData.cc	(revision 8156)
+++ 	(revision )
@@ -1,199 +1,0 @@
-/* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MPedCalcFromData.cc,v 1.3 2006-10-17 17:16:01 tbretz Exp $
-! --------------------------------------------------------------------------
-!
-! *
-! * 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 expressed
-! * or implied warranty.
-! *
-!
-!
-!   Author(s): Josep Flix 06/2004 <mailto:jflix@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//   MPedCalcFromData                                                      //
-//                                                                         //
-//  Input Containers:                                                      //
-//   MRawEvtData                                                           //
-//                                                                         //
-//  Output Containers:                                                     //
-//   MPedestalCam                                                          //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MPedCalcFromData.h"
-#include "MExtractor.h"
-
-#include "MParList.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MRawRunHeader.h"  
-#include "MRawEvtPixelIter.h"
-#include "MRawEvtData.h"
-
-#include "MPedestalPix.h"
-#include "MPedestalCam.h"
-
-ClassImp(MPedCalcFromData);
-
-using namespace std;
-
-MPedCalcFromData::MPedCalcFromData(const char *name, const char *title) 
-{
-    fName  = name  ? name  : "MPedCalcFromData";
-    fTitle = title ? title : "Task to calculate pedestals from data runs";
-
-    AddToBranchList("fHiGainPixId");
-    AddToBranchList("fHiGainFadcSamples");
-
-    SetRange(fLoGainFirst, fLoGainLast);
-    Clear();
-}
-
-void MPedCalcFromData::Clear(const Option_t *o)
-{
-
-  fRawEvt    = NULL;
-  fRunHeader = NULL;
-
-}
-
-void MPedCalcFromData::SetLoRange(Byte_t lofirst, Byte_t lolast)
-{
-    fLoGainFirst = lofirst;
-    fLoGainLast = lolast;
-    
-    fWindowSizeLoGain = lolast - lofirst;
-
-}
-
-Int_t MPedCalcFromData::PreProcess( MParList *pList )
-{
-    Clear();
-    
-    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
-    if (!fRawEvt)
-    {
-	*fLog << err << "MRawEvtData not found... aborting." << endl;
-	return kFALSE;
-    }
-    
-    fRunHeader = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
-    if (!fRunHeader)
-    {
-	*fLog << err << AddSerialNumber("MRawRunHeader") << " not found... aborting." << endl;
-	return kFALSE;
-    }
-    
-    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
-    if (!fPedestals)
-	return kFALSE;
-    
-    return kTRUE;
-}
-
-
-Bool_t MPedCalcFromData::ReInit(MParList *pList)
-{
-  
-  Int_t npixels  = fPedestals->GetSize();
-  
-  if (fSumx.GetSize()==0)
-    {
-      fSumx. Set(npixels);
-      fSumx2.Set(npixels);
-      fEvtCounter.Set(npixels);
-      fTotalCounter.Set(npixels);
-
-      fEvtCounter.Reset();
-      fTotalCounter.Reset();
-      fSumx.Reset();
-      fSumx2.Reset();
-    }
-  
-  return kTRUE;
-      
-}
-
-Int_t MPedCalcFromData::Process()
-{
-
-  MRawEvtPixelIter pixel(fRawEvt);
-  
-  while (pixel.Next())
-    {
-
-      const UInt_t idx    = pixel.GetPixelId();
-      
-      if ( (UInt_t)pixel.GetMaxHiGainSample() < fHiGainThreshold ) {
-	  
-	  fEvtCounter[idx]++;
-
-	  Byte_t *ptr = pixel.GetLoGainSamples() + fLoGainFirst;
-	  Byte_t *end = ptr + fWindowSizeLoGain;
-	  
-	  UInt_t sum = 0;
-	  UInt_t sqr = 0;
-	  
-	  if (fWindowSizeLoGain != 0)
-	  {
-	      do
-	      {
-		  sum += *ptr;
-		  sqr += *ptr * *ptr;
-	      }
-	      while (++ptr != end);
-	  }
-	  
-	  const Float_t msum = (Float_t)sum;
-	  fSumx[idx]          += msum;
-	  
-	  const Float_t sqrsum  = msum*msum;
-	  fSumx2[idx]          += sqrsum;
-
-	  if ((UInt_t)fEvtCounter[idx] == fDump){
-	      
-	      // Compute pedestals and rms from the sample
-	      const ULong_t n     = fWindowSizeLoGain*fDump;
-
-	      const Float_t sum1 = fSumx.At(idx);
-	      const Float_t sum2 = fSumx2.At(idx);
-	      const Float_t higainped = sum1/n;
-
-	      // 1. Calculate the Variance of the sums:
-	      Float_t higainVar = (sum2-sum1*sum1/fDump)/(fDump-1.);
-	      // 2. Scale the variance to the number of slices:
-	      higainVar /= (Float_t)(fWindowSizeLoGain);
-	      // 3. Calculate the RMS from the Variance:
-	      (*fPedestals)[idx].Set(higainped, higainVar < 0 ? 0. : TMath::Sqrt(higainVar));
-
-	      fTotalCounter[idx]++;
-	      fEvtCounter[idx]=0;
-	      fSumx[idx]=0;
-	      fSumx2[idx]=0;
-	  };
-      }
-      
-    };
-  
-  fPedestals->SetReadyToSave();
-  return kTRUE;
-}
-
Index: unk/MagicSoft/Mars/mpedestal/MPedCalcFromData.h
===================================================================
--- /trunk/MagicSoft/Mars/mpedestal/MPedCalcFromData.h	(revision 8156)
+++ 	(revision )
@@ -1,59 +1,0 @@
-#ifndef MARS_MPedCalcFromData
-#define MARS_MPedCalcFromData
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         
-// MPedCalcFromData
-//                                                                         
-// Evaluate the pedestal from real data. Uses pixels which have no switched to Low Gain
-// to take pedestals from Low Gain samples.
-//
-// Author: J. Flix (jflix@ifae.es)
-// Date: 25-06-2004
-//                                                                         
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef ROOT_TArrayD
-#include <TArrayD.h>
-#endif
-
-#ifndef ROOT_TArrayI
-#include <TArrayI.h>
-#endif
-
-#ifndef MARS_MExtractor
-#include "MExtractor.h"
-#endif
-
-class MPedCalcFromData : public MExtractor
-{
-
-    UInt_t fDump; // Number for dumping.
-    Byte_t fLoGainFirst;      // First FADC slice Lo-Gain (currently set to: 3) 
-    Byte_t fLoGainLast;       // Last FADC slice Lo-Gain (currently set to: 14) 
-    Byte_t fWindowSizeLoGain;             // Number of Lo Gain slices in window
-    Byte_t fHiGainThreshold;
-
-    TArrayD fSumx;         // sum of values
-    TArrayD fSumx2;        // sum of squared values
-
-    TArrayI fEvtCounter; // Counter for dumping values to Pedestal Container
-    TArrayI fTotalCounter; // Counter for dumping values to Pedestal Container
-
-    Int_t  PreProcess ( MParList *pList );
-    Bool_t ReInit     ( MParList *pList );
-    Int_t  Process    ();
-
-public:
-
-    MPedCalcFromData(const char *name=NULL, const char *title=NULL);
- 
-    void Clear(const Option_t *o="");
-    void SetDumpEvents(UInt_t dumpevents = 0){fDump = dumpevents;}
-    void SetfHiGainThreshold(Byte_t Threshold = 0){fHiGainThreshold = Threshold;}
-    void SetLoRange(Byte_t lofirst=0, Byte_t lolast=0);
-
-    ClassDef(MPedCalcFromData, 0)   // Task to calculate pedestals from data runs 
-};
-
-#endif
