Index: trunk/MagicSoft/Mars/macros/CT1Hillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 1489)
+++ trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 1490)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!   Author(s): Thomas Bretz et al,  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
@@ -24,9 +24,10 @@
 
 
-void CT1Hillas()
+void CT1Hillas(const char *filename)
 {
     //
     // This is a demonstration program which calculates the Hillas
-    // parameter out of a CT1 dataset.
+    // parameter out of a Magic root file (raw data file).
+    //
 
     //
@@ -34,5 +35,6 @@
     // The tasklist is identified in the eventloop by its name
     //
-    MParList  plist;
+    MParList plist;
+
 
     MTaskList tlist;
@@ -47,22 +49,21 @@
 
     //
-    // Setup binning for your histograms.
+    // Use this if you want to change the binning of one of
+    // the histograms. You can use:
+    // BinningConc, BinningConc1, BinningAsym, BinningM3Long,
+    // BinningM3Trans, BinningWidth, BinningLength, BinningDist,
+    // BinningHeadTail, BinningAlpha, BinningSize, BinningDelta,
+    // BinningPixels and BinningCamera
     //
-    MBinning binswidth("BinningWidth");
-    binswidth.SetEdges(100, 0, 1);   // 100 bins from 0 to 1 deg
+    // For more information see MBinning and the corresponding
+    // histograms
+    //
+    // MBinning binsalpha("BinningAlpha");
+    // binsalpha.SetEdges(90, 0, 90);       // 90 bins from 0 to 90 deg
+    // plist.AddToList(&binsalpha);
 
-    MBinning binslength("BinningLength");
-    binslength.SetEdges(100, 0, 1);  // 100 bins from 0 to 1 deg
-
-    MBinning binsalpha("BinningAlpha");
-    binsalpha.SetEdges(90, 0, 90);   // 90 bins from 0 to 90 deg
-
-    MBinning binsdist("BinningDist");
-    binsdist.SetEdges(100, 0, 2);    // 100 bins from 0 to 2 deg
-
-    plist.AddToList(&binswidth);
-    plist.AddToList(&binslength);
-    plist.AddToList(&binsalpha);
-    plist.AddToList(&binsdist);
+    // MBinning binssize("BinningSize");
+    // binssize.SetEdgesLog(50, 1, 1e7);
+    // plist.AddToList(&binssize);
 
     //
@@ -73,5 +74,4 @@
     MSrcPosCam source("Source")
     source.SetXY(0, 0);
-
     plist.AddToList(&source);
 
@@ -87,19 +87,66 @@
     //read.AddFile("../data/CT1_97_off1.dat");
 
-    MImgCleanStd   clean;
+    MMcPedestalCopy pcopy;
+    MMcPedestalNSBAdd pnsb;
+
+    MCerPhotCalc ncalc;
+    //
+    //  Alternative photon calculation:
+    //  Example: use only 2nd to 6th FADC slices for photon calculation:
+    //
+    //    MCerPhotCalc2 ncalc;
+    //    const Float_t x[15]={0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+    //    TArrayF w(15,x);
+    //    ncalc.SetWeights(w);
+    //
+
+    MCameraSmooth   smooth;
+    MImgCleanStd    clean;
+    MBlindPixelCalc blind;
+    //
+    // Instead of unmapping the pixels you can also
+    //
+    // blind.SetUseInterpolation();
+    // blind.SetUseCetralPixel();
+    //
     MHillasCalc    hcalc;
     MHillasSrcCalc csrc1("Source",  "HillasSource");
 
-    MFillH hfill("MHHillas",   "MHillas");
-    MFillH sfill("MHStarMap",  "MHillas");
-    MFillH hfill2s("HistSource  [MHHillasSrc]", "HillasSource");
+    //
+    // Uncomment this two line if you want to use MHillasExt instead
+    // of MHillas
+    //
+    //MHillasExt hext;
+    //plist.AddToList(&hext);
+
+    MFillH hfill1("MHHillas", "MHillas");
+    MFillH hfill2("MHHillasExt");
+    MFillH hfill3("MHStarMap", "MHillas");
+    MFillH hfill4("HistExtSource [MHHillasExt]", "HillasSource");
+    MFillH hfill5("HistSource [MHHillasSrc]", "HillasSource");
+
+    MWriteRootFile write("hillas.root");
+    write.AddContainer("HillasSource",  "Hillas");
+    write.AddContainer("MHStarMap");
+    write.AddContainer("MMcEvt","Hillas");
+    write.AddContainer("Source","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(&hfill);
-    tlist.AddToList(&sfill);
-    tlist.AddToList(&hfill2s);
+    tlist.AddToList(&csrc2);
+
+    tlist.AddToList(&hfill1);
+    tlist.AddToList(&hfill2);
+    tlist.AddToList(&hfill3);
+    tlist.AddToList(&hfill4);
+    tlist.AddToList(&hfill5);
+    tlist.AddToList(&write);
 
     //
@@ -115,9 +162,14 @@
         return;
 
+    tlist.PrintStatistics();
+
     //
     // After the analysis is finished we can display the histograms
     //
     plist.FindObject("MHHillas")->DrawClone();
+    plist.FindObject("MHHillasExt")->DrawClone();
+    plist.FindObject("MHStarMap")->DrawClone();
     plist.FindObject("HistSource")->DrawClone();
-    plist.FindObject("MHStarMap")->DrawClone();
+    plist.FindObject("HistExtSource")->DrawClone();
 }
+
Index: trunk/MagicSoft/Mars/macros/MagicHillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 1489)
+++ trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 1490)
@@ -24,5 +24,5 @@
 
 
-void MagicHillas(const char *filename="~/data/Gamma*.root")
+void MagicHillas(const char *filename="~/data/Gamma_20_N*.root")
 {
     //
@@ -35,17 +35,9 @@
     // The tasklist is identified in the eventloop by its name
     //
-    MParList  plist;
+    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);
-     */
 
     //
