Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1946)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1947)
@@ -1,3 +1,29 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/04/11: Thomas Bretz
+
+   * macros/readMagic.C:
+     - replaced GetEventNum by GetNumEntry
+     
+   * manalysis/MCT1SupercutsCalc.cc:
+     - fixed constructor (no default for fHadronnessName)
+     - missing fHadronness->SetReadyToSave added
+     
+   * manalysis/MMultiDimDistCalc.cc:
+     - missing fHadronness->SetReadyToSave added
+    
+   * manalysis/MParameters.cc:
+     - changed title
+
+   * mfilter/MFCT1SelFinal.h:
+     - set ClassDef to 0
+   
+   * mimage/Makefile:
+     - fixed a typo
+     
+   * mraw/MRawEvtData.cc:
+     - fixed Pixel assignment (i->ipos, fPosInArray++)
+
+
 
  2003/04/10: Thomas Bretz
@@ -50,5 +76,6 @@
 
    * manalysis/Makefile, manalysis/AnalysisLinkDef.h,
-     mhist/Makefile, mhist/AnalysisLinkDef.h:
+     mhist/Makefile, mhist/AnalysisLinkDef.h, mmain/Makefile,
+     mfilter/Makefile, meventdisp/Makefile, mgui/Makefile:
      - adapted
 
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 1946)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 1947)
@@ -98,5 +98,5 @@
     while (tlist.Process())
     {
-        cout << "Event #" << read.GetEventNum() ":" << endl;
+        cout << "Event #" << read.GetNumEntry() ":" << endl;
 
         display.DrawPhotNum((MCerPhotEvt*)clone.GetClone());
Index: trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc	(revision 1946)
+++ trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc	(revision 1947)
@@ -136,12 +136,10 @@
 //
 MCT1SupercutsCalc::MCT1SupercutsCalc(const char *hilname, 
-               const char *hilsrcname, const char *name, const char *title) 
+                                     const char *hilsrcname, const char *name, const char *title)
+: fHadronnessName("MHadronness"), fHilName(hilname), fHilSrcName(hilsrcname)
 {
     fName  = name  ? name  : "MCT1SupercutsCalc";
     fTitle = title ? title : "Class to evaluate the Supercuts";
 
-    fHilName    = hilname;
-    fHilSrcName = hilsrcname;
-
     InitParams();
 }
@@ -186,5 +184,4 @@
         return kFALSE;
     }
-
 
     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
@@ -274,19 +271,21 @@
   //      << width << endl;
 
-  if (    newdist  < 1.05
-       && newdist  < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2)
-       && newdist  > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2)
-       && dist     < 1.05
-       && length   < CtsMCut (fLengthUp, dmls, dmcza, dmls2, dd2)
-       && length   > CtsMCut (fLengthLo, dmls, dmcza, dmls2, dd2)
-       && width    < CtsMCut (fWidthUp,  dmls, dmcza, dmls2, dd2)
-       && width    > CtsMCut (fWidthLo,  dmls, dmcza, dmls2, dd2)
-       //&& asym   < CtsMCut (asymup,    dmls, dmcza, dmls2, dd2)
-       //&& asym   > CtsMCut (asymlow,   dmls, dmcza, dmls2, dd2)
-       && dist     < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2)
-       && dist     > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2)  )
-    fHadronness->SetHadronness(0.25);
+  if (newdist < 1.05                                         &&
+      newdist < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2) &&
+      newdist > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2) &&
+      dist    < 1.05                                         &&
+      length  < CtsMCut (fLengthUp, dmls, dmcza, dmls2, dd2) &&
+      length  > CtsMCut (fLengthLo, dmls, dmcza, dmls2, dd2) &&
+      width   < CtsMCut (fWidthUp,  dmls, dmcza, dmls2, dd2) &&
+      width   > CtsMCut (fWidthLo,  dmls, dmcza, dmls2, dd2) &&
+      //asym  < CtsMCut (asymup,    dmls, dmcza, dmls2, dd2) &&
+      //asym  > CtsMCut (asymlow,   dmls, dmcza, dmls2, dd2) &&
+      dist    < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2) &&
+      dist    > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2)  )
+      fHadronness->SetHadronness(0.25);
   else
-    fHadronness->SetHadronness(0.75);
+      fHadronness->SetHadronness(0.75);
+
+  fHadronness->SetReadyToSave();
 
   return kTRUE;
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 1946)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 1947)
@@ -210,4 +210,5 @@
 
     fHadronness->SetHadronness(dg==0 ? 0 : exp(-dh/dg));
+    fHadronness->SetReadyToSave();
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/manalysis/MParameters.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MParameters.cc	(revision 1946)
+++ trunk/MagicSoft/Mars/manalysis/MParameters.cc	(revision 1947)
@@ -42,4 +42,5 @@
 ClassImp(MParameterD);
 ClassImp(MParameterI);
+//ClassImp(MParameter);
 
 // --------------------------------------------------------------------------
@@ -50,5 +51,5 @@
 {
     fName  = name  ? name  : "MParameterD";
-    fTitle = title ? title : "Storgare container for general parameters";
+    fTitle = title ? title : "Storgare container for general parameters (double)";
 }
 
@@ -60,5 +61,5 @@
 {
     fName  = name  ? name  : "MParameterI";
-    fTitle = title ? title : "Storgare container for general parameters";
+    fTitle = title ? title : "Storgare container for general parameters (integer)";
 }
 
Index: trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.h	(revision 1946)
+++ trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.h	(revision 1947)
@@ -56,5 +56,5 @@
     void SetCuts(Float_t hadmax, Float_t alphamax); 
 
-    ClassDef(MFCT1SelFinal, 1)   // Class to evaluate final cuts
+    ClassDef(MFCT1SelFinal, 0)   // Class to evaluate final cuts
 };
 
Index: trunk/MagicSoft/Mars/mhist/MHHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillasExt.cc	(revision 1946)
+++ 	(revision )
@@ -1,334 +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  2001 <mailto:tbretz@uni-sw.gwdg.de>
-!
-!   Copyright: MAGIC Software Development, 2000-2002
-!
-!
-\* ======================================================================== */
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// MHHillasExt
-//
-// This class contains histograms for every Hillas parameter
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MHHillasExt.h"
-
-#include <math.h>
-
-#include <TH1.h>
-#include <TPad.h>
-#include <TLegend.h>
-#include <TCanvas.h>
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MGeomCam.h"
-
-#include "MParList.h"
-
-#include "MBinning.h"
-#include "MHillasExt.h"
-#include "MHillasSrc.h"
-
-ClassImp(MHHillasExt);
-
-// --------------------------------------------------------------------------
-//
-// Setup four histograms for Width, Length
-//
-MHHillasExt::MHHillasExt(const char *name, const char *title,
-                         const char *hil)
-    : fMm2Deg(1), fUseMmScale(kTRUE)
-{
-    //
-    //   set the name and title of this object
-    //
-    fName  = name  ? name  : "MHHillasExt";
-    fTitle = title ? title : "Container for extended Hillas histograms";
-
-    fHilName = hil;
-    //*fLog << "MHHillasExt : fHilName = " << fHilName << endl;
-
-    //
-    // 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
-    //
-    fHConc1.SetLineColor(kBlue);
-    fHConc.SetFillStyle(0);
-
-    fHConc.SetDirectory(NULL);
-    fHConc1.SetDirectory(NULL);
-    fHAsym.SetDirectory(NULL);
-    fHM3Long.SetDirectory(NULL);
-    fHM3Trans.SetDirectory(NULL);
-
-    fHConc.SetName("Conc2");
-    fHConc1.SetName("Conc1");
-    fHAsym.SetName("Asymmetry");
-    fHM3Long.SetName("3rd Mom Long");
-    fHM3Trans.SetName("3rd Mom Trans");
-
-    fHConc.SetTitle("Ratio: Conc");
-    fHConc1.SetTitle("Ratio: Conc1");
-    fHAsym.SetTitle("Asymmetry");
-    fHM3Long.SetTitle("3^{rd} Moment Longitudinal");
-    fHM3Trans.SetTitle("3^{rd} Moment Transverse");
-
-    fHConc.SetXTitle("Ratio");
-    fHConc1.SetXTitle("Ratio");
-    fHAsym.SetXTitle("Asym [mm]");
-    fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
-    fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
-
-    fHConc.SetYTitle("Counts");
-    fHConc1.SetYTitle("Counts");
-    fHAsym.SetYTitle("Counts");
-    fHM3Long.SetYTitle("Counts");
-    fHM3Trans.SetYTitle("Counts");
-
-
-    MBinning bins;
-
-    bins.SetEdges(100, 0, 1);
-    bins.Apply(fHConc);
-    bins.Apply(fHConc1);
-
-    bins.SetEdges(101, -326, 326);
-    bins.Apply(fHM3Long);
-    bins.Apply(fHM3Trans);
-
-    bins.SetEdges(101, -593, 593);
-    bins.Apply(fHAsym);
-}
-
-// --------------------------------------------------------------------------
-//
-// Delete the four histograms
-//
-MHHillasExt::~MHHillasExt()
-{
-}
-
-// --------------------------------------------------------------------------
-//
-// Setup the Binning for the histograms automatically if the correct
-// instances of MBinning (with the names 'BinningWidth' and 'BinningLength')
-// are found in the parameter list
-// Use this function if you want to set the conversion factor which
-// is used to convert the mm-scale in the camera plain into the deg-scale
-// used for histogram presentations. The conversion factor is part of
-// the camera geometry. Please create a corresponding MGeomCam container.
-//
-Bool_t MHHillasExt::SetupFill(const MParList *plist)
-{
-    TObject *obj = plist->FindObject(fHilName, "MHillas");
-    if (!obj)
-    {
-      *fLog << err << dbginf << "Sorry '" << fHilName 
-            << "' not found in parameter list... aborting." << endl;
-        return kFALSE;
-    }
-    if (!obj->InheritsFrom(MHillasExt::Class()))
-    {
-        *fLog << err << dbginf << "Sorry 'MHillas' doesn't inherit from MHillasExt... aborting." << endl;
-        return kFALSE;
-    }
-    fHillasExt = (MHillasExt*)obj;
-
-    const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
-    if (!geom)
-        *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
-    else
-    {
-        fMm2Deg = geom->GetConvMm2Deg();
-        SetMmScale(kFALSE);
-    }
-
-    ApplyBinning(*plist, "Conc",    &fHConc);
-    ApplyBinning(*plist, "Conc1",   &fHConc1);
-    ApplyBinning(*plist, "Asym",    &fHAsym);
-    ApplyBinning(*plist, "M3Long",  &fHM3Long);
-    ApplyBinning(*plist, "M3Trans", &fHM3Trans);
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Fill the four histograms with data from a MHillas-Container.
-// Be careful: Only call this with an object of type MHillas
-//
-Bool_t MHHillasExt::Fill(const MParContainer *par)
-{
-    const MHillasSrc *src = (MHillasSrc*)par;
-
-    const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, src ? src->GetCosDeltaAlpha() : 1);
-
-    fHConc.Fill(fHillasExt->GetConc());
-    fHConc1.Fill(fHillasExt->GetConc1());
-
-    fHAsym.Fill(scale*fHillasExt->GetAsym());
-    fHM3Long.Fill(scale*fHillasExt->GetM3Long());
-    fHM3Trans.Fill(scale*fHillasExt->GetM3Trans());
-    //fHAsymna.Fill(scale*ext.GetAsymna());
-    //fHAsym0.Fill(scale*ext.GetAsym0());
-
-    return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// With this function you can convert the histogram ('on the fly') between
-// degrees and millimeters.
-//
-void MHHillasExt::SetMmScale(Bool_t mmscale)
-{
-    if (fUseMmScale == mmscale)
-        return;
-
-    if (fMm2Deg<0)
-    {
-        *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;
-        return;
-    }
-
-    const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;
-    MH::ScaleAxis(&fHAsym,    scale);
-    MH::ScaleAxis(&fHM3Long,  scale);
-    MH::ScaleAxis(&fHM3Trans, scale);
-
-    if (mmscale)
-    {
-        fHAsym.SetXTitle("Asym [mm]");
-        fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");
-        fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");
-    }
-    else
-    {
-        fHAsym.SetXTitle("Asym [\\circ]");
-        fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");
-        fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");
-    }
-
-    fUseMmScale = mmscale;
-}
-
-// --------------------------------------------------------------------------
-//
-// Use this function to setup your own conversion factor between degrees
-// and millimeters. The conversion factor should be the one calculated in
-// MGeomCam. Use this function with Caution: You could create wrong values
-// by setting up your own scale factor.
-//
-void MHHillasExt::SetMm2Deg(Float_t mmdeg)
-{
-    if (mmdeg<0)
-    {
-        *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;
-        return;
-    }
-
-    if (fMm2Deg>=0)
-        *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;
-
-    fMm2Deg = mmdeg;
-}
-
-// --------------------------------------------------------------------------
-//
-// Draw clones of all four histograms. So that the object can be deleted
-// and the histograms are still visible in the canvas.
-// The cloned object are deleted together with the canvas if the canvas is
-// destroyed. If you want to handle dostroying the canvas you can get a
-// pointer to it from this function
-//
-TObject *MHHillasExt::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas(this, 720, 540);
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c.cd(1);
-    DrawCopy(fHConc1, fHConc, "Concentrations");
-
-    c.cd(2);
-    ((TH1&)fHAsym).DrawCopy();
-
-    c.cd(3);
-    ((TH1&)fHM3Long).DrawCopy();
-
-    c.cd(4);
-    ((TH1&)fHM3Trans).DrawCopy();
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
-// Creates a new canvas and draws the four histograms into it.
-// Be careful: The histograms belongs to this object and won't get deleted
-// together with the canvas.
-//
-void MHHillasExt::Draw(Option_t *)
-{
-    if (!gPad)
-        MakeDefCanvas(this, 720, 540);
-
-    gPad->Divide(2, 2);
-
-    gPad->cd(1);
-    MH::Draw(fHConc1, fHConc, "Concentrations");
-
-    gPad->cd(2);
-    fHAsym.Draw();
-
-    gPad->cd(3);
-    fHM3Long.Draw();
-
-    gPad->cd(4);
-    fHM3Trans.Draw();
-
-    gPad->Modified();
-    gPad->Update();
-}
-
-TH1 *MHHillasExt::GetHistByName(const TString name)
-{
-    if (name.Contains("Conc", TString::kIgnoreCase))
-        return &fHConc;
-    if (name.Contains("Conc1", TString::kIgnoreCase))
-        return &fHConc1;
-    if (name.Contains("Asym", TString::kIgnoreCase))
-        return &fHAsym;
-    if (name.Contains("M3Long", TString::kIgnoreCase))
-        return &fHM3Long;
-    if (name.Contains("M3Trans", TString::kIgnoreCase))
-        return &fHM3Trans;
-
-    return NULL;
-}
Index: trunk/MagicSoft/Mars/mimage/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mimage/Makefile	(revision 1946)
+++ trunk/MagicSoft/Mars/mimage/Makefile	(revision 1947)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mhist -I../mgeom -I../manalysi
+INCLUDES = -I. -I../mbase -I../mhist -I../mgeom -I../manalysis
 
 #------------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 1946)
+++ trunk/MagicSoft/Mars/mraw/MRawEvtData.cc	(revision 1947)
@@ -420,7 +420,8 @@
         // get the spiral pixel number from the run header
         //
-        const UShort_t npix = fRunHeader->GetPixAssignment(i);
-
         const UShort_t ipos = npos+i;
+
+        const UShort_t npix = fRunHeader->GetPixAssignment(ipos);
+
         //
         //  This is to fill the data of one pixel to the MRawEvtHeader Class.
@@ -440,4 +441,6 @@
         //}
     }
-}
-
+
+    fPosInArray++;
+}
+
