Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7978)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7979)
@@ -24,4 +24,6 @@
      - implemented a hadronness cut as an option
      - updated class reference
+     - fixed abug introduced 14.7.2005 which caused the M3Long of the
+       anti source to be not properly evaluated in case of optimization.
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7978)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7979)
@@ -121,4 +121,9 @@
      cut in hadronness (index 8) and a fixed cut in size (index 9).
 
+   - ganymed: MFMagicCuts: fixed abug introduced 2005/7/14 which caused
+     the M3Long of the anti source to be not properly evaluated 
+     (actually is was evaluated as a unique random number) in case
+     of optimization with anti-theta cut switched on. This might have
+     lead to improper, but not necessarily wrong, optimization results.
 
 
Index: trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc	(revision 7978)
+++ trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc	(revision 7979)
@@ -33,9 +33,12 @@
 //      lgsize       = log10(MHillas.fSize)
 //
+//      leakage1     = log10(MNewImagePar.fLeakage1+1)
+//
 //      alpha        = MHillasSrc.fAlpha
 //      dist         = MHillasSrc.fDist*fMm2Deg
-//      leakage1     = log10(MNewImagePar.fLeakage1+1)
-//
 //      m3long       = MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*fMm2Deg
+//
+//      antialpha    = MHillasSrcAnti.fAlpha
+//      antidist     = MHillasSrcAnti.fDist*fMm2Deg
 //      antim3long   = MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*fMm2Deg
 //
@@ -51,5 +54,5 @@
 //          antidisp    = TMath::Sign(disp, antim3long-c[5])
 //          thetasq     = disp^2 + dist^2 - 2*disp*dist*alpha
-//          antithetasq = antidisp^2 + dist^2 - 2*antidisp*dist*alpha
+//          antithetasq = antidisp^2 + antidist^2 - 2*antidisp*antidist*antialpha
 //
 //    c[1]:
@@ -140,6 +143,9 @@
     AddToBranchList("MHillas.fSize");
     AddToBranchList("MHillasSrc.fAlpha");
+    AddToBranchList("MHillasSrc.fDist");
+    AddToBranchList("MHillasSrc.fCosDeltaAlpha");
     AddToBranchList("MHillasSrcAnti.fAlpha");
-    AddToBranchList("MHillasExt.fMaxDist");
+    AddToBranchList("MHillasSrcAnti.fDist");
+    AddToBranchList("MHillasSrcAnti.fCosDeltaAlpha");
     AddToBranchList("MHillasExt.fM3Long");
     AddToBranchList("MNewImagePar.fLeakage1");
@@ -270,14 +276,15 @@
     fMatrix = mat;
 
+    fMap[kEWdivL]   = fMatrix->AddColumn("MHillas.fWidth/MHillas.fLength");
     fMap[kESize]    = fMatrix->AddColumn("log10(MHillas.fSize)");
     fMap[kEArea]    = fMatrix->AddColumn("MHillas.GetArea*MGeomCam.fConvMm2Deg*MGeomCam.fConvMm2Deg");
-    fMap[kEM3Trans] = fMatrix->AddColumn("abs(MHillasExt.fM3Trans)*MGeomCam.fConvMm2Deg");
-    fMap[kEM3Long]  = fMatrix->AddColumn("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg");
-    fMap[kESrcSign] = fMatrix->AddColumn("sign(MHillasSrc.fCosDeltaAlpha)");
-    fMap[kEWdivL]   = fMatrix->AddColumn("MHillas.fWidth/MHillas.fLength");
+
+    fMap[kELeakage] = fMatrix->AddColumn("log10(MNewImagePar.fLeakage1+1)");
 
     fMap[kEAlpha]   = fMatrix->AddColumn("MHillasSrc.fAlpha");
     fMap[kEDist]    = fMatrix->AddColumn("MHillasSrc.fDist*MGeomCam.fConvMm2Deg");
-    fMap[kELeakage] = fMatrix->AddColumn("log10(MNewImagePar.fLeakage1+1)");
+    fMap[kEM3Long]  = fMatrix->AddColumn("MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg");
+
+    fMap[kESrcSign] = fMatrix->AddColumn("sign(MHillasSrc.fCosDeltaAlpha)");
 
     if (fThetaCut&kOff)
@@ -285,4 +292,5 @@
         fMap[kEAlphaAnti]  = fMatrix->AddColumn("MHillasSrcAnti.fAlpha");
         fMap[kEDistAnti]   = fMatrix->AddColumn("MHillasSrcAnti.fDist*MGeomCam.fConvMm2Deg");
+        fMap[kEM3LongAnti] = fMatrix->AddColumn("MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg");
     }
 
Index: trunk/MagicSoft/Mars/mfilter/MFMagicCuts.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFMagicCuts.h	(revision 7978)
+++ trunk/MagicSoft/Mars/mfilter/MFMagicCuts.h	(revision 7979)
@@ -42,7 +42,6 @@
     // the last on in the list. It is used as counter for fMap.
     enum {
-        kESize, kEAlpha, kEAlphaAnti, kEArea, kEDist,
-        kEM3Long, kEM3LongAnti, kEM3Trans, kEDistAnti, kEWdivL,
-        kELeakage, kESrcSign, kEHadronness,
+        kESize, kEAlpha, kEAlphaAnti, kEArea, kEDist, kEDistAnti,
+        kEM3Long, kEM3LongAnti, kEWdivL, kELeakage, kESrcSign, kEHadronness,
         kLastElement
     };
