Index: trunk/MagicSoft/Mars/macros/MagicHillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 3957)
@@ -16,19 +16,27 @@
 !
 !
-!   Author(s): Thomas Bretz et al,  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
+///////////////////////////////////////////////////////////////////////////
+//
+// MagicHillas.C
+// =============
+//
+// This is a demonstration program which calculates image (Hillas +)
+// parameters using as input a Merpp output file (raw data).
+// All parameters are written to an output file called hillas.root. Also
+// filles histograms are displayed.
+// For the calculation an arbitrary signal extractor (MCerPhotAnal2/Calc)
+// is used.
+//
+///////////////////////////////////////////////////////////////////////////
 
 void MagicHillas(const char *filename="~/data/Gamma_20_N*.root")
 {
-    //
-    // This is a demonstration program which calculates the Hillas
-    // parameter out of a Magic root file (raw data file).
-    //
-
     //
     // Create a empty Parameter List and an empty Task List
@@ -80,9 +88,15 @@
     read.DisableAutoScheme();
 
+    // Setup a task which makes sure that all used arrays have
+    // the correct size
     MGeomApply geomapl;
 
+    // tasks used if MC files are detected to calculate pedestals
     MMcPedestalCopy pcopy;
     MMcPedestalNSBAdd pnsb;
 
+    // calculate the signal in a very simple way
+    // for real adat files use MCerPhotAnal2 instead which also
+    // calculates the pedestal.
     MCerPhotCalc ncalc;
     //
@@ -95,15 +109,21 @@
     //
 
+    // setup image cleaning and blind pixel treatment
     MImgCleanStd    clean;
     MBlindPixelCalc blind;
+
     //
-    // Instead of unmapping the pixels you can also
+    // Instead of unmapping the pixels you can also (The use of this
+    // class is deprecated, it will be replaced by MBadPixels*)
     //
     // blind.SetUseInterpolation();
     // blind.SetUseCetralPixel();
     //
+
+    // setup tasks to calculate image parameters
     MHillasCalc    hcalc;
     MHillasSrcCalc csrc1;
 
+    // setup tasks to fill histograms
     MFillH hfill1("MHHillas", "MHillas");
     MFillH hfill2("MHHillasExt");
@@ -113,4 +133,5 @@
     MFillH hfill6("MHNewImagePar");
 
+    // setup task to write containers to a file
     MWriteRootFile write("hillas.root");
     write.AddContainer("MHStarMap");
@@ -121,4 +142,5 @@
     write.AddContainer("MHNewImagePar");
 
+    // Setup the contents of zour tasklist
     tlist.AddToList(&read);
     tlist.AddToList(&geomapl);
Index: trunk/MagicSoft/Mars/macros/comprob.C
===================================================================
--- trunk/MagicSoft/Mars/macros/comprob.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/comprob.C	(revision 3957)
@@ -1,29 +1,29 @@
 /* ======================================================================== *\
- !
- ! *
- ! * 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
- !
- !
- \* ======================================================================== */
+!
+! *
+! * 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-2004
+!
+!
+\* ======================================================================== */
 
-// -------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////
 //
 //  This macro demonstrates one way of gamma hadron separation using the
@@ -31,4 +31,5 @@
 //  a file ouput by the star.C macro containing image parameters)
 //
+///////////////////////////////////////////////////////////////////////////
 void comprob()
 {
Index: trunk/MagicSoft/Mars/macros/derotatedc.C
===================================================================
--- trunk/MagicSoft/Mars/macros/derotatedc.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/derotatedc.C	(revision 3957)
@@ -25,8 +25,18 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-//  derotate.C - STandard Analysis and Reconstruction (MC example)
+// derotatedc.C
+// ============
 //
-//  Derotate a MCamEvent and fill a histogram with derotated data
-//  (sky-plot)
+// Derotate a MCamEvent and fill a histogram with derotated data
+// (sky-plot).
+//
+// As an input you need a merpped root file conataining DC information
+// from a camera report file. To be able to derotate you also need
+// aproproitate time-stamps and the corresponding pointing information.
+//
+// All events are filled into a 2D histograms - derotated.
+//
+// The example shows the usage of MHCamEventRot. The output is the derotated
+// sky-plot.
 //
 /////////////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/macros/dohtml.C
===================================================================
--- trunk/MagicSoft/Mars/macros/dohtml.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/dohtml.C	(revision 3957)
@@ -22,4 +22,18 @@
 !
 \* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// dohtml.C
+// ========
+//
+// This is a service macro used to create the html-documentation from
+// source code (THtml)
+//
+// Add here all directories in which files are stored from which the
+// documentation should be created an add all macros which should be
+// converted to HTML.
+//
+///////////////////////////////////////////////////////////////////////////
 
 void dohtml()
Index: trunk/MagicSoft/Mars/macros/evtrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/evtrate.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/evtrate.C	(revision 3957)
@@ -1,28 +1,78 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// evtrate.C
+// =========
+//
+// Example macro how to calulate the eventrate (per event) and display
+// the result versus time.
+//
+// As an input you need a merpped raw-data file containing correct times.
+// The output is the plot: Eventrate vs. time.
+//
+///////////////////////////////////////////////////////////////////////////
+
 void evtrate()
 {
+    // Setup parameter- and tasklist
     MParList plist;
     MTaskList tlist;
     plist.AddToList(&tlist);
 
+    // Setup reading task
     MReadMarsFile read("Events");
     read.DisableAutoScheme();
     read.AddFile("test-time.root");
 
+    // Setup event rate calculator
     MEventRateCalc calc;
+    // Setup number of events to be averaged
     calc.SetNumEvents(200);
 
+    // Setup histogram to be filles with rate
     MHVsTime rate("MEventRate.fRate");
 
+    // Setup task to fill the histogram
     MFillH fill(&rate, "MTime");
 
+    // Setup tasklist
     tlist.AddToList(&read);
     tlist.AddToList(&calc);
     tlist.AddToList(&fill);
 
+    // Execute your eventloop
     MEvtLoop loop;
     loop.SetParList(&plist);
 
-    loop.Eventloop();
+    if (!loop.Eventloop())
+        return;
 
+    // print some execution statistics
+    tlist.PrintStatistics();
+
+    // Draw result
     rate.DrawClone();
 }
Index: trunk/MagicSoft/Mars/macros/merpp.C
===================================================================
--- trunk/MagicSoft/Mars/macros/merpp.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/merpp.C	(revision 3957)
@@ -16,17 +16,19 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
-
 /////////////////////////////////////////////////////////////////////////////
+//
+// merpp.C
+// =======
 //
 // This is an easy implementation of the Merging process (as root Macro)
 //
-// at the moment it reads a binary file ("rawtest.bin") which was written
+// at the moment it reads a binary file ("rawtest.raw") which was written
 // in the DAQ raw format.
 //
@@ -35,4 +37,7 @@
 //
 // This containers are written to a root file ("rawtest.root")
+//
+// It also demonstrates how you can loop over files in a single or more
+// than one directory and process them. For details see MRunIter.
 //
 /////////////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/macros/pixfirerate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pixfirerate.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/pixfirerate.C	(revision 3957)
@@ -17,6 +17,7 @@
 !
 !   Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
+!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -26,4 +27,5 @@
 //
 // pixfirerate.C
+// =============
 //
 // This macro can help to  find "hot" pixels firing too often
@@ -73,4 +75,6 @@
     tlist.AddToList(&geomapl);
 
+    // A list of threshold which should be displayed. The last entry
+    // MUST be -1.
     Double_t threshold[] = { 10, 20, 100, 200, -1 };
 
@@ -78,4 +82,5 @@
     while (threshold[cnt]>0) cnt++;
 
+    // Create the corresponding fill tasks and containers
     for (int i=0; i<cnt; i++)
     {
@@ -95,4 +100,5 @@
     }
 
+    // create the eventloop
     MEvtLoop evtloop;
     evtloop.SetParList(&plist);
Index: trunk/MagicSoft/Mars/macros/pixsatrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 3957)
@@ -17,6 +17,7 @@
 !
 !   Author(s): Abelardo Moralejo <mailto:moralejo@pd.infn.it>
+!   Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -26,4 +27,5 @@
 //
 // pixfirerate.C
+// =============
 //
 // This macro can help to  find "hot" pixels firing too often
@@ -73,4 +75,5 @@
     tlist.AddToList(&geomapl);
 
+    // Create histograms with saturation limits at 254
     MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains");
     MHTriggerLvl0 triglo(254, "SaturationLo", "Saturation Rate of Lo Gains");
@@ -78,4 +81,5 @@
     triglo.SetType(2);
 
+    // craete fill tasks to fill the histogarms
     MFillH fillhi(&trighi, "MRawEvtData");
     MFillH filllo(&triglo, "MRawEvtData");
@@ -83,4 +87,5 @@
     tlist.AddToList(&filllo);
 
+    // create eventloop
     MEvtLoop evtloop;
     evtloop.SetParList(&plist);
Index: trunk/MagicSoft/Mars/macros/plot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/plot.C	(revision 3957)
@@ -19,17 +19,31 @@
 !   Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
-// -------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////
 //
 //  plot.C
+//  ======
 //
 //  This macro shows how to fill and display a histogram using Mars
 //
+//  The advantage of using Mars histograms instead of root-trees is that
+//  you can fill values in your histogram which is calculated in the
+//  eventloop.
+//
+//  In this particular sample we fill a histogram with the size parameter
+//  of gammas and one with hadron's size. At the end we display both in a
+//  single plot.
+//
+//  The input is a star-macro already conatining image parameters.
+//
+///////////////////////////////////////////////////////////////////////////
+
 void plot()
 {
+    // Create a status display for graphical output
     MStatusDisplay *d = new MStatusDisplay;
     d->SetLogStream(&gLog);
@@ -57,9 +71,9 @@
 
     // Create a filter for Gammas
-    MFParticleId fgamma("MMcEvt", '=', kGAMMA);
+    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
     tlist.AddToList(&fgamma);
 
     // Create a filter for Non-Gammas
-    MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
+    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
     tlist.AddToList(&fhadrons);
 
Index: trunk/MagicSoft/Mars/macros/plot2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot2.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/plot2.C	(revision 3957)
@@ -19,15 +19,27 @@
 !   Author(s): Rudy Bock, 5/2002 <mailto:rkb@mppmu.mpg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
-// -------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////
 //
-//  plot.C
+//  plot2.C
+//  =======
 //
-//  This macro shows how to fill and display a 2D histogram using Mars
+//  This macro shows how to fill and display a histogram using Mars
 //
+//  The advantage of using Mars histograms instead of root-trees is that
+//  you can fill values in your histogram which is calculated in the
+//  eventloop.
+//
+//  In this particular sample we fill a histogram with width vs length
+//  of gammas and hadrons. At the end we display both in a single plot.
+//
+//  The input is a star-macro already conatining image parameters.
+//
+///////////////////////////////////////////////////////////////////////////
+
 void plot2()
 {
@@ -52,9 +64,9 @@
 
     // Create a filter for the gamma events
-    MFParticleId fgamma("MMcEvt", '=', kGAMMA);
+    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
     tlist.AddToList(&fgamma);
 
     // Create a filter for the non-gamma events
-    MFParticleId fhadrons("MMcEvt", '!', kGAMMA);
+    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
     tlist.AddToList(&fhadrons);
 
@@ -66,7 +78,9 @@
     plist.AddToList(&cam);
 
+    // Set the variables (converted to deg)
     TString vary("MHillas.fWidth*MGeomCam.fConvMm2Deg");
     TString varx("MHillas.fLength*MGeomCam.fConvMm2Deg");
 
+    // Set the binning
     MBinning binsy("BinningMH3Y");
     MBinning binsx("BinningMH3X");
Index: trunk/MagicSoft/Mars/macros/pointing.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pointing.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/pointing.C	(revision 3957)
@@ -1,2 +1,42 @@
+/* ======================================================================== *\
+!
+! *
+! * 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/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// pointing.C
+// ==========
+//
+// This macro is a demonstartion how check plots for a subsystem
+// (here the drive) can be made using Mars.
+//
+// In this case a merpped (root-) cc-report file is read in. The data
+// of the Drive branch is extracted using MReadReports and the
+// Stream-Id feature of MTaskList (second argument in AddToList).
+//
+// The output are plots showing (hopefully) the peformance of the system.
+//
+/////////////////////////////////////////////////////////////////////////////
+
 /*
  class MGraph : public TGraph
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 3957)
@@ -16,14 +16,30 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
+///////////////////////////////////////////////////////////////////////////
+//
+// readMagic.C
+// ===========
+//
+// This is a demonstration program showing how to do particular processing
+// on a single event basis. Here we simply display uncleand und cleand
+// images.
+// Therefor MInteractiveTask is used, which gives you the possibility
+// to develop new tasks without the need of compilation.
+// The input is a merpp raw-data file.
+//
+///////////////////////////////////////////////////////////////////////////
 
 Bool_t HandleInput()
 {
+    // This must be there to get accesss to the GUI while the macro
+    // is still running!
+
     TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
     while (1)
@@ -46,4 +62,7 @@
 }
 
+//
+// Setup the data-members of your 'virtual' class
+//
 MHCamera display[4];
 
@@ -52,11 +71,18 @@
 MTaskList *fTaskList;
 
+//
+// Called like all PreProcess functions of tasks. Get the access to
+// the containers necessary for you.
+//
 Int_t PreProcess(MParList *plist)
 {
+    // Get parameter and tasklist, see Process
     fParList = plist;
     fTaskList = (MTaskList*)plist->FindObject("MTaskList");
 
+    // Get camera geoemtry
     MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam");
 
+    // setup canvas and camera-histograms
     c = new TCanvas("Events", "Real Events", 600, 600);
     c->SetBorderMode(0);
@@ -73,6 +99,13 @@
 }
 
+//
+// Called like all Process functions of tasks. Process a single
+// event - here display it.
+//
 Int_t Process()
 {
+    // For simplicity we search in the Process function for the
+    // objects. This is deprectaed! Store the pointers to the objects
+    // as data member and get the pointers in PreProcess.
     MReadMarsFile *read = (MReadMarsFile*)fTaskList->FindObject("MRead");
     MClone *clone = (MClone*)fTaskList->FindObject("MClone");
@@ -80,6 +113,8 @@
     MGeomCam *geom = (MGeomCam*)fParList->FindObject("MGeomCam");
 
+    // Ouput event number
     cout << "Event #" << read->GetNumEntry() << ":" << endl;
 
+    // Fill the data into your camera-histograms
     display[0].SetCamContent(*(MCerPhotEvt*)clone->GetClone());
     display[1].SetCamContent(*(MCerPhotEvt*)fParList->FindObject("MCerPhotEvt"));
@@ -87,4 +122,5 @@
     display[3].SetCamContent(*(MCameraData*)fParList->FindObject("MCameraData"));
 
+    // Setup the cleaning level histogram
     TArrayF lvl(2);
     lvl[0] = clean->GetCleanLvl2();
@@ -92,4 +128,5 @@
     display[3].SetLevels(lvl);
 
+    // Update the display
     for (int i=1; i<=4; i++)
     {
@@ -98,11 +135,17 @@
     }
 
+    // print the data on the console
     ((MHillas*)fParList->FindObject("MHillas"))->Print(*geom);
     ((MHillasExt*)fParList->FindObject("MHillasExt"))->Print(*geom);
     ((MNewImagePar*)fParList->FindObject("MNewImagePar"))->Print(*geom);
 
+    // wait for 'return'
     return HandleInput();
 }
 
+//
+// Called like all PostProcess functions of tasks. Delete
+// instanciated objects.
+//
 Int_t PostProcess()
 {
@@ -111,5 +154,6 @@
 
 void readMagic(const char *fname="../Proton*.root")
-{               
+{
+    // Setup parameter- and tasklist
     MParList  plist;
     MTaskList tlist;
@@ -117,21 +161,41 @@
     plist.AddToList(&tlist);
 
+    // setup reading task
     MReadMarsFile read("Events", fname);
     read.DisableAutoScheme();
 
+    // setup a task making sure that all arrays are resized correctly
     MGeomApply geomapl;
+
+    // Setup a print task calling TObject::Print
     MPrint print1("MMcEvt");
     MPrint print2("MRawEvtHeader");
+    // Skip them if conatainers are not found
     print1.EnableSkip();
     print2.EnableSkip();
 
+    // Copy MC pedestals to apropriate conatiners (if MC file)
     MMcPedestalCopy   pcopy;
     MMcPedestalNSBAdd pnsb;
+
+    // Calculate signal and pedestal from data (use MCerPhotCalc
+    // in case of MC files)
     MCerPhotAnal2     ncalc;
+
+    // Blind Pixel Treatment (deprecated, will be replaced by
+    // MBadPixel*)
     MBlindPixelCalc   blind;
     blind.SetUseInterpolation();
+
+    // Clone MCerPhotEvt befor eimage cleaning
     MClone            clone("MCerPhotEvt");
+
+    // Setup image cleaning
     MImgCleanStd      clean;
+
+    // Setup calculation of Image parameters
     MHillasCalc       hcalc;
+
+    // Setup intercative task calling the functions defined above
     MTaskInteractive  mytask;
 
@@ -139,4 +203,5 @@
     mytask.SetProcess(Process);
 
+    // Setup your tasklist
     tlist.AddToList(&read);
     tlist.AddToList(&geomapl);
@@ -152,4 +217,5 @@
     tlist.AddToList(&mytask);
 
+    // Run your analysis
     MEvtLoop evtloop;
     evtloop.SetParList(&plist);
@@ -158,4 +224,5 @@
         return;
 
+    // Print statistics information about your loop
     tlist.PrintStatistics();
 }
Index: trunk/MagicSoft/Mars/macros/rootlogon.C
===================================================================
--- trunk/MagicSoft/Mars/macros/rootlogon.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/rootlogon.C	(revision 3957)
@@ -16,10 +16,33 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// rootlogon.C
+// ===========
+//
+// This file is the startup script ("autoexec.bat") executed when root is
+// started. The definition which file to start is done in ".rootrc".
+// There are three files which are automatically processed by root at
+// startup: A systemwide .rootrc, one in your home directory and one
+// in the current directory.
+// So rootlogon.C is correctly executed if your start root from your
+// Mars directory.
+//
+// The script setupts some small environmental things and makes
+// sure that the Mars shared object (libmars.so) is loaded. This shared
+// object gives you access to all Mars features from within the root
+// interpreter.
+//
+// If libmars.so is not found in the current directory we search in the
+// directory given in "MARSSYS" environment variable.
+//
+///////////////////////////////////////////////////////////////////////////
 
 Bool_t isloaded()
Index: trunk/MagicSoft/Mars/macros/runbook.C
===================================================================
--- trunk/MagicSoft/Mars/macros/runbook.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/runbook.C	(revision 3957)
@@ -1,4 +1,47 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// runbook.C
+// =========
+//
+// This is an example macro how to extract the runbook information of
+// a given date from the runbook files.
+//
+// The argument is a date in regexp format, eg.
+//   .x runbook.C("2004-05-1[0-9]")
+//
+// With an MDirIter you can tell the macro which directories and files
+// should be searched.
+//
+// The output are the runbook entries matching your query.
+//
+///////////////////////////////////////////////////////////////////////////
+
 void Wrap(TString &str)
 {
+    // Wrap lines to 80 chars
     while (str.Length()>80)
     {
@@ -15,6 +58,8 @@
 void ProcessFile(TString fname, TString date)
 {
+    // File processed
     cout << fname << endl;
 
+    // Open file
     ifstream fin(fname);
 
@@ -32,4 +77,5 @@
     while (!fin.eof())
     {
+        // Read file line by line
         char *txt=new char[i];
         fin.getline(txt, i-1);
@@ -58,7 +104,9 @@
         }
 
+        // Check whether line matches regexp
         if (!line(r0).IsNull())
             print = !line(r1).IsNull();
 
+        // Wrap lines to 80 chars
         if (print)
             Wrap(line);
@@ -71,4 +119,5 @@
 void runbook(const char *d="20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]")
 {
+    // Regexp to check for valid date
     TString regexp = "20[0-2][0-9]-[0-1][0-9]-[0-3][0-9]";
 
@@ -85,7 +134,9 @@
     }
 
+    // Tell which dierctories and files to search
     MDirIter Next;
     Next.AddDirectory("/home/MAGIC/online_data/runbook", "CC_*.rbk");
 
+    // Loop over files
     TString name;
     while (1)
Index: trunk/MagicSoft/Mars/macros/sectorvstime.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sectorvstime.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/sectorvstime.C	(revision 3957)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -25,6 +25,12 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-//  This macro is an example of how to plot the value of a part of the
-// camera or the whole camera.
+// sectorvstime.C
+// ==============
+//
+// In this example we plot the mean content of the right and left half of
+// camera. As an input we use a class derived from MCamEvent. Here this
+// are dc currents read directly from a camera control report file.
+//
+// The output are two histograms one for each half.
 //
 /////////////////////////////////////////////////////////////////////////////
Index: trunk/MagicSoft/Mars/macros/star.C
===================================================================
--- trunk/MagicSoft/Mars/macros/star.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/star.C	(revision 3957)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -27,6 +27,12 @@
 //  STAR - STandard Analysis and Reconstruction
 //
-//  This macro is the standard converter to convert raw data into image
-//  parameters
+// This macro is the standard converter to convert raw data into image
+// parameters. It is a demonstration how the star-executable implementation
+// looks like.
+//
+// As an input you need a Merpp output file (raw data).
+// All parameters are written to an output file called starfile.root.
+// For the calculation an arbitrary signal extractor (MCerPhotAnal2/Calc)
+// is used.
 //
 /////////////////////////////////////////////////////////////////////////////
@@ -34,8 +40,4 @@
 void star()
 {
-    //
-    // This is a demonstration program which calculates the image 
-    // parameters from a Magic raw data root file.
-
     //
     // Create a empty Parameter List and an empty Task List
@@ -101,5 +103,4 @@
     //
     // tlist.SetSerialNumber(1); // Serial number of telescope
-
     write.AddContainer(write.AddSerialNumber("MMcEvt"),       "Events", kFALSE);
     write.AddContainer(write.AddSerialNumber("MSigmabar"),    "Events");
Index: trunk/MagicSoft/Mars/macros/sumcurrents.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 3957)
@@ -18,8 +18,20 @@
 !   Author(s): Thomas Bretz, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// sumcurrents.C
+// =============
+//
+// This is a demonstration macro to display mean DC currents for all pixels.
+// The input is cc report file. The output are histograms and plots.
+// Using the MDirIter functionality you can process more than one file
+// in one or more directories. For more information see MDirIter.
+//
+///////////////////////////////////////////////////////////////////////////
 
 void ProcessFile(TString fname)
@@ -39,4 +51,5 @@
     //
 
+    // Create the magic geometry
     MGeomCamMagic geom;
     plist.AddToList(&geom);
@@ -49,4 +62,5 @@
     tlist.AddToList(&read);
 
+    // create a task to fill a histogram
     MFillH fill("MHCamEvent", "MCameraDC");
     tlist.AddToList(&fill);
@@ -66,4 +80,7 @@
     tlist.PrintStatistics();
 
+    //
+    // Now display the result of the loop
+    //
     MHCamEvent &h2 = *(MHCamEvent*)plist->FindObject("MHCamEvent");
     MHCamera &h = *(MHCamera*)h2.GetHistByName("sum");
@@ -129,10 +146,4 @@
 }
 
-// -------------------------------------------------------------------------
-//
-//  plot.C
-//
-//  This macro shows how to fill and display a histogram using Mars
-//
 void sumcurrents(const char *dirname=".")
 {
Index: trunk/MagicSoft/Mars/macros/tar.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tar.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/tar.C	(revision 3957)
@@ -1,2 +1,36 @@
+/* ======================================================================== *\
+!
+! *
+! * 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 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// tar.C
+// =====
+//
+// Service script. used to create the tar archive for an release. It makes
+// sure that the correct files are included and the name of the archive is
+// the name of the current directory (+.tar.gz)
+//
+///////////////////////////////////////////////////////////////////////////
 void tar()
 {
Index: trunk/MagicSoft/Mars/macros/testenv.C
===================================================================
--- trunk/MagicSoft/Mars/macros/testenv.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/testenv.C	(revision 3957)
@@ -1,2 +1,43 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// testenv.C
+// =========
+//
+// This example reads an config-file (steering card, input card, ...)
+// The contents of the file a forwarded to the apropriate eventloop
+// setup in your file.
+//
+// All tasks and containers in an eventloop should implement the
+// ReadEnv/WriteEnv function (for an example see the tasks used below).
+//
+// The functions gets the corresponding setup data from the file as an
+// argument and can change their behaviour and setup on this information.
+//
+///////////////////////////////////////////////////////////////////////////
+
 void testenv()
 {
Index: trunk/MagicSoft/Mars/macros/weights.C
===================================================================
--- trunk/MagicSoft/Mars/macros/weights.C	(revision 3930)
+++ trunk/MagicSoft/Mars/macros/weights.C	(revision 3957)
@@ -18,22 +18,20 @@
 !   Author(s): Marcos Lopez, 10/2003 <mailto:marcos@gae.ucm.es>
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
 \* ======================================================================== */
 
-
 //////////////////////////////////////////////////////////////////////////////
-//                                                                          //
-// This macro shows how to use the class MMcWeightEnergySpecCalc            //
-// to convert the energy spectrum of the MC showers generated with Corsika, //
-// to a different one.                                                      //
-//                                                                          //
+//
+// weights.C
+// =========
+//
+// This macro shows how to use the class MMcWeightEnergySpecCalc
+// to convert the energy spectrum of the MC showers generated with Corsika,
+// to a different one.
+//
 //////////////////////////////////////////////////////////////////////////////
 
-
-// --------------------------------------------------------------------------
-//
-//
 Double_t myfunction(Double_t *x, Double_t *par)
 {
@@ -43,9 +41,4 @@
 }
 
-
-
-// --------------------------------------------------------------------------
-//
-//
 void weights(TString filename="/up1/data/Magic-MC/CameraAll/Gammas/zbin0/Gamma_zbin0_0_7_1000to1009_w0-4:4:2.root")
 {
@@ -109,5 +102,4 @@
     //-------------------------------------------------------------
 
-
     MFillH hfill(&h1,"MMcEvt");
     MFillH hfill2(&h2,"MMcEvt");
@@ -118,5 +110,4 @@
     tasklist.AddToList(&hfill);
     tasklist.AddToList(&hfill2);
-
 
     //
@@ -132,6 +123,5 @@
     parlist.Print();
 
-
-    // 
+    //
     // Draw the Results
     //
@@ -146,17 +136,3 @@
     hist1->DrawClone();
     hist2->DrawClone("same");    
-
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
