Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7748)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7749)
@@ -18,4 +18,38 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/05/29 Thomas Bretz
+
+   * mbase/MEnv.cc:
+     - included THashList for compatibility with root 5.10/00
+
+   * mdata/MDataArray.[h,cc]:
+     - included TVector in header for compatibility with root 5.10/00
+
+   * mgui/MHexagon.cc:
+     - changed argument of PaintFillArea from Float_t to Double_t
+       for compatibility with root 5.10/00
+
+   * mhbase/MHMatrix.[h,cc]:
+     - added some #ifdef for compatibility with root 5.10/00
+     - included TVector in the header for compatibility with
+       root 5.10/00
+
+   * mjtrain/MJTrainDisp.cc:
+     - added the possibility to set weights
+     - added new histogram to show avg psf versus energy
+
+   * mjtrain/MJTrainRanForest.cc:
+     - included TFile for compatibility with root 5.10/00
+
+   * mranforest/MRanForest.[h,cc]:
+     - included TMatrix and TVector in header for compatibilty
+       with root 5.10/00
+
+   * mtools/MHSimulatedAnnealing.[h,cc]:
+     - included TMatrix and TVector in header for compatibilty
+       with root 5.10/00
+
+
 
  2006/05/24
Index: trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7749)
@@ -40,4 +40,5 @@
 #include <TAttText.h>
 #include <TAttMarker.h>
+#include <THashList.h>   // needed since root v5.10/00 (TEnv::GetTable)
 
 #include "MLog.h"
Index: trunk/MagicSoft/Mars/mdata/MDataArray.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mdata/MDataArray.cc	(revision 7749)
@@ -35,6 +35,4 @@
 #include <fstream>
 
-#include <TVector.h>
-
 #include "MLog.h"
 #include "MLogManip.h"
Index: trunk/MagicSoft/Mars/mdata/MDataArray.h
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataArray.h	(revision 7748)
+++ trunk/MagicSoft/Mars/mdata/MDataArray.h	(revision 7749)
@@ -3,6 +3,6 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//              
-//  MDataArray  
+//
+//  MDataArray
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -15,5 +15,7 @@
 #endif
 
-class TVector;
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
 
 class MData;
Index: trunk/MagicSoft/Mars/mgui/MHexagon.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mgui/MHexagon.cc	(revision 7749)
@@ -284,11 +284,11 @@
     const Int_t np = 6;
 
-    const Float_t dx[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    };
-    const Float_t dy[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 };
+    const Double_t dx[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    };
+    const Double_t dy[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 };
 
     //
     //  calculate the positions of the pixel corners
     //
-    Float_t x[np+1], y[np+1];
+    Double_t x[np+1], y[np+1];
     for (Int_t i=0; i<np+1; i++)
     {
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 7749)
@@ -53,5 +53,4 @@
 #include <TArrayD.h>
 #include <TArrayI.h>
-#include <TVector.h>
 
 #include <TH1.h>
@@ -421,5 +420,9 @@
         avg /= rows;
 
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+        TMatrixFColumn(m, x) += -avg;
+#else
         TMatrixColumn(m, x) += -avg;
+#endif
     }
 
@@ -924,5 +927,9 @@
     //
     TVector v(fM.GetNrows());
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+    v = TMatrixFColumn_const(fM, refcolumn);
+#else
     v = TMatrixColumn(fM, refcolumn);
+#endif
     //v += -frombin;
     //v *= 1/dbin;
@@ -1260,6 +1267,9 @@
     for (int i=0; i<m.GetNrows(); i++)
     {
+#if ROOT_VERSION_CODE > ROOT_VERSION(5,00,00)
+        const TMatrixFRow_const &row = TMatrixFRow_const(m, i);
+#else
         const TMatrixRow &row = TMatrixRow(m, i);
-
+#endif
         // finite (-> math.h) checks for NaN as well as inf
         int jcol;
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7748)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 7749)
@@ -9,11 +9,15 @@
 #include <TMatrix.h>
 #endif
+
 #ifndef MARS_MH
 #include "MH.h"
 #endif
 
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
+
 class TArrayI;
 class TArrayF;
-class TVector;
 class TH1F;
 
Index: trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc	(revision 7749)
@@ -115,4 +115,6 @@
     MHMatrix train("Train");
     train.AddColumns(fRules);
+    if (fEnableWeights)
+        train.AddColumn("MWeight.fVal");
     train.AddColumn("MHillasSrc.fDist*MGeomCam.fConvMm2Deg");
     //train.AddColumn("TMath::Hypot(MHillasSrc.fDCA, MHillasSrc.fDist)*MGeomCam.fConvMm2Deg");
@@ -126,4 +128,6 @@
     fill.AddPreCuts(fPreCuts);
     fill.AddPreCuts(fTrainCuts);
+    fill.AddPreTasks(fPreTasks);
+    fill.AddPostTasks(fPostTasks);
     if (!fill.Process())
         return kFALSE;
