Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 705)
+++ trunk/MagicSoft/Mars/Changelog	(revision 706)
@@ -4,9 +4,32 @@
                                                                   
    * manalysis/MHillas.[h,cc]:
-     fixed some minor errors, added sanity check (N<2) to Calc
+     - fixed some minor errors, added sanity check (N<2) to Calc
 
    * manalysis/MFillHHillas.cc:
-     skip event if Hillas calculations fails
-
+     - skip event if Hillas calculations fails
+     
+   * macros/getCollArea.C, macros/readMagic.C, 
+     mdatacheck/MViewAdcSpectra.cc, meventdisp/MGFadcDisp.cc:
+     - changed order in MReadTree constructor
+
+   * manalysis/MCT1ReadAscii.[h,cc]:
+     - changed to use MPedestalCam
+     
+   * manalysis/Makefile:
+     - removed MCT1Pedestals
+     
+   * mbase/BaseLinkDef.h:
+     - added const values from Magic.h
+     
+   * mbase/MLogManip.h:
+     - changed style of dbginf
+   
+   * mbase/MParList.cc:
+     - make use of dbginf
+     
+   * mbase/MReadTree.[h,cc]:
+     - switched from a TTree to a TChain object
+     - chnaged order of variables of the constructor
+     
      
  2000/03/21: Thomas Bretz
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 705)
+++ trunk/MagicSoft/Mars/NEWS	(revision 706)
@@ -3,4 +3,7 @@
   
     * Hillas Calculation added
+    
+    * MReadTree is now able to handle more than one file
+      (Remark: of the same structure)
     
     
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 705)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 706)
@@ -14,5 +14,4 @@
 
     MReadTree    read("Events", "oscar_protons.root");
-    MReadTree    read.AddFile("test.root");
     MCerPhotCalc ncalc;
     MImgCleanStd clean;
Index: trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc	(revision 705)
+++ trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc	(revision 706)
@@ -10,4 +10,5 @@
 
 #include "MHillas.h"
+#include "MCerPhotEvt.h"
 
 #include "MLog.h"
@@ -47,7 +48,11 @@
 Bool_t MHillasCalc::Process()
 {
-    fHillas->Calc(*fGeomCam, *fCerPhotEvt);
-
-    return kTRUE;
+    //
+    // If you want do complex descisions inside the calculations
+    // we must move the calculation code inside this function
+    //
+    // If the calculation wasn't sucessfull skip this event
+    //
+    return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 705)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 706)
@@ -18,8 +18,10 @@
 
 #include <TFile.h>
-#include <TTree.h>
+#include <TChain.h>
 #include <TObjArray.h>
 
 #include "MLog.h"
+#include "MLogManip.h"
+
 #include "MTime.h"
 #include "MParList.h"
@@ -27,5 +29,5 @@
 ClassImp(MReadTree)
 
-MReadTree::MReadTree(const char *fname, const char *tname,
+MReadTree::MReadTree(const char *tname, const char *fname,
                      const char *name, const char *title)
 {
@@ -36,6 +38,24 @@
     // open the input stream
     //
-    fFileName = fname;
-    fTreeName = tname;
+    fChain = new TChain(tname);
+
+    if (fname)
+        fChain->Add(fname);
+}
+
+MReadTree::~MReadTree()
+{
+    delete fChain;
+}
+
+/*Int_t*/ void MReadTree::AddFile(const char *fname)
+{
+    //
+    // FIXME! A check is missing whether the file already exists or not.
+    //
+    //
+    // returns the number of file which were added
+    //
+    /*return  root >3.0*/ fChain->Add(fname);
 }
 
@@ -45,28 +65,15 @@
     // open file and check if file is really open
     //
-    fFile = new TFile(fFileName, "READ");
-
-    if (!fFile->IsOpen())
-    {
-        *fLog << "MReadTree::PreProcess: ERROR: Cannot open file '";
-        *fLog << fFileName << "'" << endl;
-        return kFALSE;
-    }
-
-    //
-    // try to get the tree and check if it was found
-    //
-    fTree = (TTree*)fFile->Get(fTreeName);
-    if (!fTree)
-    {
-        *fLog << "MReadTree::PreProcess: ERROR: Cannot open tree '";
-        *fLog << fTreeName << "'" << endl;
-        return kFALSE;
-    }
 
     //
     // get number of events in this tree
     //
-    fNumEntries = (UInt_t)fTree->GetEntries();
+    fNumEntries = (UInt_t)fChain->GetEntries();
+
+    if (!fNumEntries)
+    {
+        *fLog << dbginf << "No Entries found in chain (file/s)." << endl;
+        return kFALSE;
+    }
 
     //
@@ -78,6 +85,5 @@
     // output logging information
     //
-    *fLog << "File: '" << fFileName << "'  Tree: '" << fTreeName;
-    *fLog << "' with " << fNumEntries << " Entries opened." << endl;
+    *fLog << fNumEntries << " Entries found in file(s)." << endl;
 
     //
@@ -85,5 +91,5 @@
     // create the Iterator to loop over all branches
     //
-    TIter Next(fTree->GetListOfBranches());
+    TIter Next(fChain->GetListOfBranches());
     TBranch *branch=NULL;
     
@@ -102,4 +108,5 @@
         //
         MParContainer *pcont = pList->FindCreateObj(name);
+        
 
         if (!pcont)
@@ -134,5 +141,5 @@
     // get entry
     //
-    fTree->GetEntry(fNumEntry );
+    fChain->GetEntry(fNumEntry );
 
     fNumEntry ++ ; 
@@ -146,5 +153,5 @@
     // Close File
     //
-    fFile->Close();
+    //fFile->Close();
 
     return kTRUE;
@@ -156,5 +163,5 @@
     // Get the Event with the current EventNumber fNumEntry
     //
-    fTree->GetEntry(fNumEntry);
+    fChain->GetEntry(fNumEntry);
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc	(revision 705)
+++ trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc	(revision 706)
@@ -11,4 +11,5 @@
 #include <TH1.h>
 #include <TPad.h>
+#include <TCanvas.h>
 
 #include "MHillas.h"
@@ -36,7 +37,7 @@
     //
     fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
-    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  150, 0, 150);
-    fLength = new TH1F("Length [mm]", "Length of Hillas", 150, 0, 150);
-    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   200, 0, 200);
+    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
+    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
+    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
 }
 
@@ -51,5 +52,5 @@
 void MHHillas::Fill(MHillas *par)
 {
-    fAlpha ->Fill(par->GetAlpha());
+    fAlpha ->Fill(fabs(par->GetAlpha()));
     fWidth ->Fill(par->GetWidth());
     fLength->Fill(par->GetLength());
@@ -57,8 +58,11 @@
 }
 
-#include <TCanvas.h>
 void MHHillas::Draw(Option_t *)
 {
 
+    //
+    // Fixme! Check for an existing canvas.
+    // And create one if no canvas exists only!
+    //
     TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
     c->Divide(2,2);
Index: trunk/MagicSoft/Mars/mgui/MGMarsMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMarsMain.h	(revision 705)
+++ trunk/MagicSoft/Mars/mgui/MGMarsMain.h	(revision 706)
@@ -26,7 +26,8 @@
   //  the things for the menu bar 
     
-  TGMenuBar         *fMenuBar ; 
-  TGPopupMenu       *fFileMenu ;
-  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
+  TGMenuBar          *fMenuBar ;
+  TGPopupMenu        *fFileMenu ;
+  TGLayoutHints      *fLayMenuBar;
+  TGLayoutHints      *fLayMenuItem ;
   TGHorizontal3DLine *fLineSep ; 
 
@@ -40,11 +41,16 @@
   //   the object in the top part of the frame
   
-  TGPictureButton *fPicMagic, *fPicMars ;
+  TGPictureButton  *fPicMagic;
+  TGPictureButton  *fPicMars ;
  
   //   the object in the low part of the frame
  
-  TGVerticalFrame  *fTabF1, *fTabF2 ; 
+  TGVerticalFrame  *fTabF1; 
+  TGVerticalFrame  *fTabF2 ;
   
-  TGTextButton     *fButEvtDisp, *fButDataCheck, *fButAnalys, *fButMonteCarlo ;
+  TGTextButton     *fButEvtDisp;
+  TGTextButton     *fButDataCheck;
+  TGTextButton     *fButAnalys;
+  TGTextButton     *fButMonteCarlo ;
   TGLayoutHints    *fButLayout ; 
  
Index: trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc	(revision 705)
+++ trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc	(revision 706)
@@ -27,5 +27,5 @@
 MGMonteCarloMain::MGMonteCarloMain(const TGWindow *p, const TGWindow *main, 
                             UInt_t w, UInt_t h ) 
-        : TGTransientFrame(p, main, w, h ) 
+        : TGTransientFrame(p, main, w, h )
 {
   //
@@ -222,10 +222,5 @@
   //   Checks if there is a selected input root file
    
-  if ( strcmp ( fInputFile, "\n") == 0 )
-    { 
-      return ( kFALSE ) ; 
-    } 
-  
-  return (kTRUE) ; 
+    return strcmp ( fInputFile, "\n") == 0 ? kFALSE : kTRUE;
 } 
 
Index: trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc	(revision 705)
+++ trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc	(revision 706)
@@ -23,20 +23,14 @@
   
   fMcEvt  = (MMcEvt*)pList->FindCreateObj("MMcEvt") ; 
-  if (!fMcEvt) { 
-    *fLog << dbginf << " Error: MMcEvt not found... exit." << endl;
+  if (!fMcEvt)
     return kFALSE;
-  } 
 
   fMcTrig = (MMcTrig*)pList->FindCreateObj("MMcTrig") ; 
-  if (!fMcTrig) { 
-    *fLog << dbginf << " Error: MMcTrig not found... exit." << endl;
+  if (!fMcTrig) 
     return kFALSE;
-  } 
 
   fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ; 
-  if (!fCollArea) { 
-    *fLog << dbginf << " Error: MCollArea not found... exit." << endl;
+  if (!fCollArea) 
     return kFALSE;
-  } 
 
   return kTRUE ; 
