Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3453)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3454)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/03/10: Thomas Bretz
+
+   * mfilter/MFSoftwareTrigger.[h,cc]:
+     - changed to support also a predifined number of NN
+
+
+
  2004/03/10: Ester Aliu
 
@@ -27,4 +34,6 @@
    * mtemp/MIslandCalc.[h,cc]
      - New MTask to count and characterize Islands.
+
+
 
  2004/03/09: Thomas Bretz
Index: trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc	(revision 3453)
+++ trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc	(revision 3454)
@@ -59,5 +59,5 @@
 //
 MFSoftwareTrigger::MFSoftwareTrigger(const char *name, const char *title)
-    : fNumMinPhotons(0)
+    : fNumMinPhotons(0), fNumNeighbors(2)
 {
     fName  = name  ? name  : "MFSoftwareTrigger";
@@ -91,4 +91,6 @@
             continue;
 
+        Int_t num = 1;
+
         const Int_t nneighbors = gpix.GetNumNeighbors();
         for (Int_t n=0; n<nneighbors; n++)
@@ -103,5 +105,6 @@
             const Double_t photons = fEvt->GetPixById(id)->GetNumPhotons();
             if (photons >= fNumMinPhotons)
-                return kTRUE;
+                if (++num==fNumNeighbors)
+                    return kTRUE;
         }
     }
@@ -162,5 +165,6 @@
     *fLog << (int)(fCut[1]*100/GetNumExecutions()) ;
     *fLog << "%) Evts skipped due to: Software trigger not fullfilled" ;
-    *fLog << " (with fNumMinPhotons = " << fNumMinPhotons << ")" << endl;
+    *fLog << " (NumPhotons>=" << fNumMinPhotons << ", NumNeighbors>=";
+    *fLog << fNumNeighbors << ")" << endl;
 
     *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions()) ;
Index: trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.h
===================================================================
--- trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.h	(revision 3453)
+++ trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.h	(revision 3454)
@@ -17,4 +17,5 @@
 
     Float_t     fNumMinPhotons; // nuber of minimum required photons
+    Byte_t      fNumNeighbors;  // number of required neighbours
 
     Int_t       fCut[2];
@@ -34,4 +35,5 @@
 
     void SetNumMinPhotons(Float_t minphotons) { fNumMinPhotons = minphotons; }
+    void SetNumNeighbors(Byte_t num) { fNumNeighbors = num; }
 
     ClassDef(MFSoftwareTrigger, 0) // Filter for software trigger
