Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1949)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1950)
@@ -1,3 +1,12 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/04/12: Wolfgang Wittek
+
+   * manalysis/MCT1PointingCorrCalc.[h,cc]
+     - replaces MPointingCorr.[h,cc]
+
+   * manalysis/AnalysisLinkDef.h
+               Makefile
+
 
  2003/04/12: Wolfgang Wittek
Index: /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1949)
+++ /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1950)
@@ -46,5 +46,5 @@
 #pragma link C++ class MPadSchweizer+;
 
-#pragma link C++ class MPointingCorr+;
+#pragma link C++ class MCT1PointingCorrCalc+;
 
 #pragma link C++ class MParameterI+;
@@ -63,2 +63,8 @@
 
 
+
+
+
+
+
+
Index: /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 1950)
+++ /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 1950)
@@ -0,0 +1,151 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Wolfgang Wittek  03/2003 <mailto:wittek@mppmu.mpg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  MCT1PointingCorrCalc                                                   //
+//                                                                         //
+//  This is a task to do the CT1 pointing correction                       //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MCT1PointingCorrCalc.h"
+
+#include "MParList.h"
+
+#include "MMcEvt.hxx"
+#include "MSrcPosCam.h"
+#include "MGeomCam.h"
+#include "MParameters.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MCT1PointingCorrCalc);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MCT1PointingCorrCalc::MCT1PointingCorrCalc(const char *name, const char *title,
+                             const char *srcname)
+{
+    fName  = name  ? name  : "MCT1PointingCorrCalc";
+    fTitle = title ? title : "Task to do the CT1 pointing correction";
+
+    fSrcName = srcname;
+}
+
+// --------------------------------------------------------------------------
+//
+// 
+// 
+// 
+//
+Bool_t MCT1PointingCorrCalc::PreProcess(MParList *pList)
+{
+    MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!geom)
+        *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl;
+    else
+    {
+        fMm2Deg = geom->GetConvMm2Deg();
+    }
+
+
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+    if (!fMcEvt)
+    {
+        *fLog << dbginf << "MMcEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
+    if (!fHourAngle)
+    {
+        *fLog << dbginf << "HourAngle not found... aborting." << endl;
+        return kFALSE;
+    }
+
+
+    fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
+    if (!fSrcPos)
+    {
+        *fLog << err << dbginf << fSrcName << " [MSrcPosCam] not found... aborting." << endl;
+        return kFALSE;
+    }
+
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Do the pointing correction
+//
+// the parametrization is for Mkn421 2001 data (Daniel Kranich)
+// 
+Bool_t MCT1PointingCorrCalc::Process()
+{
+   // fhourangle is the hour angle [degrees]
+   // (cx, cy) is the source position in the camera [mm]
+   //
+   Float_t fhourangle = fHourAngle->GetVal();
+
+   //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = " 
+   //      << fhourangle << endl;
+
+   Float_t cx = -0.05132 - 0.001064 * fhourangle 
+                         - 3.530e-6 * fhourangle * fhourangle;
+   cx /= fMm2Deg;
+
+   Float_t cy = -0.04883 - 0.0003175* fhourangle
+                         - 2.165e-5 * fhourangle * fhourangle;
+   cy /= fMm2Deg;
+
+   fSrcPos->SetXY(cx, cy);
+
+   //*fLog << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
+   //      << fhourangle << ",  " << cx << ",  " << cy << ",  " 
+   //      << fMm2Deg << endl;
+
+   fSrcPos->SetReadyToSave();
+
+   return kTRUE;
+}
+// --------------------------------------------------------------------------
+//
+//  
+//
+Bool_t MCT1PointingCorrCalc::PostProcess()
+{
+    return kTRUE;
+}
+//============================================================================
+
+
+
+
+
+
Index: /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h	(revision 1950)
+++ /trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h	(revision 1950)
@@ -0,0 +1,53 @@
+#ifndef MARS_MCT1PointingCorrCalc
+#define MARS_MCT1PointingCorrCalc
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MCT1PointingCorrCalc                                                    //
+//                                                                         //
+// Task to do the pointing correction                                      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MMcEvt;
+class MSrcPosCam;
+class MParameterD;
+
+
+class MCT1PointingCorrCalc : public MTask
+{
+private:
+    MMcEvt       *fMcEvt;       
+    MSrcPosCam   *fSrcPos;
+    TString       fSrcName;
+    MParameterD  *fHourAngle;
+
+    Float_t      fMm2Deg;
+
+public:
+    MCT1PointingCorrCalc(const char *name=NULL, const char *title=NULL,
+                         const char *srcname="MSrcPosCam");
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MCT1PointingCorrCalc, 1)   // Task to do the CT1 pointing correction for Mkn421 2001 data
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
Index: /trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1949)
+++ /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1950)
@@ -58,5 +58,7 @@
 	   MPadding.cc \
 	   MPadSchweizer.cc \
-	   MPointingCorr.cc \
+	   MCT1PointingCorrCalc.cc \
+	   MNewImagePar.cc \
+	   MNewImageParCalc.cc \
            MParameters.cc \
 	   MMcTriggerLvl2.cc \
