Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7294)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7297)
@@ -18,4 +18,28 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/08/22 Thomas Bretz
+
+   * mgeom/MGeomPix.h:
+     - added new function GetDist returning the distance between two
+       pixels
+
+   * mhist/MHCamera.h:
+     - added new function (also to context menu) SetMinMax
+
+   * mhist/MHEvent.[h,cc]:
+     - added the possibility to set min and max values for the displayed
+       data
+     - added a new option to display the arrival time after cleaning
+
+   * mmain/MEventDisplay.cc:
+     - added the arrival time after cleaning to display
+     - set the min value in some displays to 0
+
+   * msignal/MSignalCam.cc:
+     - added the possibility to return the arrival time after cleaning
+
+
+
  2005/08/18
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7294)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7297)
@@ -141,4 +141,18 @@
 // --------------------------------------------------------------------------
 //
+// Returns the distance between the pixels i and j. -1 if an index
+// doesn't exist. The default for j is 0. Assuming that 0 is the index
+// for a central pixel you can get the distance to the camera center.
+//
+Float_t MGeomCam::GetDist(UShort_t i, UShort_t j) const
+{
+    if (i>=fNumPixels || j>=fNumPixels)
+        return -1;
+
+    return (*this)[i].GetDist((*this)[j]);
+}
+
+// --------------------------------------------------------------------------
+//
 //  Set the kIsOuterRing flag for all pixels which have a outermost pixel
 //  as Next Neighbor and don't have the kIsOutermostRing flag itself.
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 7294)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 7297)
@@ -63,4 +63,6 @@
     UInt_t  GetSector() const { return fSector; }
 
+    Float_t GetDist(const MGeomPix & pix) const  { return TMath::Hypot(fX-pix.fX, fY-pix.fY); }
+
     Float_t GetA() const    { return fA; /*fD*fD*gsTan60/2;*/ }
     Int_t   GetAidx() const { return fAidx; }
Index: trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7294)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7297)
@@ -221,6 +221,4 @@
     void     SetInvDeepBlueSeaPalette(); // *MENU*
 
-    void     SetAutoScale() { fMinimum = fMaximum = -1111; } // *MENU*
-
     void     SetFreezed(Bool_t f=kTRUE) { f ? SetBit(kFreezed) : ResetBit(kFreezed); } // *TOGGLE* *GETTER=IsFreezed
     Bool_t   IsFreezed() const { return TestBit(kFreezed); }
@@ -228,4 +226,7 @@
 
     void     SetAbberation(Float_t f=0.0713) { fAbberation=f; } // *MENU*
+
+    void     SetAutoScale() { fMinimum = fMaximum = -1111; } // *MENU*
+    void     SetMinMax(Double_t min=-1111, Double_t max=-1111) { SetMinimum(min); SetMaximum(max); } // *MENU*
 
     void     AddNotify(TObject *event);
Index: trunk/MagicSoft/Mars/mhist/MHEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 7294)
+++ trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 7297)
@@ -71,5 +71,6 @@
 // --------------------------------------------------------------------------
 //
-MHEvent::MHEvent(EventType_t type) : fHist(NULL), fType(type)
+MHEvent::MHEvent(EventType_t type) : fHist(NULL), fType(type),
+    fMinimum(-1111), fMaximum(-1111)
 {
     fName = "MHEvent";
@@ -121,4 +122,7 @@
     fHist = new MHCamera(*cam);
     fHist->AddNotify(fClone);
+
+    fHist->SetMinimum(fMinimum);
+    fHist->SetMaximum(fMaximum);
 
     switch (fType)
@@ -167,4 +171,5 @@
         break;
      case kEvtArrTime:
+     case kEvtArrTimeCleaned:
         fHist->SetName("Arrival Time");
         fHist->SetYTitle("t [slice id]");
@@ -241,4 +246,7 @@
     case kEvtArrTime:
         fHist->SetCamContent(*event, 6);
+        break; 
+    case kEvtArrTimeCleaned:
+        fHist->SetCamContent(*event, 8);
         break; 
     case kEvtTrigPix:
Index: trunk/MagicSoft/Mars/mhist/MHEvent.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEvent.h	(revision 7294)
+++ trunk/MagicSoft/Mars/mhist/MHEvent.h	(revision 7297)
@@ -25,5 +25,6 @@
         kEvtPedPhot, kEvtPedPhotRMS,
         kEvtCleaningLevels, kEvtCleaningData,
-        kEvtIdxMax, kEvtArrTime, kEvtTrigPix, kEvtIslandIndex
+        kEvtIdxMax, kEvtArrTime, kEvtArrTimeCleaned,
+        kEvtTrigPix, kEvtIslandIndex
     };
 
