Index: trunk/MagicSoft/Mars/macros/comprob.C
===================================================================
--- trunk/MagicSoft/Mars/macros/comprob.C	(revision 1337)
+++ trunk/MagicSoft/Mars/macros/comprob.C	(revision 1337)
@@ -0,0 +1,115 @@
+/* ======================================================================== *\
+ !
+ ! *
+ ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+ ! * Software. It is distributed to you in the hope that it can be a useful
+ ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+ ! * It is distributed WITHOUT ANY WARRANTY.
+ ! *
+ ! * Permission to use, copy, modify and distribute this software and its
+ ! * documentation for any purpose is hereby granted without fee,
+ ! * provided that the above copyright notice appear in all copies and
+ ! * that both that copyright notice and this permission notice appear
+ ! * in supporting documentation. It is provided "as is" without express
+ ! * or implied warranty.
+ ! *
+ !
+ !   macro comprob.C
+ !
+ !   Author(s): Abelardo Moralejo
+ !   Author(s): Thomas Bretz, 2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+ !
+ !   Copyright: MAGIC Software Development, 2000-2002
+ !
+ !
+ \* ======================================================================== */
+
+void comprob()
+{
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    // Create task list and add it to the parameter list:
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    // First task in list: read mars file
+    MReadMarsFile read("Events", "star.root");
+    read.DisableAutoScheme();
+    tlist.AddToList(&read);
+
+    // Task to do the composite analysis of Hillas parameters:
+    MHCompProb compprob(500);
+    compprob.Add("MHillas.fWidth",              500,    0, 160);
+    compprob.Add("MHillas.fLength",             500,    0, 300);
+    compprob.Add("abs(MHillas.fAsym)",          500,    0, 400);
+    compprob.Add("HillasSource.fDist",          500,    0, 400);
+    compprob.Add("abs(HillasSource.fHeadTail)", 500,    0, 400);
+    compprob.Add("abs(MHillas.fM3Long)",        500,    0, 300);
+    compprob.Add("abs(MHillas.fM3Trans)",       500,    0, 150);
+    compprob.Add("MHillas.fConc1",              500,    0, 0.6);
+    compprob.Add("MHillas.fConc",               500,    0, 0.9);
+    compprob.Add("log10(MHillas.fSize)",        500,    0,   5);
+
+    plist.AddToList(&compprob);
+
+    MFillH fill(&compprob, "MMcEvt");
+
+    // Energy filter:
+    /*
+     MF filter("MMcEvt.fEnergy < 100");
+     fill->SetFilter(&filter);
+     tlist.AddToList(&filter);
+     */
+
+    tlist.AddToList(&fill);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    // Loop over all data to fill the "normal" histograms:
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+
+    gLog.SetDebugLevel(2);
+
+    // Loop to fill the variable bin histograms:
+    read.SetEventNum(0);
+    if (!evtloop.Eventloop())
+        return;
+
+    // ------------------------------------------------------------------
+
+    // Create task list and replace the old task list with the new one
+    MTaskList tlist2;
+    plist.Replace(&tlist2);
+
+    // First task in list: read mars file
+    MReadMarsFile read2("Events", "star2.root");
+    read2.DisableAutoScheme();
+    tlist2.AddToList(&read2);
+
+    // create task to calculate composite probabilities
+    MCompProbCalc calc;
+    tlist2.AddToList(&calc);
+
+    // fill probabilities (hadroness) into histogram
+    MFillH fill2("MHHadroness");
+    tlist2.AddToList(&fill2);
+
+    // Loop to fill the hadronness histograms:
+    if (!evtloop.Eventloop())
+        return;
+
+    plist.FindObject("MHHadroness")->DrawClone();
+    plist.FindObject("MHHadroness")->Print();
+}
+
Index: trunk/MagicSoft/Mars/macros/dohtml.C
===================================================================
--- trunk/MagicSoft/Mars/macros/dohtml.C	(revision 1325)
+++ trunk/MagicSoft/Mars/macros/dohtml.C	(revision 1337)
@@ -41,13 +41,16 @@
 
     html.SetSourceDir("macros");
