Index: trunk/MagicSoft/Mars/macros/comprob.C
===================================================================
--- trunk/MagicSoft/Mars/macros/comprob.C	(revision 1409)
+++ trunk/MagicSoft/Mars/macros/comprob.C	(revision 1410)
@@ -25,4 +25,10 @@
  \* ======================================================================== */
 
+// -------------------------------------------------------------------------
+//
+//  This macro demonstrates one way of gamma hadron separation using the
+//  composite probability method. To use it you need a star-file (which is
+//  a file ouput by the star.C macro containing image parameters)
+//
 void comprob()
 {
@@ -37,10 +43,14 @@
     plist.AddToList(&tlist);
 
-    // First task in list: read mars file
+    // First task in list: read the star file (reference data)
     MReadMarsFile read("Events", "star.root");
     read.DisableAutoScheme();
     tlist.AddToList(&read);
 
+    //
     // Task to do the composite analysis of Hillas parameters:
+    // Add(rule, number of bins, lower limit, upper limit)
+    // For the meaning of the rule see MDataChain
+    //
     MHCompProb compprob(500);
     compprob.Add("MHillas.fWidth",              500,    0, 160);
@@ -59,5 +69,5 @@
     MFillH fill(&compprob, "MMcEvt");
 
-    // Energy filter:
+    // Use this if you want to do it for a fixed energy range:
     /*
      MF filter("MMcEvt.fEnergy < 100");
@@ -93,5 +103,5 @@
     plist.Replace(&tlist2);
 
-    // First task in list: read mars file
+    // First task in list: read star file (test data)
     MReadMarsFile read2("Events", "star2.root");
     read2.DisableAutoScheme();
@@ -110,4 +120,8 @@
         return;
 
+    //
+    // Display the hadroness histograms and print some informations on
+    // the console window
+    //
     plist.FindObject("MHHadroness")->DrawClone();
     plist.FindObject("MHHadroness")->Print();
Index: trunk/MagicSoft/Mars/macros/plot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot.C	(revision 1409)
+++ trunk/MagicSoft/Mars/macros/plot.C	(revision 1410)
@@ -24,10 +24,12 @@
 \* ======================================================================== */
 
+// -------------------------------------------------------------------------
+//
+//  plot.C
+//
+//  This macro shows how to fill and display a histogram using Mars
+//
 void plot()
 {
-    //
-    // 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
@@ -43,16 +45,16 @@
     // ---------------------------------
     //
-    // The first argument is the tree you want to read.
-    //   Events:     Cosmic ray events
-    //   PedEvents:  Pedestal Events
-    //   CalEvents:  Calibration Events
-    //
+
+    // First Task: Read file with image parameters
+    // (created with the star.C macro)
     MReadMarsFile  read("Events", "star.root");
     read.DisableAutoScheme();
     tlist.AddToList(&read);
 
+    // Create a filter for Gammas
     MFParticleId fgamma("MMcEvt", '=', kGAMMA);
     tlist.AddToList(&fgamma);
 
+    // Create a filter for Non-Gammas
     MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
     tlist.AddToList(&fhadrons);
@@ -66,19 +68,22 @@
     MBinning bins("BinningMH3X");
     bins.SetEdgesLog(50, 100, 20000);
+    plist.AddToList(&bins);
     //
-    // -------------------------------------------------
+    // -------------------------------------------------------
 
+    // Create a histogram for the data from gammas and from non-gammas
     MH3 h3g(var);
     MH3 h3h(var);
 
+    // Add the histograms to the parameter container list
     plist.AddToList(&h3g);
     plist.AddToList(&h3h);
 
-    plist.AddToList(&bins);
-
+    // Create a task which fills one histogram with the gamma-data
     MFillH fillg(&h3g);
     fillg.SetFilter(&fgamma);
     tlist.AddToList(&fillg);
 
+    // Create a task which fills the other histogram with the non-gamma-data
     MFillH fillh(&h3h);
     fillh.SetFilter(&fhadrons);
@@ -99,5 +104,11 @@
     tlist.PrintStatistics();
 
+    // Create a default canvas called Plot and set the
+    // x-axis to logarithmic scale
     MH::MakeDefCanvas("Plot");
+    gPad->SetLogx();
+
+    // Setup some style options of the two histograms
+    // and draw a copy of both
     h3h.GetHist().SetLineColor(kRed);
     h3h.GetHist().SetFillStyle(4000);
@@ -105,4 +116,6 @@
     h3h.GetHist().DrawCopy("same");
 
+    // Now create a new histogram, fill it with the division of the
+    // two histograms and draw also a copy of it
     TH1D h;
     MH::SetBinning(&h, &bins);
@@ -111,5 +124,3 @@
     h.SetFillStyle(4000);
     h.DrawCopy("same");
-
-    gPad->SetLogx();
 }
Index: trunk/MagicSoft/Mars/macros/plot2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot2.C	(revision 1409)
+++ trunk/MagicSoft/Mars/macros/plot2.C	(revision 1410)
@@ -24,10 +24,12 @@
 \* ======================================================================== */
 
+// -------------------------------------------------------------------------
+//
+//  plot.C
+//
+//  This macro shows how to fill and display a 2D histogram using Mars
+//
 void plot2()
 {
-    //
-    // 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
@@ -43,16 +45,15 @@
     // ---------------------------------
     //
-    // The first argument is the tree you want to read.
-    //   Events:     Cosmic ray events
-    //   PedEvents:  Pedestal Events
-    //   CalEvents:  Calibration Events
-    //
+
+    // First Task: read in a file created with star.C
     MReadMarsFile  read("Events", "star.root");
     read.DisableAutoScheme();
     tlist.AddToList(&read);
 
+    // Create a filter for the gamma events
     MFParticleId fgamma("MMcEvt", '=', kGAMMA);
     tlist.AddToList(&fgamma);
 
+    // Create a filter for the non-gamma events
     MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
     tlist.AddToList(&fhadrons);
@@ -72,8 +73,10 @@
     binsy.SetEdges(11, 0, 0.3);
     binsx.SetEdges(11, 0, 0.6);
-
+    plist.AddToList(&binsx);
+    plist.AddToList(&binsy);
     //
     // -------------------------------------------------
 
+    // Create two 2D histograms and add them to the list
     MH3 h3g(varx, vary);
     MH3 h3h(varx, vary);
@@ -82,11 +85,10 @@
     plist.AddToList(&h3h);
 
-    plist.AddToList(&binsx);
-    plist.AddToList(&binsy);
-
+    // Create a task to fill one histogram with the gamma data
     MFillH fillg(&h3g);
     fillg.SetFilter(&fgamma);
     tlist.AddToList(&fillg);
 
+    // Create a task to fill the other one with the non gamma data
     MFillH fillh(&h3h);
     fillh.SetFilter(&fhadrons);
@@ -107,8 +109,13 @@
     tlist.PrintStatistics();
 
+    // Create a default canvas
     MH::MakeDefCanvas("Plot");
+
+    // setup some style options
     h3h.GetHist().SetMarkerColor(kRed);
     h3h.GetHist().SetLineColor(kRed);
     h3h.GetHist().SetFillStyle(4000);
+
+    // show a contour plot of both histograms
     h3h.GetHist().DrawCopy("cont3");
     h3g.GetHist().DrawCopy("cont3same");
@@ -116,4 +123,8 @@
     return;
 
+    //
+    // Use this (or something similar) if you want to plot the profile
+    // histograms
+    //
     TProfile *p = ((TH2&)h3g.GetHist()).ProfileX();
     p->Draw("same");
Index: trunk/MagicSoft/Mars/macros/star.C
===================================================================
--- trunk/MagicSoft/Mars/macros/star.C	(revision 1409)
+++ trunk/MagicSoft/Mars/macros/star.C	(revision 1410)
@@ -79,9 +79,4 @@
     // ---------------------------------
     //
-    // 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");
