Index: trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc	(revision 8646)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc	(revision 8656)
@@ -189,5 +189,5 @@
 // Run Disp optimization
 //
-Bool_t MJTrainDisp::Train(const char *out, const MDataSet &set, Int_t num)
+Bool_t MJTrainDisp::TrainDisp(const char *out, const MDataSet &set, Int_t num)
 {
     SetTitle(Form("TrainDisp: %s", out));
@@ -224,5 +224,5 @@
     if (fEnableWeights)
         train.AddColumn("MWeight.fVal");
-    train.AddColumn(fgTrainParameter);
+    train.AddColumn(fTrainParameter);
 
     // ----------------------- Fill Matrix RF ----------------------
@@ -240,5 +240,5 @@
 
     // ------------------------ Train RF --------------------------
-    MRanForestCalc rf(fTitle);
+    MRanForestCalc rf("TrainDisp", fTitle);
     rf.SetNumTrees(fNumTrees);
     rf.SetNdSize(fNdSize);
@@ -268,4 +268,6 @@
     gLog.Separator("Test");
 
+    MH::SetPalette("pretty");
+
     MParList  plist;
     MTaskList tlist;
@@ -329,6 +331,6 @@
     MFillH fillh2a(&hdisp1, "", "FillSize");
     MFillH fillh2b(&hdisp2, "", "FillEnergy");
-    fillh2a.SetDrawOption("blue profx");
-    fillh2b.SetDrawOption("blue profx");
+    fillh2a.SetDrawOption("colz profx");
+    fillh2b.SetDrawOption("colz profx");
     fillh2a.SetNameTab("Size");
     fillh2b.SetNameTab("Energy");
@@ -354,5 +356,7 @@
 
     // Print the result
-    *fLog << inf << "Rule: " << rule << endl;
+    *fLog << inf;
+    *fLog << "Rule: " << rule << endl;
+    *fLog << "Disp: " << fTrainParameter << endl;
     hist.GetAlphaFitter().Print("result");
 
@@ -366,2 +370,162 @@
 }
 
