Index: trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.cc	(revision 7560)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.cc	(revision 7560)
@@ -0,0 +1,85 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Thomas Bretz, 3/2006 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2006
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MSrcPosRndm
+//
+// Input Container:
+//   MHSrcPosCam
+//
+// Output Container:
+//   MSrcPosCam
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MSrcPosRndm.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+#include "MSrcPosCam.h"
+#include "MHSrcPosCam.h"
+
+ClassImp(MSrcPosRndm);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+//  Search for 'MPointingPos'. Create if not found.
+//
+Int_t MSrcPosRndm::PreProcess(MParList *plist)
+{
+    fSrcPos = (MSrcPosCam*)plist->FindCreateObj("MSrcPosCam");
+    if (!fSrcPos)
+        return kFALSE;
+
+    fHist = (MHSrcPosCam*)plist->FindObject("MHSrcPosCam");
+    if (!fHist)
+    {
+        *fLog << inf << "MHSrcPosCam not found... skipping." << endl;
+        return kSKIP;
+    }
+
+    *fLog << inf << "MHSrcPosCam found... taken to produce a random distribution." << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  See class description.
+//
+Int_t MSrcPosRndm::Process()
+{
+    Axis_t x, y;
+
+    fHist->GetHist().GetRandom2(x, y);
+
+    fSrcPos->SetXY(x, y);
+
+    return kTRUE;
+}
Index: trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.h	(revision 7560)
+++ trunk/MagicSoft/Mars/mpointing/MSrcPosRndm.h	(revision 7560)
@@ -0,0 +1,30 @@
+#ifndef MARS_MSrcPosRndm
+#define MARS_MSrcPosRndm
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+
+class MSrcPosCam;
+class MHSrcPosCam;
+
+class MSrcPosRndm : public MTask
+{
+private:
+    MSrcPosCam   *fSrcPos; //!
+    MHSrcPosCam  *fHist;   //!
+
+    Int_t  PreProcess(MParList *plist);
+    Int_t  Process();
+
+public:
+    MSrcPosRndm() : fSrcPos(0), fHist(0)
+    {
+        fName  = "MSrcPosRndm";
+        fTitle = "Overwrite the source position with a random one from MHSrcPosCam";
+    }
+
+    ClassDef(MSrcPosRndm, 0) //Overwrite the source position with a random one from MHSrcPosCam
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mpointing/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mpointing/Makefile	(revision 7558)
+++ trunk/MagicSoft/Mars/mpointing/Makefile	(revision 7560)
@@ -32,4 +32,5 @@
            MSrcPosCam.cc \
            MSrcPosCalc.cc \
+           MSrcPosRndm.cc \
            MSrcPosCorrect.cc \
            MSrcPosFromModel.cc
Index: trunk/MagicSoft/Mars/mpointing/PointingLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mpointing/PointingLinkDef.h	(revision 7558)
+++ trunk/MagicSoft/Mars/mpointing/PointingLinkDef.h	(revision 7560)
@@ -19,4 +19,5 @@
 #pragma link C++ class MSrcPosCam+;
 #pragma link C++ class MSrcPosCalc+;
+#pragma link C++ class MSrcPosRndm+;
 #pragma link C++ class MSrcPosCorrect+;
 #pragma link C++ class MSrcPosFromModel+;
