Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 709)
+++ trunk/MagicSoft/Mars/Changelog	(revision 710)
@@ -1,4 +1,9 @@
                                                                   -*-*- END -*-*-
 
+ 2000/03/30: Thomas Bretz
+ 
+   * mdatacheck/MH*, mdatacheck/MFillH* moved to mhist
+ 
+ 
  2000/03/21: Thomas Bretz
                             
Index: trunk/MagicSoft/Mars/Makefile
===================================================================
--- trunk/MagicSoft/Mars/Makefile	(revision 709)
+++ trunk/MagicSoft/Mars/Makefile	(revision 710)
@@ -35,5 +35,13 @@
 #  ----->>>   mars libraries
 #
-SUBDIRS = mgui manalysis meventdisp mdatacheck mmontecarlo mbase mraw mmc
+SUBDIRS = mgui        \
+	  manalysis   \
+          meventdisp  \
+          mdatacheck  \
+          mmontecarlo \
+          mhist       \
+          mbase       \
+          mraw        \
+          mmc
 
 LIBRARIES = $(SUBDIRS:=.a)
@@ -85,4 +93,7 @@
 	@cd mraw; make mrproper; cd ..
 	@echo "cd .."
+	@echo "cd mhist"
+	@cd mhist; make mrproper; cd ..
+	@echo "cd .."
 	@echo "cd mgui"
 	@cd mgui; make mrproper; cd ..
Index: trunk/MagicSoft/Mars/macros/CT1Hillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 709)
+++ trunk/MagicSoft/Mars/macros/CT1Hillas.C	(revision 710)
@@ -26,6 +26,9 @@
     // finished you must create them yourself and add it to the list
     //
-    MHHillas *hists = new MHHillas;
+    MHHillas  *hists = new MHHillas;
     plist->AddToList(hists);
+
+    MHStarMap *smap = new MHStarMap;
+    plist->AddToList(smap);
 
     //
@@ -37,8 +40,9 @@
     //  4) fill the hillas into the histograms
     //
-    MCT1ReadAscii read("CT1_99_on1.dat") ;
+    MCT1ReadAscii read("CT1_97_on1.dat") ;
     MImgCleanStd  clean;
     MHillasCalc   hcalc;
     MFillHHillas  hfill;
+    MFillHStarMap sfill;
 
     tlist.AddToList(&read);
@@ -46,4 +50,5 @@
     tlist.AddToList(&hcalc);
     tlist.AddToList(&hfill);
+    tlist.AddToList(&sfill);
 
     //
@@ -62,3 +67,4 @@
     //
     hists->Draw();
+    smap->Draw();
 }
Index: trunk/MagicSoft/Mars/macros/MagicHillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 709)
+++ trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 710)
@@ -32,4 +32,7 @@
     plist->AddToList(hists);
 
+    MHStarMap *smap = new MHStarMap;
+    plist->AddToList(smap);
+
     //
     // Now setup the tasks and tasklist:
@@ -40,9 +43,12 @@
     //  4) fill the hillas into the histograms
     //
-    MReadTree    read("oscar_protons.root", "Events") ;
-    MCerPhotCalc ncalc;
-    MImgCleanStd clean;
-    MHillasCalc  hcalc;
-    MFillHHillas hfill;
+    MReadTree    read("Events", "oscar_protons.root");
+    read.AddFile("test.root");
+
+    MCerPhotCalc  ncalc;
+    MImgCleanStd  clean;
+    MHillasCalc   hcalc;
+    MFillHHillas  hfill;
+    MFillHStarMap sfill;
 
     tlist.AddToList(&read);
@@ -51,4 +57,5 @@
     tlist.AddToList(&hcalc);
     tlist.AddToList(&hfill);
+    tlist.AddToList(&sfill);
 
     //
@@ -67,3 +74,5 @@
     //
     hists->Draw();
+    smap->Draw();
 }
+
Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 709)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 710)
@@ -11,5 +11,5 @@
     plist->AddToList(&tlist);
 
-    MCT1ReadAscii read("CT1_99_on1.dat") ;
+    MCT1ReadAscii read("CT1_99_off1.dat") ;
     MImgCleanStd  clean;
     MHillasCalc   hcalc;
@@ -29,11 +29,10 @@
     Int_t icount = 0 ;
     MCamDisplay display(&geomcam) ;