+/*
+#include "MParameterCalc.h"
+#include "MHillasCalc.h"
+#include "../mpointing/MSrcPosRndm.h"
+
+Bool_t MJTrainDisp::TrainGhostbuster(const char *out, const MDataSet &set, Int_t num)
+{
+    SetTitle(Form("TrainGhostbuster: %s", out));
+
+    if (fDisplay)
+        fDisplay->SetTitle(fTitle);
+
+    if (!set.IsValid())
+    {
+        *fLog << err << "ERROR - DataSet invalid!" << endl;
+        return kFALSE;
+    }
+
+    if (!HasWritePermission(out))
+        return kFALSE;
+
+    *fLog << inf;
+    fLog->Separator(GetDescriptor());
+
+    // --------------------- Setup files --------------------
+    MReadMarsFile readtrn("Events");
+    MReadMarsFile readtst("Events");
+    readtrn.DisableAutoScheme();
+    readtst.DisableAutoScheme();
+
+    if (!set.AddFilesOn(readtrn))
+        return kFALSE;
+    if (!set.AddFilesOff(readtst))
+        return kFALSE;
+
+    // ----------------------- Setup Matrix ------------------
+    MHMatrix train("Train");
+    train.AddColumns(fRules);
+    if (fEnableWeights)
+        train.AddColumn("MWeight.fVal");
+    train.AddColumn("sign(MHillasSrc.fCosDeltaAlpha)==sign(SignStore.fVal)");
+
+    MParameterCalc calc("MHillasSrc.fCosDeltaAlpha", "SignStore");
+    calc.SetNameParameter("SignStore");
+
+    MSrcPosRndm rndm;
+    rndm.SetRule(fTrainParameter);
+    //rndm.SetDistOfSource(120*3.37e-3);
+
+    MHillasCalc hcalc;
+    hcalc.SetFlags(MHillasCalc::kCalcHillasSrc);
+
+    // ----------------------- Fill Matrix RF ----------------------
+    MTFillMatrix fill(fTitle);
+    fill.SetDisplay(fDisplay);
+    fill.SetLogStream(fLog);
+    fill.SetDestMatrix1(&train, num);
+    fill.SetReader(&readtrn);
+    fill.AddPreCuts(fPreCuts);
+    fill.AddPreCuts(fTrainCuts);
+    fill.AddPreTasks(fPreTasks);
+    fill.AddPostTasks(fPostTasks);
+    fill.AddPostTask(&calc);
+    fill.AddPostTask(&rndm);
+    fill.AddPostTask(&hcalc);
+    if (!fill.Process())
+        return kFALSE;
+
+    // ------------------------ Train RF --------------------------
+    MRanForestCalc rf("TrainGhostbuster", fTitle);
+    rf.SetNumTrees(fNumTrees);
+    rf.SetNdSize(fNdSize);
+    rf.SetNumTry(fNumTry);
+    rf.SetNumObsoleteVariables(1);
+    rf.SetLastDataColumnHasWeights(fEnableWeights);
+    rf.SetDisplay(fDisplay);
+    rf.SetLogStream(fLog);
+    rf.SetFileName(out);
+    rf.SetDebug(fDebug>1);
+    rf.SetNameOutput("Sign");
+
+    if (!rf.TrainRegression(train))                  // regression (best choice)
+        return kFALSE;
+
+    // --------------------- Display result ----------------------
+
+    gLog.Separator("Test");
+
+    MH::SetPalette("pretty");
+
+    MParList  plist;
+    MTaskList tlist;
+    plist.AddToList(this);
+    plist.AddToList(&tlist);
+    //plist.AddToList(&b);
+
+    MFilterList list;
+    if (!list.AddToList(fPreCuts))
+        *fLog << err << "ERROR - Calling MFilterList::AddToList for fPreCuts failed!" << endl;
+    if (!list.AddToList(fTestCuts))
+        *fLog << err << "ERROR - Calling MFilterList::AddToList for fTestCuts failed!" << endl;
+
+    MContinue cont(&list);
+    cont.SetInverted();
+
+    const char *rule = "abs(Sign.fVal-(sign(MHillasSrc.fCosDeltaAlpha)==sign(SignStore.fVal)))";
+
+    //MChisqEval eval;
+    //eval.SetY1("sqrt(ThetaSquared.fVal)");
+
+    MH3 hsign1("MHillas.fSize",  rule);
+    MH3 hsign2("MMcEvt.fEnergy", rule);
+    hsign1.SetTitle("Was ist das? vs. Size:Size [phe]:XXX");
+    hsign2.SetTitle("Was ist das? vs. Energy:Enerhy [GeV]:XXXX");
+
+    MBinning binsx( 70, 10, 31623, "BinningMH3X", "log");
+    MBinning binsy( 51,  0,     1, "BinningMH3Y", "lin");
+
+    plist.AddToList(&binsx);
+    plist.AddToList(&binsy);
+
+    MFillH fillh2a(&hsign1, "", "FillSize");
+    MFillH fillh2b(&hsign2, "", "FillEnergy");
+    fillh2a.SetDrawOption("profx colz");
+    fillh2b.SetDrawOption("profx colz");
+    fillh2a.SetNameTab("Size");
+    fillh2b.SetNameTab("Energy");
+
+    tlist.AddToList(&readtst);
+    tlist.AddToList(&cont);
+    tlist.AddToList(&calc);
+    tlist.AddToList(&rndm);
+    tlist.AddToList(&hcalc);
+    tlist.AddToList(&rf);
+    tlist.AddToList(&fillh2a);
+    tlist.AddToList(&fillh2b);
+    //tlist.AddToList(&eval);
+
+    MEvtLoop loop(fTitle);
+    loop.SetLogStream(fLog);
+    loop.SetDisplay(fDisplay);
+    loop.SetParList(&plist);
+    //if (!SetupEnv(loop))
+    //    return kFALSE;
+
+    if (!loop.Eventloop())
+        return kFALSE;
+
+    // Print the result
+    *fLog << inf << "Rule: " << rule << endl;
+
+    //DisplayResult(hdisp1, hdisp2);
+
+    SetPathOut(out);
+    if (!WriteDisplay(0, "UPDATE"))
+        return kFALSE;
+
+    return kTRUE;
+}
+*/
Index: trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.h
===================================================================
--- trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.h	(revision 8646)
+++ trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.h	(revision 8656)
@@ -27,4 +27,5 @@
 
     Bool_t Train(const char *out, const MDataSet &set, Int_t num);
+    //Bool_t TrainGhostbuster(const char *out, const MDataSet &set, Int_t num);
 
     ClassDef(MJTrainDisp, 0)//Class to train Random Forest disp estimator