-    html.Convert("merpp.C",       "MARS - Merging and Preprocessing");
-    html.Convert("readraw.C",     "MARS - How To Read A Raw");
-    html.Convert("rootlogon.C",   "MARS - rootlogon.C");
-    html.Convert("readCT1.C",     "MARS - Read and display CT1 Events");
-    html.Convert("readMagic.C",   "MARS - Read and display Magic Events");
-    html.Convert("CT1Hillas.C",   "MARS - Calculate CT1 Hillas");
-    html.Convert("MagicHillas.C", "MARS - Calculate Magic Hillas");
-    html.Convert("collarea.C",    "MARS - Calculate Collection Area from a MC root file");
-    html.Convert("threshold.C",   "MARS - Calculate Energy Threshold from a MC root file");
-    html.Convert("trigrate.C",    "MARS - Calculate Trigger Rate from a MC root file");
+    html.Convert("merpp.C",        "MARS - Merging and Preprocessing");
+    html.Convert("readraw.C",      "MARS - How To Read A Raw");
+    html.Convert("rootlogon.C",    "MARS - rootlogon.C");
+    html.Convert("readCT1.C",      "MARS - Read and display CT1 Events");
+    html.Convert("readMagic.C",    "MARS - Read and display Magic Events");
+    html.Convert("CT1Hillas.C",    "MARS - Calculate CT1 Hillas");
+    html.Convert("MagicHillas.C",  "MARS - Calculate Magic Hillas");
+    html.Convert("collarea.C",     "MARS - Calculate Collection Area from a MC root file");
+    html.Convert("threshold.C",    "MARS - Calculate Energy Threshold from a MC root file");
+    html.Convert("trigrate.C",     "MARS - Calculate Trigger Rate from a MC root file");
+    html.Convert("star.C",         "MARS - (St)andard (A)nalysis and (R)econstruction");
+    html.Convert("comprob.C",      "MARS - Calculation of composite probabilities for G/H-Seperation");
+    html.Convert("multidimdist.C", "MARS - Calculation of multidimensional distances for G/H-Seperation");
 }
