Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1298)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1299)
@@ -17,7 +17,11 @@
      - added usage of Data-Chains
      - added a profiling option to the draw functions
+     - use the title (rule) of the data-chain as axis title
 
    * mhist/Makefile:
      - added mdata-path
+
+   * mbase/MParContainer.h:
+     - changed some output in GetterFunction
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 1298)
+++ trunk/MagicSoft/Mars/NEWS	(revision 1299)
@@ -3,4 +3,9 @@
  *** Version 0.7
  
+   - added a bugfix to MCerPhotCalc. In older camera versions (<=40)
+     the pedestal mean value was saved incorrectly. For files from
+     this versions we substract 0.5 from the pedestal mean.
+     WARNING: This may effect your results, so don't wonder...
+
    - Ascii Output can now also be used for parameter containers which
      doesn't overload MParCointainer::AsciiWrite
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1298)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 1299)
@@ -325,5 +325,6 @@
     if (!cls)
     {
-        *fLog << err << "No (base) class containing '" << name << "'." << endl;
+        *fLog << err << "'" << name << "' is neither a member of ";
+        *fLog << GetDescriptor() << " nor one of its base classes." << endl;
         return NULL;
     }
Index: trunk/MagicSoft/Mars/mdata/MDataChain.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 1298)
+++ trunk/MagicSoft/Mars/mdata/MDataChain.cc	(revision 1299)
@@ -46,5 +46,5 @@
 {
     fName  = name  ? name  : "MDataChain";
-    fTitle = title ? title : "MDataChain";
+    fTitle = title ? title : rule;
 
     *fLog << inf << "Trying to resolve rule..." << endl;
Index: trunk/MagicSoft/Mars/mhist/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1298)
+++ trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1299)
@@ -63,4 +63,6 @@
 #include <TH2.h>
 #include <TH3.h>
+#include <TProfile.h>
+#include <TProfile2D.h>
 #include <TPad.h>
 #include <TCanvas.h>
@@ -73,4 +75,6 @@
 #include "MParList.h"
 
+#include "MDataChain.h"
+
 ClassImp(MH3);
 
@@ -80,9 +84,12 @@
 // description see the class description above.
 //
-MH3::MH3(const char *memberx) : fDimension(1)
+MH3::MH3(const char *memberx)
+    : fDimension(1)
 {
     fHist = new TH1F;
 
-    fDataMember[0] = memberx;
+    fData[0] = new MDataChain(memberx);
+    fData[1] = NULL;
+    fData[2] = NULL;
 
     fName  = "MH3";
@@ -103,10 +110,12 @@
 // description above.
 //
-MH3::MH3(const char *memberx, const char *membery) : fDimension(2)
+MH3::MH3(const char *memberx, const char *membery)
+    : fDimension(2)
 {
     fHist = new TH2F;
 
-    fDataMember[0] = memberx;
-    fDataMember[1] = membery;
+    fData[0] = new MDataChain(memberx);
+    fData[1] = new MDataChain(membery);
+    fData[2] = NULL;
 
     fName  = "MH3";
@@ -127,14 +136,17 @@
 // description see the class description above.
 //
-MH3::MH3(const char *memberx, const char *membery, const char *memberz) : fDimension(3)
+MH3::MH3(const char *memberx, const char *membery, const char *memberz)
+    : fDimension(3)
 {
     fHist = new TH3F;
 
-    fDataMember[0] = memberx;
-    fDataMember[1] = membery;
-    fDataMember[2] = memberz;
+    fData[0] = new MDataChain(memberx);
+    fData[1] = new MDataChain(membery);
+    fData[2] = new MDataChain(memberz);
 
     fName  = "MH3";
     fTitle = "Container for a 3D Mars Histogram";
+
+    fHist->SetDirectory(NULL);
 
     fScale[0] = 1;
@@ -150,38 +162,9 @@
 {
     delete fHist;
-}
-
-// --------------------------------------------------------------------------
-//
-// Trys to determin the TMethodCall corresponding to the num-axis
-// corresponding data member.
-//
-Bool_t MH3::GetMethodCall(const MParList *plist, Int_t num)
-{
-    TString cname(fDataMember[num]);
-    TString mname(fDataMember[num]);
-
-    const char *dot = strrchr(cname, '.');
-
-    if (dot)
-    {
-        const int pos = dot-cname;
-
-        cname.Remove(pos);
-        mname.Remove(0, pos+1);
-    }
-
-    fObject[num] = (MParContainer*)plist->FindObject(cname);
-    if (!fObject[num])
-    {
-        *fLog << err << "Object '" << cname << "' not in parameter list... aborting." << endl;
-        return kFALSE;
-    }
-
-    fMethodCall[num] = fObject[num]->GetterMethod(mname);
-
-    return fMethodCall[num] ? kTRUE : kFALSE;
-}
-
+
+    for (int i=0; i<3; i++)
+        if (fData[i])
+            delete fData[i];
+}
 
 // --------------------------------------------------------------------------
@@ -208,6 +191,6 @@
             return kFALSE;
         }
-        fHist->SetZTitle(fName+"Z");
-        if (!GetMethodCall(plist, 2))
+        fHist->SetZTitle(fData[2]->GetTitle());
+        if (!fData[2]->PreProcess(plist))
             return kFALSE;
     case 2:
@@ -218,6 +201,6 @@
             return kFALSE;
         }
