Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8632)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8633)
@@ -18,4 +18,22 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+
+ 2007/07/14 Thomas Bretz
+
+   * mpedestal/MPedestalSubtract.[h,cc]:
+     - fixed the buggy Memcpy function introduced with the last change
+       07/06/17 ;( This bug was effecting the old FADC data only, the
+       MUX data were (by chance) correctly copied
+
+   * mpedestal/MExtractPedestal.cc:
+     - some cosmetics
+
+  * mfilter/MFMagicCuts.cc:
+     - changed some comments
+
+   * mjobs/MJCut.cc:
+     - some cosmetics. Simplified the setting of the scale factor
+
 
 
Index: trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc	(revision 8632)
+++ trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc	(revision 8633)
@@ -368,7 +368,9 @@
     const Double_t slope  = fMatrix ? GetVal(kESlope)   : fHilExt->GetSlopeLong()/TMath::Sign(fMm2Deg, fHilSrc->GetCosDeltaAlpha());
 
-        // Do Ghostbusting with slope and m3l
+    // Do Ghostbusting with slope and m3l
     const Double_t sign1 = (dist-c[9])*c[8]-slope;
     const Double_t sign2 = m3long-c[5];
+
+    // Calculate disp including sign
     const Double_t p = sign1<0 || sign2<0 ? -disp : disp;
 
Index: trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8632)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 8633)
@@ -635,8 +635,5 @@
     plist.AddToList(&fit);
     if (set.IsWobbleMode())
-    {
-        fit.SetScaleMode(MAlphaFitter::kNone);
-        fit.SetScaleUser(1./fNumOffSourcePos);
-    }
+        fit.SetScaleUser(1./fNumOffSourcePos); // includes fit.SetScaleMode(MAlphaFitter::kUserScale);
 
     MHAlpha *halphaoff = CreateNewHist(plist, "Off");
Index: trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 8632)
+++ trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 8633)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.33 2007-06-19 09:25:39 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.34 2007-07-14 00:02:24 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -714,6 +714,4 @@
         CalcSums(pixel, offset, ab[0], ab[1]);
 
-    fNumEventsUsed[idx]++;
-
     if (fIntermediateStorage)
         (*fPedestalsInter)[idx].Set(sum, 0, 0, fNumEventsUsed[idx]);
@@ -723,4 +721,6 @@
     fSumx[idx]  += sum;
     fSumx2[idx] += sqrsum;
+
+    fNumEventsUsed[idx]++;
 
     if (!fExtractor && pixel.IsABFlagValid())
Index: trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc	(revision 8632)
+++ trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc	(revision 8633)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.7 2007-06-17 14:51:55 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.8 2007-07-14 00:02:24 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -129,11 +129,11 @@
 }
 
-void MPedestalSubtract::Memcpy(void *dest, Int_t offset, void *src, Int_t cnt) const
+void MPedestalSubtract::Memcpy(void *dest, void *src, Int_t cnt) const
 {
     if (fRawEvt->GetNumBytesPerSample()==2)
-        memcpy((UShort_t*)dest+offset, src, cnt*2);
+        memcpy((UShort_t*)dest, src, cnt*2);
     else
     {
-        const Byte_t *b = (Byte_t*)src+offset;
+        const Byte_t *b = (Byte_t*)src;
         for (USample_t *ptr=(USample_t*)dest; ptr<(USample_t*)dest+cnt; ptr++)
             *ptr = *b++;
@@ -171,6 +171,6 @@
 
         // copy hi- and lo-gains samples together
-        Memcpy(sample, 0,    pixel.GetHiGainSamples(), numh);
-        Memcpy(sample, numh, pixel.GetLoGainSamples(), numl);
+        Memcpy(sample,      pixel.GetHiGainSamples(), numh);
+        Memcpy(sample+numh, pixel.GetLoGainSamples(), numl);
 
         // start of destination array, end of hi-gain destination array
Index: trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.h
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.h	(revision 8632)
+++ trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.h	(revision 8633)
@@ -26,5 +26,5 @@
     Int_t  Process();
 
-    void Memcpy(void *sample, Int_t offset, void *ptr, Int_t cnt) const;
+    void Memcpy(void *sample, void *ptr, Int_t cnt) const;
 
 public:
