Index: /trunk/MagicSoft/Mars/macros/derotatedc.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/derotatedc.C	(revision 3785)
+++ /trunk/MagicSoft/Mars/macros/derotatedc.C	(revision 3785)
@@ -0,0 +1,94 @@
+/* ======================================================================== *\
+!
+! *
+! * 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, 4/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2004
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  derotate.C - STandard Analysis and Reconstruction (MC example)
+//
+//  Derotate a MCamEvent and fill a histogram with derotated data
+//  (sky-plot)
+//
+/////////////////////////////////////////////////////////////////////////////
+
+void derotatedc()
+{
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    // Define Observatory location (for derotation)
+    MObservatory obs;
+    plist.AddToList(&obs);
+
+    // Set the camera geometry (for histogram size)
+    MGeomCamMagic cam;
+    plist.AddToList(&cam);
+
+    // setup pointing position
+    MPointingPos ppos;
+    ppos.SetSkyPosition(MAstro::Hms2Hor(5, 34, 31.9), MAstro::Dms2Deg(22, 0, 52.0));
+    plist.AddToList(&ppos);
+
+    // Define which file to read
+    MReadTree read("Currents", "../dc.root");
+    read.DisableAutoScheme();
+
+    // Derotated histogram to fill
+    MHCamEventRot hist;
+
+    // Set name of time container corresponding to your data
+    hist.SetNameTime("MTimeCurrents");
+
+    // Setup fill task
+    MFillH fill(&hist, "MCameraDC");
+
+    // Set a draw option for your 2D histogram
+    //fill.SetDrawOption("colz");
+
+    // Setup tasklist
+    tlist.AddToList(&read);
+    tlist.AddToList(&fill);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    MStatusDisplay *d = new MStatusDisplay;
+    evtloop.SetDisplay(d);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    tlist.PrintStatistics();
+}
Index: /trunk/MagicSoft/Mars/mhist/MHCamEventRot.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamEventRot.cc	(revision 3784)
+++ /trunk/MagicSoft/Mars/mhist/MHCamEventRot.cc	(revision 3785)
@@ -67,5 +67,5 @@
 //
 MHCamEventRot::MHCamEventRot(const char *name, const char *title)
-    : fTime(0), fPointPos(0), fObservatory(0), fType(0)
+    : fTime(0), fPointPos(0), fObservatory(0), fType(0), fNameTime("MTime")
 {
     //
@@ -100,14 +100,11 @@
     }
 
-    MBinning binsa;
-    binsa.SetEdges(18, 0, 90);
-
     const MBinning *bins = (MBinning*)plist->FindObject("BinningCamEvent");
     if (!bins)
     {
-        const Float_t r = (fGeom ? fGeom->GetMaxRadius()/3 : 200)*fGeom->GetConvMm2Deg();
+        const Float_t r = fGeom->GetMaxRadius()*fGeom->GetConvMm2Deg();
 
         MBinning b;
-        b.SetEdges(20, -r, r);
+        b.SetEdges(41, -r, r);
         SetBinning(&fHist, &b, &b);
     }
@@ -119,5 +116,5 @@
         *fLog << warn << "MPointingPos not found... no derotation." << endl;
 
-    fTime = (MTime*)plist->FindObject(AddSerialNumber("MTime"));
+    fTime = (MTime*)plist->FindObject(AddSerialNumber(fNameTime));
     if (!fTime)
         *fLog << warn << "MTime not found... no derotation." << endl;
@@ -130,6 +127,9 @@
     // for the current pointing position and add a offset in the
     // Fill function!
-    fRa  = fPointPos->GetRa();
-    fDec = fPointPos->GetDec();
+    if (fPointPos)
+    {
+        fRa  = fPointPos->GetRa();
+        fDec = fPointPos->GetDec();
+    }
 
     return kTRUE;
Index: /trunk/MagicSoft/Mars/mhist/MHCamEventRot.h
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamEventRot.h	(revision 3784)
+++ /trunk/MagicSoft/Mars/mhist/MHCamEventRot.h	(revision 3785)
@@ -33,4 +33,5 @@
     Double_t fDec;
 
+    TString fNameTime;
     //Int_t DistancetoPrimitive(Int_t px, Int_t py);
     //void Modified();
@@ -48,4 +49,6 @@
 
     TH1 *GetHistByName(const TString name) { return &fHist; }
+
+    void SetNameTime(const char *name) { fNameTime=name; }
 
     //void FitSignificance(Float_t sigint=15, Float_t sigmax=70, Float_t bgmin=40, Float_t bgmax=70, Byte_t polynom=1); //*MENU*
