Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5831)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5832)
@@ -22,4 +22,42 @@
 
 
+ 2005/01/14 Thomas Bretz
+ 
+   * callisto.cc:
+     - fixed a typo in output
+
+   * manalysis/MGeomApply.cc:
+     - removed some old code already in comments
+
+   * manalysis/MMultiDimDistCalc.cc, mhbase/MHMatrix.[h,cc],
+     mranforest/MRanForestCalc.cc, mtools/MHSimulatedAnnealing.[h,cc],
+     mtools/MSimulatedAnnealing.h:
+     - added include of TVector because in newer root version it is 
+       not included from TMatrix anymore
+
+   * mbase/BaseLinkDef.h, mbase/MMath.[h,cc]:
+     - to stick to the convention of TMath in newer root versions MMath
+       changed from a class to a namespace
+
+   * mbase/MEvtLoop.[h,cc]:
+     - to support newer root version added a second Write-function
+       with a const qualifier.
+
+   * mdata/MDataChain.cc:
+     - changed access to TMath for newer root versions
+
+   * mfileio/MChain.[h,cc]:
+     - implemented a workaround for teh changed LoadTree definition
+       in newer root-versions
+
+   * mfileio/MReadTree.cc:
+     - fixed a bug in CheckBranchSize caused some warning to be
+       displayed
+
+   * mhflux/MHAlpha.cc:
+     - removed check for fResult in PostProcess (it is always there)
+
+
+
  2005/01/14 Abelardo Moralejo
 
@@ -28,8 +66,10 @@
 
 
+
  2005/01/14 Daniela Dorner
 
    * macros/sql/filldotrun.C
      - added new arehucas-verions and changed code accordingly
+
 
 
Index: trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- trunk/MagicSoft/Mars/callisto.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/callisto.cc	(revision 5832)
@@ -397,5 +397,5 @@
         if (!job1.ProcessFile())
         {
-            gLog << err << "Calculation of fundamentan pedestal failed." << endl << endl;
+            gLog << err << "Calculation of fundamental pedestal failed." << endl << endl;
             return -1;
         }
Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 5832)
@@ -139,45 +139,4 @@
             cam->Init(*geom);
     }
-/*
-    MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
-    if (ped)
-        ped->Init(*geom);
-
-    MCalibrationCam *cal = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
-    if (cal)
-        cal->Init(*geom);
-
-    MCalibrationCam *cat = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam"));
-    if (cat)
-        cat->Init(*geom);
-
-    MCalibrationCam *qe = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationQECam"));
-    if (qe)
-        qe->Init(*geom);
-
-    MCalibrationCam *pcam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationPedCam"));
-    if (pcam)
-        pcam->Init(*geom);
-
-    MPedPhotCam *pedphot = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam"));
-    if (pedphot)
-        pedphot->Init(*geom);
-
-    MExtractedSignalCam *ext = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
-    if (ext)
-        ext->Init(*cam);
-
-    MArrivalTimeCam *tme = (MArrivalTimeCam*)pList->FindObject(AddSerialNumber("MArrivalTimeCam"));
-    if (tme)
-      tme->InitSize(cam->GetNumPixels());
-
-    MArrivalTime    *atm = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
-    if (atm)
-      atm->InitSize(cam->GetNumPixels());
-
-    MBadPixelsCam *bad = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam"));
-    if (bad)
-        bad->InitSize(cam->GetNumPixels());
-    */
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc	(revision 5832)
@@ -47,4 +47,6 @@
 #include <fstream>
 
+#include <TVector.h>
+
 #include "MHMatrix.h" // must be before MLogManip.h
 
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 5832)
@@ -20,5 +20,5 @@
 
 // Basic Tools
-#pragma link C++ class MMath+;
+#pragma link C++ namespace MMath;
 #pragma link C++ class MString+;
 #pragma link C++ class MIter+;
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 5832)
@@ -883,5 +883,5 @@
 //        file.Close();
 //