-        fHist->SetYTitle(fName+"Y");
-        if (!GetMethodCall(plist, 1))
+        fHist->SetYTitle(fData[1]->GetTitle());
+        if (!fData[1]->PreProcess(plist))
             return kFALSE;
     case 1:
@@ -228,6 +211,6 @@
             return kFALSE;
         }
-        fHist->SetXTitle(fName+"X");
-        if (!GetMethodCall(plist, 0))
+        fHist->SetXTitle(fData[0]->GetTitle());
+        if (!fData[0]->PreProcess(plist))
             return kFALSE;
     }
@@ -279,47 +262,20 @@
 // --------------------------------------------------------------------------
 //
-// Returns the value corresponding to the data member of the given object
-//
-Bool_t MH3::GetValue(Int_t num, Double_t &v)
-{
-    switch (fMethodCall[num]->ReturnType())
-    {
-    case TMethodCall::kLong:
-        Long_t l;
-        fMethodCall[num]->Execute(fObject[num], l); // FIXME: const, root
-        v = fScale[num]*l;
-        return kTRUE;
-
-    case TMethodCall::kDouble:
-        fMethodCall[num]->Execute(fObject[num], v); // FIXME: const, root
-        v *= fScale[num];
-        return kTRUE;
-
-    default:
-        *fLog << err << "DataMember "  << fDataMember[num] << " of ";
-        *fLog << fObject[num]->GetName() << " neither int nor float... abort." << endl;
-        return kFALSE;
-    }
-}
-
-// --------------------------------------------------------------------------
-//
 // Fills the one, two or three data members into our histogram
 //
 Bool_t MH3::Fill(const MParContainer *par)
 {
-    Double_t x, y, z;
+    Double_t x=0;
+    Double_t y=0;
+    Double_t z=0;
 
     switch (fDimension)
     {
     case 3:
-        if (!GetValue(2, z))
-            return kFALSE;
+        z = fData[2]->GetValue()*fScale[2];
     case 2:
-        if (!GetValue(1, y))
-            return kFALSE;
+        y = fData[1]->GetValue()*fScale[1];
     case 1:
-        if (!GetValue(0, x))
-            return kFALSE;
+        x = fData[0]->GetValue()*fScale[0];
     }
 
@@ -359,4 +315,18 @@
     fHist->DrawCopy(opt);
 
+    TString str(opt);
+    if (str.Contains("PROFX", TString::kIgnoreCase) && fDimension==2)
+    {
+        TProfile *p = ((TH2*)fHist)->ProfileX();
+        p->Draw("same");
+        p->SetBit(kCanDelete);
+    }
+    if (str.Contains("PROFY", TString::kIgnoreCase) && fDimension==2)
+    {
+        TProfile *p = ((TH2*)fHist)->ProfileY();
+        p->Draw("same");
+        p->SetBit(kCanDelete);
+    }
+
     c.Modified();
     c.Update();
@@ -378,4 +348,18 @@
     fHist->Draw(opt);
 
+    TString str(opt);
+    if (str.Contains("PROFX", TString::kIgnoreCase) && fDimension==2)
+    {
+        TProfile *p = ((TH2*)fHist)->ProfileX();
+        p->Draw("same");
+        p->SetBit(kCanDelete);
+    }
+    if (str.Contains("PROFY", TString::kIgnoreCase) && fDimension==2)
+    {
+        TProfile *p = ((TH2*)fHist)->ProfileY();
+        p->Draw("same");
+        p->SetBit(kCanDelete);
+    }
+
     gPad->Modified();
     gPad->Update();
Index: trunk/MagicSoft/Mars/mhist/MH3.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.h	(revision 1298)
+++ trunk/MagicSoft/Mars/mhist/MH3.h	(revision 1299)
@@ -11,4 +11,5 @@
 class TH1;
 class TMethodCall;
+class MDataChain;
 
 class MH3 : public MH
@@ -21,11 +22,7 @@
     TString fDataMember[3];        // Data member which should be filled into the histogram x
 
-    MParContainer *fObject[3];     // Object from which the data is filled
-    TMethodCall   *fMethodCall[3]; // Method call to get the data from the object
+    MDataChain *fData[3];     // Object from which the data is filled
 
     Double_t fScale[3];
-
-    Bool_t GetValue(Int_t num, Double_t &v);
-    Bool_t GetMethodCall(const MParList *plist, Int_t num);
 
 public:
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 1298)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 1299)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc -I../mgui
+INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc -I../mgui -I../mdata
 
 #------------------------------------------------------------------------------
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx	(revision 1298)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx	(revision 1299)
@@ -132,9 +132,12 @@
 	    );
   
-  Float_t GetNumPheFromDNSB() const { return fNumPheFromDNSB; }
-  void GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const;
-  void GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const;
+  void     GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const;
+  void     GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const;
 
-  UShort_t GetCamVersion() const { return fCamVersion; }
+  Float_t  GetNumPheFromDNSB() const      { return fNumPheFromDNSB; }
+  Float_t  GetTelesTheta() const          { return fTelesTheta; }
+  UShort_t GetCamVersion() const          { return fCamVersion; }
+  UInt_t   GetNumSimulatedShowers() const { return fNumSimulatedShowers; }
+  UInt_t   GetCorsikaVersion() const      { return fCorsikaVersion; }
 
   ClassDef(MMcRunHeader, 2)	// storage container for general info