+        display.DrawPhotNum(&phevt);
+
 
     while (read.Process())
     {
         cout << "Event: " << icount++  << endl  ;
-
-        if (icount < 45 )
-            continue;
 
         display.DrawPhotNum(&phevt);
Index: trunk/MagicSoft/Mars/mars.cc
===================================================================
--- trunk/MagicSoft/Mars/mars.cc	(revision 709)
+++ trunk/MagicSoft/Mars/mars.cc	(revision 710)
@@ -26,5 +26,5 @@
   // start the main window
   
-  MGMarsMain mainWin(gClient->GetRoot(), 400, 650);     
+  MGMarsMain *mainWin = new MGMarsMain(400, 650);
   
   theApp.Run();
Index: trunk/MagicSoft/Mars/mdatacheck/DataCheckIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/DataCheckIncl.h	(revision 709)
+++ trunk/MagicSoft/Mars/mdatacheck/DataCheckIncl.h	(revision 710)
@@ -1,14 +1,3 @@
 #ifndef __CINT__
 
-#include "MParList.h"
-
-#include "MRawRunHeader.h"
-#include "MRawEvtHeader.h"
-#include "MRawEvtData.h"
-#include "MRawCrateArray.h"
-#include "MTime.h"
-#include "MInputStreamID.h"
-
-#include "MReadTree.h"
-
 #endif // __CINT__
Index: trunk/MagicSoft/Mars/mdatacheck/DataCheckLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/DataCheckLinkDef.h	(revision 709)
+++ trunk/MagicSoft/Mars/mdatacheck/DataCheckLinkDef.h	(revision 710)
@@ -5,13 +5,5 @@
 #pragma link off all functions;
 
-#pragma link C++ class MHFadcCam;
-#pragma link C++ class MHFadcPix;
-#pragma link C++ class MHHillas;
-
 #pragma link C++ class MShowSpect;
-
-#pragma link C++ class MFillHFadc;
-#pragma link C++ class MFillHHillas;
-
 #pragma link C++ class MDumpEvtHeader;
 
Index: trunk/MagicSoft/Mars/mdatacheck/MFillHFadc.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MFillHFadc.cc	(revision 709)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#include "MFillHFadc.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MParList.h"
-#include "MHFadcCam.h"
-#include "MRawEvtData.h"
-#include "MRawEvtPixelIter.h"
-
-ClassImp(MFillHFadc)
-
-    MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
-{
-  *fName  = name  ? name  : "MFillHFadc";
-  *fTitle = title ? title : "Task to fill the adc spectra with  raw data";
-}
-
-Bool_t MFillHFadc::PreProcess (MParList *pList)
-{
-  // connect the raw data with this task
-  
-  fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
-  if (!fHistos)
-      return kFALSE;
-
-  fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
-  if (!fRawEvtData)
-  {
-      *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
-      return kFALSE ;
-  }
-
-  return kTRUE ; 
-
-} 
-
-Bool_t MFillHFadc::Process()
-{
-  //  loop over the pixels and fill the values in the histograms
-  
-  MRawEvtPixelIter pixel(fRawEvtData);
-
-  const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
-  const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
-
-  //  cout << "HighSamples " << iHighSamples ;
-
-  while ( pixel.Next() )
-    { 
-      for (Int_t i=0 ; i<nhisamples ; i++ )
-	{ 
-            fHistos->FillHi ( pixel.GetPixelId(),
-                              pixel.GetHiGainFadcSamples()[i] );
-	}
-
-      for (Int_t i=0 ; i<nlosamples ; i++ )
-	{ 
-            fHistos->FillLo ( pixel.GetPixelId(),
-                              pixel.GetLoGainFadcSamples()[i] );
-	}
-    } 
-  
-  return kTRUE;
-  
-} 
Index: trunk/MagicSoft/Mars/mdatacheck/MFillHFadc.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MFillHFadc.h	(revision 709)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifndef MFILLHFADC_H
-#define MFILLHFADC_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef MTASK_H
-#include "MTask.h"
-#endif
-
-class MParList;
-class MHFadcCam;
-class MRawEvtData;
-
-class MFillHFadc : public MTask {
- private:
-  MRawEvtData      *fRawEvtData;
-
-  MHFadcCam        *fHistos ;
-
- public:   
-  MFillHFadc (const char *name=NULL, const char *title=NULL); 
-
-  Bool_t PreProcess(MParList *pList);
-  Bool_t Process() ;
-  
-  ClassDef(MFillHFadc, 0)	// Task to fill a MHistosAdc Container with data
-
-};
-    
-#endif
-
Index: trunk/MagicSoft/Mars/mdatacheck/MFillHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MFillHHillas.cc	(revision 709)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#include "MFillHHillas.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-#include "MHHillas.h"
-#include "MParList.h"
-
-ClassImp(MFillHHillas)
-
-MFillHHillas::MFillHHillas (const char *name, const char *title)
-{
-    *fName  = name  ? name  : "MFillHHillas";
-    *fTitle = title ? title : "Task to fill Hillas histograms";
-}
-
-Bool_t MFillHHillas::PreProcess (MParList *pList)
-{
-    fEvt = (MHillas*)pList->FindObject("MHillas");
-    if (!fEvt)
-    {
-        *fLog << dbginf << "MHillas not found... aborting." << endl;
-        return kFALSE ;
-    }
-
-    fHistos = (MHHillas*)pList->FindCreateObj("MHHillas");
-    if (!fHistos)
-        return kFALSE;
-
-    return kTRUE ;
-} 
-
-Bool_t MFillHHillas::Process()
-{
-    fHistos->Fill(fEvt);
-
-    return kTRUE;
-} 
Index: trunk/MagicSoft/Mars/mdatacheck/MFillHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MFillHHillas.h	(revision 709)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#ifndef MFILLHHILLAS_H
-#define MFILLHHILLAS_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef MTASK_H
-#include "MTask.h"
-#endif
-
-class MParList;
-class MHHillas;
-class MHillas;
-
-class MFillHHillas : public MTask {
- private:
-  MHillas  *fEvt;
-  MHHillas *fHistos ;
-
- public:   
-  MFillHHillas (const char *name=NULL, const char *title=NULL); 
-
-  Bool_t PreProcess(MParList *pList);
-  Bool_t Process() ;
-  
-  ClassDef(MFillHHillas, 0)	// Task to fill the Hillas histograms
-
-};
-    
-#endif
-
Index: trunk/MagicSoft/Mars/mdatacheck/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHFadcCam.cc	(revision 709)
+++ 	(revision )
@@ -1,66 +1,0 @@
-///////////////////////////////////////////////////////////////////////
-//
-// MHFadcCam
-//
-// This class contains a list of all ADC spektra histograms
-//
-///////////////////////////////////////////////////////////////////////
-
-#include "MHFadcCam.h"
-
-#include <TH1.h>
-
-ClassImp(MHFadcCam)
-
-MHFadcCam::MHFadcCam (const char *name, const char *title)
-{
-    //
-    //  default constructor
-    //  creates an a list of histograms for all pixels and both gain channels
-    //
-
-    //
-    //   set the name and title of this object
-    //
-    
-    *fName  = name  ? name  : "MHFadcCam" ;
-    *fTitle = title ? title : "Container for ADC spectra histograms" ;
-
-    //
-    //   loop over all Pixels and create two histograms
-    //   one for the Low and one for the High gain
-    //   connect all the histogram with the container fHist
-    //
-    fArray = new TObjArray(577);
-
-    for (Int_t i=0; i<577; i++)
-        (*fArray)[i] = new MHFadcPix(i);
-}
-
-MHFadcCam::~MHFadcCam ()
-{
-    delete fArray;
-}
-
-/*void MHFadcCam::SaveHist(char *name)
-{
-    //
-    //   save all histogram in this class to a root file
-    //
-
-    //
-    // FIXME: Don't open a file and write to this file!
-    // just Fill the current container (or the two histograms
-    // to an open file. The user must choose a file before.
-    //
-    TFile out( name, "recreate") ;
-
-    //
-    //  loop over all pixels and write the files out
-    //
-
-    fHistLo->Write() ;
-    fHistHi->Write() ;
-}
-
-  */
Index: trunk/MagicSoft/Mars/mdatacheck/MHFadcCam.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHFadcCam.h	(revision 709)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#ifndef MHFADCCAM_H
-#define MHFADCCAM_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TObjArray
-#include <TObjArray.h>
-#endif
-
-#ifndef MPARCONTAINER_H
-#include "MParContainer.h"
-#endif
-#ifndef MHFADCPIX_H
-#include "MHFadcPix.h"
-#endif
-
-class TH1F;
-
-class MHFadcCam : public MParContainer
-{
-private:
-    TObjArray *fArray;	// List of Lo/Hi gain Histograms
-
-public:
-     MHFadcCam(const char *name=NULL, const char *title=NULL);
-    ~MHFadcCam();
-
-    void FillHi(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillHi(data); }
-    void FillLo(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillLo(data); }
-
-    //    void SaveHist(char *name);
-
-    MHFadcPix *operator[](UInt_t i) { return (MHFadcPix*)(fArray->At(i)); }
-
-    TH1F *GetHistHi(UInt_t i)  { return (*this)[i]->GetHistHi(); }
-    TH1F *GetHistLo(UInt_t i)  { return (*this)[i]->GetHistLo(); }
-
-    void DrawHi(UInt_t i) { GetHistHi(i)->Draw(); }
-    void DrawLo(UInt_t i) { GetHistLo(i)->Draw(); }
-
-    void Draw(UInt_t i) { (*this)[i]->Draw(); }
-
-    Int_t GetEntries()
-    {
-        return fArray->GetEntries() ;
-    }
-
-    ClassDef(MHFadcCam, 1)	// list of Histograms with ADC spectra
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/mdatacheck/MHFadcPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHFadcPix.cc	(revision 709)
+++ 	(revision )
@@ -1,31 +1,0 @@
-///////////////////////////////////////////////////////////////////////
-//
-// MHistosAdc
-//
-// This class contains a list of all ADC spektra histograms
-//
-///////////////////////////////////////////////////////////////////////
-
-#include "MHFadcPix.h"
-
-#include <TPad.h>
-
-ClassImp(MHFadcPix)
-
-void MHFadcPix::Draw(Option_t *)
-{
-    if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-
-    gPad->Divide(1, 2);
-
-    gPad->cd(0);
-    fHistHi->Draw();
-
-    gPad->cd(1);
-    fHistLo->Draw();
-}
Index: trunk/MagicSoft/Mars/mdatacheck/MHFadcPix.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHFadcPix.h	(revision 709)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#ifndef MHFADCPIX_H
-#define MHFADCPIX_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TH1
-#include <TH1.h>
-#endif
-
-class MHFadcPix : public TObject
-{
-private:
-    TH1F *fHistHi;
-    TH1F *fHistLo;
-
-public:
-    MHFadcPix(UInt_t pixid)
-    {
-        Char_t tmp1[40];
-        Char_t tmp2[40];
-
-        sprintf(tmp1, "high%d", pixid);
-        sprintf(tmp2, "high gain Pixel %d", pixid);
-
-        fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
-
-        sprintf(tmp1, "low %d", pixid);
-        sprintf(tmp2, "low gain Pixel %d", pixid);
-
-        fHistLo =  new TH1F(tmp1, tmp2, 256, 0, 255);
-    }
-    ~MHFadcPix()
-    {
-        delete fHistHi;
-        delete fHistLo;
-    }
-    TH1F *GetHistHi() { return fHistHi; }
-    TH1F *GetHistLo() { return fHistLo; }
-
-    void FillHi(Byte_t i) { fHistHi->Fill(i); }
-    void FillLo(Byte_t i) { fHistLo->Fill(i); }
-
-    void DrawHi() { fHistHi->Draw(); }
-    void DrawLo() { fHistLo->Draw(); }
-
-    void Draw(Option_t *opt=NULL);
-
-    ClassDef(MHFadcPix, 1)
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc	(revision 709)
+++ 	(revision )
@@ -1,81 +1,0 @@
-///////////////////////////////////////////////////////////////////////
-//
-// MHHillas
-//
-// This class contains histograms for every Hillas parameter
-//
-///////////////////////////////////////////////////////////////////////
-
-#include "MHHillas.h"
-
-#include <TH1.h>
-#include <TPad.h>
-#include <TCanvas.h>
-
-#include "MHillas.h"
-
-ClassImp(MHHillas)
-
-MHHillas::MHHillas (const char *name, const char *title)
-{
-    //
-    //  default constructor
-    //  creates an a list of histograms for all pixels and both gain channels
-    //
-
-    //
-    //   set the name and title of this object
-    //
-    
-    *fName  = name  ? name  : "MHHillas" ;
-    *fTitle = title ? title : "Container for Hillas histograms" ;
-
-    //
-    //   loop over all Pixels and create two histograms
-    //   one for the Low and one for the High gain
-    //   connect all the histogram with the container fHist
-    //
-    fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
-    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
-    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
-    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
-}
-
-MHHillas::~MHHillas()
-{
-    delete fAlpha;
-    delete fWidth;
-    delete fLength;
-    delete fDist;
-}
-
-void MHHillas::Fill(MHillas *par)
-{
-    fAlpha ->Fill(fabs(par->GetAlpha()));
-    fWidth ->Fill(par->GetWidth());
-    fLength->Fill(par->GetLength());
-    fDist  ->Fill(par->GetDist());
-}
-
-void MHHillas::Draw(Option_t *)
-{
-
-    //
-    // Fixme! Check for an existing canvas.
-    // And create one if no canvas exists only!
-    //
-    TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
-    c->Divide(2,2);
-
-    c->cd(1);
-    fAlpha->Draw();
-    c->cd(2);
-    fLength->Draw();
-    c->cd(3);
-    fDist->Draw();
-    c->cd(4);
-    fWidth->Draw();
-
-    c->Modified();
-    c->Update();
-}
Index: trunk/MagicSoft/Mars/mdatacheck/MHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHHillas.h	(revision 709)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifndef MHHILLAS_H
-#define MHHILLAS_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef MPARCONTAINER_H
-#include "MParContainer.h"
-#endif
-
-class TH1F;
-class MHillas;
-
-class MHHillas : public MParContainer
-{
-private:
-    TH1F *fAlpha;
-    TH1F *fWidth;
-    TH1F *fLength;
-    TH1F *fDist;
-
-public:
-     MHHillas(const char *name=NULL, const char *title=NULL);
-    ~MHHillas();
-
-    void Fill(MHillas *par);
-
-    TH1F *GetHistAlpha()  { return fAlpha; }
-    TH1F *GetHistWidth()  { return fWidth; }
-    TH1F *GetHistLength() { return fLength; }
-    TH1F *GetHistDist()   { return fDist; }
-
-    void Draw(Option_t *opt=NULL);
-
-    ClassDef(MHHillas, 1)	// list of Histograms with ADC spectra
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/mdatacheck/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/Makefile	(revision 709)
+++ trunk/MagicSoft/Mars/mdatacheck/Makefile	(revision 710)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mraw -I../manalysis
+INCLUDES = -I. -I../mbase -I../mraw -I../mhist
 
 #------------------------------------------------------------------------------
@@ -29,10 +29,5 @@
 
 SRCFILES = MDumpEvtHeader.cc \
-	   MFillHFadc.cc \
-           MFillHHillas.cc \
 	   MGDisplayAdc.cc \
-           MHFadcPix.cc \
-           MHFadcCam.cc \
-           MHHillas.cc \
 	   MShowSpect.cc \
 	   MViewAdcSpectra.cc 
Index: trunk/MagicSoft/Mars/mgui/MGMarsMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMarsMain.cc	(revision 709)
+++ trunk/MagicSoft/Mars/mgui/MGMarsMain.cc	(revision 710)
@@ -31,6 +31,6 @@
 
 
-MGMarsMain::MGMarsMain(const TGWindow *p, UInt_t w, UInt_t h)
-  : TGMainFrame(p, w, h)
+MGMarsMain::MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
+  : TGMainFrame(gClient->GetRoot(), w, h)
 { 
   //    First create the MenuBar.   
Index: trunk/MagicSoft/Mars/mgui/MGMarsMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMarsMain.h	(revision 709)
+++ trunk/MagicSoft/Mars/mgui/MGMarsMain.h	(revision 710)
@@ -56,5 +56,5 @@
  
  public: 
-  MGMarsMain(const TGWindow *p, UInt_t w, UInt_t h) ;
+  MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h) ;
   
   ~MGMarsMain(); 
Index: trunk/MagicSoft/Mars/mhist/HistIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistIncl.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/HistIncl.h	(revision 710)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 710)
@@ -0,0 +1,16 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MHFadcCam;
+#pragma link C++ class MHFadcPix;
+#pragma link C++ class MHHillas;
+#pragma link C++ class MHStarMap;
+
+#pragma link C++ class MFillHFadc;
+#pragma link C++ class MFillHHillas;
+#pragma link C++ class MFillHStarMap;
+
+#endif
Index: trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 710)
@@ -0,0 +1,65 @@
+#include "MFillHFadc.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MParList.h"
+#include "MHFadcCam.h"
+#include "MRawEvtData.h"
+#include "MRawEvtPixelIter.h"
+
+ClassImp(MFillHFadc)
+
+    MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
+{
+  *fName  = name  ? name  : "MFillHFadc";
+  *fTitle = title ? title : "Task to fill the adc spectra with  raw data";
+}
+
+Bool_t MFillHFadc::PreProcess (MParList *pList)
+{
+  // connect the raw data with this task
+  
+  fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
+  if (!fHistos)
+      return kFALSE;
+
+  fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
+  if (!fRawEvtData)
+  {
+      *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
+      return kFALSE ;
+  }
+
+  return kTRUE ; 
+
+} 
+
+Bool_t MFillHFadc::Process()
+{
+  //  loop over the pixels and fill the values in the histograms
+  
+  MRawEvtPixelIter pixel(fRawEvtData);
+
+  const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
+  const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
+
+  //  cout << "HighSamples " << iHighSamples ;
+
+  while ( pixel.Next() )
+    { 
+      for (Int_t i=0 ; i<nhisamples ; i++ )
+	{ 
+            fHistos->FillHi ( pixel.GetPixelId(),
+                              pixel.GetHiGainFadcSamples()[i] );
+	}
+
+      for (Int_t i=0 ; i<nlosamples ; i++ )
+	{ 
+            fHistos->FillLo ( pixel.GetPixelId(),
+                              pixel.GetLoGainFadcSamples()[i] );
+	}
+    } 
+  
+  return kTRUE;
+  
+} 
Index: trunk/MagicSoft/Mars/mhist/MFillHFadc.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHFadc.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHFadc.h	(revision 710)
@@ -0,0 +1,33 @@
+#ifndef MFILLHFADC_H
+#define MFILLHFADC_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHFadcCam;
+class MRawEvtData;
+
+class MFillHFadc : public MTask {
+ private:
+  MRawEvtData      *fRawEvtData;
+
+  MHFadcCam        *fHistos ;
+
+ public:   
+  MFillHFadc (const char *name=NULL, const char *title=NULL); 
+
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process() ;
+  
+  ClassDef(MFillHFadc, 0)	// Task to fill a MHistosAdc Container with data
+
+};
+    
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MFillHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 710)
@@ -0,0 +1,37 @@
+#include "MFillHHillas.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MHHillas.h"
+#include "MParList.h"
+
+ClassImp(MFillHHillas)
+
+MFillHHillas::MFillHHillas (const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MFillHHillas";
+    *fTitle = title ? title : "Task to fill Hillas histograms";
+}
+
+Bool_t MFillHHillas::PreProcess (MParList *pList)
+{
+    fEvt = (MHillas*)pList->FindObject("MHillas");
+    if (!fEvt)
+    {
+        *fLog << dbginf << "MHillas not found... aborting." << endl;
+        return kFALSE ;
+    }
+
+    fHistos = (MHHillas*)pList->FindCreateObj("MHHillas");
+    if (!fHistos)
+        return kFALSE;
+
+    return kTRUE ;
+} 
+
+Bool_t MFillHHillas::Process()
+{
+    fHistos->Fill(fEvt);
+
+    return kTRUE;
+} 
Index: trunk/MagicSoft/Mars/mhist/MFillHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHHillas.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHHillas.h	(revision 710)
@@ -0,0 +1,32 @@
+#ifndef MFILLHHILLAS_H
+#define MFILLHHILLAS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHHillas;
+class MHillas;
+
+class MFillHHillas : public MTask {
+ private:
+  MHillas  *fEvt;
+  MHHillas *fHistos ;
+
+ public:   
+  MFillHHillas (const char *name=NULL, const char *title=NULL); 
+
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process() ;
+  
+  ClassDef(MFillHHillas, 0)	// Task to fill the Hillas histograms
+
+};
+    
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 710)
@@ -0,0 +1,41 @@
+#include "MFillHStarMap.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MHStarMap.h"
+#include "MHillas.h"
+#include "MParList.h"
+
+ClassImp(MFillHStarMap)
+
+MFillHStarMap::MFillHStarMap (const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MFillHStarMap";
+    *fTitle = title ? title : "Task to fill a StarMap";
+}
+
+Bool_t MFillHStarMap::PreProcess (MParList *pList)
+{
+    fEvt = (MHillas*)pList->FindObject("MHillas");
+    if (!fEvt)
+    {
+        *fLog << dbginf << "MHillas not found... aborting." << endl;
+        return kFALSE ;
+    }
+
+    fHistos = (MHStarMap*)pList->FindCreateObj("MHStarMap");
+    if (!fHistos)
+        return kFALSE;
+
+    return kTRUE ;
+} 
+
+Bool_t MFillHStarMap::Process()
+{
+//    if (fabs(fEvt->GetAlpha())>60)
+//        return kCONTINUE;
+
+    fHistos->Fill(fEvt);
+
+    return kTRUE;
+} 
Index: trunk/MagicSoft/Mars/mhist/MFillHStarMap.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHStarMap.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MFillHStarMap.h	(revision 710)
@@ -0,0 +1,32 @@
+#ifndef MFILLHSTARMAP_H
+#define MFILLHSTARMAP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHStarMap;
+class MHillas;
+
+class MFillHStarMap : public MTask {
+ private:
+  MHillas   *fEvt;
+  MHStarMap *fHistos ;
+
+ public:   
+  MFillHStarMap(const char *name=NULL, const char *title=NULL);
+
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process() ;
+  
+  ClassDef(MFillHStarMap, 0)	// Task to fill the Hillas histograms
+
+};
+    
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 710)
@@ -0,0 +1,66 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHFadcCam
+//
+// This class contains a list of all ADC spektra histograms
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHFadcCam.h"
+
+#include <TH1.h>
+
+ClassImp(MHFadcCam)
+
+MHFadcCam::MHFadcCam (const char *name, const char *title)
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHFadcCam" ;
+    *fTitle = title ? title : "Container for ADC spectra histograms" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+    fArray = new TObjArray(577);
+
+    for (Int_t i=0; i<577; i++)
+        (*fArray)[i] = new MHFadcPix(i);
+}
+
+MHFadcCam::~MHFadcCam ()
+{
+    delete fArray;
+}
+
+/*void MHFadcCam::SaveHist(char *name)
+{
+    //
+    //   save all histogram in this class to a root file
+    //
+
+    //
+    // FIXME: Don't open a file and write to this file!
+    // just Fill the current container (or the two histograms
+    // to an open file. The user must choose a file before.
+    //
+    TFile out( name, "recreate") ;
+
+    //
+    //  loop over all pixels and write the files out
+    //
+
+    fHistLo->Write() ;
+    fHistHi->Write() ;
+}
+
+  */
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 710)
@@ -0,0 +1,54 @@
+#ifndef MHFADCCAM_H
+#define MHFADCCAM_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+#ifndef MHFADCPIX_H
+#include "MHFadcPix.h"
+#endif
+
+class TH1F;
+
+class MHFadcCam : public MParContainer
+{
+private:
+    TObjArray *fArray;	// List of Lo/Hi gain Histograms
+
+public:
+     MHFadcCam(const char *name=NULL, const char *title=NULL);
+    ~MHFadcCam();
+
+    void FillHi(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillHi(data); }
+    void FillLo(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillLo(data); }
+
+    //    void SaveHist(char *name);
+
+    MHFadcPix *operator[](UInt_t i) { return (MHFadcPix*)(fArray->At(i)); }
+
+    TH1F *GetHistHi(UInt_t i)  { return (*this)[i]->GetHistHi(); }
+    TH1F *GetHistLo(UInt_t i)  { return (*this)[i]->GetHistLo(); }
+
+    void DrawHi(UInt_t i) { GetHistHi(i)->Draw(); }
+    void DrawLo(UInt_t i) { GetHistLo(i)->Draw(); }
+
+    void Draw(UInt_t i) { (*this)[i]->Draw(); }
+
+    Int_t GetEntries()
+    {
+        return fArray->GetEntries() ;
+    }
+
+    ClassDef(MHFadcCam, 1)	// list of Histograms with ADC spectra
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 710)
@@ -0,0 +1,31 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHistosAdc
+//
+// This class contains a list of all ADC spektra histograms
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHFadcPix.h"
+
+#include <TPad.h>
+
+ClassImp(MHFadcPix)
+
+void MHFadcPix::Draw(Option_t *)
+{
+    if (!gPad)
+    {
+        if (!gROOT->GetMakeDefCanvas())
+            return;
+        (gROOT->GetMakeDefCanvas())();
+    }
+
+    gPad->Divide(1, 2);
+
+    gPad->cd(0);
+    fHistHi->Draw();
+
+    gPad->cd(1);
+    fHistLo->Draw();
+}
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 710)
@@ -0,0 +1,54 @@
+#ifndef MHFADCPIX_H
+#define MHFADCPIX_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
+class MHFadcPix : public TObject
+{
+private:
+    TH1F *fHistHi;
+    TH1F *fHistLo;
+
+public:
+    MHFadcPix(UInt_t pixid)
+    {
+        Char_t tmp1[40];
+        Char_t tmp2[40];
+
+        sprintf(tmp1, "high%d", pixid);
+        sprintf(tmp2, "high gain Pixel %d", pixid);
+
+        fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
+
+        sprintf(tmp1, "low %d", pixid);
+        sprintf(tmp2, "low gain Pixel %d", pixid);
+
+        fHistLo =  new TH1F(tmp1, tmp2, 256, 0, 255);
+    }
+    ~MHFadcPix()
+    {
+        delete fHistHi;
+        delete fHistLo;
+    }
+    TH1F *GetHistHi() { return fHistHi; }
+    TH1F *GetHistLo() { return fHistLo; }
+
+    void FillHi(Byte_t i) { fHistHi->Fill(i); }
+    void FillLo(Byte_t i) { fHistLo->Fill(i); }
+
+    void DrawHi() { fHistHi->Draw(); }
+    void DrawLo() { fHistLo->Draw(); }
+
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHFadcPix, 1)
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 710)
@@ -0,0 +1,81 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHHillas
+//
+// This class contains histograms for every Hillas parameter
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHHillas.h"
+
+#include <TH1.h>
+#include <TPad.h>
+#include <TCanvas.h>
+
+#include "MHillas.h"
+
+ClassImp(MHHillas)
+
+MHHillas::MHHillas (const char *name, const char *title)
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHHillas" ;
+    *fTitle = title ? title : "Container for Hillas histograms" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+    fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
+    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
+    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
+    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
+}
+
+MHHillas::~MHHillas()
+{
+    delete fAlpha;
+    delete fWidth;
+    delete fLength;
+    delete fDist;
+}
+
+void MHHillas::Fill(MHillas *par)
+{
+    fAlpha ->Fill(fabs(par->GetAlpha()));
+    fWidth ->Fill(par->GetWidth());
+    fLength->Fill(par->GetLength());
+    fDist  ->Fill(par->GetDist());
+}
+
+void MHHillas::Draw(Option_t *)
+{
+
+    //
+    // Fixme! Check for an existing canvas.
+    // And create one if no canvas exists only!
+    //
+    TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
+    c->Divide(2,2);
+
+    c->cd(1);
+    fAlpha->Draw();
+    c->cd(2);
+    fLength->Draw();
+    c->cd(3);
+    fDist->Draw();
+    c->cd(4);
+    fWidth->Draw();
+
+    c->Modified();
+    c->Update();
+}
Index: trunk/MagicSoft/Mars/mhist/MHHillas.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.h	(revision 710)
@@ -0,0 +1,40 @@
+#ifndef MHHILLAS_H
+#define MHHILLAS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class TH1F;
+class MHillas;
+
+class MHHillas : public MParContainer
+{
+private:
+    TH1F *fAlpha;
+    TH1F *fWidth;
+    TH1F *fLength;
+    TH1F *fDist;
+
+public:
+     MHHillas(const char *name=NULL, const char *title=NULL);
+    ~MHHillas();
+
+    void Fill(MHillas *par);
+
+    TH1F *GetHistAlpha()  { return fAlpha; }
+    TH1F *GetHistWidth()  { return fWidth; }
+    TH1F *GetHistLength() { return fLength; }
+    TH1F *GetHistDist()   { return fDist; }
+
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHHillas, 1)	// list of Histograms with ADC spectra
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 710)
@@ -0,0 +1,78 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHStarMap
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHStarMap.h"
+
+#include <TH2.h>
+#include <TStyle.h>
+#include <TCanvas.h>
+
+#include "MHillas.h"
+
+ClassImp(MHStarMap)
+
+MHStarMap::MHStarMap (const char *name, const char *title)
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHStarMap" ;
+    *fTitle = title ? title : "Container for a Star Map" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+    fStarMap = new TH2F("Star Map", "Counts",
+                        50, -300, 300,
+                        50, -300, 300);
+}
+
+MHStarMap::~MHStarMap()
+{
+    delete fStarMap;
+}
+
+void MHStarMap::Draw(Option_t *)
+{
+    TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
+
+    gStyle->SetPalette(1, 0);
+    fStarMap->Draw("colz");
+
+    c->Modified();
+    c->Update();
+}
+
+void MHStarMap::Fill(MHillas *par)
+{
+    const float dist  = par->GetDist();
+    const float theta = par->GetTheta();
+    const float alpha = par->GetAlpha()/kRad2Deg;
+
+    const float m = tan(theta+alpha-kPI);
+    const float t = dist*(sin(theta)-cos(theta)*m);
+
+    float y0 = -m*300+t;
+    for (int i=-297; i<300; i+=3)
+    {
+        const float y1 = m*i+t;
+
+//        if (y1<=y0-3 || y1>=y0+3)
+//            continue;
+
+        fStarMap->Fill(i, y1);
+        y0 = y1;
+    }
+}
+
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 710)
@@ -0,0 +1,38 @@
+#ifndef MHSTARMAP_H
+#define MHSTARMAP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+#ifndef ROOT_TH2
+// what's the reason that we need this here? cint complains about it
+// if it is missing...
+#include <TH2.h>
+#endif
+
+class MHillas;
+
+class MHStarMap : public MParContainer
+{
+private:
+    TH2F *fStarMap;
+
+public:
+     MHStarMap(const char *name=NULL, const char *title=NULL);
+    ~MHStarMap();
+
+    void Fill(MHillas *par);
+
+    TH2F *GetHist()               { return fStarMap; }
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHStarMap, 1)	// list of Histograms with ADC spectra
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 710)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 710)
@@ -0,0 +1,53 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Hist
+
+#
+# Library name to creatre
+#
+LIB   = mhist.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mraw -I../manalysis
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MFillHFadc.cc \
+           MFillHHillas.cc \
+           MFillHStarMap.cc \
+           MHFadcPix.cc \
+           MHFadcCam.cc \
+           MHHillas.cc \
+           MHStarMap.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 709)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc	(revision 710)
@@ -34,6 +34,6 @@
 		      50, 0., 500. ) ; 
 
