Index: /trunk/MagicSoft/Cosy/main/MMoonPointing.cc
===================================================================
--- /trunk/MagicSoft/Cosy/main/MMoonPointing.cc	(revision 9556)
+++ /trunk/MagicSoft/Cosy/main/MMoonPointing.cc	(revision 9557)
@@ -19,6 +19,6 @@
 public:
     MPositionOffsetCalc(Double_t offset) :
-        fCosOffset(offset<=0?0:TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset<=0?0:TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
         fCosAngle(0), fSinAngle(0)
     {
@@ -26,6 +26,6 @@
 
     MPositionOffsetCalc(Double_t offset, Double_t angle) :
-        fCosOffset(offset<=0?0:TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset<=0?0:TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
         fCosAngle(TMath::Cos(angle*TMath::DegToRad())),
         fSinAngle(TMath::Sin(angle*TMath::DegToRad()))
@@ -34,6 +34,6 @@
 
     MPositionOffsetCalc(Double_t offset, Double_t cos, Double_t sin) :
-        fCosOffset(offset<=0?0:TMath::Cos(offset*TMath::DegToRad())),
-        fSinOffset(offset<=0?0:TMath::Sin(offset*TMath::DegToRad())),
+        fCosOffset(offset==0 ? 0 : TMath::Cos(offset*TMath::DegToRad())),
+        fSinOffset(offset==0 ? 0 : TMath::Sin(offset*TMath::DegToRad())),
         fCosAngle(cos), fSinAngle(sin)
     {
@@ -45,10 +45,12 @@
     ZdAz Calc(const ZdAz &pos, Double_t *sn=0, Double_t *cs=0) const
     {
+        // This is to avoid unnecessary calculations
+        // in case the offset is zero
         if (fCosOffset==0 && fSinOffset==0)
         {
             if (sn)
-                *sn = fSinAngle;
+                *sn = -fCosAngle;
             if (cs)
-                *cs = fCosAngle;
+                *cs =  fSinAngle;
             return pos;
         }
@@ -119,11 +121,4 @@
 Bool_t MMoonPointing::CalcPosition(const ZdAz &moon, ZdAz &srcpos, ZdAz &pointpos) const
 {
-    // Avoid unnecessary calculations
-    if (fOffsetShadow==0)
-    {
-        pointpos = srcpos = moon;
-        return kTRUE;
-    }
-
     const Double_t fcos = const_cast<TGraph2D&>(fCos).Interpolate(moon.Az(), moon.Zd());
     const Double_t fsin = const_cast<TGraph2D&>(fSin).Interpolate(moon.Az(), moon.Zd());
@@ -134,19 +129,13 @@
         return kFALSE;
 
-    // Calculate Moon Shadow Position and apply a small numerical improvement
+    // Apply a small numerical improvement
     Double_t sn=fsin/norm;
     Double_t cs=fcos/norm;
 
+    // Calculate moon shadow position
     const MPositionOffsetCalc calc1(fOffsetShadow, fcos, fsin);
     srcpos = calc1.Calc(moon, &sn, &cs);
     if (srcpos.Zd()==0)
         return kFALSE;
-
-    // Avoid unnecessary calculations
-    if (fOffsetWobble==0)
-    {
-        pointpos = srcpos;
-        return kTRUE;
-    }
 
     // Calaculate Telescope pointing position:
