Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1207)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1208)
@@ -1,3 +1,13 @@
                                                                   -*-*- END -*-*-
+
+ 2002/01/22: Thomas Bretz
+ 
+   * mhist/MHHillasSrc.[h,cc], mhist/MHFadcCam.[h,cc]:
+     - changed return type of Fill to Bool_t
+   
+   * mfilter/MFAlpha.[h,cc]:
+     - added
+
+
 
  2002/01/21: Thomas Bretz
@@ -20,5 +30,4 @@
    * macros/readMagic.C:
      - removed MPedestalCam
-
 
 
Index: /trunk/MagicSoft/Mars/mfilter/MFAlpha.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFAlpha.cc	(revision 1208)
+++ /trunk/MagicSoft/Mars/mfilter/MFAlpha.cc	(revision 1208)
@@ -0,0 +1,113 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  01/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MFAlpha                                                               //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MFAlpha.h"
+
+#include <math.h>
+
+#include "MParList.h"
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MHillasSrc.h"
+
+ClassImp(MFAlpha);
+
+
+// --------------------------------------------------------------------------
+//
+MFAlpha::MFAlpha(const char *cname, const char type, const Float_t val) : fHillas(NULL)
+{
+    fContName = cname;
+    Init(type, val);
+}
+
+// --------------------------------------------------------------------------
+//
+MFAlpha::MFAlpha(const MHillasSrc *hillas, const char type, const Float_t val) : fHillas(hillas)
+{
+    Init(type, val);
+}
+
+// --------------------------------------------------------------------------
+//
+void MFAlpha::Init(const char type, const Int_t val)
+{
+    fFilterType = (type=='<' ? kELowerThan : kEGreaterThan);
+
+    if (type!='<' && type!='>')
+        *fLog << warn << dbginf << "Warning: Neither '<' nor '>' specified... using '>'." << endl;
+
+    fValue = val;
+
+    AddToBranchList(Form("%s.fAlpha", (const char*)fContName));
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFAlpha::IsExpressionTrue() const
+{
+    return fResult;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFAlpha::PreProcess(MParList *pList)
+{
+    if (fHillas)
+        return kTRUE;
+
+    fHillas = (MHillasSrc*)pList->FindObject(fContName);
+    if (fHillas)
+        return kTRUE;
+
+    *fLog << err << dbginf << fContName << " [MHillas] not found... aborting." << endl;
+    return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFAlpha::Process()
+{
+    const Float_t alpha = fabs(fHillas->GetAlpha());
+
+    switch (fFilterType)
+    {
+    case kELowerThan:
+        fResult = (alpha < fValue);
+        break;
+    case kEGreaterThan:
+        fResult = (alpha > fValue);
+        break;
+    }
+
+    return kTRUE;
+}
+
Index: /trunk/MagicSoft/Mars/mfilter/MFAlpha.h
===================================================================
--- /trunk/MagicSoft/Mars/mfilter/MFAlpha.h	(revision 1208)
+++ /trunk/MagicSoft/Mars/mfilter/MFAlpha.h	(revision 1208)
@@ -0,0 +1,42 @@
+#ifndef MARS_MFAlpha
+#define MARS_MFAlpha
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFAlpha                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARS_MFilter
+#include "MFilter.h"
+#endif
+
+class MParList;
+class MHillasSrc;
+
+class MFAlpha : public MFilter
+{
+private:
+    const MHillasSrc *fHillas;
+    TString fContName;
+
+    typedef enum { kELowerThan, kEGreaterThan } FilterType_t;
+    FilterType_t fFilterType;
+
+    Bool_t  fResult;
+    Float_t fValue; // [deg]
+
+    void Init(const char type, const Int_t val);
+
+public:
+    MFAlpha(const char       *cname="MHillas", const char type='>', const Float_t deg=15);
+    MFAlpha(const MHillasSrc *hillas,          const char type='>', const Float_t deg=15);
+
+    Bool_t IsExpressionTrue() const;
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MFAlpha, 0)		// A Filter for the Level 1 Trigger
+};
+
+#endif
Index: /trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1208)
@@ -8,4 +8,5 @@
 
 #pragma link C++ class MH+;
+#pragma link C++ class MBinning+;
 #pragma link C++ class MHFadcCam+;
 #pragma link C++ class MHFadcPix+;
Index: /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1208)
@@ -87,5 +87,5 @@
 
 // --------------------------------------------------------------------------
-void MHFadcCam::Fill(const MParContainer *par)
+Bool_t MHFadcCam::Fill(const MParContainer *par)
 {
     MRawEvtData *evt = (MRawEvtData*)par;
@@ -110,3 +110,4 @@
     }
 
+    return kTRUE;
 }
Index: /trunk/MagicSoft/Mars/mhist/MHFadcCam.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1208)
@@ -34,5 +34,5 @@
     TH1F *GetHistLo(UInt_t i)  { return (*this)[i]->GetHistLo(); }
 
-    void Fill(const MParContainer *par);
+    Bool_t Fill(const MParContainer *par);
 
     //
Index: /trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc	(revision 1208)
@@ -88,5 +88,5 @@
 // Be careful: Only call this with an object of type MHillas
 //
-void MHHillasSrc::Fill(const MParContainer *par)
+Bool_t MHHillasSrc::Fill(const MParContainer *par)
 {
     const MHillasSrc &h = *(MHillasSrc*)par;
@@ -94,4 +94,6 @@
     fAlpha->Fill(fabs(h.GetAlpha()));
     fDist ->Fill(h.GetDist());
+
+    return kTRUE;
 }
 
Index: /trunk/MagicSoft/Mars/mhist/MHHillasSrc.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHHillasSrc.h	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/MHHillasSrc.h	(revision 1208)
@@ -16,8 +16,8 @@
 
 public:
-     MHHillasSrc(const char *name=NULL, const char *title=NULL);
+    MHHillasSrc(const char *name=NULL, const char *title=NULL);
     ~MHHillasSrc();
 
-    void Fill(const MParContainer *par);
+    Bool_t Fill(const MParContainer *par);
 
     TH1F *GetHistAlpha()  { return fAlpha; }
Index: /trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mhist/Makefile	(revision 1207)
+++ /trunk/MagicSoft/Mars/mhist/Makefile	(revision 1208)
@@ -29,6 +29,7 @@
 
 SRCFILES = MFillH.cc \
+           MBinning.cc \
            MH.cc \
-	MHFadcPix.cc \
+           MHFadcPix.cc \
            MHFadcCam.cc \
            MHHillas.cc \
