Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8154)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8155)
@@ -18,5 +18,93 @@
 
                                                  -*-*- END OF LINE -*-*-
- 2006/10/23
+ 2006/10/24 Thomas Bretz
+
+   * Makefile:
+     - added mextralgo directory
+
+   * mextralgo/MExtralgoDigitalFilter.[h,cc]:
+     - added code to calculate chisq
+     - some small changes to calculating the weights
+
+   * mextralgo/MExtralgoSpline.[h,cc]:
+     - removed the random iterator, use a random number instead
+
+   * mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc,
+     mjobs/MJPedestal.cc:
+     - introduced new MPedestalSubtract
+     - changed the range for the pedestal extraction window
+       (the window should be the same as the extractor search
+        window, even if it need not to be used in the case of
+        the random extractor)
+
+   * mpedestal/MExtractPedestal.[h,cc], mpedestal/MPedCalcPedRun.[h,cc],
+     mpedestal/MPedCalcFromLoGain.[h,cc]:
+     - removed a lot of obsolte code
+     - unified and moved a lot of code to the base class
+     - moved code used only in a single derived class to this class
+     - changed and simplified the range check for the windows
+     - removed memcpy stuff, instead use the output of MExtractPedestal
+     - get the window size automatically from a possible extractor
+
+   * mpedestal/Makefile, mpedestal/PedestalLinkDef.h:
+     - added MHPedestalCor
+     - added MPedestalSubtract
+     - added MPedestalSubtractedEvt
+     - removed MPedCalcFromData
+
+   * msignal/MExtractTime.[h,cc]:
+     - commented out some code which will become obsolete soon
+     - improved Print() function
+
+   * msignal/MExtractTimeAndCharge.[h,cc]:
+     - redesign to use the new extraction interface
+     - changed from hi/lo-gain to one sample by using 
+       MPedestalSubtractedEvt
+     - changed the lo-gain star shift default to -6.0
+     - moved the determination of saturation and maxima into 
+       MPedestalSubtractedEvt
+     - improved Print() function
+     - removed obsolete data members
+
+   * msignal/MExtractTimeAndChargeDigitalFilter.[h,cc]:
+     - changed to use the new MExtralgo class instead of its own
+       algorithm
+     - now read a third column from the weights files
+     - improved Print() function
+     - removed obsolete data members
+     - added data member for pulse shape
+
+   * msignal/MExtractTimeAndChargeSpline.[h,cc]:
+     - changed to use the new MExtralgo class instead of its own
+       algorithm
+     - changed rise-time from 0.5 to 0.7 and fall time from 0.5 to 1.0
+     - removed obsolete data members
+
+   * msignal/MExtractedSignalPix.h:
+     - changed some comments
+
+   * msignal/MExtractor.cc:
+     - changed default saturation limit from 250 to 245 to be
+       more than two times the ab-offset away from 255
+     - small changes to the range checks
+     - updated Print() function
+     - removed fHiLoLast data member
+
+   * msignal/Makefile:
+     - added mextralgo as include directory
+
+   * msignal/calibration_weights_UV46.dat, msignal/cosmics_weights46.dat:
+     - added third column (now contains zeros)
+
+   * msignal/MExtractBlindPixel.cc:
+     - replaced self allocated arrays by MArrays
+     - added data member fHiLoLast (for the moment)
+
+   * msignal/MExtractPINDiode.cc:
+     - removed printing of fHiLoLast (it wasn't used anyhow
+
+
+
+ 2006/10/23 Thomas Bretz
 
    * mbadpixels/MBadPixelsCam.cc:
Index: /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc	(revision 8154)
+++ /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc	(revision 8155)
@@ -92,8 +92,5 @@
 //
 MExtractBlindPixel::MExtractBlindPixel(const char *name, const char *title)
-    : fHiGainSignal(NULL),
-      fHiGainFirstDeriv(NULL), 
-      fHiGainSecondDeriv(NULL),
-      fDataType(0)
+    : fBlindPixel(0), fHiLoLast(0), fDataType(0)
 {
   
@@ -108,25 +105,4 @@
 
   Clear();
-
-}
-
-// --------------------------------------------------------------------------
-//
-// Destructor: 
-// 
-// - Deletes, (if not NULL):
-//   fHiGainSignal;
-//   fHiGainFirstDeriv;
-//   fHiGainSecondDeriv;
-// 
-MExtractBlindPixel::~MExtractBlindPixel()
-{
-
-  if (fHiGainSignal)
-    delete [] fHiGainSignal;
-  if (fHiGainFirstDeriv)
-    delete [] fHiGainFirstDeriv;
-  if (fHiGainSecondDeriv)
-    delete [] fHiGainSecondDeriv;
 
 }
@@ -150,26 +126,8 @@
 void MExtractBlindPixel::Clear( const Option_t *o)
 {
-
-  fExtractionType = 0;
-
-  fBlindPixelIdx.Set(0);
-  SetBlindPixelIdx();
-
-  if (fHiGainSignal)
-    {
-      delete [] fHiGainSignal;
-      fHiGainSignal = NULL;
-    }
-  if (fHiGainFirstDeriv)
-    {
-      delete [] fHiGainFirstDeriv;
-      fHiGainFirstDeriv = NULL;
-    }
-  if (fHiGainSecondDeriv)
-    {
-      delete [] fHiGainSecondDeriv;
-      fHiGainSecondDeriv = NULL;
-    }
-
+    fExtractionType = 0;
+
+    fBlindPixelIdx.Set(0);
+    SetBlindPixelIdx();
 }
 
@@ -246,11 +204,4 @@
 {
   
-  if (fHiGainSignal)
-    delete [] fHiGainSignal;
-  if (fHiGainFirstDeriv)
-    delete [] fHiGainFirstDeriv;
-  if (fHiGainSecondDeriv)
-    delete [] fHiGainSecondDeriv;
-
   for (Int_t i=0;i<fNumBlindPixels;i++)
     fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(i),i);
@@ -258,5 +209,5 @@
   fBlindPixel->SetExtractionType(fExtractionType);
 
-  for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
+  for (UInt_t i=0;i<fBlindPixelIdx.GetSize();i++)
   {
 
@@ -317,10 +268,12 @@
   const Int_t range = fHiLoFirst ? fHiLoLast - fHiLoFirst + 1 : fHiGainLast - fHiGainFirst + fHiLoLast + 1;
 
-  fHiGainSignal      = new Float_t[range];
-  memset(fHiGainSignal,0,range*sizeof(Float_t));
-  fHiGainFirstDeriv  = new Float_t[range];
-  memset(fHiGainFirstDeriv,0,range*sizeof(Float_t));
-  fHiGainSecondDeriv = new Float_t[range];
-  memset(fHiGainSecondDeriv,0,range*sizeof(Float_t));
+  fHiGainSignal.Set(range);
+  fHiGainSignal.Reset();
+
+  fHiGainFirstDeriv.Set(range);
+  fHiGainFirstDeriv.Reset();
+
+  fHiGainSecondDeriv.Set(range);
+  fHiGainSecondDeriv.Reset();
 
   *fLog << endl;
@@ -670,5 +623,5 @@
   fBlindPixel->Clear();
   
-  for (Int_t id=0;id<fBlindPixelIdx.GetSize();id++)
+  for (UInt_t id=0;id<fBlindPixelIdx.GetSize();id++)
     {
   
Index: /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h	(revision 8154)
+++ /trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h	(revision 8155)
@@ -6,9 +6,13 @@
 #endif
 
-#ifndef ROOT_TArrayI
-#include <TArrayI.h>
+#ifndef MARS_MArrayI
+#include "MArrayI.h"
+#endif
+#ifndef MARS_MArrayF
+#include "MArrayF.h"
 #endif
 
 class MExtractedSignalBlindPixel;
+
 class MExtractBlindPixel : public MExtractor
 {
@@ -27,11 +31,12 @@
 
   Byte_t   fHiLoFirst;                     // If not zero, start extraction from fHiLoFirst slice of Low-Gain
+  Byte_t   fHiLoLast;
 
-  Float_t *fHiGainSignal;                  // Need fast access to the signals in a float way
-  Float_t *fHiGainFirstDeriv;              // First derivative at intersection
-  Float_t *fHiGainSecondDeriv;             // Second derivative at intersection
+  MArrayF  fHiGainSignal;                  //! Need fast access to the signals in a float way
+  MArrayF  fHiGainFirstDeriv;              //! First derivative at intersection
+  MArrayF  fHiGainSecondDeriv;             //! Second derivative at intersection
 
   Float_t fResolution;                     // The time resolution in FADC units
-  TArrayI fBlindPixelIdx;                  // Array holding the IDs of the blind pixel(s)
+  MArrayI fBlindPixelIdx;                  // Array holding the IDs of the blind pixel(s)
   Int_t   fNSBFilterLimit;                 // Limit of sum of FADC slices for filter part
 
@@ -56,5 +61,4 @@
 
   MExtractBlindPixel(const char *name=NULL, const char *title=NULL);
-  ~MExtractBlindPixel();
 
   void Clear( const Option_t *o ="");
@@ -65,8 +69,10 @@
 
   // Setters
-  void SetBlindPixelIdx(  const Int_t  idx=fgBlindPixelIdx, const Int_t nr=0 ) {
-    if (nr>fBlindPixelIdx.GetSize()-1)
-      fBlindPixelIdx.Set(nr+1);
-    fBlindPixelIdx.AddAt(idx,nr); }
+  void SetBlindPixelIdx(  const Int_t  idx=fgBlindPixelIdx, const UInt_t nr=0 )
+  {
+      if (nr>=fBlindPixelIdx.GetSize())
+          fBlindPixelIdx.Set(nr+1);
+      fBlindPixelIdx[nr] = idx;
+  }
   void SetExtractionType( const ExtractionType_t typ=kAmplitude );
   void SetDataType    ( const DataType_t       typ=kRawEvt    );  
Index: /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 8154)
+++ /trunk/MagicSoft/Mars/msignal/MExtractPINDiode.cc	(revision 8155)
@@ -248,5 +248,5 @@
   *fLog << inf << "Taking " << fNumHiGainSamples
         << " HiGain samples from slice " << (Int_t)fHiGainFirst
-        << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl;
+        << " to " << (Int_t)(fHiGainLast/*+fHiLoLast*/) << " incl" << endl;
 
   return kTRUE;
