Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1211)
@@ -21,6 +21,6 @@
 #pragma link C++ class MHEffOnTimeTime+;
 #pragma link C++ class MHEffOnTimeTheta+;
-#pragma link C++ class MHDiffTimeTime+;
-#pragma link C++ class MHDiffTimeTheta+;
+#pragma link C++ class MHTimeDiffTime+;
+#pragma link C++ class MHTimeDiffTheta+;
 
 #pragma link C++ class MBinning+;
Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1211)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz  07/2001 <mailto:tbretz@uni-sw.gwdg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1211)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz  07/2001 <mailto:tbretz@uni-sw.gwdg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 1211)
@@ -0,0 +1,180 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz    1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MHAlphaEnergyTheta                                                       //
+//                                                                          //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MHAlphaEnergyTheta.h"
+
+#include <TCanvas.h>
+
+#include "MMcEvt.hxx"
+#include "MHillasSrc.h"
+#include "MEnergyEst.h"
+
+#include "MBinning.h"
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHAlphaEnergyTheta);
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+MHAlphaEnergyTheta::MHAlphaEnergyTheta(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHAlphaEnergyTheta";
+    fTitle = title ? title : "3-D histogram in alpha, energy and theta";
+
+    fHist.SetDirectory(NULL);
+
+    fHist.GetXaxis()->SetTitle("\\alpha [\\circ]");
+    fHist.GetYaxis()->SetTitle("E_{est} [GeV]");
+    fHist.GetZaxis()->SetTitle("\\Theta [\\circ]");
+}
+
+Bool_t MHAlphaEnergyTheta::SetupFill(const MParList *plist)
+{
+   fEnergy = (MEnergyEst*)plist->FindObject("MEnergyEst");
+   if (!fEnergy)
+   {
+       *fLog << err << dbginf << "MEnergyEst not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
+   if (!fMcEvt)
+   {
+       *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   MBinning* binsenergy = (MBinning*)plist->FindObject("BinningE");
+   MBinning* binsalpha  = (MBinning*)plist->FindObject("BinningAlpha");
+   MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta");
+   if (!binsenergy || !binsalpha || !binstheta)
+   {
+       *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
+       return kFALSE;      
+   }
+
+   SetBinning(&fHist, binsalpha, binsenergy, binstheta);
+
+   return kTRUE;
+}
+
+Bool_t MHAlphaEnergyTheta::Fill(const MParContainer *par)
+{
+    MHillasSrc &hil = *(MHillasSrc*)par;
+
+    fHist.Fill(hil.GetAlpha(), fEnergy->GetEnergy(), fMcEvt->GetTheta()*kRad2Deg);
+    return kTRUE;
+}
+
+void MHAlphaEnergyTheta::Draw(Option_t *opt)
+{
+    if (!gPad)
+        MakeDefCanvas("AlphaEnergyTheta", "Distrib of \\alpha, E, \\Theta");
+
+    gPad->Divide(2,2);
+
+    gPad->cd(1);
+    fHist.Project3D("x")->Draw(opt);
+
+    gPad->cd(2);
+    fHist.Project3D("y")->Draw(opt);
+
+    gPad->cd(3);
+    fHist.Project3D("z")->Draw(opt);
+
+    gPad->cd(4);
+    fHist.Draw(opt);
+
+    gPad->Modified();
+    gPad->Update();
+}
+
+TObject *MHAlphaEnergyTheta::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas("DiffTimeTheta", "Distrib of \\Delta t, \\Theta");
+    c->Divide(2, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // FIXME: ProjectionX,Y is not const within root
+    //
+    c->cd(1);
+    ((TH3*)(&fHist))->Project3D("x")->DrawCopy(opt);
+
+    c->cd(2);
+    ((TH3*)(&fHist))->Project3D("y")->DrawCopy(opt);
+
+    c->cd(3);
+    ((TH3*)(&fHist))->Project3D("z")->DrawCopy(opt);
+
+    c->cd(4);
+    ((TH3*)(&fHist))->DrawCopy(opt);
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+void MHAlphaEnergyTheta::Substract(const TH3D *h1, const TH3D *h2)
+{
+    MH::SetBinning(&fHist, h1);
+
+    fHist.Sumw2();
+    fHist.Add((TH1*)h1, (TH1*)h2, 1, -1); // Root: FIXME
+}
+
+void MHAlphaEnergyTheta::SetAlphaRange(Axis_t lo, Axis_t up)
+{
+    TAxis &axe = *fHist.GetXaxis();
+
+    //
+    // FIXME: ROOT Binning??? of projection
+    // root 3.02: SetRangeUser
+    axe.SetRange(axe.FindFixBin(lo), axe.FindFixBin(up));
+}
+
+TH2D *MHAlphaEnergyTheta::GetAlphaProjection(Axis_t lo, Axis_t up)
+{
+    SetAlphaRange(lo, up);
+    return (TH2D*)fHist.Project3D("yz");
+}
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h	(revision 1211)
@@ -0,0 +1,57 @@
+#ifndef MARS_MHAlphaEnergyTheta
+#define MARS_MHAlphaEnergyTheta
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+#ifndef ROOT_TH3
+#include "TH3.h"
+#endif
+
+class MMcEvt;
+class MHillasSrc;
+class MEnergyEst;
+class TH2D;
+class MParList;
+
+
+class MHAlphaEnergyTheta : public MH
+{
+private:
+    MMcEvt     *fMcEvt;  //!
+    MHillasSrc *fHillas; //!
+    MEnergyEst *fEnergy; //!
+
+    TH3D fHist;
+
+    void SetAlphaRange(Axis_t lo, Axis_t up);
+
+public:
+    MHAlphaEnergyTheta(const char *name=NULL, const char *title=NULL);
+
+    virtual Bool_t SetupFill(const MParList *pList);
+    virtual Bool_t Fill(const MParContainer *par);
+
+    const TH3D *GetHist()       { return &fHist; }
+    const TH3D *GetHist() const { return &fHist; }
+
+    void Draw(Option_t *option="");
+    TObject *DrawClone(Option_t *option="") const;
+
+    void Substract(const TH3D *h1, const TH3D *h2);
+    void Substract(const MHAlphaEnergyTheta *h1, const MHAlphaEnergyTheta *h2)
+    {
+        Substract(h1->GetHist(), h2->GetHist());
+    }
+
+    TH2D *GetAlphaProjection(Axis_t lo, Axis_t up);
+
+    ClassDef(MHAlphaEnergyTheta, 1) //Histogram to store a 3-Dim histogram in alpha, Energy and theta
+};
+
+#endif
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 1211)
@@ -0,0 +1,185 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz    1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MHAlphaEnergyTime                                                       //
+//                                                                          //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MHAlphaEnergyTime.h"
+
+#include <TCanvas.h>
+
+#include "MHillasSrc.h"
+#include "MEnergyEst.h"
+#include "MTime.h"
+
+#include "MBinning.h"
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHAlphaEnergyTime);
+
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+#include <iostream.h>
+MHAlphaEnergyTime::MHAlphaEnergyTime(const char *name, const char *title) 
+  : fHist()
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHAlphaEnergyTime";
+    fTitle = title ? title : "3-D histogram in alpha, energy and time";
+
+    fHist.SetDirectory(NULL);
+
+    fHist.GetXaxis()->SetTitle("\\alpha [\\circ]");
+    fHist.GetYaxis()->SetTitle("E_{est} [GeV]");
+    fHist.GetZaxis()->SetTitle("t [s]");
+}
+
+Bool_t MHAlphaEnergyTime::SetupFill(const MParList *plist)
+{
+   fEnergy = (MEnergyEst*)plist->FindObject("MEnergyEst");
+   if (!fEnergy)
+   {
+       *fLog << err << dbginf << "MEnergyEst not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   fTime = (MTime*)plist->FindObject("MTime");
+   if (!fTime)
+   {
+       *fLog << err << dbginf << "MTime not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   MBinning* binsenergy = (MBinning*)plist->FindObject("BinningE");
+   MBinning* binsalpha  = (MBinning*)plist->FindObject("BinningAlpha");
+   MBinning* binstime   = (MBinning*)plist->FindObject("BinningTime");
+   if (!binsenergy || !binsalpha || !binstime)
+   {
+       *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
+       return kFALSE;      
+   }
+
+   SetBinning(&fHist, binsalpha, binsenergy, binstime);
+
+   fHist.Sumw2();
+
+   return kTRUE;
+}
+
+Bool_t MHAlphaEnergyTime::Fill(const MParContainer *par)
+{
+    MHillasSrc &hil = *(MHillasSrc*)par;
+
+    fHist.Fill(hil.GetAlpha(), fEnergy->GetEnergy(), 0.0001*fTime->GetTimeLo());
+    return kTRUE;
+}
+
+void MHAlphaEnergyTime::Draw(Option_t *opt)
+{
+    if (!gPad)
+        MakeDefCanvas("AlphaEnergyTime", "Distrib of \\alpha, E, t");
+
+    gPad->Divide(2,2);
+
+    gPad->cd(1);
+    fHist.Project3D("x")->Draw(opt);
+
+    gPad->cd(2);
+    fHist.Project3D("y")->Draw(opt);
+
+    gPad->cd(3);
+    fHist.Project3D("z")->Draw(opt);
+
+    gPad->cd(4);
+    fHist.Draw(opt);
+
+    gPad->Modified();
+    gPad->Update();
+}
+
+TObject *MHAlphaEnergyTime::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas("DiffTimeTheta", "Distrib of \\Delta t, t");
+    c->Divide(2, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // FIXME: ProjectionX,Y is not const within root
+    //
+    c->cd(1);
+    ((TH3D*)(&fHist))->Project3D("x")->DrawCopy(opt);
+
+    c->cd(2);
+    ((TH3D*)(&fHist))->Project3D("y")->DrawCopy(opt);
+
+    c->cd(3);
+    ((TH3D*)(&fHist))->Project3D("z")->DrawCopy(opt);
+
+    c->cd(4);
+    ((TH3D*)(&fHist))->DrawCopy(opt);
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+void MHAlphaEnergyTime::Substract(const TH3D *h1, const TH3D *h2)
+{
+    MH::SetBinning(&fHist, h1);
+
+    fHist.Sumw2();
+    fHist.Add((TH1*)h1, (TH1*)h2, 1, -1); // ROOT: FIXME!
+}
+
+void MHAlphaEnergyTime::SetAlphaRange(Axis_t lo, Axis_t up)
+{
+    TAxis &axe = *fHist.GetXaxis();
+
+    //
+    // FIXME: ROOT Binning??? of projection
+    // root 3.02: SetRangeUser
+    axe.SetRange(axe.FindFixBin(lo), axe.FindFixBin(up));
+}
+
+TH2D *MHAlphaEnergyTime::GetAlphaProjection(Axis_t lo, Axis_t up)
+{
+    SetAlphaRange(lo, up);
+    return (TH2D*)fHist.Project3D("yz");
+}
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h	(revision 1211)
@@ -0,0 +1,52 @@
+#ifndef MARS_MHAlphaEnergyTime
+#define MARS_MHAlphaEnergyTime
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+#ifndef ROOT_TH3
+#include "TH3.h"
+#endif
+
+class MHillasSrc;
+class MEnergyEst;
+class MTime;
+class TH2D;
+class MParList;
+
+class MHAlphaEnergyTime : public MH
+{
+private:
+    MHillasSrc *fHillas; //!
+    MEnergyEst *fEnergy; //!
+    MTime      *fTime;   //!
+
+    TH3D    fHist;
+
+    void SetAlphaRange(Axis_t lo, Axis_t up);
+
+public:
+    MHAlphaEnergyTime(const char *name=NULL, const char *title=NULL);
+
+    virtual Bool_t SetupFill(const MParList *pList);
+    virtual Bool_t Fill(const MParContainer *par);
+
+    const TH3D *GetHist()       { return &fHist; }
+    const TH3D *GetHist() const { return &fHist; }
+
+    void Draw(Option_t *option="");
+    TObject *DrawClone(Option_t *option="") const;
+
+    void Substract(const TH3D *h1, const TH3D *h2);
+    void Substract(const MHAlphaEnergyTime *h1, const MHAlphaEnergyTime *h2)
+    {
+        Substract(h1->GetHist(), h2->GetHist());
+    }
+
+    TH2D *GetAlphaProjection(Axis_t lo, Axis_t up);
+
+    ClassDef(MHAlphaEnergyTime, 1) //Histogram to store a 3-Dim histogram in alpha, Energy and time
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1211)
@@ -19,5 +19,5 @@
 !   Author(s): Harald Kornmayer 1/2001
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1211)
@@ -18,5 +18,5 @@
 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2002
 !
 !
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 1211)
@@ -0,0 +1,160 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz    1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MHTimeDiffTheta                                                       //
+//                                                                          //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MHTimeDiffTheta.h"
+
+#include <TCanvas.h>
+
+#include "MTime.h"
+#include "MMcEvt.hxx"
+
+#include "MBinning.h"
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHTimeDiffTheta);
+
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+MHTimeDiffTheta::MHTimeDiffTheta(const char *name, const char *title)
+    : fHist(), fLastTime(0)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHTimeDiffTheta";
+    fTitle = title ? title : "2-D histogram in time and time difference";
+
+    fHist.SetDirectory(NULL);
+
+    fHist.GetXaxis()->SetTitle("\\Delta t [s]");
+    fHist.GetYaxis()->SetTitle("\\Theta [\\circ]");
+}
+
+Bool_t MHTimeDiffTheta::SetupFill(const MParList *plist)
+{
+   fTime = (MTime*)plist->FindObject("MTime");
+   if (!fTime)
+   {
+       *fLog << err << dbginf << "MTime not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
+   if (!fMcEvt)
+   {
+       *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   const MBinning* binsdtime = (MBinning*)plist->FindObject("BinningTimeDiff");
+   const MBinning* binstheta = (MBinning*)plist->FindObject("BinningTheta");
+   if (!binstheta || !binsdtime)
+   {
+       *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
+       return kFALSE;      
+   }
+
+   SetBinning(&fHist, binsdtime, binstheta);
+
+   return kTRUE;
+}
+
+TObject *MHTimeDiffTheta::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas("DiffTimeTheta", "Distrib \\Delta t, \\Theta");
+    c->Divide(2, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // FIXME: ProjectionX,Y is not const within root
+    //
+    c->cd(1);
+    ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt);
+    gPad->SetLogy();
+
+    c->cd(2);
+    ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt);
+
+    c->cd(3);
+    ((TH2*)&fHist)->DrawCopy(opt);
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+void MHTimeDiffTheta::Draw(Option_t *opt)
+{
+    if (!gPad)
+        MakeDefCanvas("DiffTimeTheta", "Distrib \\Delta t, \\Theta");
+
+    TH1 *h;
+
+    gPad->Divide(2,2);
+
+    gPad->cd(1);
+    h = fHist.ProjectionX("ProX", -1, 9999, "E");
+    h->DrawCopy(opt);
+    delete h;
+    gPad->SetLogy();
+
+    gPad->cd(2);
+    h = fHist.ProjectionY("ProY", -1, 9999, "E");
+    h->DrawCopy(opt);
+    delete h;
+
+    gPad->cd(3);
+    fHist.Draw(opt);
+
+    gPad->Modified();
+    gPad->Update();
+}
+
+Bool_t MHTimeDiffTheta::Fill(const MParContainer *par)
+{
+    const Int_t time = fTime->GetTimeLo();
+
+    fHist.Fill(0.0001*(time-fLastTime), fMcEvt->GetTheta()*kRad2Deg);
+    fLastTime = time;
+
+    return kTRUE;
+}
+
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h	(revision 1211)
@@ -0,0 +1,41 @@
+#ifndef MARS_MHTimeDiffTheta
+#define MARS_MHTimeDiffTheta
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+#ifndef ROOT_TH2
+#include "TH2.h"
+#endif
+
+class MTime;
+class MMcEvt;
+
+class MParList;
+
+class MHTimeDiffTheta : public MH
+{
+private:
+    MTime  *fTime;   //!
+    MMcEvt *fMcEvt;  //!
+    Int_t   fLastTime;
+
+    TH2D    fHist;
+
+public:
+    MHTimeDiffTheta(const char *name=NULL, const char *title=NULL);
+
+    virtual Bool_t SetupFill(const MParList *pList);
+    virtual Bool_t Fill(const MParContainer *par);
+
+    const TH2D *GetHist() { return &fHist; }
+    const TH2D *GetHist() const { return &fHist; }
+
+    void Draw(Option_t *option="");
+    TObject *DrawClone(Option_t *option="") const;
+
+    ClassDef(MHTimeDiffTheta, 1) //Histogram to store a 3-Dim histogram in alpha, Energy and time
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1211)
@@ -0,0 +1,147 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz    1/2002 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Wolfgang Wittek 1/2002 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MHTimeDiffTime                                                       //
+//                                                                          //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MHTimeDiffTime.h"
+
+#include <TCanvas.h>
+
+#include "MTime.h"
+
+#include "MBinning.h"
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHTimeDiffTime);
+
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+MHTimeDiffTime::MHTimeDiffTime(const char *name, const char *title)
+    : fHist(), fLastTime(0)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHTimeDiffTime";
+    fTitle = title ? title : "2-D histogram in time and time difference";
+
+    fHist.SetDirectory(NULL);
+
+    fHist.GetXaxis()->SetTitle("\\Delta t [s]");
+    fHist.GetYaxis()->SetTitle("t [s]");
+}
+
+Bool_t MHTimeDiffTime::SetupFill(const MParList *plist)
+{
+   fTime = (MTime*)plist->FindObject("MTime");
+   if (!fTime)
+   {
+       *fLog << err << dbginf << "MTime not found... aborting." << endl;
+       return kFALSE;
+   }
+
+   const MBinning* binsdtime = (MBinning*)plist->FindObject("BinningTimeDiff");
+   const MBinning* binstime  = (MBinning*)plist->FindObject("BinningTime");
+   if (!binstime || !binsdtime)
+   {
+       *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl;
+       return kFALSE;      
+   }
+
+   SetBinning(&fHist, binsdtime, binstime);
+
+   return kTRUE;
+}
+
+TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const
+{
+    TCanvas *c = MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
+    c->Divide(2, 2);
+
+    gROOT->SetSelectedPad(NULL);
+
+    //
+    // FIXME: ProjectionX,Y is not const within root
+    //
+    c->cd(1);
+    ((TH2*)&fHist)->ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt);
+    gPad->SetLogy();
+
+    c->cd(2);
+    ((TH2*)&fHist)->ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt);
+
+    c->cd(3);
+    ((TH2*)&fHist)->DrawCopy(opt);
+
+    c->Modified();
+    c->Update();
+
+    return c;
+}
+
+void MHTimeDiffTime::Draw(Option_t *opt)
+{
+    if (!gPad)
+        MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
+
+    gPad->Divide(2,2);
+
+    gPad->cd(1);
+    fHist.ProjectionX("ProX", -1, 9999, "E")->DrawCopy(opt);
+    gPad->SetLogy();
+
+    gPad->cd(2);
+    fHist.ProjectionY("ProY", -1, 9999, "E")->DrawCopy(opt);
+
+    gPad->cd(3);
+    fHist.DrawCopy(opt);
+
+    gPad->Modified();
+    gPad->Update();
+}
+
+Bool_t MHTimeDiffTime::Fill(const MParContainer *par)
+{
+    const Int_t time = fTime->GetTimeLo();
+
+    fHist.Fill(0.0001*(time-fLastTime), 0.0001*time);
+
+    fLastTime = time;
+
+    return kTRUE;
+}
+
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h	(revision 1211)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h	(revision 1211)
@@ -0,0 +1,39 @@
+#ifndef MARS_MHTimeDiffTime
+#define MARS_MHTimeDiffTime
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+#ifndef ROOT_TH2
+#include "TH2.h"
+#endif
+
+class MTime;
+
+class MParList;
+
+class MHTimeDiffTime : public MH
+{
+private:
+    MTime *fTime;   //!
+    Int_t  fLastTime;
+
+    TH2D   fHist;
+
+public:
+    MHTimeDiffTime(const char *name=NULL, const char *title=NULL);
+
+    virtual Bool_t SetupFill(const MParList *pList);
+    virtual Bool_t Fill(const MParContainer *par);
+
+    const TH2D *GetHist() { return &fHist; }
+    const TH2D *GetHist() const { return &fHist; }
+
+    void Draw(Option_t *option="");
+    TObject *DrawClone(Option_t *option="") const;
+
+    ClassDef(MHTimeDiffTime, 1) //Histogram to store a 3-Dim histogram in alpha, Energy and time
+};
+
+#endif
+
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 1210)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 1211)
@@ -22,5 +22,5 @@
 #  connect the include files defined in the config.mk file
 #
-INCLUDES = -I. -I../mbase -I../mraw -I../manalysis
+INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc
 
 #------------------------------------------------------------------------------
@@ -36,5 +36,13 @@
            MHHillasSrc.cc \
            MHStarMap.cc \
+           MHEnergyTime.cc \
+           MHEnergyTheta.cc \
            MHMcCollectionArea.cc \
+           MHAlphaEnergyTime.cc \
+           MHAlphaEnergyTheta.cc \
+           MHEffOnTimeTime.cc \
+           MHEffOnTimeTheta.cc \
+           MHTimeDiffTime.cc \
+           MHTimeDiffTheta.cc \
            MHMcEnergy.cc \
 	   MHMcRate.cc
