Index: trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc	(revision 9595)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.cc	(revision 9613)
@@ -106,5 +106,5 @@
 MSrcPosCalc::MSrcPosCalc(const char *name, const char *title)
     : fObservatory(NULL), fPointPos(NULL), fDeviation(NULL), fMcEvt(NULL),
-    fMcHeader(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL),
+    fMcHeader(NULL), fMcCorsika(NULL), fGeom(NULL), fTime(NULL), fCallback(NULL),
     fSourcePos(NULL), fSrcPosCam(NULL), fSrcPosAnti(NULL), fMode(kDefault),
     fNumRandomOffPositions(0)
@@ -342,9 +342,10 @@
     }
 
+    fMcCorsika = 0;
     if (fMcHeader->IsCeres())
         return kTRUE;
 
-    const MMcCorsikaRunHeader *h = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
-    if (!h)
+    fMcCorsika = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
+    if (!fMcCorsika)
     {
         *fLog << err << "MMcCorsikaRunHeader not found... aborting." << endl;
@@ -358,7 +359,7 @@
     // Determine Monte Carlo position from Monte Carlo header
     TVector2 v(0, 0);
-    if (h->GetWobbleMode()>0.5)
+    if (fMcCorsika->GetWobbleMode()>0.5)
         v.Set(120.*fGeom->GetConvMm2Deg(), 0.);
-    if (h->GetWobbleMode()<-0.5)
+    if (fMcCorsika->GetWobbleMode()<-0.5)
         v.Set(-120.*fGeom->GetConvMm2Deg(), 0.);
 
@@ -409,4 +410,12 @@
         }
 
+        // If this is ceres data and we have a view cone keep
+        // the source position fixed to the center of the camera
+        if (fMcCorsika && fMcCorsika->HasViewCone())
+        {
+            SetSrcPos();
+            return kTRUE;
+        }
+
         // If the reflector version was new enough calculate the
         // source position from shower and telescope orientation
@@ -414,7 +423,13 @@
         MVector3 pos0, pos;
         pos0.SetZdAz(fPointPos->GetZdRad(), fPointPos->GetAzRad());
-        pos.SetZdAz(fMcEvt->GetTheta(), fMcEvt->GetPhi());
+        pos.SetZdAz(fMcEvt->GetParticleTheta(), fMcEvt->GetParticlePhi());
 
         CalcResult(pos0, pos);
+
+        // If it was not ceres due to a bug in the MAGIC MCs
+        // we have to fix the sign of X
+        if (!fMcHeader->IsCeres())
+            SetSrcPos(TVector2(-fSrcPosCam->GetX(), fSrcPosCam->GetY()));
+
         return kTRUE;
     }
Index: trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h	(revision 9595)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosCalc.h	(revision 9613)
@@ -20,4 +20,5 @@
 class MMcEvt;
 class MMcRunHeader;
+class MMcCorsikaRunHeader;
 
 class MSrcPosCalc : public MTask
@@ -35,12 +36,13 @@
     };
 
-    const MObservatory *fObservatory;   //! Observatory location
-    const MPointingPos *fPointPos;      //! Present pointing position of the telescope in Zd/Az
-    const MPointingDev *fDeviation;     //! Deviation calculated from starguider data
-    const MMcEvt       *fMcEvt;         //! Possible input of shower position from MC
-    const MMcRunHeader *fMcHeader;      //! Monte Carlo run header needed for correct wobble position
-    const MGeomCam     *fGeom;          //! Camera geomety
-    const MTime        *fTime;          //! Time of the current event
-    const MTaskList    *fCallback;      //! Callback function to get the number of the cycle
+    const MObservatory        *fObservatory;   //! Observatory location
+    const MPointingPos        *fPointPos;      //! Present pointing position of the telescope in Zd/Az
+    const MPointingDev        *fDeviation;     //! Deviation calculated from starguider data
+    const MMcEvt              *fMcEvt;         //! Possible input of shower position from MC
+    const MMcRunHeader        *fMcHeader;      //! Monte Carlo run header needed for correct wobble position
+    const MMcCorsikaRunHeader *fMcCorsika;     //! Monte Carlo run header needed to determine view cone option
+    const MGeomCam            *fGeom;          //! Camera geomety
+    const MTime               *fTime;          //! Time of the current event
+    const MTaskList           *fCallback;      //! Callback function to get the number of the cycle
     MPointingPos *fSourcePos;     //! Source Postion in sky coordinates
     MSrcPosCam   *fSrcPosCam;     //! Output: Source position in the camera
