Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5693)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5694)
@@ -32,4 +32,16 @@
      mhft/Makefile:
      - added
+
+   * macros/extendcam.C: 
+     - added: tutorial for MGeomCamExtend
+
+   * macros/hft.C: 
+     - added: tutorial for MHexgonalFTCalc
+
+   * macros/dohtml.C: 
+     - updated
+
+   * macros/rootlogon.C: 
+     - updated
 
    * Makefile:
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 5693)
+++ trunk/MagicSoft/Mars/NEWS	(revision 5694)
@@ -15,9 +15,9 @@
 
    - added class to perform fourier tranformation of a hexagonal structure
-     in a tasklist (MHexagonalFTCalc)
+     in a tasklist (MHexagonalFTCalc) example: hft.C
 
    - added class to enhance the MCerPhotEvt from the Magic camera geometry
      MGeomCamMagic to a enhanced geometry MGeomCamMagicXT having only
-     small pixels
+     small pixels, example: extendcam.C
 
    - added possibility to write data to memory (TTree) using MReadTree
Index: trunk/MagicSoft/Mars/macros/dohtml.C
===================================================================
--- trunk/MagicSoft/Mars/macros/dohtml.C	(revision 5693)
+++ trunk/MagicSoft/Mars/macros/dohtml.C	(revision 5694)
@@ -70,4 +70,5 @@
     sourcedir += "mhbase:";
     sourcedir += "mhflux:";
+    sourcedir += "mhft:";
     sourcedir += "mhist:";
     sourcedir += "mhistmc:";
@@ -129,3 +130,5 @@
     html.Convert("bootcampstandardanalysis.C", "MARS - Example of the status of the standard analysis at the bootcamp");
     html.Convert("readIPR.C",       "MARS - Example to read and display the IPRs from a (merpped) report file");
+    html.Convert("extendcam.C",     "MARS - Example of using MGeomCamExtend and MHexagonalFTCalc");
+    html.Convert("hft.C",           "MARS - Example of using MHexagonalFTCalc");
 }