@@ -45,4 +46,7 @@
     EventType_t fType;
 
+    Double_t fMinimum;
+    Double_t fMaximum;
+
     TH1 *GetHistByName(const TString name) const { return (TH1*)fHist; }
 
@@ -53,4 +57,7 @@
     MHEvent(EventType_t type=kEvtSignalRaw);
     ~MHEvent();
+
+    void SetMinimum(Double_t min=-1111) { fMinimum=min; }
+    void SetMaximum(Double_t max=-1111) { fMaximum=max; }
 
     MHCamera *GetHist() { return fHist; }
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7294)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7297)
@@ -223,4 +223,5 @@
     MHEvent *evt07 = new MHEvent(MHEvent::kEvtIdxMax);
     MHEvent *evt08 = new MHEvent(MHEvent::kEvtArrTime);
+    MHEvent *evt09 = new MHEvent(MHEvent::kEvtArrTimeCleaned);
     //MHEvent *evt09 = new MHEvent(MHEvent::kEvtTrigPix);
     MHEvent *evt10 = new MHEvent(MHEvent::kEvtIslandIndex);
@@ -228,12 +229,17 @@
     evt01->SetName("Signal");
     evt02->SetName("Cleaned");
-    evt03->SetName("Pedestal");
+    evt03->SetName("Ped");
     evt04->SetName("PedRMS");
     evt06a->SetName("CleanData");
-    evt06b->SetName("CleanLevels");
-    evt07->SetName("Max Slice Idx");
-    evt08->SetName("Arrival Time");
-    //evt09->SetName("Trigger");
+    evt06b->SetName("Levels");
+    evt07->SetName("MaxSliceIdx");
+    evt08->SetName("ArrTime");
+    evt09->SetName("Time");
     evt10->SetName("Islands");
+
+    evt01->SetMinimum(0);
+    evt03->SetMinimum(0);
+    evt04->SetMinimum(0);
+    evt06a->SetMinimum(0);
 
     // This makes sure, that the containers are deleted...
@@ -246,5 +252,5 @@
     plist->AddToList(evt07);
     plist->AddToList(evt08);
-    //plist->AddToList(evt09);
+    plist->AddToList(evt09);
     plist->AddToList(evt10);
 
@@ -336,5 +342,7 @@
     {
         MFillH *fill08 = new MFillH(evt08, "MSignalCam", "MFillH8");
+        MFillH *fill09 = new MFillH(evt09, "MSignalCam", "MFillH9");
         tlist->AddToList(fill08);
+        tlist->AddToList(fill09);
     }
     tlist->AddToList(hcalc);
Index: trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7294)
+++ trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7297)
@@ -600,5 +600,5 @@
     MSignalPix *pix = GetPixById(idx);
 
-    if ((!pix || !pix->IsPixelUsed()) && type<6)
+    if ((!pix || !pix->IsPixelUsed()) && (type<6 || type==8))
         return kFALSE;
 
@@ -632,4 +632,7 @@
         val = pix->GetArrivalTime();
         break;
+    case 8:
+        val = pix->GetArrivalTime();
+        break;
     default:
         val = pix->GetNumPhotons()*ratio;
