Index: /trunk/MagicSoft/Mars/macros/getCollArea.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/getCollArea.C	(revision 704)
+++ /trunk/MagicSoft/Mars/macros/getCollArea.C	(revision 705)
@@ -15,5 +15,5 @@
 
 
-  MReadTree reader( filename ,"Events" ) ; 
+  MReadTree reader( "Events", filename) ;
   tasklist->AddToList( &reader ) ; 
 
Index: /trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/readMagic.C	(revision 704)
+++ /trunk/MagicSoft/Mars/macros/readMagic.C	(revision 705)
@@ -13,5 +13,6 @@
     plist->AddToList(&tlist);
 
-    MReadTree    read("oscar_protons.root", "Events") ;
+    MReadTree    read("Events", "oscar_protons.root");
+    MReadTree    read.AddFile("test.root");
     MCerPhotCalc ncalc;
     MImgCleanStd clean;
@@ -37,7 +38,4 @@
     {
         cout << "Event: " << icount++  << endl  ;
-
-        if (icount < 45 )
-            continue;
 
         ncalc.Process();
Index: /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 704)
+++ /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc	(revision 705)
@@ -14,5 +14,5 @@
 #include "MParList.h"
 #include "MCerPhotEvt.h"
-#include "MCT1Pedestals.h"
+#include "MPedestalCam.h"
 
 ClassImp(MCT1ReadAscii)
@@ -57,9 +57,70 @@
     //  look for the pedestal class in the plist
     //
-    fPedest = (MCT1Pedestals*)pList->FindCreateObj("MCT1Pedestals");
+    fPedest = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     if (!fPedest)
         return kFALSE;
 
+    fPedest->InitSize(127);
+
     return kTRUE;
+}
+
+void MCT1ReadAscii::ReadPedestals()
+{
+    *fLog << "MCT1Pedestals::AsciiRead: Reading Pedestals..." << endl;
+
+    //
+    // skip the next 4 values
+    //
+    Float_t val;
+
+    *fIn >> val;
+    *fIn >> val;
+    *fIn >> val;
+    *fIn >> val;
+
+    //
+    //    read in the next 127 numbers as the pedestals
+    //
+    for (Int_t i = 0; i<127; i++)
+    {
+        *fIn >> val;
+
+        if (val > 0.0)
+            (*fPedest)[i].SetSigma(val);
+    }
+}
+
+void MCT1ReadAscii::ReadData()
+{
+    //
+    // clear the list of cerphot-events
+    //
+    fNphot->Clear();
+
+    //
+    // five unsused numbers
+    //
+    Int_t val;
+
+    *fIn >> val;   // ener
+    *fIn >> val;   // zenang
+    *fIn >> val;   // sec1
+    *fIn >> val;   // sec2
+
+    //
+    // read in the number of cerenkov photons and add the 'new' pixel
+    // too the list with it's id, number of photons and error
+    //
+    for (Int_t i = 0; i<127; i++ )
+    {
+        Float_t nphot;
+
+        *fIn >> nphot;
+
+        if (nphot > 0.0)
+            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetSigma());
+    }
+
 }
 
@@ -74,8 +135,8 @@
  
     //
-    // read in a dummy number (event number)
+    // read in the event nr
     //
-    Int_t dummyI;
-    *fIn >> dummyI;
+    Int_t evtnr;
+    *fIn >> evtnr;
 
     //
@@ -89,33 +150,13 @@
     // read in pedestals
     //
-    if (dummyI < 0)
-        fPedest->AsciiRead(*fIn);
+    // FIXME! Set InputStreamID
 
-    //
-    // five unsused numbers
-    //
-    *fIn >> dummyI;   // ener
-    *fIn >> dummyI;   // zenang
-    *fIn >> dummyI;   // sec1
-    *fIn >> dummyI;   // sec2
+    if (evtnr < 0)
+    {
+        ReadPedestals();
+        return kCONTINUE;
+    }
 
-    //
-    // clear the list of cerphot-events
-    //
-    fNphot->Clear();
-
-    //
-    // read in the number of cerenkov photons and add the 'new' pixel
-    // too the list with it's id, number of photons and error
-    //
-    for (Int_t i = 0; i<127; i++ )
-    {
-        Float_t nphot;
-
-        *fIn >> nphot;
-
-        if (nphot > 0.0)
-            fNphot->AddPixel(i, nphot, (*fPedest)[i]);
-    }
+    ReadData();
 
     return kTRUE;
Index: /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h	(revision 704)
+++ /trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h	(revision 705)
@@ -7,13 +7,16 @@
 
 class MCerPhotEvt;
-class MCT1Pedestals;
+class MPedestalCam;
 
 class MCT1ReadAscii : public MTask
 {
 private:
-    TString        fFileName;    //! the file name of the string
-    ifstream      *fIn;          //! the inputfile
-    MCerPhotEvt   *fNphot;       //! the data container for all data.
-    MCT1Pedestals *fPedest;      //! ct1 pedestals
+    TString       fFileName;    //! the file name of the string
+    ifstream     *fIn;          //! the inputfile
+    MCerPhotEvt  *fNphot;       //! the data container for all data.
+    MPedestalCam *fPedest;      //! ct1 pedestals
+
+    void ReadPedestals();
+    void ReadData();
 
 public:
Index: /trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 704)
+++ /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 705)
@@ -28,6 +28,5 @@
 .SUFFIXES: .c .cc .cxx .h .hxx .o 
 