-Int_t MEvtLoop::Write(const char *name, Int_t option, Int_t bufsize)
+Int_t MEvtLoop::Write(const char *name, Int_t option, Int_t bufsize) const
 {
     if (!gFile)
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 5832)
@@ -74,5 +74,9 @@
 
     Int_t Read(const char *name="Evtloop");
-    Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0);
+    Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0) const;
+    Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0)
+    {
+        return const_cast<MEvtLoop*>(this)->Write(name, option, bufsize);
+    }
 
     void Print(Option_t *opt="") const;
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 5832)
@@ -30,7 +30,5 @@
 #include "MMath.h"
 
-ClassImp(MMath);
-
-using namespace std;
+using namespace TMath;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mbase/MMath.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mbase/MMath.h	(revision 5832)
@@ -9,21 +9,18 @@
 #endif
 
-class MMath : public TMath
+namespace MMath
 {
-public:
-    static Double_t GaussProb(Double_t x, Double_t sigma, Double_t mean=0);
+    Double_t GaussProb(Double_t x, Double_t sigma, Double_t mean=0);
 
-    static Double_t Significance(Double_t s, Double_t b);
-    static Double_t SignificanceSym(Double_t s, Double_t b);
-    static Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1);
-    static Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1);
+    Double_t Significance(Double_t s, Double_t b);
+    Double_t SignificanceSym(Double_t s, Double_t b);
+    Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1);
+    Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1);
 
-    static TVector3 GetParab(const TVector3 &x, const TVector3 &y);
-    static Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
-    static Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
-    static Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
-
-    ClassDef(MMath, 0)
-};
+    TVector3 GetParab(const TVector3 &x, const TVector3 &y);
+    Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
+    Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
+    Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
+}
 
 #endif
Index: trunk/MagicSoft/Mars/mdata/MDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 5832)
@@ -347,5 +347,11 @@
 
     const TString name = txt(1, txt.Length());
+#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00)
     TMethodCall call(TMath::Class(), name, "");
+#else
+    static TClass *const tmath = TClass::GetClass("TMath");
+    TMethodCall call(tmath, name, "");
+#endif
+
     switch (call.ReturnType())
     {
Index: trunk/MagicSoft/Mars/mfileio/MChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mfileio/MChain.cc	(revision 5832)
@@ -36,5 +36,9 @@
 using namespace std;
 
-Int_t MChain::LoadTree(Int_t entry)
+//#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00)
+//Int_t MChain::LoadTree(Int_t entry)
+//#else
+Long64_t MChain::LoadTree(Long64_t entry)
+//#endif
 {
     //
@@ -50,5 +54,10 @@
     SetNotify(this);
 
-    Int_t rc = TChain::LoadTree(entry);
+//#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00)
+//    Int_t
+//#else
+    Long64_t
+//#endif
+        rc = TChain::LoadTree(entry);
 
     if (rc >= 0 && fNotified && notify)
Index: trunk/MagicSoft/Mars/mfileio/MChain.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mfileio/MChain.h	(revision 5832)
@@ -20,5 +20,9 @@
     virtual void   SetNotify(TObject *obj) { fNotify = obj; fNotified = kFALSE; }
 
-    Int_t LoadTree(Int_t entry);
+//#if ROOT_VERSION_CODE < ROOT_VERSION(4,02,00)
+    Int_t LoadTree(Int_t entry) { return (Int_t)LoadTree((Long64_t)entry); }
+//#else
+    Long64_t LoadTree(Long64_t entry);
+//#endif
 
     ClassDef(MChain, 1) // Class derived from TChain to give access to Notify-return value
Index: trunk/MagicSoft/Mars/mfileio/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mfileio/MReadTree.cc	(revision 5832)
@@ -217,38 +217,12 @@
 Bool_t MReadTree::CheckBranchSize()
 {
-    //if (!fChain) // >FIXME: fTree!=0
-    //    return kTRUE;
-
-    TArrayI entries(fChain ? fChain->GetStatus()->GetSize() : fTree->GetListOfBranches()->GetSize());
+    TArrayI entries(fTree->GetListOfBranches()->GetSize());
     Int_t num=0;
 
-    // Loop over all branches which have a corresponding container
-    /*
-    if (fChain)
-    {
-        TIter Next(fChain->GetStatus());
-
-        TChainElement *element = NULL;
-        while ((element=(TChainElement*)Next()))
-        {
-            // Get branch name and find pointer to corresponding branch
-            const TString name = element->GetName();
-            const TBranch *b = fChain->FindBranch(name);
-
-            // Skip element without corresponding branches (like "*")
-            if (!b)
-                continue;
-
-            entries[num++] = (Int_t)b->GetEntries();
-        }
-    }
-    else */
-    {
-        TIter Next(fTree->GetListOfBranches());
-
-        TBranch *element = NULL;
-        while ((element=(TBranch*)Next()))
-            entries[num++] = (Int_t)element->GetEntries();
-    }
+    TIter Next(fTree->GetListOfBranches());
+
+    TBranch *element = NULL;
+    while ((element=(TBranch*)Next()))
+        entries[num++] = (Int_t)element->GetEntries();
 
     // Check the number of entries of the branches pair-wise
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.cc	(revision 5832)
@@ -53,4 +53,5 @@
 #include <TArrayD.h>
 #include <TArrayI.h>
+#include <TVector.h>
 
 #include <TH1.h>
Index: trunk/MagicSoft/Mars/mhbase/MHMatrix.h
===================================================================
--- trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mhbase/MHMatrix.h	(revision 5832)
@@ -15,6 +15,7 @@
 class TArrayI;
 class TArrayF;
+class TVector;
+class TH1F;
 
-class TH1F;
 class MTask;
 class MParList;
Index: trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHAlpha.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mhflux/MHAlpha.cc	(revision 5832)
@@ -823,6 +823,5 @@
     fFit.Print("result");
 
-    if (fResult)
-        fResult->SetVal(-fFit.GetSignificance());
+    fResult->SetVal(-fFit.GetSignificance());
 
     if (!fSkipHistEnergy)
Index: trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc	(revision 5832)
@@ -664,4 +664,3 @@
         *fLog << (fRandomCalculation?"":"non-") << "random)" << endl;
     }
-
-}
+}
Index: trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc	(revision 5832)
@@ -437,6 +437,5 @@
       : fExtractWinLast;
 
-    *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << last << " incl." << endl;
-
+    *fLog << "ExtractWindow from slice      " << fExtractWinFirst << " to " << last << " incl." << endl;
     *fLog << "Num overlap lo-gain slices:   " << fOverlap << endl;
     *fLog << "First pedrun out of sequence: " << (fIsFirstPedRun?"yes":"no") << endl;
Index: trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc	(revision 5832)
@@ -36,4 +36,6 @@
 #include "MRanForestCalc.h"
 
+#include <TVector.h>
+
 #include "MHMatrix.h" // must be before MLogManip.h
 #include "MDataArray.h"
Index: trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc	(revision 5831)
+++ trunk/MagicSoft/Mars/mtools/MHSimulatedAnnealing.cc	(revision 5832)
@@ -33,4 +33,5 @@
 #include "MHSimulatedAnnealing.h"
 
+#include <TVector.h>
 #include <TMatrix.h>
 #include <TObjArray.h>
Index: trunk/MagicSoft/Mars/mtools/MSimulatedAnnealing.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MSimulatedAnnealing.h	(revision 5831)
+++ trunk/MagicSoft/Mars/mtools/MSimulatedAnnealing.h	(revision 5832)
@@ -8,4 +8,8 @@
 #ifndef ROOT_TMatrix
 #include <TMatrix.h>
+#endif
+
+#ifndef ROOT_TVector
+#include <TVector.h>
 #endif
 
