Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3502)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3503)
@@ -64,4 +64,13 @@
    * mjobs/MJExtactSignal.cc:
      - added MRawEvtHeader to output
+
+   * mbase/MStatusDisplay.cc:
+     - changed displayed year
+
+   * mfileio/MReadTree.cc:
+     - enhanced output
+
+   * mmain/MCameraDisplay.cc, mmain/MEventDisplay.[h,cc]:
+     - added preliminary mode to display F1/F2/F3-files
 
 
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 3502)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 3503)
@@ -349,5 +349,5 @@
 
     // Add copyright notice
-    l = new TGLabel(f, "(c) MAGIC Software Development, 2000-2003");
+    l = new TGLabel(f, "(c) MAGIC Software Development, 2000-2004");
     fList->Add(l);
     f->AddFrame(l, layb);
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 3502)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 3503)
@@ -869,5 +869,6 @@
     {
         *fLog << warn << GetDescriptor() << ": DecEventNum, WARNING - Event " << fNumEntry << "-";
-        *fLog << dec << "=" << (Int_t)fNumEntry-dec << " out of Range." << endl;
+        *fLog << dec << "=" << (Int_t)fNumEntry-dec << " out of Range (>=";
+        *fLog << GetEntries() << ")." << endl;
         return kFALSE;
     }
@@ -887,5 +888,6 @@
     {
         *fLog << warn << GetDescriptor() << ": IncEventNum, WARNING - Event " << fNumEntry << "+";
-        *fLog << inc << "=" << (Int_t)fNumEntry+inc << " out of Range." << endl;
+        *fLog << inc << "=" << (Int_t)fNumEntry+inc << " out of Range (>=";
+        *fLog << GetEntries() << ")." << endl;
         return kFALSE;
     }
Index: trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc	(revision 3502)
+++ trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc	(revision 3503)
@@ -19,5 +19,5 @@
 !   Author(s): Harald Kornmayer 1/2001
 !
-!   Copyright: MAGIC Software Development, 2000-2003
+!   Copyright: MAGIC Software Development, 2000-2004
 !
 !
@@ -90,5 +90,5 @@
         {
         case kButDisplay:
-            new MEventDisplay(fInputFile);
+            new MEventDisplay(fInputFile, "ped.root", "cal.root");
             return kTRUE;
         }
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 3502)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 3503)
@@ -32,4 +32,5 @@
 // root
 //
+#include <TFile.h>               // TFile
 #include <TList.h>               // TList::Add
 #include <TStyle.h>              // gStyle->SetOptStat
@@ -78,12 +79,14 @@
 // Container
 //
-#include "MHillas.h"             // MHillas::Print(const MGeomCam&)
-#include "MHillasExt.h"          // MHillasExt::Print(const MGeomCam&)
-#include "MHillasSrc.h"          // MHillasSrc::Print(const MGeomCam&)
-#include "MHEvent.h"             // MHEvent
-#include "MHCamera.h"            // MHCamera
-#include "MRawEvtData.h"         // MRawEvtData
-#include "MArrivalTimeCam.h"     // MArrivalTimeCam
-#include "MBadPixelsCam.h"       // MBadPixelsCam
+#include "MHillas.h"               // MHillas::Print(const MGeomCam&)
+#include "MHillasExt.h"            // MHillasExt::Print(const MGeomCam&)
+#include "MHillasSrc.h"            // MHillasSrc::Print(const MGeomCam&)
+#include "MHEvent.h"               // MHEvent
+#include "MHCamera.h"              // MHCamera
+#include "MRawEvtData.h"           // MRawEvtData
+#include "MArrivalTimeCam.h"       // MArrivalTimeCam
+#include "MBadPixelsCam.h"         // MBadPixelsCam
+#include "MPedPhotCam.h"           // MPedPhotCam
+#include "MCalibrationChargeCam.h" // MCalibrationChargeCam
 
 ClassImp(MEventDisplay);