-SRCFILES = MCT1Pedestals.cc \
-	   MCT1ReadAscii.cc \
+SRCFILES = MCT1ReadAscii.cc \
            MPedestalCam.cc \
            MPedestalPix.cc \
Index: /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 704)
+++ /trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 705)
@@ -4,4 +4,13 @@
 #pragma link off all classes;
 #pragma link off all functions;
+
+#pragma link C++ global kCONTINUE;
+#pragma link C++ global kGAMMA;
+#pragma link C++ global kPROTON;
+#pragma link C++ global kHELIUM;
+#pragma link C++ global kOXIGEN;
+#pragma link C++ global kIRON;
+#pragma link C++ global kPI;
+#pragma link C++ global kRad2Deg;
 
 #pragma link C++ global gLog;
Index: /trunk/MagicSoft/Mars/mbase/MLogManip.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 704)
+++ /trunk/MagicSoft/Mars/mbase/MLogManip.h	(revision 705)
@@ -53,5 +53,5 @@
 //
 #ifndef __CINT__
-#define dbginf        __FILE__ << " l." << __LINE__ << ": "
+#define dbginf      __FILE__ << " l." << __LINE__ << ": "
 #endif
 //
@@ -63,5 +63,5 @@
 //
 #ifndef __CINT__
-#define DEBUG(lvl)    flush << debug(lvl) << dbginf
+#define DEBUG(lvl)  flush << debug(lvl) << dbginf
 #endif
 
Index: /trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 704)
+++ /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 705)
@@ -21,4 +21,5 @@
 
 #include "MLog.h"
+#include "MLogManip.h"
 
 ClassImp(MParList)
@@ -91,5 +92,5 @@
   if (fContainer.FindObject(obj))
   {
-      *fLog << "WARNING: MParList::add: Container already added" << endl;
+      *fLog << dbginf << "Container already added" << endl;
       return kTRUE;
   }
@@ -103,5 +104,5 @@
       if (!fContainer.FindObject(where))
       {
-          *fLog << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
+          *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;
           return kFALSE;
       }
@@ -139,5 +140,5 @@
     // if object is not existing in the list try to create one
     //
-    *fLog << "MParList::CreateObject - Warning: '" << name << "' not found... creating." << endl;
+    *fLog << dbginf << "'" << name << "' not found... creating." << endl;
 
     //
@@ -151,5 +152,5 @@
         // if class is not existing in the root environment
         //
-        *fLog << "MParList::CreateObject - Warning: Class '" << name << "' not existing in dictionary." << endl;
+        *fLog << dbginf << "Class '" << name << "' not existing in dictionary." << endl;
         return NULL;
     }
@@ -175,5 +176,5 @@
   //   print some information about the current status of MParList
   //
-  *fLog << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
+  *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
   *fLog << endl;
   
Index: /trunk/MagicSoft/Mars/mbase/MReadTree.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 704)
+++ /trunk/MagicSoft/Mars/mbase/MReadTree.h	(revision 705)
@@ -7,5 +7,5 @@
 
 class TFile;
-class TTree;
+class TChain;
 
 class MReadTree : public MTask
@@ -13,18 +13,18 @@
 private:
     TFile  *fFile;       // Pointer to file
-    TTree  *fTree;       // Pointer to tree
+    TChain *fChain;      // Pointer to tree
 
     UInt_t  fNumEntry;   // Number of actual entry
     UInt_t  fNumEntries; // Number of Events in Tree
 
-    TString fFileName;   // Name of File
-    TString fTreeName;   // Name of Tree
-
 public:
-    MReadTree(const char *filename, const char *treename, const char *name=NULL, const char *title=NULL);
+    MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
+    ~MReadTree();
 
     Bool_t PreProcess(MParList *pList);
     Bool_t Process();
     Bool_t PostProcess();
+
+    void AddFile(const char *fname);
 
     Bool_t GetEvent() ; 
@@ -33,6 +33,7 @@
     Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
     Bool_t SetEventNum(UInt_t nr);    // set number of event (position in tree)
-    UInt_t GetEventNum() {return fNumEntry;}
-    UInt_t GetEntries() {return fNumEntries;}
+
+    UInt_t GetEventNum() const { return fNumEntry;   }
+    UInt_t GetEntries() const  { return fNumEntries; }
 
     ClassDef(MReadTree, 0)	// Reads one tree
Index: /trunk/MagicSoft/Mars/mdatacheck/MViewAdcSpectra.cc
===================================================================
--- /trunk/MagicSoft/Mars/mdatacheck/MViewAdcSpectra.cc	(revision 704)
+++ /trunk/MagicSoft/Mars/mdatacheck/MViewAdcSpectra.cc	(revision 705)
@@ -74,5 +74,5 @@
   plist.AddToList(&tasks);
 
-  MReadTree readin ( inputfile, treeName ) ;
+  MReadTree readin ( treeName, inputfile ) ;
   tasks.AddToList( &readin ) ;
 
Index: /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 704)
+++ /trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 705)
@@ -52,5 +52,5 @@
 
   
-  fReadTree  =  new MReadTree ( filename, treename ) ; 
+  fReadTree  =  new MReadTree ( treename, filename ) ;
   fReadTree->PreProcess( pList ) ; 
 
