Index: trunk/Mars/mfileio/MWriteFitsFile.cc
===================================================================
--- trunk/Mars/mfileio/MWriteFitsFile.cc	(revision 18276)
+++ trunk/Mars/mfileio/MWriteFitsFile.cc	(revision 18280)
@@ -519,7 +519,8 @@
 
          // initialize all columns of the sub-table, defined by the current container
+         TString containerName = i_subTable->second.GetContainer()->GetName();
          TClass * cl = i_subTable->second.GetContainer()->IsA();
-         if (!InitColumns(i_table->first, TString(cl->GetName()) + ".",  fitsTable, 
-                          i_subTable->second.GetContainer(), cl)     ) 
+         if (!InitColumns(i_table->first, containerName + ".",  fitsTable,
+                          i_subTable->second.GetContainer(), cl)     )
             return kFALSE;
 
Index: trunk/Mars/mjobs/MJSimulation.cc
===================================================================
--- trunk/Mars/mjobs/MJSimulation.cc	(revision 18276)
+++ trunk/Mars/mjobs/MJSimulation.cc	(revision 18280)
@@ -247,4 +247,5 @@
     write.AddContainer("IncidentAngle",       "Events", kFALSE);
     write.AddContainer("MPointingPos",        "Events", kFALSE);
+    write.AddContainer("MSimSourcePos",       "Events", kFALSE);
 }
 
@@ -658,5 +659,4 @@
     write3af.AddContainer("MRawEvtData",      "Events");
     write3af.AddContainer("MTruePhotonsPerPixelCont", "Events");
-    write3af.AddContainer("MPhotonEvent","Events");
 
     write3ar.AddContainer("ElectronicNoise",  "RunHeaders", kTRUE, 1);
Index: trunk/Mars/msim/MSimPointingPos.cc
===================================================================
--- trunk/Mars/msim/MSimPointingPos.cc	(revision 18276)
+++ trunk/Mars/msim/MSimPointingPos.cc	(revision 18280)
@@ -39,5 +39,5 @@
 //
 // If no view cone option was given and off-target observations are switched
-// on by setting fOffTargetDistance!=0 the poitnting position is calculated:
+// on by setting fOffTargetDistance!=0 the pointing position is calculated:
 //
 //  1) fOffTargetDistance < 0:
@@ -51,4 +51,18 @@
 //     fOffTargetDistance. (phi==0 is the direction of positive theta)
 //
+// The original zenith and azimuth coordinates of the shower axis are stored in
+// the MSimSourcePos container.
+//
+// If the view cone option was given and off-target observations are switched on
+// the orientation is fixed to the main direction around the view cone was
+// produced.
+// In addition a 'quasi'-simulated source position is calculated,
+// depending on fOffTargetDistance and fOffTargetPhi (see 1) and 2) above).
+// The corresponding zenith and azimuth coordinates are stored in the
+// MSimSourcePos container. This is of course not a physical source position,
+// but it can be used to determine the performance of wobble analysis on
+// background events (which are homogenous distributed).
+//
+//
 //
 //  Input Containers:
@@ -58,4 +72,5 @@
 //  Output Containers:
 //   MPointingPos
+//   MSimSourcePos
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -84,5 +99,5 @@
 //
 MSimPointingPos::MSimPointingPos(const char* name, const char *title)
-    : fRunHeader(0), fEvtHeader(0), fPointing(0),
+    : fRunHeader(0), fEvtHeader(0), fPointing(0), fSimSourcePosition(0),
     fOffTargetDistance(0), fOffTargetPhi(-1)
 
@@ -140,4 +155,8 @@
     fPointing = (MPointingPos*)pList->FindCreateObj("MPointingPos");
     if (!fPointing)
+        return kFALSE;
+
+    fSimSourcePosition = (MPointingPos*)pList->FindCreateObj("MPointingPos","MSimSourcePos");
+    if (!fSimSourcePosition)
         return kFALSE;
 