-  fHistColl = new TH1D("collArea", "Collection Area", 
-		       50, 0., 5.) ; 
+  fHistCol = new TH1D("collArea", "Collection Area",
+                      50, 0., 5.) ;
   
 } 
@@ -43,5 +43,5 @@
   delete fHistAll ; 
   delete fHistSel ; 
-  delete fHistColl ; 
+  delete fHistCol ;
 } 
 
@@ -68,82 +68,70 @@
 void MCollArea::Draw(Option_t* option) 
 { 
-  fHistColl->Draw(option) ; 
+  fHistCol->Draw(option) ;
 } 
 
-void MCollArea::CalculateEffi()
+void MCollArea::CalcEfficiency()
 { 
-  //  first of all calculate the efficency
-  //  do it here by hand to get the right error of efficency
- 
-  Int_t iBinx = ( (TAxis *) fHistSel->GetXaxis())->GetNbins() ; 
-  Int_t iBiny = ( (TAxis *) fHistSel->GetYaxis())->GetNbins() ; 
- 
-  Float_t N, Nall ; 
-  Double_t effi, error ; 
-  for (Int_t ix=1; ix<=iBiny; ix++ ) 
+    // Description!
+
+    //
+    //  first of all calculate the efficency
+    //  do it here by hand to get the right error of efficency
+    //
+    const Int_t iBinx = ((TAxis *)fHistSel->GetXaxis())->GetNbins();
+    const Int_t iBiny = ((TAxis *)fHistSel->GetYaxis())->GetNbins();
+
+    for (Int_t ix=1; ix<=iBiny; ix++ )
     {
-      for (Int_t iy=1; iy<=iBiny; iy++ ) 
-	{ 
-	  effi = error = 0. ; 
+        for (Int_t iy=1; iy<=iBiny; iy++ )
+        {
+            const Float_t N    = fHistSel->GetCellContent(ix, iy);
+            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
 
-	  N    = fHistSel->GetCellContent(ix, iy) ; 
-	  Nall = fHistAll->GetCellContent(ix, iy) ; 
-	  
-	  if ( Nall > 0 ) { 
-	    effi   = N / Nall ; 
-	    error = sqrt ( Nall + Nall * N - N * N - N ) / (Nall * Nall ) ; 
+            if ( Nall <= 0 ) {
+                // cout << ix << " " << iy << endl ;
+                continue;
+            }
 
-	    cout << ix << " " << iy 
-		 << " N " << N 
-		 << " Nall " << Nall
-		 << " effi  " << effi 
-		 << " error " << error 
-		 << endl ; 
+            const Double_t eff = N / Nall ;
+            const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
+            /*
+             cout << ix << " " << iy
+             << " N " << N
+             << " Nall " << Nall
+             << " effi  " << eff
+             << " error " << err
+             << endl ;
+             */
+            fHistSel->SetCellContent(ix, iy, eff);
+            fHistSel->SetCellError(ix, iy, err);
+        }
+    }
 
-	    fHistSel->SetCellContent(ix, iy, effi) ; 
-	    fHistSel->SetCellError(ix, iy, error) ; 
-	  } 
-	  else 
-	    cout << ix << " " << iy << endl ; 
-	    
-	  
+    //
+    //  now calculate the Collection area for different
+    //  energies
+    //
+    for (Int_t ix=1; ix<=iBiny; ix++ )
+    {
+        Double_t errA = 0;
+        Double_t colA = 0;
 
-	  
-	}
-    } 
-  
-  // 
-  //  now calculate the Collection area for different 
-  //  energies
-  //   
-  
-  
-  Double_t  r1, r2, eff, errEff, A, errA, collA ; 
+        for (Int_t iy=1; iy<=iBiny; iy++ )
+        {
+            const Double_t r1  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy);
+            const Double_t r2  = ((TAxis *)fHistSel->GetYaxis())->GetBinLowEdge(iy+1);
 
-  for (Int_t ix=1; ix<=iBiny; ix++ ) 
-    {
-      A = errA = collA = errEff = 0. ; 
-      
-      for (Int_t iy=1; iy<=iBiny; iy++ ) 
-	{ 
-	  r1 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy) ; 
-	  r2 = ( (TAxis *) fHistSel->GetYaxis())->GetBinLowEdge(iy+1) ; 
-	  A  = 3.141592654 * ( r2*r2 - r1*r1 ) ; 
-	  eff    = fHistSel->GetCellContent(ix, iy) ;
-	  errEff = fHistSel->GetCellError(ix, iy) ; 
-	  collA += eff * A ; 
-	  
-	  errA  += ( A * A ) * errEff * errEff ; 
-	}
+            const Double_t A   = kPI * (r2*r2 - r1*r1);
 
-      errA = sqrt( errA ) ; 
+            const Double_t eff = fHistSel->GetCellContent(ix, iy);
+            const Double_t err = fHistSel->GetCellError(ix, iy);
 
-      cout << ix << " --> " << A
-	   << endl ; 
-      
-      fHistColl->SetBinContent(ix, collA ) ; 
-      fHistColl->SetBinError(ix, errA ) ; 
-      
+            colA += eff*A;
+            errA += (A*A) * err * err;
+        }
 
-    } 
-} 
+        fHistCol->SetBinContent(ix, colA);
+        fHistCol->SetBinError(ix, sqrt(errA));
+    }
+}
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h	(revision 709)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollArea.h	(revision 710)
@@ -9,7 +9,7 @@
 
  private: 
-  TH2D  *fHistAll ; //!    all simulated showers 
-  TH2D  *fHistSel ; //!    the selected showers
-  TH1D  *fHistColl ; //!   the collection area
+  TH2D  *fHistAll ; //! all simulated showers
+  TH2D  *fHistSel ; //! the selected showers
+  TH1D  *fHistCol ; //  the collection area
 
  public: 
@@ -23,5 +23,5 @@
   void DrawSel() ;
   void Draw(Option_t* option = "") ; 
-  void CalculateEffi() ; 
+  void CalcEfficiency() ;
 
   ClassDef(MCollArea, 1)  //  Data Container to calculate Collection Area
