Index: trunk/MagicSoft/Mars/macros/plot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot.C	(revision 7159)
+++ 	(revision )
@@ -1,146 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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-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);
-
-    //
-    // 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:
-    // ---------------------------------
-    //
-
-    // First Task: Read file with image parameters
-    // (created with the star.C macro)
-    MReadMarsFile  read("Events", "MC_OFF1.root");
-    read.AddFile("MC_ON1.root");
-    read.DisableAutoScheme();
-    tlist.AddToList(&read);
-
-    // Create a filter for Gammas
-    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
-    tlist.AddToList(&fgamma);
-
-    // Create a filter for Non-Gammas
-    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
-    tlist.AddToList(&fhadrons);
-
-    // -------------------------------------------------------
-    //
-    // set the name of the variable to plot and the binning
-    //
-    TString var("Hillas.fSize");
-
-    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);
-
-    // 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);
-    tlist.AddToList(&fillh);
-
-    //
-    // Create and setup the eventloop
-    //
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-
-    //
-    // Execute your analysis
-    //
-    evtloop.SetDisplay(d);
-    if (!evtloop.Eventloop())
-        return;
-
-    tlist.PrintStatistics();
-
-    // Create a pad, check if MStatusDisplay was not closed meanwhile
-    if (evtloop.GetDisplay())
-        d->AddTab("Size");
-    else
-        MH::MakeDefCanvas("Plot");
-
-    // x-axis to logarithmic scale
-    gPad->SetLogx();
-
-    // Setup some style options of the two histograms
-    // and draw a copy of both
-    h3h.GetHist().SetLineColor(kRed);
-    MH::DrawCopy(h3h.GetHist(), h3g.GetHist(), "Size");
-
-    // 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);
-    h.Divide(&h3g.GetHist(), &h3h.GetHist());
-    h.SetLineColor(kGreen);
-    h.DrawCopy("same");
-}
Index: trunk/MagicSoft/Mars/macros/plot2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot2.C	(revision 7159)
+++ 	(revision )
@@ -1,154 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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-2004
-!
-!
-\* ======================================================================== */
-
-///////////////////////////////////////////////////////////////////////////
-//
-//  plot2.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 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()
-{
-    //
-    // 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:
-    // ---------------------------------
-    //
-
-    // 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", '=', MMcEvt::kGAMMA);
-    tlist.AddToList(&fgamma);
-
-    // Create a filter for the non-gamma events
-    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
-    tlist.AddToList(&fhadrons);
-
-    // -------------------------------------------------------
-    //
-    // set the name of the variable to plot and the binning
-    //
-    MGeomCamMagic cam;
-    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");
-    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);
-
-    plist.AddToList(&h3g);
-    plist.AddToList(&h3h);
-
-    // 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);
-    tlist.AddToList(&fillh);
-
-    //
-    // Create and setup the eventloop
-    //
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-
-    //
-    // Execute your analysis
-    //
-    MProgressBar bar;
-    evtloop.SetProgressBar(&bar);
-    if (!evtloop.Eventloop())
-        return;
-
-    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");
-
-    return;
-
-    //
-    // Use this (or something similar) if you want to plot the profile
-    // histograms
-    //
-    TProfile *p = ((TH2&)h3g.GetHist()).ProfileX();
-    p->Draw("same");
-    p->SetBit(kCanDelete);
-
-    TProfile *p = ((TH2&)h3h.GetHist()).ProfileX();
-    p->SetLineColor(kRed);
-    p->SetFillStyle(4000);
-    p->Draw("same");
-    p->SetBit(kCanDelete);
-}
Index: trunk/MagicSoft/Mars/macros/readcurrents.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readcurrents.C	(revision 7159)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2003
-!
-!
-\* ======================================================================== */
-
-Bool_t HandleInput()
-{
-    TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
-    while (1)
-    {
-        //
-        // While reading the input process gui events asynchronously
-        //
-        timer.TurnOn();
-        TString input = Getline("Type 'q' to exit, <return> to go on: ");
-        timer.TurnOff();
-
-        if (input=="q\n")
-            return kFALSE;
-
-        if (input=="\n")
-            return kTRUE;
-    };
-
-    return kFALSE;
-}
-
-void readcurrents(const char *fname="../currents/dcs_arcturus.dat")
-{
-    MParList plist;
-
-    MGeomCamMagic geomcam;
-    MCameraDC     cur;
-    MTaskList     tlist;
-
-    plist.AddToList(&geomcam);
-    plist.AddToList(&cur);
-    plist.AddToList(&tlist);
-
-    MReportFileRead read(fname);
-    read.SetHasNoHeader();
-    read.AddToList("MReportCurrents");
-
-    tlist.AddToList(&read);
-
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
-
-    if (!evtloop.PreProcess())
-        return;
-
-    MHCamera display(geomcam);
-    display.Draw();
-    gPad->SetLogy();
-
-    int gifcnt = 0;
-
-    while (tlist.Process())
-    {
-        // cur.Print();
-        display.SetCamContent(cur);
-        gPad->GetPad(1)->Modified();
-        gPad->GetPad(1)->Update();
-        // Remove the comments if you want to go through the file
-        // event-by-event:
-        if (!HandleInput())
-            break;
-    } 
-
-    evtloop.PostProcess();
-}
Index: trunk/MagicSoft/Mars/macros/readin.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readin.C	(revision 7159)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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 (tbretz@uni-sw.gwdg.de)
-!
-!   Copyright: MAGIC Software Development, 2000-2001
-!
-!
-\* ======================================================================== */
-
-
-void readin()
-{
-    //
-    // open the file
-    //
-    TFile input("test.root", "READ");
-
-    //
-    // open the Run Header tree
-    //
-    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
-
-    if (!runtree)
-        return;
-
-    cout << " Entries in Tree RunHeaders: " << runtree->GetEntries() << endl ;
-
-    //
-    // create an instance of MRawRunHeader, enable the branch and
-    // read the header, print it
-    //
-    MRawRunHeader *runheader = new MRawRunHeader();
-    runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
-    runtree->GetEvent(0);
-    runheader->Print();
-
-    //
-    // open the Data Tree
-    //
-    TTree *evttree = (TTree*) input.Get("Data") ;
-
-    //
-    // create the instances of the data to read in
-    //
-    MRawEvtHeader  *evtheader = new MRawEvtHeader();
-    MTime          *evttime   = new MTime();
-    MRawEvtData    *evtdata   = new MRawEvtData();
-    MRawCrateArray *evtcrate  = new MRawCrateArray();
-
-    //
-    // enable the corresponding branches
-    //
-    evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
-    evttree->GetBranch("MTime")->SetAddress(&evttime);
-    evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
-    evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
-
-    //
-    // loop over all events and print the information
-    //
-    Int_t iEnt = evttree->GetEntries();
-    cout << " Entries in Tree Data: " << iEnt << endl;
-
-    for (Int_t i = 0; i<iEnt; i++)
-    {
-      // readin event with the selected branches
-      evttree->GetEvent(i);
-
-      evtheader->Print();
-      evttime->Print();
-      evtcrate->Print();
-      evtdata->Print();
-    } 
-}
-
-
Index: trunk/MagicSoft/Mars/macros/testMTrans.C
===================================================================
--- trunk/MagicSoft/Mars/macros/testMTrans.C	(revision 7159)
+++ 	(revision )
@@ -1,453 +1,0 @@
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// Description: Macro to test the class MTransCelLocCam
-//
-// Author:      Wolfgang Wittek (wittek@mppmu.mpg.de)
-// Date:        08/2004
-//                                                                         // 
-/////////////////////////////////////////////////////////////////////////////
-
-void testMTrans()
-{
-  gLog->SetNoColors();
-
-
-    MGeomCamMagic geom;
-    MObservatory  obs;
-
-    MStarCamTrans trans(geom, obs);
-
-    trans.SetGridParameters(0.50, 0.1);
-
-    /*
-    trans.PlotGridAtTheta0Phi0("Plot_2a",  0.001,135.0);
-    trans.PlotGridAtTheta0Phi0("Plot_2b",  30.00,135.0);
-    trans.PlotGridAtTheta0Phi0("Plot_2c",  60.00,135.0);
-    trans.PlotGridAtTheta0Phi0("Plot_2d",  90.00,135.0);
-
-    trans.PlotGridAtTheta0Phi0("Plot1a",  0.001, 0.0);
-    trans.PlotGridAtTheta0Phi0("Plot1b",  30.00, 0.0);
-    trans.PlotGridAtTheta0Phi0("Plot1c",  60.00, 0.0);
-    trans.PlotGridAtTheta0Phi0("Plot1d",  90.00, 0.0);
-
-    trans.PlotGridAtTheta0Phi0("Plot2a",  0.001, 90.0);
-    trans.PlotGridAtTheta0Phi0("Plot2b",  30.00, 90.0);
-    trans.PlotGridAtTheta0Phi0("Plot2c",  60.00, 90.0);
-    trans.PlotGridAtTheta0Phi0("Plot2d",  90.00, 90.0);
-
-
-    trans.PlotGridAtTheta0Phi0("Plot3a",  0.001, 180.0);
-    */
-
-    trans.PlotGridAtTheta0Phi0("Plot3b",  30.00, 180.0);
-
-    /*
-
-    trans.PlotGridAtTheta0Phi0("Plot3c",  60.00, 180.0);
-    trans.PlotGridAtTheta0Phi0("Plot3d",  90.00, 180.0);
-
-    trans.PlotGridAtTheta0Phi0("Plot4a",  0.001, 270.0);
-    trans.PlotGridAtTheta0Phi0("Plot4b",  30.00, 270.0);
-    trans.PlotGridAtTheta0Phi0("Plot4c",  60.00, 270.0);
-    trans.PlotGridAtTheta0Phi0("Plot4d",  90.00, 270.0);
-
-    trans.PlotGridAtDec0H0    ("Plot5a", 89.999, -12.0);
-    trans.PlotGridAtDec0H0    ("Plot5b", 60.000, -12.0);
-    trans.PlotGridAtDec0H0    ("Plot5c", 30.000, -12.0);
-    trans.PlotGridAtDec0H0    ("Plot5d",  0.000, -12.0);
-    trans.PlotGridAtDec0H0    ("Plot5e",-30.000, -12.0);
-
-    trans.PlotGridAtDec0H0    ("Plot6a", 89.999, -6.0);
-    trans.PlotGridAtDec0H0    ("Plot6b", 60.000, -6.0);
-    trans.PlotGridAtDec0H0    ("Plot6c", 30.000, -6.0);
-    trans.PlotGridAtDec0H0    ("Plot6d",  0.000, -6.0);
-    trans.PlotGridAtDec0H0    ("Plot6e",-30.000, -6.0);
-
-    trans.PlotGridAtDec0H0    ("Plot7a", 89.999, 0.0);
-    trans.PlotGridAtDec0H0    ("Plot7b", 60.000, 0.0);
-    trans.PlotGridAtDec0H0    ("Plot7c", 30.000, 0.0);
-    trans.PlotGridAtDec0H0    ("Plot7d",  0.000, 0.0);
-    trans.PlotGridAtDec0H0    ("Plot7e",-30.000, 0.0);
-
-    trans.PlotGridAtDec0H0    ("Plot8a", 89.999, 6.0);
-    trans.PlotGridAtDec0H0    ("Plot8b", 60.000, 6.0);
-    trans.PlotGridAtDec0H0    ("Plot8c", 30.000, 6.0);
-    trans.PlotGridAtDec0H0    ("Plot8d",  0.000, 6.0);
-    trans.PlotGridAtDec0H0    ("Plot8e",-30.000, 6.0);
-    */
-
-    //===================================================
-    // special tests
-
-    gLog << "==============================================================="
-         << endl;
-
-    Double_t th1 = 10.0;
-    Double_t ph1 = 200.0;
-    Double_t X1  = 0.0;
-    Double_t Y1  = 0.0;
-    Double_t X2  = 100.0;
-    Double_t Y2  =  50.0;
-    Double_t th2;
-    Double_t ph2;
-
-    trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-    
-    trans.Loc0CamToLoc(th1, ph1, X2, Y2, th2, ph2);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th2, ph2, X2, Y2, th1, ph1);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.Loc0LocToCam(th1, ph1, th2, ph2, X2, Y2);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-    gLog << "==============================================================="
-         << endl;
-
-    //---------------------
-
-    gLog << "==============================================================="
-         << endl;
-
-    th1 =  th2;
-    ph1 =  ph2;
-    X1  = 100.0;
-    Y1  =  50.0;
-    X2  =  0.0;
-    Y2  =  0.0;
-
-    trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-    
-    trans.LocCamToLoc0(th1, ph1, X1, Y1, th2, ph2);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.Loc0CamToLoc(th2, ph2, X1, Y1, th1, ph1);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.Loc0LocToCam(th2, ph2, th1, ph1, X1, Y1);    
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    Double_t de1 = 10.0;
-    Double_t ho1 = 200.0;
-    Double_t XX1  = 0.0;
-    Double_t YY1  = 0.0;
-    Double_t XX2  = 100.0;
-    Double_t YY2  =  50.0;
-    Double_t de2;
-    Double_t ho2;
-
-    trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-    
-    trans.Cel0CamToCel(de1, ho1, XX2, YY2, de2, ho2);    
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.Cel0CelToCam(de1, ho1, de2, ho2, XX2, YY2);    
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-
-    gLog << "==============================================================="
-         << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    de1 =  de2;
-    ho1 =  ho2;
-    XX1  = 100.0;
-    YY1  =  50.0;
-    XX2  =  0.0;
-    YY2  =  0.0;
-
-    trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-    
-    trans.CelCamToCel0(de1, ho1, XX1, YY1, de2, ho2);    
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    //---------------------
-
-    gLog << "==============================================================="
-         << endl;
-
-    th1 =  70.0;
-    ph1 = 200.0;
-    X1  = 100.0;
-    Y1  =  50.0;
-    X2  = 120.0;
-    Y2  = -30.0;
-
-    Double_t th0;
-    Double_t ph0;
-
-    trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamCamToLoc(th2, ph2, X2, Y2, X1, Y1, th1, ph1);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
-    gLog << "th0, ph0 = " << th0 << ",  " << ph0 << endl;
-
-    trans.Loc0CamToLoc(th0, ph0, X1, Y1, th1, ph1);
-    gLog << "th1, ph1 = " << th1 << ",  " << ph1 << endl;
-
-    trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th2, ph2, X2, Y2, th0, ph0);
-    gLog << "th0, ph0 = " << th0 << ",  " << ph0 << endl;
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamLocToCam(th2, ph2, X2, Y2, th1, ph1, X1, Y1);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
-    gLog << "th0, ph0 = " << th0 << ",  " << ph0 << endl;
-
-    trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
-
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    th1 = th2;
-    ph1 = ph2;
-    X1  = 120.0;
-    Y1  = -30.0;
-    X2  = 100.0;
-    Y2  =  50.0;
-
-    Double_t th0;
-    Double_t ph0;
-
-    trans.LocCamCamToLoc(th1, ph1, X1, Y1, X2, Y2, th2, ph2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
-    gLog << "th0, ph0 = " << th0 << ",  " << ph0 << endl;
-
-    trans.Loc0CamToLoc(th0, ph0, X2, Y2, th2, ph2);
-
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamLocToCam(th1, ph1, X1, Y1, th2, ph2, X2, Y2);
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    trans.LocCamToLoc0(th1, ph1, X1, Y1, th0, ph0);
-    gLog << "th0, ph0 = " << th0 << ",  " << ph0 << endl;
-
-    trans.Loc0LocToCam(th0, ph0, th2, ph2, X2, Y2);
-
-    gLog << "th1, ph1, X1, Y1, th2, ph2, X2, Y2 = "
-         << th1 << ",  " << ph1 << ";    " << X1 << ",  " << Y1 << ";   "
-         << th2 << ",  " << ph2 << ";    " << X2 << ",  " << Y2 << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    Double_t de1 = 10.0;
-    Double_t ho1 = 3.0;
-    Double_t XX1  = -30.0;
-    Double_t YY1  = 200.0;
-    Double_t XX2  = 100.0;
-    Double_t YY2  =  50.0;
-    Double_t de2;
-    Double_t ho2;
-
-    trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    Double_t de0;
-    Double_t ho0;
-    trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
-    gLog << "de0, ho0 = " << de0 << ",  " << ho0 << endl;
-
-    trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
-    gLog << "de0, ho0 = " << de0 << ",  " << ho0 << endl;
-
-    trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-
-    gLog << "==============================================================="
-         << endl;
-
-    gLog << "==============================================================="
-         << endl;
-
-    de1 = de2;
-    ho1 = ho2;
-    XX1  = 100.0;
-    YY1  =  50.0;
-    XX2  = -30.0;
-    YY2  = 200.0;
-
-    trans.CelCamCamToCel(de1, ho1, XX1, YY1, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    Double_t de0;
-    Double_t ho0;
-    trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
-    gLog << "de0, ho0 = " << de0 << ",  " << ho0 << endl;
-
-    trans.Cel0CamToCel(de0, ho0, XX2, YY2, de2, ho2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamCelToCam(de1, ho1, XX1, YY1, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-    trans.CelCamToCel0(de1, ho1, XX1, YY1, de0, ho0);
-    gLog << "de0, ho0 = " << de0 << ",  " << ho0 << endl;
-
-    trans.Cel0CelToCam(de0, ho0, de2, ho2, XX2, YY2);
-    gLog << "de1, ho1, XX1, YY1, de2, ho2, XX2, YY2 = "
-         << de1 << ",  " << ho1 << ";    " << XX1 << ",  " << YY1 << ";   "
-         << de2 << ",  " << ho2 << ";    " << XX2 << ",  " << YY2 << endl;
-
-
-    gLog << "==============================================================="
-         << endl;
-
-}
-//=========================================================================
- 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/macros/tutorials/plot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/plot.C	(revision 7160)
+++ trunk/MagicSoft/Mars/macros/tutorials/plot.C	(revision 7160)
@@ -0,0 +1,146 @@
+/* ======================================================================== *\
+!
+! *
+! * 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-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);
+
+    //
+    // 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:
+    // ---------------------------------
+    //
+
+    // First Task: Read file with image parameters
+    // (created with the star.C macro)
+    MReadMarsFile  read("Events", "MC_OFF1.root");
+    read.AddFile("MC_ON1.root");
+    read.DisableAutoScheme();
+    tlist.AddToList(&read);
+
+    // Create a filter for Gammas
+    MFParticleId fgamma("MMcEvt", '=', MMcEvt::kGAMMA);
+    tlist.AddToList(&fgamma);
+
+    // Create a filter for Non-Gammas
+    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
+    tlist.AddToList(&fhadrons);
+
+    // -------------------------------------------------------
+    //
+    // set the name of the variable to plot and the binning
+    //
+    TString var("Hillas.fSize");
+
+    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);
+
+    // 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);
+    tlist.AddToList(&fillh);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    evtloop.SetDisplay(d);
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+
+    // Create a pad, check if MStatusDisplay was not closed meanwhile
+    if (evtloop.GetDisplay())
+        d->AddTab("Size");
+    else
+        MH::MakeDefCanvas("Plot");
+
+    // x-axis to logarithmic scale
+    gPad->SetLogx();
+
+    // Setup some style options of the two histograms
+    // and draw a copy of both
+    h3h.GetHist().SetLineColor(kRed);
+    MH::DrawCopy(h3h.GetHist(), h3g.GetHist(), "Size");
+
+    // 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);
+    h.Divide(&h3g.GetHist(), &h3h.GetHist());
+    h.SetLineColor(kGreen);
+    h.DrawCopy("same");
+}
Index: trunk/MagicSoft/Mars/macros/tutorials/plot2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/plot2.C	(revision 7160)
+++ trunk/MagicSoft/Mars/macros/tutorials/plot2.C	(revision 7160)
@@ -0,0 +1,154 @@
+/* ======================================================================== *\
+!
+! *
+! * 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-2004
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+//  plot2.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 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()
+{
+    //
+    // 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:
+    // ---------------------------------
+    //
+
+    // 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", '=', MMcEvt::kGAMMA);
+    tlist.AddToList(&fgamma);
+
+    // Create a filter for the non-gamma events
+    MFParticleId fhadrons("MMcEvt", '!', MMcEvt::kGAMMA);
+    tlist.AddToList(&fhadrons);
+
+    // -------------------------------------------------------
+    //
+    // set the name of the variable to plot and the binning
+    //
+    MGeomCamMagic cam;
+    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");
+    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);
+
+    plist.AddToList(&h3g);
+    plist.AddToList(&h3h);
+
+    // 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);
+    tlist.AddToList(&fillh);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    MProgressBar bar;
+    evtloop.SetProgressBar(&bar);
+    if (!evtloop.Eventloop())
+        return;
+
+    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");
+
+    return;
+
+    //
+    // Use this (or something similar) if you want to plot the profile
+    // histograms
+    //
+    TProfile *p = ((TH2&)h3g.GetHist()).ProfileX();
+    p->Draw("same");
+    p->SetBit(kCanDelete);
+
+    TProfile *p = ((TH2&)h3h.GetHist()).ProfileX();
+    p->SetLineColor(kRed);
+    p->SetFillStyle(4000);
+    p->Draw("same");
+    p->SetBit(kCanDelete);
+}
Index: trunk/MagicSoft/Mars/macros/tutorials/readcurrents.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/readcurrents.C	(revision 7160)
+++ trunk/MagicSoft/Mars/macros/tutorials/readcurrents.C	(revision 7160)
@@ -0,0 +1,90 @@
+/* ======================================================================== *\
+!
+! *
+! * 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/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+Bool_t HandleInput()
+{
+    TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
+    while (1)
+    {
+        //
+        // While reading the input process gui events asynchronously
+        //
+        timer.TurnOn();
+        TString input = Getline("Type 'q' to exit, <return> to go on: ");
+        timer.TurnOff();
+
+        if (input=="q\n")
+            return kFALSE;
+
+        if (input=="\n")
+            return kTRUE;
+    };
+
+    return kFALSE;
+}
+
+void readcurrents(const char *fname="../currents/dcs_arcturus.dat")
+{
+    MParList plist;
+
+    MGeomCamMagic geomcam;
+    MCameraDC     cur;
+    MTaskList     tlist;
+
+    plist.AddToList(&geomcam);
+    plist.AddToList(&cur);
+    plist.AddToList(&tlist);
+
+    MReportFileRead read(fname);
+    read.SetHasNoHeader();
+    read.AddToList("MReportCurrents");
+
+    tlist.AddToList(&read);
+
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    if (!evtloop.PreProcess())
+        return;
+
+    MHCamera display(geomcam);
+    display.Draw();
+    gPad->SetLogy();
+
+    int gifcnt = 0;
+
+    while (tlist.Process())
+    {
+        // cur.Print();
+        display.SetCamContent(cur);
+        gPad->GetPad(1)->Modified();
+        gPad->GetPad(1)->Update();
+        // Remove the comments if you want to go through the file
+        // event-by-event:
+        if (!HandleInput())
+            break;
+    } 
+
+    evtloop.PostProcess();
+}
Index: trunk/MagicSoft/Mars/macros/tutorials/readin.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/readin.C	(revision 7160)
+++ trunk/MagicSoft/Mars/macros/tutorials/readin.C	(revision 7160)
@@ -0,0 +1,91 @@
+/* ======================================================================== *\
+!
+! *
+! * 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 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+void readin()
+{
+    //
+    // open the file
+    //
+    TFile input("test.root", "READ");
+
+    //
+    // open the Run Header tree
+    //
+    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
+
+    if (!runtree)
+        return;
+
+    cout << " Entries in Tree RunHeaders: " << runtree->GetEntries() << endl ;
+
+    //
+    // create an instance of MRawRunHeader, enable the branch and
+    // read the header, print it
+    //
+    MRawRunHeader *runheader = new MRawRunHeader();
+    runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
+    runtree->GetEvent(0);
+    runheader->Print();
+
+    //
+    // open the Data Tree
+    //
+    TTree *evttree = (TTree*) input.Get("Data") ;
+
+    //
+    // create the instances of the data to read in
+    //
+    MRawEvtHeader  *evtheader = new MRawEvtHeader();
+    MTime          *evttime   = new MTime();
+    MRawEvtData    *evtdata   = new MRawEvtData();
+    MRawCrateArray *evtcrate  = new MRawCrateArray();
+
+    //
+    // enable the corresponding branches
+    //
+    evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
+    evttree->GetBranch("MTime")->SetAddress(&evttime);
+    evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
+    evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
+
+    //
+    // loop over all events and print the information
+    //
+    Int_t iEnt = evttree->GetEntries();
+    cout << " Entries in Tree Data: " << iEnt << endl;
+
+    for (Int_t i = 0; i<iEnt; i++)
+    {
+      // readin event with the selected branches
+      evttree->GetEvent(i);
+
+      evtheader->Print();
+      evttime->Print();
+      evtcrate->Print();
+      evtdata->Print();
+    } 
+}
+
+