@@ -93,15 +96,15 @@
 //  Constructor.
 //
-MEventDisplay::MEventDisplay(const char *filename) : MStatusDisplay()
+MEventDisplay::MEventDisplay(const char *fname, const char *pname, const char *cname) : MStatusDisplay()
 {
     //
     // Setup Task list for hillas calculation
     //
-    SetupTaskList("Events", filename);
+    SetupTaskList("Events", fname, pname, cname);
 
     //
     // Add MEventDisplay GUI elements to the display
     //
-    AddUserFrame(filename);
+    AddUserFrame(fname);
 
     //
@@ -134,6 +137,51 @@
 //  preprocess tasks and read in first event (process)
 //
-void MEventDisplay::SetupTaskList(const char *tname, const char *fname)
-{
+void MEventDisplay::SetupTaskList(const char *tname, const char *fname,
+                                  const char *pname, const char *cname)
+{
+    MCalibrationChargeCam *ccam=0;
+    MPedPhotCam           *pcam=0;
+
+    MBadPixelsCam *badpix = new MBadPixelsCam;
+
+    TFile file(pname, "READ");
+    if (!file.IsZombie())
+        pcam = new MPedPhotCam;
+    if (pcam)
+    {
+        if (pcam->Read()<=0)
+        {
+            delete pcam;
+            pcam = NULL;
+        }
+
+        if (file.FindKey("MBadPixelsCam"))
+        {
+            MBadPixelsCam bad;
+            if (bad.Read()>0)
+                badpix->Merge(bad);
+        }
+    }
+    file.Close();
+    file.Open(cname, "READ");
+    if (!file.IsZombie())
+        ccam = new MCalibrationChargeCam;
+    if (ccam)
+    {
+        if (ccam->Read()<=0)
+        {
+            delete ccam;
+            ccam = NULL;
+        }
+
+        if (file.FindKey("MBadPixelsCam"))
+        {
+            MBadPixelsCam bad;
+            if (bad.Read()>0)
+                badpix->Merge(bad);
+        }
+    }
+    file.Close();
+
     //
     // Setup an empty job, with a reader task only.
@@ -154,7 +202,9 @@
     plist->SetOwner();
     plist->AddToList(tlist);
-
-    MBadPixelsCam *badpix = new MBadPixelsCam;
     plist->AddToList(badpix);
+    if (pcam)
+        plist->AddToList(pcam);
+    if (ccam)
+        plist->AddToList(ccam);
 
     fEvtLoop = new MEvtLoop;
@@ -180,4 +230,5 @@
     evt8->SetName("Arrival Time");
 
+    // This makes sure, that the containers are deleted...
     plist->AddToList(evt1);
     plist->AddToList(evt2);
@@ -189,7 +240,4 @@
     plist->AddToList(evt8);
 
-
-    MMcPedestalCopy   *pcopy = new MMcPedestalCopy;
-    MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
     MCerPhotAnal2     *nanal = new MCerPhotAnal2;
     MFillH            *fill1 = new MFillH(evt1, "MCerPhotEvt", "MFillH1");
@@ -203,38 +251,49 @@
     MHillasCalc       *hcalc = new MHillasCalc;
     MHillasSrcCalc    *scalc = new MHillasSrcCalc;
-    MArrivalTimeCalc  *tcalc = new MArrivalTimeCalc;
-    MFillH            *fill7 = new MFillH(evt7, "MRawEvtData",  "MFillH7");
-    MFillH            *fill8 = new MFillH(evt8, "MArrivalTimeCam", "MFillH8");
-
-    MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
-    MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
-    f1->SetName("MFMonteCarlo");
-    f2->SetName("MFRealData");
-
-    MExtractSignal* sigextract = new MExtractSignal();
-    sigextract->SetRange(5, 9, 5, 9);
-
-    MMcCalibrationUpdate* mccalibupdate = new MMcCalibrationUpdate;
-    mccalibupdate->SetOuterPixelsGainScaling(kFALSE);
-    MCalibrate* mccalib = new MCalibrate;
-
-    // MC
-    sigextract->SetFilter(f1);
-    mccalibupdate->SetFilter(f1);
-    mccalib->SetFilter(f1);
-
-    // Data
-    nanal->SetFilter(f2);
-
-    tlist->AddToList(f1);
-    tlist->AddToList(f2);
-    tlist->AddToList(pcopy);
-    tlist->AddToList(pdnsb);
-
-    tlist->AddToList(sigextract);
-    tlist->AddToList(mccalibupdate);
-    tlist->AddToList(mccalib);
-
-    tlist->AddToList(nanal);
+
+    // If no pedestal or no calibration file is availble
+    if (!pcam || !ccam)
+    {
+        MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
+        MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
+        f1->SetName("MFMonteCarlo");
+        f2->SetName("MFRealData");
+
+        MMcPedestalCopy   *pcopy = new MMcPedestalCopy;
+        MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
+
+        MExtractSignal* extra = new MExtractSignal();
+        extra->SetRange(5, 9, 5, 9);
+
+        MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate;
+        mcupd->SetOuterPixelsGainScaling(kFALSE);
+
+        MCalibrate* mccal = new MCalibrate;
+
+        // MC
+        extra->SetFilter(f1);
+        mcupd->SetFilter(f1);
+        mccal->SetFilter(f1);
+
+        // Data
+        nanal->SetFilter(f2);
+
+        // TaskList
+        tlist->AddToList(f1);
+        tlist->AddToList(f2);
+        tlist->AddToList(pcopy);
+        tlist->AddToList(pdnsb);
+
+        tlist->AddToList(extra);
+        tlist->AddToList(mcupd);
+        tlist->AddToList(mccal);
+
+        tlist->AddToList(nanal);
+    }
+    else
+    {
+        MCalibrate* calib = new MCalibrate;
+        tlist->AddToList(calib);
+    }
 
     tlist->AddToList(fill1);
@@ -248,7 +307,13 @@
     tlist->AddToList(hcalc);
     tlist->AddToList(scalc);
-    tlist->AddToList(tcalc);
-    tlist->AddToList(fill7);
-    tlist->AddToList(fill8);
+    if (!pcam || !ccam)
+    {
+        MArrivalTimeCalc  *tcalc = new MArrivalTimeCalc;
+        MFillH            *fill7 = new MFillH(evt7, "MRawEvtData",     "MFillH7");
+        MFillH            *fill8 = new MFillH(evt8, "MArrivalTimeCam", "MFillH8");
+        tlist->AddToList(tcalc);
+        tlist->AddToList(fill7);
+        tlist->AddToList(fill8);
+    }
 
     //
@@ -408,6 +473,4 @@
     MGeomCam    *geom  = (MGeomCam*)   plist->FindObject("MGeomCam");
     MRawEvtData *raw   = (MRawEvtData*)plist->FindObject("MRawEvtData");
-    if (!raw)
-        return;
 
     //
@@ -436,5 +499,5 @@
         reader->DecEventNum();
 
-    } while (raw->GetNumPixels()<1 && dir!=0);
+    } while (raw && raw->GetNumPixels()<1 && dir!=0);
 
     //
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.h	(revision 3502)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.h	(revision 3503)
@@ -38,5 +38,6 @@
 
     void UpdateDisplay();
-    void SetupTaskList(const char *tname, const char *fname);
+    void SetupTaskList(const char *tname, const char *fname,
+                       const char *pname=0, const char *cname=0);
 
     void ReadFirstEvent();
@@ -46,5 +47,5 @@
 
 public:
-    MEventDisplay(const char *filename);
+    MEventDisplay(const char *fname, const char *pname=0, const char *cname=0);
     ~MEventDisplay();
 