Index: trunk/MagicSoft/Mars/macros/extendcam.C
===================================================================
--- trunk/MagicSoft/Mars/macros/extendcam.C	(revision 5694)
+++ trunk/MagicSoft/Mars/macros/extendcam.C	(revision 5694)
@@ -0,0 +1,235 @@
+/* ======================================================================== *\
+!
+! *
+! * 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/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2004-2005
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// extendcam.C
+//
+// This macro demonstrates how to extend the magic camera and performes
+// a fourier transformation on it
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+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)
+    {
+        //
+        // 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;
+}
+
+TCanvas   *c;
+MHCamera *d1=new MHCamera(MGeomCamMagic());
+MHCamera *d2=new MHCamera;
+MHCamera *d3=new MHCamera;
+MHCamera *d4=new MHCamera;
+MHCamera *d5=new MHCamera;
+MHCamera *d6=new MHCamera(MGeomCamMagicXT());
+
+MCerPhotEvt *evt=0;
+MMcEvt *mc;
+
+MHexagonFreqSpace *fFreq1;
+MHexagonFreqSpace *fFreq2;
+
+Int_t PreProcess(MParList *plist)
+{
+    fFreq1 = (MHexagonFreqSpace*)plist->FindObject("MHexagonFreqSpace1");
+    if (!fFreq1)
+        return kFALSE;
+    fFreq2 = (MHexagonFreqSpace*)plist->FindObject("MHexagonFreqSpace2");
+    if (!fFreq2)
+        return kFALSE;
+
+    //Für Real-Raum
+    evt = (MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
+    if (!evt)
+    {
+        cout << "Fehler: MCerPhotEvt" << endl;
+        return kFALSE;
+    }
+
+    mc = (MMcEvt*)plist->FindObject("MMcEvt");
+    if (!mc)
+    {
+        cout << "Fehler: MMcEvt" << endl;
+        return kFALSE;
+    }
+
+    c = new TCanvas("Events", "Real Events", 900, 600);
+    c->SetBorderMode(0);
+    c->Divide(3,2);
+
+    MGeomCam *geomfreq=fFreq1->NewGeomCam();
+    geomfreq->SetName("FreqSpace");
+
+    c->cd(1);
+    d1->SetPrettyPalette();
+    d1->Draw();
+    c->cd(2);
+    d2->SetGeometry(MGeomCamMagicXT());
+    d2->SetPrettyPalette();
+    d2->Draw();
+    c->cd(4);
+    d3->SetGeometry(*geomfreq);
+    d3->SetPrettyPalette();
+    d3->Draw();
+    c->cd(5);
+    d4->SetGeometry(MGeomCamMagicXT());
+    d4->SetPrettyPalette();
+    d4->Draw();
+    c->cd(3);
+    d5->SetGeometry(MGeomCamMagicXT());
+    d5->SetPrettyPalette();
+    d5->Draw();
+    c->cd(6);
+    //d6->SetGeometry(MGeomCamMagicXT());
+    d6->SetPrettyPalette();
+    d6->Draw();
+    return kTRUE;
+}
+
+MClone *cl1;
+MClone *cl2;
+MClone *cl3;
+MClone *cl4;
+
+Int_t Process()
+{
+    d1->SetCamContent(*(MCerPhotEvt*)cl1->GetClone());
+    d2->SetCamContent(*(MCerPhotEvt*)cl2->GetClone());
+    d3->SetCamContent(*fFreq2);
+    d4->SetCamContent(*(MCerPhotEvt*)cl4->GetClone());
+    d5->SetCamContent(*(MCerPhotEvt*)cl3->GetClone());
+    d6->SetCamContent(*evt);
+
+    d2->SetMaximum(-1111);
+    d4->SetMaximum(-1111);
+    d2->SetMinimum(0);
+    d4->SetMinimum(0);
+    d2->SetMaximum(TMath::Max(d2->GetMaximum(), d4->GetMaximum()));
+    d4->SetMaximum(d2->GetMaximum());
+
+    for (int i=1; i<7; i++)
+    {
+        c->GetPad(i)->GetPad(1)->Modified();
+        c->GetPad(i)->GetPad(1)->Update();
+    }
+
+    c->Modified();
+    c->Update();
+
+
+    return HandleInput();
+}
+
+void extendcam()
+{
+    MParList  plist;
+    MTaskList tlist;
+
+    MGeomCamMagicXT geom("MGeomCamMagicXT");
+    plist.AddToList(&geom);
+
+    plist.AddToList(&tlist);
+
+    MReadMarsFile read("Events");
+    read.DisableAutoScheme();
+    read.AddFile("/home/kolodziejski/Diplomarbeit/marsdata/mcdata/*.root");
+    //read.AddFile("/home/hoehne/data/mcdata/gammas/calib/calib_gamma_zbin0.root");
+    //read.AddFile("/home/hoehne/data/mcdata/hadrons/calib/calib_proton_zbin0.root");
+
+
+    // Setup intercative task calling the functions defined above
+    MGeomApply           apply; //necessary for evt
+    MGeomCamMagicEnhance enhance;
+    // enhance.SetNameCerPhotEvtOut("MCerPhotEvt2");
+
+    MClone clone1("MCerPhotEvt", "Clone1");
+    MClone clone2("MCerPhotEvt", "Clone2");
+    MClone clone3("MCerPhotEvt", "Clone3");
+    MClone clone4("MCerPhotEvt", "Clone4");
+
+    cl1 = &clone1;
+    cl2 = &clone2;
+    cl3 = &clone3;
+    cl4 = &clone4;
+
+    MHexagonalFTCalc     ftcalc;
+    ftcalc.SetNameGeomCam("MGeomCamMagicXT");
+    // ftcalc.SetNameCerPhotEvt("MCerPhotEvt2");
+
+    MTaskInteractive mytask;
+    mytask.SetPreProcess(PreProcess);
+    mytask.SetProcess(Process);
+
+    MImgCleanStd clean1(26, 18);
+    clean1.SetMethod(MImgCleanStd::kAbsolute);
+    clean1.SetNameGeomCam("MGeomCamMagicXT");
+
+    MImgCleanStd clean2(26, 18);
+    clean2.SetMethod(MImgCleanStd::kAbsolute);
+    clean2.SetNameGeomCam("MGeomCamMagicXT");
+
+    // Setup your tasklist
+    tlist.AddToList(&read);
+    tlist.AddToList(&apply);
+    tlist.AddToList(&clone1);
+    tlist.AddToList(&enhance);
+    tlist.AddToList(&clone2);
+    tlist.AddToList(&clean1);
+    tlist.AddToList(&clone3);
+    tlist.AddToList(&ftcalc);
+    tlist.AddToList(&clone4);
+    tlist.AddToList(&clean2);
+    tlist.AddToList(&mytask);
+
+    // Run your analysis
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    if (!evtloop.Eventloop())
+        return;
+
+    // Print statistics information about your loop
+    tlist.PrintStatistics();
+}
+
Index: trunk/MagicSoft/Mars/macros/hft.C
===================================================================
--- trunk/MagicSoft/Mars/macros/hft.C	(revision 5694)
+++ trunk/MagicSoft/Mars/macros/hft.C	(revision 5694)
@@ -0,0 +1,236 @@
+/* ======================================================================== *\
+!
+! *
+! * 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/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2004-2005
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// hft.C
+//
+// example of using MHexagonal*
+//
+///////////////////////////////////////////////////////////////////////////
+
+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)
+    {
+        //
+        // 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;
+}
+
+//
+// Setup the data-members of your 'virtual' class
+//
+MHCamera display[5];
+
+TCanvas   *c;
+MParList  *fParList;
+MTaskList *fTaskList;
+
+MHexagonalFTCalc  hft;
+MHexagonFreqSpace *fFreq1;
+MHexagonFreqSpace *fFreq2;
+
+MGeomCam *geomfreq;
+
+TH1F histo("", "", 35, -0.5, 35);
+
+//
+// Called like all PreProcess functions of tasks. Get the access to
+// the containers necessary for you.
+//
+Int_t PreProcess(MParList *plist)
+{
+    fFreq1 = (MHexagonFreqSpace*)plist->FindObject("MHexagonFreqSpace1");
+    if (!fFreq1)
+        return kFALSE;
+    fFreq2 = (MHexagonFreqSpace*)plist->FindObject("MHexagonFreqSpace2");
+    if (!fFreq2)
+        return kFALSE;
+
+    geomfreq=fFreq1->NewGeomCam();
+    geomfreq->SetName("FreqSpace");
+    plist->AddToList(geomfreq);
+
+    //    return kTRUE;
+
+    // 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", 900, 600);
+    c->SetBorderMode(0);
+    c->Divide(3,2);
+    for (int i=0; i<3; i++)
+    {
+        display[i].SetGeometry(*geomfreq);
+        display[i].SetPrettyPalette();
+        c->cd(i+1);
+        display[i].Draw();
+    }
+
+    display[1].SetName("In");
+    display[2].SetName("Out");
+    display[0].SetName("Freq");
+
+    return kTRUE;
+}
+
+//
+// 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.
+    MClone *clone1 = (MClone*)fTaskList->FindObject("Clone1");
+    MClone *clone2 = (MClone*)fTaskList->FindObject("Clone2");
+    MGeomCam *geom = (MGeomCam*)fParList->FindObject("MGeomCam");
+
+    // Fill the data into your camera-histograms
+    display[1].SetCamContent(*fFreq1, 1);
+    display[2].SetCamContent(*fFreq1, 2);
+    display[0].SetCamContent(*fFreq2, 0);
+
+    display[1].SetMaximum(-1111);
+    display[2].SetMaximum(-1111);
+    display[1].SetMinimum(0);
+    display[2].SetMinimum(0);
+    display[1].SetMaximum(TMath::Max(display[1].GetMaximum(),
+                                     display[2].GetMaximum()));
+    display[2].SetMaximum(display[1].GetMaximum());
+
+    MHexagonalFT *ft = &hft.GetHFT();
+
+    histo.Reset();
+    for (int i=0; i<ft->GetNumKnots(); i++)
+    {
+        Double_t val=0;
+        fFreq2->GetPixelContent(val, i, *display[1].GetGeometry());
+        histo.Fill(ft->GetRow(i), val/(i+1));
+    }
+
+    c->cd(4);
+    histo.Draw();
+
+    c->cd(5);
+
+    TH1D *obj1 = (TH1D*)display[1].Projection("Proj1");
+    obj1->SetLineColor(kBlue);
+    obj1->Draw();
+    obj1 = (TH1D*)display[2].Projection("Proj2");
+    obj1->Draw("same");
+
+    c->cd(6);
+    display[0].DrawProjection();
+
+    // Update the display
+    for (int i=1; i<=3; i++)
+    {
+        c->GetPad(i)->GetPad(1)->Modified();
+        c->GetPad(i)->GetPad(1)->Update();
+    }
+
+    return HandleInput();
+}
+
+//
+// Called like all PostProcess functions of tasks. Delete
+// instanciated objects.
+//
+Int_t PostProcess()
+{
+    delete c;
+    delete geomfreq;
+}
+
+void hft(const char *fname="/home/hoehne/data/mcdata/hadrons/calib/calib_proton_zbin0.root")
+{
+    // Setup parameter- and tasklist
+    MParList  plist;
+    MTaskList tlist;
+
+    plist.AddToList(&tlist);
+
+    // setup reading task
+    MReadMarsFile read("Events", fname);
+    read.DisableAutoScheme();
+
+    // Clone MCerPhotEvt befor eimage cleaning
+    MClone clone1("MCerPhotEvt", "Clone1");
+
+    // Setup image cleaning
+    MImgCleanStd clean(24, 12);
+    clean.SetMethod(MImgCleanStd::kAbsolute);
+
+    // Clone MCerPhotEvt befor eimage cleaning
+    MClone clone2("MCerPhotEvt", "Clone2");
+
+    // Setup intercative task calling the functions defined above
+    MTaskInteractive  mytask;
+
+    mytask.SetPreProcess(PreProcess);
+    mytask.SetProcess(Process);
+
+    // Setup your tasklist
+    tlist.AddToList(&read);
+    tlist.AddToList(&clone1);
+    tlist.AddToList(&hft);
+    tlist.AddToList(&clone2);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&mytask);
+
+    // Run your analysis
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    if (!evtloop.Eventloop())
+        return;
+
+    // Print statistics information about your loop
+    tlist.PrintStatistics();
+}
+
Index: trunk/MagicSoft/Mars/macros/rootlogon.C
===================================================================
--- trunk/MagicSoft/Mars/macros/rootlogon.C	(revision 5693)
+++ trunk/MagicSoft/Mars/macros/rootlogon.C	(revision 5694)
@@ -138,4 +138,5 @@
     gInterpreter->AddIncludePath(dir+"mhbase");
     gInterpreter->AddIncludePath(dir+"mhflux");
+    gInterpreter->AddIncludePath(dir+"mhft");
     gInterpreter->AddIncludePath(dir+"mhist");
     gInterpreter->AddIncludePath(dir+"mhistmc");
Index: trunk/MagicSoft/Mars/mhft/HftLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhft/HftLinkDef.h	(revision 5693)
+++ trunk/MagicSoft/Mars/mhft/HftLinkDef.h	(revision 5694)
@@ -9,4 +9,5 @@
 #pragma link C++ class MHexagonFreqSpace+;
 
+#pragma link C++ class MGeomCamMagicXT+;
 #pragma link C++ class MGeomCamMagicEnhance+;
 
Index: trunk/MagicSoft/Mars/mhft/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhft/Makefile	(revision 5693)
+++ trunk/MagicSoft/Mars/mhft/Makefile	(revision 5694)
@@ -26,4 +26,5 @@
            MHexagonalFTCalc.cc \
    	   MHexagonFreqSpace.cc \
+           MGeomCamMagicXT.cc \
            MGeomCamMagicEnhance.cc
 