Index: trunk/MagicSoft/Mars/macros/multidimdist.C
===================================================================
--- trunk/MagicSoft/Mars/macros/multidimdist.C	(revision 1337)
+++ trunk/MagicSoft/Mars/macros/multidimdist.C	(revision 1337)
@@ -0,0 +1,133 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+void multidimdist()
+{
+    //
+    // This is a demonstration program which calculates the Hillas
+    // parameter out of a Magic root file.
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    //
+    // Now setup the tasks and tasklist:
+    // ---------------------------------
+    //
+    // The first argument is the tree you want to read.
+    //   Events:     Cosmic ray events
+    //   PedEvents:  Pedestal Events
+    //   CalEvents:  Calibration Events
+    //
+    MReadMarsFile  read("Events", "star.root");
+    read.DisableAutoScheme();
+    tlist.AddToList(&read);
+
+    MFParticleId fgamma("MMcEvt", '=', kGAMMA);
+    tlist.AddToList(&fgamma);
+
+    MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
+    tlist.AddToList(&fhadrons);
+
+    MHMatrix matrix("MatrixGammas");
+    matrix.AddColumn("MHillas.fWidth");
+    matrix.AddColumn("MHillas.fLength");
+    matrix.AddColumn("MHillas.fWidth*MHillas.fLength/MHillas.fSize");
+    matrix.AddColumn("abs(MHillas.fAsym)");
+    matrix.AddColumn("abs(MHillas.fM3Long)");
+    matrix.AddColumn("abs(MHillas.fM3Trans)");
+    matrix.AddColumn("abs(HillasSource.fHeadTail)");
+    matrix.AddColumn("MHillas.fConc");
+    matrix.AddColumn("MHillas.fConc1");
+    matrix.AddColumn("HillasSource.fDist");
+    matrix.AddColumn("log10(MHillas.fSize)");
+    plist.AddToList(&matrix);
+
+    MHMatrix matrix2("MatrixHadrons");
+    matrix2.AddColumns(&matrix);
+    plist.AddToList(&matrix2);
+
+    MFillH fillmat("MatrixGammas");
+    fillmat.SetFilter(&fgamma);
+    tlist.AddToList(&fillmat);
+
+    MFillH fillmat2("MatrixHadrons");
+    fillmat2.SetFilter(&fhadrons);
+    tlist.AddToList(&fillmat2);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+
+    // ---------------------------------------------------------
+
+    MTaskList tlist2;
+
+    plist.Replace(&tlist2);
+
+    MReadMarsFile read2("Events", "star2.root");
+    read2.DisableAutoScheme();
+    tlist2.AddToList(&read2);
+
+    MMultiDimDistCalc calc(5);
+    tlist2.AddToList(&calc);
+
+    MFillH fillh("MHHadroness");
+
+    /*
+     MF filter("MMcEvt.fEnergy < 100");
+     fillh.SetFilter(&filter);
+     tlist2.AddToList(&filter);
+     */
+
+    tlist2.AddToList(&fillh);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist2.PrintStatistics();
+
+    plist.FindObject("MHHadroness")->DrawClone();
+    plist.FindObject("MHHadroness")->Print();
+}
Index: trunk/MagicSoft/Mars/macros/star.C
===================================================================
--- trunk/MagicSoft/Mars/macros/star.C	(revision 1337)
+++ trunk/MagicSoft/Mars/macros/star.C	(revision 1337)
@@ -0,0 +1,132 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  5/2002 <mailto:(tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  STAR - STandard Analysis and Reconstruction
+//
+//  This macro is the standard converter to convert raw data into image
+//  parameters
+//
+/////////////////////////////////////////////////////////////////////////////
+
+void star()
+{
+    //
+    // This is a demonstration program which calculates the Hillas
+    // parameter out of a Magic root file.
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    //
+    // Uncomment this two line if you want to use MHillasExt instead
+    // of MHillas
+    //
+    MHillasExt hext;
+    plist.AddToList(&hext);
+
+    //
+    // The geometry container must be created by yourself to make sure
+    // that you don't choos a wrong geometry by chance
+    //
+    MGeomCamMagic geomcam;
+    plist.AddToList(&geomcam);
+
+    //
+    // Craete the object which hlods the source positions in the camera
+    // plain in respect to which the image parameters will be calculated.
+    // For real data the containers will be filled by a task.
+    //
+    MSrcPosCam source("Source")
+    source.SetXY(0, 0);
+
+    MSrcPosCam antisrc("AntiSrc");
+    antisrc.SetXY(240, 0);
+
+    plist.AddToList(&source);
+    plist.AddToList(&antisrc);
+
+    //
+    // Now setup the tasks and tasklist:
+    // ---------------------------------
+    //
+    // The first argument is the tree you want to read.
+    //   Events:     Cosmic ray events
+    //   PedEvents:  Pedestal Events
+    //   CalEvents:  Calibration Events
+    //
+    MReadMarsFile read("Events");
+    read.AddFile("~/data/Gamma_0_7_1011*.root");
+    read.AddFile("~/data/prot_N_0*.root");
+    read.DisableAutoScheme();
+
+    MMcPedestalCopy   pcopy;
+    MMcPedestalNSBAdd pnsb;
+    MCerPhotCalc      ncalc;
+    MImgCleanStd      clean;
+    MBlindPixelCalc   blind;
+    MHillasCalc       hcalc;
+    MHillasSrcCalc    csrc1("Source",  "HillasSource");
+    MHillasSrcCalc    csrc2("AntiSrc", "HillasAntiSrc");
+
+    MWriteRootFile write("star2.root");
+    write.AddContainer("MHillas",       "Events");
+    write.AddContainer("HillasSource",  "Events");
+    write.AddContainer("HillasAntiSrc", "Events");
+    write.AddContainer("MMcEvt",        "Events");
+    write.AddContainer("MRawRunHeader", "RunHeaders");
+    write.AddContainer("MMcRunHeader",  "RunHeaders");
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&pcopy);
+    tlist.AddToList(&pnsb);
+    tlist.AddToList(&ncalc);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&blind);
+    tlist.AddToList(&hcalc);
+    tlist.AddToList(&csrc1);
+    tlist.AddToList(&csrc2);
+    tlist.AddToList(&write);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+}
