Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 4429)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 4430)
@@ -19,4 +19,10 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/07/28: Javi Lopez
+
+   * mhist/MHCamera.[h,cc]
+     - Added new argument to CntCamContent() funtion to select to count
+       the events above or bellow a certain discriminator level.
 
  2004/07/20: Florian Goebel
Index: /trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 4429)
+++ /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 4430)
@@ -1229,4 +1229,30 @@
             Fill(idx);
         if (val<threshold && !isabove)
+            Fill(idx);
+    }
+    fEntries++;
+}
+
+// ------------------------------------------------------------------------
+//
+// Call this function to add a MCamEvent on top of the present contents.
+// 1 is added to each pixel if the contents of MCamEvent>threshold (in case isabove is set to kTRUE == default)
+// 1 is added to each pixel if the contents of MCamEvent<threshold (in case isabove is set to kFALSE)
+//
+void MHCamera::CntCamContent(const MCamEvent &event, TArrayD threshold, Int_t type, Bool_t isabove)
+{
+    if (fNcells<=1 || IsFreezed())
+        return;
+
+    // FIXME: Security check missing!
+    for (Int_t idx=0; idx<fNcells-2; idx++)
+    {
+        Double_t val=threshold[idx];
+        if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/)
+            SetUsed(idx);
+
+        if (val>threshold[idx] && isabove)
+            Fill(idx);
+        if (val<threshold[idx] && !isabove)
             Fill(idx);
     }
Index: /trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 4429)
+++ /trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 4430)
@@ -10,4 +10,7 @@
 #ifndef ROOT_TArrayI
 #include <TArrayI.h>
+#endif
+#ifndef ROOT_TArrayD
+#include <TArrayD.h>
 #endif
 #ifndef ROOT_TClonesArray
@@ -151,4 +154,5 @@
 
     virtual void     CntCamContent(const MCamEvent &evt, Double_t threshold, Int_t type=0, Bool_t isabove=kTRUE);
+    virtual void     CntCamContent(const MCamEvent &evt, TArrayD threshold, Int_t type=0, Bool_t isabove=kTRUE);
     virtual void     CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE);
 
