Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3891)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3892)
@@ -18,4 +18,13 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/04/29: Nadia Tonello
+
+   * mbadpixels/MBadPixelsTreat.h
+     - changed enums {.. BIT(1), ... BIT(2), ... BIT(3) } in {1,2,3}
+       to have the right behaviour of the flags (and of SetProcessRMS)
+
+   * manalysis/MCT1PointingCorrCalc.[h,cc]
+     - added pointing correction for 1ES1959
+
  2004/04/29: Markus Gaug
 
Index: trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 3891)
+++ trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.cc	(revision 3892)
@@ -17,5 +17,5 @@
 !
 !   Author(s): Wolfgang Wittek  03/2003 <mailto:wittek@mppmu.mpg.de>
-!
+!              Nadia Tonello    05/2003 <mailto:tonello@mppmu.mpg.de>
 !   Copyright: MAGIC Software Development, 2000-2003
 !
@@ -27,6 +27,15 @@
 //  MCT1PointingCorrCalc                                                   //
 //                                                                         //
-//  This is a task to do the CT1 pointing correction                       //
-//                                                                         //
+//  This is a task to do the CT1 pointing correction.                      // 
+//                                                                         //
+//  NT: You can correct the Mkn421 data (default setting), or the 1ES1959  //
+//      data.                                                              // 
+//      To change to the correction needed for 1ES1959,  you have to call  //
+//      the member funcion: SetPointedSource                               //
+//                                                                         //
+//  Example:                                                               //
+//      MCT1PointingCorrCalc correct;                                      //
+//      correct.SetPointedSource(MCT1PointingCorrectionCalc::K1959)        //
+//                                                                         // 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -45,5 +54,4 @@
 
 using namespace std;
-
 // --------------------------------------------------------------------------
 //
@@ -52,5 +60,5 @@
 MCT1PointingCorrCalc::MCT1PointingCorrCalc(const char *srcname,
                                            const char *name, const char *title)
-    : fSrcName(srcname)
+  : fSrcName(srcname), fPoiSource(k421)
 {
     fName  = name  ? name  : "MCT1PointingCorrCalc";
@@ -70,5 +78,5 @@
     }
 
-    fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
+   fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
     if (!fHourAngle)
     {
@@ -89,10 +97,67 @@
 }
 
+
+// --------------------------------------------------------------------------
+//
+//Implemented Daniel Kranich's pointing correction for Mkn421 (2001 data)
+//
+
+void MCT1PointingCorrCalc::PointCorr421()
+{
+   //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = " 
+   //      << fhourangle << endl;
+
+   Float_t fhourangle = fHourAngle->GetVal();
+
+   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;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// NT :Implemente Daniel Kranich's pointing correction for 1ES1959 (2002 data)
+
+void MCT1PointingCorrCalc::PointCorr1959()
+{
+   //*fLog << "MCT1PointingCorrCalc::Process; fhourangle = " 
+   //      << fhourangle << endl;
+
+   Float_t fhourangle = fHourAngle->GetVal();
+
+   Float_t cx = -0.086 - 0.00091 * fhourangle ;
+   cx /= fMm2Deg;
+
+   Float_t cy = -0.083 - 0.001 * fhourangle ;
+   cy /= fMm2Deg;
+
+   fSrcPos->SetXY(cx, cy);
+
+   //*fLog << "MCT1PointingCorrCal::Process; fhourangle, cx, cy, fMm2Deg = "
+   //      << fhourangle << ",  " << cx << ",  " << cy << ",  " 
+   //      << fMm2Deg << endl;
+
+   fSrcPos->SetReadyToSave();
+   return;
+
+}
 // --------------------------------------------------------------------------
 //
 // Do the pointing correction
 //
-// the parametrization is for Mkn421 2001 data (Daniel Kranich)
-// 
 Int_t MCT1PointingCorrCalc::Process()
 {
@@ -100,25 +165,11 @@
    // (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();
-
+   switch (fPoiSource)
+    {
+    case k421:
+        PointCorr421();
+    case k1959:
+        PointCorr1959();
+    }  
    return kTRUE;
 }
@@ -126,2 +177,42 @@
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h	(revision 3891)
+++ trunk/MagicSoft/Mars/manalysis/MCT1PointingCorrCalc.h	(revision 3892)
@@ -20,4 +20,10 @@
 class MCT1PointingCorrCalc : public MTask
 {
+public:
+    typedef enum {
+        k421,
+        k1959
+    } PointedSource_t;
+
 private:
 
@@ -26,7 +32,12 @@
     MParameterD  *fHourAngle;
 
+    PointedSource_t fPoiSource;
     Float_t       fMm2Deg;
 
+    void PointCorr421();
+    void PointCorr1959();
+
 public:
+
     MCT1PointingCorrCalc(const char *srcname="MSrcPosCam",
                          const char *name=NULL, const char *title=NULL);
@@ -35,5 +46,7 @@
     Int_t Process();
 
-    ClassDef(MCT1PointingCorrCalc, 0)   // Task to do the CT1 pointing correction for Mkn421 2001 data
+    void SetPointedSource(PointedSource_t s) { fPoiSource = s; }
+ 
+    ClassDef(MCT1PointingCorrCalc, 0)   // Task to do the CT1 pointing correction for Mkn421 2001 data or 1ES1959 2002 data
 };
 
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 3891)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h	(revision 3892)
@@ -24,7 +24,7 @@
     enum
     {
-        kUseInterpolation = BIT(1),
-        kUseCentralPixel  = BIT(2),
-        kProcessRMS       = BIT(3)
+        kUseInterpolation = 1,
+        kUseCentralPixel  = 2,
+        kProcessRMS       = 3
     };
 
@@ -34,5 +34,4 @@
     void InterpolatePedestals() const;
 
-    //void  Interpolate() const;
     void   Unmap() const;
     void   StreamPrimitive(ofstream &out) const;