@@ -135,4 +139,5 @@
     rf.SetNumTry(fNumTry);
     rf.SetNumObsoleteVariables(1);
+    rf.SetLastDataColumnHasWeights(fEnableWeights);
     rf.SetDisplay(fDisplay);
     rf.SetLogStream(fLog);
@@ -191,4 +196,10 @@
     MFillH fillh(&hist, "", "FillThetaSq");
 
+    // 0 =  disp^2 - 2*disp*dist*cos(alpha) + dist^2
+
+    // cos^2 -1 = - sin^2
+
+    // disp = +dist* (cos(alpha) +/- sqrt(cos^2(alpha) - 1) )
+
     const char *rule = "(MHillasSrc.fDist*MGeomCam.fConvMm2Deg)^2 + (Disp.fVal)^2 - (2*MHillasSrc.fDist*MGeomCam.fConvMm2Deg*Disp.fVal*cos(MHillasSrc.fAlpha*kDeg2Rad))";
 
@@ -199,15 +210,21 @@
     eval.SetY1("sqrt(ThetaSquared.fVal)");
 
-    MH3 hdisp("MHillas.fSize", "sqrt(ThetaSquared.fVal)");
-    hdisp.SetTitle("\\vartheta distribution vs. Size:Size [phe]:\\vartheta [\\circ]");
-
-    MBinning binsx(100, 10, 100000, "BinningMH3X", "log");
-    MBinning binsy(100, 0,  2,      "BinningMH3Y", "lin");
+    MH3 hdisp1("MHillas.fSize",  "sqrt(ThetaSquared.fVal)");
+    MH3 hdisp2("MMcEvt.fEnergy", "sqrt(ThetaSquared.fVal)");
+    hdisp1.SetTitle("\\vartheta distribution vs. Size:Size [phe]:\\vartheta [\\circ]");
+    hdisp2.SetTitle("\\vartheta distribution vs. Energy:Enerhy [GeV]:\\vartheta [\\circ]");
+
+    MBinning binsx(50, 10, 100000, "BinningMH3X", "log");
+    MBinning binsy(50, 0,  1,      "BinningMH3Y", "lin");
 
     plist.AddToList(&binsx);
     plist.AddToList(&binsy);
 
-    MFillH fillh2(&hdisp, "", "FillMH3");
-    fillh2.SetDrawOption("blue profx");
+    MFillH fillh2a(&hdisp1, "", "FillSize");
+    MFillH fillh2b(&hdisp2, "", "FillEnergy");
+    fillh2a.SetDrawOption("blue profx");
+    fillh2b.SetDrawOption("blue profx");
+    fillh2a.SetNameTab("Size");
+    fillh2b.SetNameTab("Energy");
 
     tlist.AddToList(&readtst);
@@ -216,5 +233,6 @@
     tlist.AddToList(&calcthetasq);
     tlist.AddToList(&fillh);
-    tlist.AddToList(&fillh2);
+    tlist.AddToList(&fillh2a);
+    tlist.AddToList(&fillh2b);
     tlist.AddToList(&eval);
 
Index: trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc	(revision 7749)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz 11/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2005
+!   Copyright: MAGIC Software Development, 2005-2006
 !
 !
@@ -31,4 +31,6 @@
 /////////////////////////////////////////////////////////////////////////////
 #include "MJTrainRanForest.h"
+
+#include <TFile.h>
 
 #include "MLog.h"
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.cc	(revision 7749)
@@ -42,5 +42,4 @@
 #include "MRanForest.h"
 
-#include <TVector.h>
 #include <TRandom.h>
 
Index: trunk/MagicSoft/Mars/mranforest/MRanForest.h
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 7748)
+++ trunk/MagicSoft/Mars/mranforest/MRanForest.h	(revision 7749)
@@ -18,6 +18,12 @@
 #endif
 
-class TMatrix;
-class TVector;
+#ifndef ROOT_TMatrix
+#include <TMatrix.h>
+#endif
+
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
+
 class TObjArray;
 
Index: trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc	(revision 7748)
+++ trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc	(revision 7749)
@@ -33,6 +33,4 @@
 #include "MHSimulatedAnnealing.h"
 
-#include <TVector.h>
-#include <TMatrix.h>
 #include <TObjArray.h>
 
Index: trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.h	(revision 7748)
+++ trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.h	(revision 7749)
@@ -5,5 +5,4 @@
 //  MHSimulatedAnnealing
 //
-//  Output container of MSimulatedAnnealing
 ///////////////////////////////////////////////////////////////////////////////
 #ifndef MARS_MH
@@ -15,6 +14,12 @@
 #endif
 
-class TMatrix;
-class TVector;
+#ifndef ROOT_TMatrix
+#include <TMatrix.h>
+#endif
+
+#ifndef ROOT_TVector
+#include <TVector.h>
+#endif
+
 
 class MHSimulatedAnnealing : public MH