@@ -58,31 +50,20 @@
     //
     // Use this if you want to change the binning of one of
-    // the histograms
+    // the histograms. You can use:
+    // BinningConc, BinningConc1, BinningAsym, BinningM3Long,
+    // BinningM3Trans, BinningWidth, BinningLength, BinningDist,
+    // BinningHeadTail, BinningAlpha, BinningSize, BinningDelta,
+    // BinningPixels and BinningCamera
     //
-    /*
-     MBinning binswidth("BinningWidth");
-     binswidth.SetEdges(100, 0, 0.1);     // 100 bins from 0 to 1 deg
-     plist.AddToList(&binswidth);
+    // For more information see MBinning and the corresponding
+    // histograms
+    //
+    // MBinning binsalpha("BinningAlpha");
+    // binsalpha.SetEdges(90, 0, 90);       // 90 bins from 0 to 90 deg
+    // plist.AddToList(&binsalpha);
 
-     MBinning binslength("BinningLength");
-     binslength.SetEdges(100, 0, 1);      // 100 bins from 0 to 1 deg
-     plist.AddToList(&binslength);
-
-     MBinning binsdist("BinningDist");
-     binsdist.SetEdges(100, 0, 1.5);      // 100 bins from 0 to 1 deg
-     plist.AddToList(&binsdist);
-
-     MBinning binsht("BinningHeadTail");
-     binsht.SetEdges(100, -1.5, 1.5);     // 100 bins from 0 to 1 deg
-     plist.AddToList(&binsht);
-
-     MBinning binsalpha("BinningAlpha");
-     binsalpha.SetEdges(90, 0, 90);       // 90 bins from 0 to 90 deg
-     plist.AddToList(&binsalpha);
-
-     MBinning binscam("BinningCamera");
-     binscam.SetEdges(50, -1.5, 1.5);     //  20 bins from -2 to 2 deg
-     plist.AddToList(&binscam);
-    */
+    // MBinning binssize("BinningSize");
+    // binssize.SetEdgesLog(50, 1, 1e7);
+    // plist.AddToList(&binssize);
 
     //
@@ -112,8 +93,8 @@
     read.DisableAutoScheme();
 
-    MMcPedestalCopy   pcopy;
+    MMcPedestalCopy pcopy;
     MMcPedestalNSBAdd pnsb;
 
-    MCerPhotCalc      ncalc;
+    MCerPhotCalc ncalc;
     //
     //  Alternative photon calculation:
@@ -126,28 +107,39 @@
     //
 
-    MImgCleanStd      clean;
-    MBlindPixelCalc   blind;
-    MHillasCalc       hcalc;
-    MHillasSrcCalc    csrc1("Source",  "HillasSource");
-    MHillasSrcCalc    csrc2("AntiSrc", "HillasAntiSrc");
+    MCameraSmooth   smooth;
+    MImgCleanStd    clean;
+    MBlindPixelCalc blind;
+    //
+    // Instead of unmapping the pixels you can also
+    //
+    // blind.SetUseInterpolation();
+    // blind.SetUseCetralPixel();
+    //
+    MHillasCalc    hcalc;
+    MHillasSrcCalc csrc1("Source",  "HillasSource");
+    MHillasSrcCalc csrc2("AntiSrc", "HillasAntiSrc");
 