@@ -180,6 +199,6 @@
     {
         *fLog << warn;
-        *fLog << "WARNING - Combining the view cone option with off-target observations doesn't make sense." << endl;
-        *fLog << "          Option for off-target observations will be ignored." << endl;
+        *fLog << "WARNING - Combining the view cone option with off-target pointing can lead to not homogenous events." << endl;
+        *fLog << "          A simulated source position according to the off-target parameters will be created instead." << endl;
     }
     // FIXME: Check also the enlightened region on the ground!
@@ -209,35 +228,41 @@
 
     // Local sky coordinates (direction of telescope axis)
-    Double_t zd = viewcone ? fRunHeader->GetZdMin() : fEvtHeader->GetZd()*TMath::RadToDeg();  // x==north
-    Double_t az = viewcone ? fRunHeader->GetAzMin() : fEvtHeader->GetAz()*TMath::RadToDeg();  // y==west
-
-    if (!viewcone)
-    {
-        Double_t dtheta, dphi;
-        GetDelta(dtheta, dphi);
-
-        const Double_t theta = zd*TMath::DegToRad();
-        const Double_t phi   = az*TMath::DegToRad();
-
-        TVector3 src, pnt;
-        src.SetMagThetaPhi(1, theta,        phi);
-        pnt.SetMagThetaPhi(1, theta+dtheta, phi);
-
-        pnt.Rotate(dphi, src);
-
-        zd = pnt.Theta()*TMath::RadToDeg();
-        az = pnt.Phi()  *TMath::RadToDeg();
-    }
+    Double_t zdCorsika = viewcone ? fRunHeader->GetZdMin() : fEvtHeader->GetZd()*TMath::RadToDeg();  // x==north
+    Double_t azCorsika = viewcone ? fRunHeader->GetAzMin() : fEvtHeader->GetAz()*TMath::RadToDeg();  // y==west
+
+    // Calculate off target position in local sky coordinates
+    Double_t dtheta, dphi;
+    GetDelta(dtheta, dphi);
+
+    const Double_t theta = zdCorsika*TMath::DegToRad();
+    const Double_t phi   = azCorsika*TMath::DegToRad();
+
+    TVector3 originalVector, wobbleVector;
+    originalVector.SetMagThetaPhi(1, theta,        phi);
+    wobbleVector.SetMagThetaPhi(1, theta+dtheta, phi);
+
+    wobbleVector.Rotate(dphi, originalVector);
+
+    Double_t zdWobble, azWobble;
+    zdWobble = wobbleVector.Theta()*TMath::RadToDeg();
+    azWobble = wobbleVector.Phi()  *TMath::RadToDeg();
 
     // Transform the corsika coordinate system (north is magnetic north)
     // into the telescopes local coordinate system. Note, that all vectors
     // are already correctly oriented.
-    az += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg();
-
-    // Setup the pointing position
-    fPointing->SetLocalPosition(zd, az);
-
-    // Calculate incident angle between magnetic field direction
-    // and pointing direction ( phi and theta? )
+    azCorsika += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg();
+    azWobble += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg();
+
+    // Setup the pointing and the simulated source position
+    if (!viewcone)
+    {
+        fPointing->SetLocalPosition(zdWobble, azWobble);
+        fSimSourcePosition->SetLocalPosition(zdCorsika, azCorsika);
+    }
+    else
+    {
+        fPointing->SetLocalPosition(zdCorsika, azCorsika);
+        fSimSourcePosition->SetLocalPosition(zdWobble, azWobble);
+    }
 
     return kTRUE;
Index: trunk/Mars/msim/MSimPointingPos.h
===================================================================
--- trunk/Mars/msim/MSimPointingPos.h	(revision 18276)
+++ trunk/Mars/msim/MSimPointingPos.h	(revision 18280)
@@ -16,5 +16,6 @@
     MCorsikaRunHeader *fRunHeader;  //! Header storing event information
     MCorsikaEvtHeader *fEvtHeader;  //! Header storing event information
-    MPointingPos      *fPointing;   //! Output storing telescope poiting position in local (telescope) coordinate system
+    MPointingPos      *fPointing;   //! Output storing telescope pointing position in local (telescope) coordinate system
+    MPointingPos      *fSimSourcePosition;   //! Output storing simulated source pointing position in local (telescope) coordinate system
 
     Double_t fOffTargetDistance;    // [rad] Distance of the observed off-target position from the source
