Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3465)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3466)
@@ -18,4 +18,21 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/03/10: Abelardo Moralejo
+
+   * manalysis/MCerPhotPix.[h,cc]
+     - Added member fIsHGSaturated, and setter/getter functions. 
+       Updated class version to 4.
+
+   * mcalib/MCalibrate.cc, MCalibrateData.cc
+     - Added setting of MCerPhotPix.fIsHGSaturated if one or more HG
+       slices saturate.
+
+   * mimage/MNewImagePar.[h,cc]
+     - Added member fNumHGSaturatedPixels to count the number of pixels 
+       in which high gain saturates. Added getter funciton for it. 
+       Updated class version to 3.
+
+
  2004/03/10: Markus Gaug
 
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 3465)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 3466)
@@ -41,4 +41,8 @@
 //  - added fIsSaturated
 //
+// Version 4:
+// ----------
+//  - added fIsHGSaturated
+//
 ////////////////////////////////////////////////////////////////////////////
 #include "MCerPhotPix.h"
@@ -56,5 +60,5 @@
 //
 MCerPhotPix::MCerPhotPix(Int_t pix, Float_t phot, Float_t errphot) :
-  fPixId(pix), fRing(1), fIsCore(kFALSE), fPhot(phot), fErrPhot(errphot), fIsSaturated(kFALSE)
+  fPixId(pix), fRing(1), fIsCore(kFALSE), fPhot(phot), fErrPhot(errphot), fIsSaturated(kFALSE), fIsHGSaturated(kFALSE)
 {
 } 
@@ -69,4 +73,5 @@
     gLog << (fRing>0?"   Used ":" Unused ");
     gLog << (fIsCore?" Core ":"      ");
+    gLog << "High gain " << (fIsHGSaturated?"   ":"not") << " saturated";
     gLog << (fIsSaturated?"   ":"Not") << " saturated";
     gLog << " Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h	(revision 3465)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h	(revision 3466)
@@ -18,5 +18,6 @@
     Float_t  fErrPhot;   // the error of fPhot
 
-    Bool_t   fIsSaturated; // the pixel is saturated
+    Bool_t   fIsSaturated;   // the pixel's low gain is saturated
+    Bool_t   fIsHGSaturated; // the pixel's high gain is saturated
 
     // FIXME: arrival time t, and it's error sigma t
@@ -48,4 +49,7 @@
     Bool_t   IsPixelSaturated() const    { return fIsSaturated; }
 
+    void     SetPixelHGSaturated()         { fIsHGSaturated = kTRUE; }
+    Bool_t   IsPixelHGSaturated() const    { return fIsHGSaturated; }
+
     void     AddNumPhotons(Float_t f)    { fPhot += f; }
 
@@ -54,5 +58,5 @@
     void     Print(Option_t *opt = NULL) const;
 
-    ClassDef(MCerPhotPix, 3)  // class containing information about the Cerenkov Photons in a pixel
+    ClassDef(MCerPhotPix, 4)  // class containing information about the Cerenkov Photons in a pixel
 };
 
Index: trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 3465)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 3466)
@@ -327,4 +327,8 @@
 	cpix->SetPixelSaturated();
 
+      if (sig.GetNumHiGainSaturated() > 0)
+	cpix->SetPixelHGSaturated();
+
+
     } /* for (UInt_t pixidx=0; pixidx<npix; pixidx++) */
   
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 3465)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 3466)
@@ -340,4 +340,7 @@
       MCerPhotPix *cpix = fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);
 
+      if (sig.GetNumHiGainSaturated() > 0)
+	cpix->SetPixelHGSaturated();
+
       if (sig.GetNumLoGainSaturated() > 0)
 	cpix->SetPixelSaturated();
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 3465)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 3466)
@@ -37,4 +37,8 @@
 // ----------
 //  - added fNumSaturatedPixels
+// 
+// Version 3:
+// ----------
+//  - added fNumHGSaturatedPixels
 // 
 /////////////////////////////////////////////////////////////////////////////
@@ -82,4 +86,5 @@
 
     fNumSaturatedPixels = -1;
+    fNumHGSaturatedPixels = -1;
 }
 
@@ -95,4 +100,5 @@
 
     fNumSaturatedPixels = 0;
+    fNumHGSaturatedPixels = 0;
 
     const UInt_t npixevt = evt.GetNumPixels();
@@ -109,4 +115,6 @@
 
         // count saturated pixels
+	if (pix.IsPixelHGSaturated())
+            fNumHGSaturatedPixels++;
 	if (pix.IsPixelSaturated())
             fNumSaturatedPixels++;
@@ -175,4 +183,5 @@
     *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels << " Pixels" << endl;
     *fLog << " - Core Pixels    [#]   = " << fNumCorePixels << " Pixels" << endl;
-    *fLog << " - Sat. Pixels    [#]   = " << fNumSaturatedPixels << " Pixels" << endl;
+    *fLog << " - Sat. Pixels (HG) [#]  = " << fNumHGSaturatedPixels << " Pixels" << endl;
+    *fLog << " - Sat. Pixels (LG) [#]  = " << fNumSaturatedPixels << " Pixels" << endl;
 }
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.h	(revision 3465)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.h	(revision 3466)
@@ -21,5 +21,6 @@
     Short_t fNumUsedPixels;      // Number of pixels which survived the image cleaning
     Short_t fNumCorePixels;      // number of core pixels
-    Short_t fNumSaturatedPixels; // number of pixels with saturating lo-gains
+    Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains
+    Short_t fNumSaturatedPixels;   // number of pixels with saturating lo-gains
 
 public:
@@ -38,4 +39,5 @@
 
     Short_t GetNumSaturatedPixels() const { return fNumSaturatedPixels; }
+    Short_t GetNumHGSaturatedPixels() const { return fNumHGSaturatedPixels; }
 
     void Print(Option_t *opt=NULL) const;
@@ -44,5 +46,5 @@
               const MHillas &hillas);
 
-    ClassDef(MNewImagePar, 2) // Container to hold new image parameters
+    ClassDef(MNewImagePar, 3) // Container to hold new image parameters
 };
 