-    MFillH hfill("MHHillas",   "MHillas");
-    MFillH sfill("MHStarMap",  "MHillas");
-    MFillH hfill2s("HistSource  [MHHillasSrc]", "HillasSource");
-    MFillH hfill2a("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
+    //
+    // Uncomment this two line if you want to use MHillasExt instead
+    // of MHillas
+    //
+    //MHillasExt hext;
+    //plist.AddToList(&hext);
+
+    MFillH hfill1("MHHillas", "MHillas");
+    MFillH hfill2("MHHillasExt");
+    MFillH hfill3("MHStarMap", "MHillas");
+    MFillH hfill4("HistExtSource [MHHillasExt]", "HillasSource");
+    MFillH hfill5("HistExtAntiSource [MHHillasExt]", "HillasAntiSource");
+    MFillH hfill6("HistSource [MHHillasSrc]", "HillasSource");
+    MFillH hfill7("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
 
     MWriteRootFile write("hillas.root");
-    write.AddContainer("MHillas",       "Hillas");
     write.AddContainer("HillasSource",  "Hillas");
     write.AddContainer("HillasAntiSrc", "Hillas");
     write.AddContainer("MHStarMap");
     write.AddContainer("MMcEvt","Hillas");
-
-    /*
-     MWriteAsciiFile write("hillas.txt");
-     write.AddColumn("MHillas.fLength*MGeomCam.fConvMm2Deg");
-     write.AddColumn("MHillas", "fConc");
-     write.AddColumns("MHillas");
-     */
+    write.AddContainer("Source","RunHeaders");
+    write.AddContainer("AntiSource","RunHeaders");
 
     tlist.AddToList(&read);
@@ -157,12 +149,16 @@
     tlist.AddToList(&clean);
     tlist.AddToList(&blind);
+
     tlist.AddToList(&hcalc);
     tlist.AddToList(&csrc1);
+    tlist.AddToList(&csrc2);
 
-    tlist.AddToList(&csrc2);
-    tlist.AddToList(&hfill);
-    tlist.AddToList(&sfill);
-    tlist.AddToList(&hfill2s);
-    tlist.AddToList(&hfill2a);
+    tlist.AddToList(&hfill1);
+    tlist.AddToList(&hfill2);
+    tlist.AddToList(&hfill3);
+    tlist.AddToList(&hfill4);
+    tlist.AddToList(&hfill5);
+    tlist.AddToList(&hfill6);
+    tlist.AddToList(&hfill7);
     tlist.AddToList(&write);
 
@@ -184,8 +180,11 @@
     // After the analysis is finished we can display the histograms
     //
+    plist.FindObject("MHHillas")->DrawClone();
+    plist.FindObject("MHHillasExt")->DrawClone();
+    plist.FindObject("MHStarMap")->DrawClone();
     plist.FindObject("HistSource")->DrawClone();
-    plist.FindObject("MHHillas")->DrawClone();
-    plist.FindObject("HistAntiSrc")->DrawClone();
-    plist.FindObject("MHStarMap")->DrawClone();
+    plist.FindObject("HistAntiSource")->DrawClone();
+    plist.FindObject("HistExtSource")->DrawClone();
+    plist.FindObject("HistExtAntiSource")->DrawClone();
 }
 
Index: trunk/MagicSoft/Mars/macros/starplot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/starplot.C	(revision 1489)
+++ trunk/MagicSoft/Mars/macros/starplot.C	(revision 1490)
@@ -79,14 +79,20 @@
     read.DisableAutoScheme();
 
-    MFillH hfill("MHHillasExt", "MHillas");
-    MFillH sfill("MHStarMap",   "MHillas");
-    MFillH hfill2s("HistSource  [MHHillasSrc]", "HillasSource");
-    MFillH hfill2a("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
+    MFillH hfill1("MHHillas", "MHillas");
+    MFillH hfill2("MHHillasExt");
+    MFillH hfill3("MHStarMap", "MHillas");
+    MFillH hfill4("HistExtSource [MHHillasExt]", "HillasSource");
+    MFillH hfill5("HistExtAntiSource [MHHillasExt]", "HillasAntiSource");
+    MFillH hfill6("HistSource [MHHillasSrc]", "HillasSource");
+    MFillH hfill7("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
 
     tlist.AddToList(&read);
-    tlist.AddToList(&hfill);
-    tlist.AddToList(&sfill);
-    tlist.AddToList(&hfill2s);
-    tlist.AddToList(&hfill2a);
+    tlist.AddToList(&hfill1);
+    tlist.AddToList(&hfill2);
+    tlist.AddToList(&hfill3);
+    tlist.AddToList(&hfill4);
+    tlist.AddToList(&hfill5);
+    tlist.AddToList(&hfill6);
+    tlist.AddToList(&hfill7);
 
     //
@@ -107,8 +113,11 @@
     // After the analysis is finished we can display the histograms
     //
+    plist.FindObject("MHHillas")->DrawClone();
+    plist.FindObject("MHHillasExt")->DrawClone();
+    plist.FindObject("MHStarMap")->DrawClone();
     plist.FindObject("HistSource")->DrawClone();
-    plist.FindObject("MHHillasExt")->DrawClone();
-    plist.FindObject("HistAntiSrc")->DrawClone();
-    plist.FindObject("MHStarMap")->DrawClone();
+    plist.FindObject("HistAntiSource")->DrawClone();
+    plist.FindObject("HistExtSource")->DrawClone();
+    plist.FindObject("HistExtAntiSource")->DrawClone();
 }
 
