Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8527)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8528)
@@ -18,4 +18,16 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2007/05/21 Daniela Dorner
+
+   * msignal/MSignalPix.h:
+     - added missing arrival time in Copy function
+     - added copy constructor
+
+   * msignal/MSignalCam.[h,cc]:
+     - added a function to compare cleanigngs of two objects
+     - added a function to compare the islands in two objects
+
+
+
  2007/05/18 Daniela Dorner
 
Index: /trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 8527)
+++ /trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 8528)
@@ -68,4 +68,31 @@
 // --------------------------------------------------------------------------
 //
+// Copy contants of obj into this instance.
+//
+void MSignalCam::Copy(TObject &obj) const
+{
+    MSignalCam &cam = static_cast<MSignalCam&>(obj);
+
+    cam.fNumIslands = fNumIslands;
+    cam.fNumSinglePixels = fNumSinglePixels;
+    cam.fSizeSinglePixels = fSizeSinglePixels;
+    cam.fSizeSubIslands = fSizeSubIslands;
+    cam.fSizeMainIsland = fSizeMainIsland;
+
+    cam.fNumPixelsSaturatedHiGain = fNumPixelsSaturatedHiGain;
+    cam.fNumPixelsSaturatedLoGain = fNumPixelsSaturatedLoGain;
+
+    cam.fPixels->Delete();
+
+    const UInt_t n = GetNumPixels();
+
+    cam.InitSize(n);
+
+    for (UInt_t i=0; i<n; i++)
+        new ((*cam.fPixels)[i]) MSignalPix((*this)[i]);
+}
+
+// --------------------------------------------------------------------------
+//
 // reset counter and delete netries in list.
 //
@@ -463,4 +490,73 @@
 // --------------------------------------------------------------------------
 //
+// Compares the cleaning (fRing and fIsCore) of this object and the
+// argument. Return the result (kFALSE if different).
+//
+// If differences are found the pixels (the pixel from this object first)
+// is printed.
+//
+Bool_t MSignalCam::CompareCleaning(const MSignalCam &cam) const
+{
+    const UInt_t n = GetNumPixels();
+
+    if (n != cam.GetNumPixels())
+    {
+        *fLog << warn << "MSignalCam::CompareCleaning - Number of pixels mismatch." << endl;
+        return kFALSE;
+    }
+
+    for (UInt_t i=0; i<n; i++)
+    {
+        const MSignalPix &p = (*this)[i];
+        const MSignalPix &q = cam[i];
+
+        if (p.GetRing()==q.GetRing() && p.IsPixelCore()==q.IsPixelCore())
+            continue;
+
+        *fLog << warn << "MSignalCam::CompareCleaning - Pixel #" << i << " mismatch." << endl;
+        p.Print();
+        q.Print();
+        return kFALSE;
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Compares the islands (fIdxIsland) of this object and the
+// argument. Return the result (kFALSE if different).
+//
+// If differences are found the pixels (the pixel from this object first)
+// is printed.
+//
+Bool_t MSignalCam::CompareIslands(const MSignalCam &cam) const
+{
+    const UInt_t n = GetNumPixels();
+
+    if (n != cam.GetNumPixels())
+    {
+        *fLog << warn << "MSignalCam::CompareIslands - Number of pixels mismatch." << endl;
+        return kFALSE;
+    }
+
+    for (UInt_t i=0; i<n; i++)
+    {
+        const MSignalPix &p = (*this)[i];
+        const MSignalPix &q = cam[i];
+
+        if (p.GetIdxIsland()==q.GetIdxIsland())
+            continue;
+
+        *fLog << warn << "MSignalCam::CompareIslands - Pixel #" << i << " mismatch." << endl;
+        p.Print();
+        q.Print();
+        return kFALSE;
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
 // Returns, depending on the type flag:
 //
Index: /trunk/MagicSoft/Mars/msignal/MSignalCam.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MSignalCam.h	(revision 8527)
+++ /trunk/MagicSoft/Mars/msignal/MSignalCam.h	(revision 8528)
@@ -75,8 +75,13 @@
     Int_t CalcIslands(const MGeomCam &geom);
 
+    // Functions for easy comparisons
+    Bool_t CompareCleaning(const MSignalCam &cam) const;
+    Bool_t CompareIslands(const MSignalCam &cam) const;
+
     // class MParContainer
     void Reset();
 
     // class TObject
+    void Copy(TObject &obj) const;
     void Print(Option_t *opt=NULL) const;
     void Clear(Option_t *opt=NULL) { Reset(); }
Index: /trunk/MagicSoft/Mars/msignal/MSignalPix.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MSignalPix.h	(revision 8527)
+++ /trunk/MagicSoft/Mars/msignal/MSignalPix.h	(revision 8528)
@@ -22,16 +22,25 @@
 public:
     MSignalPix(Float_t phot=0, Float_t errphot=0);
+    MSignalPix(const MSignalPix &pix)
+        : fIsCore(pix.fIsCore), fRing(pix.fRing), fIdxIsland(pix.fIdxIsland),
+        fPhot(pix.fPhot), fErrPhot(pix.fErrPhot), fArrivalTime(pix.fArrivalTime)
+    {
+    }
 
+    // TObject
     void Clear(Option_t *o=0);
     void Copy(TObject &obj) const
     {
         MSignalPix &pix = (MSignalPix&)obj;
-        pix.fIsCore     = fIsCore;
-        pix.fRing       = fRing;
-        pix.fIdxIsland  = fIdxIsland;
-        pix.fPhot       = fPhot;
-        pix.fErrPhot    = fErrPhot;
+        pix.fIsCore      = fIsCore;
+        pix.fRing        = fRing;
+        pix.fIdxIsland   = fIdxIsland;
+        pix.fPhot        = fPhot;
+        pix.fErrPhot     = fErrPhot;
+        pix.fArrivalTime = fArrivalTime;
     }
+    void    Print(Option_t *opt = NULL) const;
 
+    // MSignalPix
     Float_t GetNumPhotons() const         { return fPhot;    }
     Float_t GetErrorPhot() const          { return fErrPhot; }
@@ -60,6 +69,4 @@
     //void    Scale(Float_t f)              { fPhot /= f; }
 
-    void    Print(Option_t *opt = NULL) const;
-
     ClassDef(MSignalPix, 7)  // class containing information about the Cerenkov Photons in a pixel
 };
