Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.cc	(revision 7135)
+++ 	(revision )
@@ -1,217 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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): Javier Rico     05/2004 <mailto:jrico@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// MDisplayHillas
-//
-// Display the camera event of type MCerPhotEvt plus the computed hillas
-// parameters.
-//
-// Input containers (in constructor):
-//  MCerPhotEvt
-//  MGeomCam
-//
-// Input containers
-//  MHillas
-//  [MSrcPosCam]
-//  [MIslands]
-//
-// Output containers
-//  [...]
-//
-//////////////////////////////////////////////////////////////////////////////
-#include <fstream>
-#include <math.h>
-
-#include "TVirtualPad.h"
-#include "TLine.h"
-#include "TEllipse.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MParList.h"
-#include "MHillasDisplay.h"
-#include "MCerPhotEvt.h"
-#include "MGeomCam.h"
-#include "MHillas.h"
-#include "MHillasSrc.h"
-#include "MNewImagePar.h"
-#include "MSrcPosCam.h"
-#include "MIslands.h"
-
-ClassImp(MHillasDisplay);
-
-using namespace std;
-
-static const TString gsDefName  = "MHillasDisplay";
-static const TString gsDefTitle = "Hillas Camera display task";
-
-// -------------------------------------------------------------------------
-//
-// Constructor (see MDisplay documentation for more information)
-//
-MHillasDisplay::MHillasDisplay(MCerPhotEvt* event, MGeomCam* geom, Int_t type, const char* name, const char* title) 
-  :  MDisplay(event,geom,type), fHillas(NULL), fHillasSrc(NULL), fNewImage(NULL), fSrcPos(NULL), fIslands(NULL)
-{
-  fName  = name  ? name  : gsDefName.Data();
-  fTitle = title ? title : gsDefTitle.Data();
-}
-// -------------------------------------------------------------------------
-//
-// Call for MHillas::PreProcess and look for MHillas and look for the
-// needed containers
-//
-Int_t MHillasDisplay::PreProcess(MParList* pList)
-{  
-  if(!MDisplay::PreProcess(pList))
-    return kFALSE;
-
-  // Look for the MHillas container  
-  if(!fHillas)
-    fHillas = (MHillas*)pList->FindObject(AddSerialNumber("MHillas"), "MHillas");
-  if(!fHillas)
-    *fLog << warn << "MHillasDisplay::PreProcess Warning: MHillas object not found" << endl;
-  else
-    {
-      gPad->cd(1);
-      Draw();
-    }
-
-  // Look for src dependent hillas parameters container
-  if(!fHillasSrc)
-    fHillasSrc = (MHillasSrc*)pList->FindObject(AddSerialNumber("MHillasSrc"), "MHillasSrc");
-
-
-  // Look for the MNewImagePar container  
-  if(!fNewImage)
-    fNewImage = (MNewImagePar*)pList->FindObject(AddSerialNumber("MNewImagePar"), "MNewImagePar");
-  if(!fNewImage)
-    *fLog << warn << "MHillasDisplay::PreProcess Warning: MNewImagePar object not found" << endl;
-
-  // Look for the MSrcPosCam container  
-  if(!fSrcPos)
-    fSrcPos = (MSrcPosCam*)pList->FindObject(AddSerialNumber("MSrcPosCam"), "MSrcPosCam");
-  if(!fSrcPos)
-    *fLog << warn << "MHillasDisplay::PreProcess Warning: MSrcPosCam object not found" << endl;
-
-  // Look for the MIslands container
-  if (strlen(fIslName) > 0)
-    fIslands = (MIslands*)pList->FindObject(AddSerialNumber(fIslName));
-  else
-    fIslands = (MIslands*)pList->FindObject(AddSerialNumber("MIslands"));
-  if (!fIslands)
-    *fLog << warn << "MHillasDisplay::PreProcess Warning: MIslands object not found" << endl;
-    
-  return kTRUE;
-
-}
-// -------------------------------------------------------------------------
-//
-// Display event AND hillas parameters
-//
-Int_t MHillasDisplay::Process()
-{
-   // draw the hillas parameters
-  if(GetPauseMode())
-    {
-      if(fHillas)
-	fHillas->Print();
-      if(fHillasSrc)
-	fHillasSrc->Print();
-      if(fNewImage)
-	fNewImage->Print();
-      if(fIslands)
-	fIslands->Print();
-    }      
-   
-  // draw the event
-  if(!MDisplay::Process())
-    return kFALSE;
-  return kTRUE;
-}
-// -------------------------------------------------------------------------
-//
-// Stuff to be painted when canvas will be updated
-//
-void MHillasDisplay::Paint(Option_t* option)
-{
-  const Float_t OffsetW=20.0;
-  const Float_t OffsetL=300.0;
-
-  Float_t meanX  = fHillas->GetMeanX();
-  Float_t meanY  = fHillas->GetMeanY();
-  Float_t length = fHillas->GetLength();
-  Float_t width  = fHillas->GetWidth();
-  Float_t delta  = fHillas->GetDelta();
-
-
-  if (length<=0 || width<=0)
-    return;
-  
-  // Length line
-  TLine lineL(-(length+OffsetL)*cos(delta) + meanX,
-              -(length+OffsetL)*sin(delta) + meanY,
-	      (length+OffsetL)*cos(delta)  + meanX,
-	      (length+OffsetL)*sin(delta)  + meanY);
-
-  lineL.SetLineWidth(1);
-  lineL.SetLineColor(2);
-  lineL.Paint();
-
-  // Width line
-  TLine lineW((width+OffsetW)*sin(delta)  + meanX,
-              -(width+OffsetW)*cos(delta) + meanY,
-	      -(width+OffsetW)*sin(delta) + meanX,
-	      (width+OffsetW)*cos(delta)  + meanY);
-
-  lineW.SetLineWidth(1);
-  lineW.SetLineColor(2);
-  lineW.Paint();
-
-  // Coordinate system
-  Float_t xSrc   = fSrcPos? fSrcPos->GetX() : 0.;
-  Float_t ySrc   = fSrcPos? fSrcPos->GetY() : 0.;
-  Float_t radius = GetGeomCam()->GetMaxRadius();
-  TLine lineX(-radius,ySrc,radius,ySrc);
-  TLine lineY(xSrc,-radius,xSrc,radius);
-  lineX.SetLineWidth(1);
-  lineX.SetLineColor(108);
-  lineY.SetLineWidth(1);
-  lineY.SetLineColor(108);
-  lineX.Paint();
-  lineY.Paint();
-  
-  // COG line
-  TLine lineMean(xSrc,ySrc,meanX,meanY);
-  lineMean.SetLineWidth(1);
-  lineMean.SetLineColor(2);
-  lineMean.Paint();
-  
-  // Hillas ellipse
-  TEllipse ellipse(meanX,meanY,length,width,0,360,delta*kRad2Deg+180);
-  ellipse.SetLineWidth(2);
-  ellipse.SetLineColor(2);
-  ellipse.Paint(); 
-}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MHillasDisplay.h	(revision 7135)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifndef MARS_MHillasDisplay
-#define MARS_MHillasDisplay
-
-#ifndef MARS_MDisplay
-#include "MDisplay.h"
-#endif
-
-class MCerPhotEvt;
-class MSrcPosCam;
-class MGeomCam;
-class MHillas;
-class MHillasSrc;
-class MIslands;
-class MNewImagePar;
-
-class MHillasDisplay : public MDisplay
-{
- private:
-  MHillas*      fHillas;    // pointer to container with the hillas parameters
-  MHillasSrc*   fHillasSrc; // pointer to container with source dependent hillas parameters
-  MNewImagePar* fNewImage;  // pointer to container with the new image parameters
-  MSrcPosCam*   fSrcPos;    // pointer to the source position in camera
-  MIslands*     fIslands;   // pointer to the islands
-
-  TString       fIslName;
-
-  virtual Int_t PreProcess(MParList *plist);
-  virtual Int_t Process();
-  
-
- public:
-  MHillasDisplay(MCerPhotEvt* event, MGeomCam* geom, Int_t type=0,
-		 const char* name=NULL, const char* title=NULL);
-
-  virtual ~MHillasDisplay(){};
-
-  void SetHillas(MHillas* hillas)    {fHillas=hillas;}
-  void SetSrcPos(MSrcPosCam* srcpos) {fSrcPos=srcpos;}
-  void SetIslands(MIslands* islands) {fIslands=islands;}
-  
-  void SetIslandsName(TString inname)    {fIslName = inname;}
-  
-  virtual void Paint(Option_t* option);
-  
-  ClassDef(MHillasDisplay, 0) // task to display cleaned events with hillas parameters
-    };
-
-#endif
-
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.cc	(revision 7135)
+++ 	(revision )
@@ -1,213 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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): Javier Lopez    04/2004 <mailto:jlopez@ifae.es>
-!   Author(s): Javier Rico     04/2004 <mailto:jrico@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// MSrcPlace
-//
-// Abstract task to set the source position in any place in the camera
-// It keeps a 2D histogram with the assigned positions, so that the same
-// distribution can be applied later to any data set (tipically the OFF data)
-// Classes inheritating MSrcPlace should override the ComputeNewSrcPosition() 
-// method and probably include a call to MsrcPlace::PreProcess in their
-// PreProcess method (see, e.g., MSrcPosFromFile or MSrcRotate classes)
-//
-//  Input Containers:
-//    MSrcPosCam
-//
-//  Output Containers:
-//    MSrcPosCam
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include <fstream>
-#include <math.h>
-
-#include "TH2F.h"
-
-#include "MParList.h"
-#include "MSrcPlace.h"
-#include "MSrcPosCam.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MSrcPlace);
-
-using namespace std;
-
-static const TString gsDefName  = "MSrcPlace";
-static const TString gsDefTitle = "Set the position of the source";
-
-// -------------------------------------------------------------------------
-//
-// Default constructor. The first argument is the name of the internal histo, 
-// the second (third) argument is the name of the input (output) container
-// containing the source position in the camera plain. 
-//
-MSrcPlace::MSrcPlace(const char* srcPosIn, const char* srcPosOut,  const char *name, const char *title)
-  : fSrcPosIn(NULL), fSrcPosOut(NULL), fHistoName("SrcPosHist"), 
-    fHistoBinPrec(1.), fHistPos(NULL)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    fSrcPosInName   = srcPosIn;
-    fSrcPosOutName  = srcPosOut;
-
-    fMode=kOn;
-    fCreateHisto=kTRUE;
-}
-// -------------------------------------------------------------------------
-//
-// Destructor
-//
-MSrcPlace::~MSrcPlace()
-{
-  if(fHistPos)
-    delete fHistPos;
-}
-
-// -------------------------------------------------------------------------
-//
-// Save the position of the source in the histogram
-//
-void MSrcPlace::SavePosIntoHisto()
-{  
-  if(fHistPos)
-    fHistPos->Fill(fSrcPosOut->GetX(),fSrcPosOut->GetY());
-}
-// -------------------------------------------------------------------------
-//
-// Read the position of the source from the histogram
-//
-void MSrcPlace::ReadPosFromHisto()
-{  
-  if(fHistPos)
-    {
-      Axis_t x;
-      Axis_t y;
-      
-      fHistPos->GetRandom2(x,y);
-      fSrcPosOut->SetXY(x,y);
-    }
-}
-// -------------------------------------------------------------------------
-//
-// Look for needed containers.
-// Check processing mode and if histogram is filled in case kOff mode
-//
-Int_t MSrcPlace::PreProcess(MParList* pList)
-{ 
-  // create (if needed and requested) internal histogram
-  if(fCreateHisto && !fHistPos)
-    {
-      const Float_t cameraSize   = 600; //[mm]
-      const UInt_t nbins =  (UInt_t)(cameraSize*2/fHistoBinPrec);
-      fHistPos = new TH2F(fHistoName,"",nbins,-cameraSize,cameraSize,nbins,-cameraSize,cameraSize);
-      fHistPos->SetDirectory(0);
-      *fLog << inf << "MSrcPlace::PreProcess Message: internal histogram " << fHistoName << " created with " << nbins << "x" << nbins << " bins" << endl;
-    }
-
-  // look for/create input MSrcPosCam
-  fSrcPosIn = (MSrcPosCam*)pList->FindObject(AddSerialNumber(fSrcPosInName), "MSrcPosCam");
-  if (!fSrcPosIn)
-    {
-      *fLog << warn << AddSerialNumber(fSrcPosInName) << " [MSrcPosCam] not found... creating default container." << endl;
-      fSrcPosIn = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcPosInName));
-      if(!fSrcPosIn)
-	return kFALSE;
-    }
-
-  // look for/create output MSrcPosCam
-  fSrcPosOut = (MSrcPosCam*)pList->FindObject(AddSerialNumber(fSrcPosOutName), "MSrcPosCam");
-  if (!fSrcPosOut)
-    {
-      *fLog << warn << AddSerialNumber(fSrcPosOutName) << " [MSrcPosCam] not found... creating default container." << endl;
-      fSrcPosOut = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcPosOutName));
-      if(!fSrcPosOut)
-	return kFALSE;
-    }
-
-  // check mode, look for a filled histogram in case kOff
-  if(fHistPos)
-    {
-      if(fMode==kOn)
-	*fLog << inf << "MSrcPlace PreProcess Message: source postions will be stored in internal histo (" << fHistPos->GetName() << ")" << endl;
-      else
-	{
-	  if(fHistPos->GetEntries())
-	    *fLog << inf << "MSrcPlace PreProcess Message: source postions will be read from internal histo (" << fHistPos->GetName() << ")" << endl;
-	  else
-	    {
-	      *fLog << err << "MSrcPlace PreProcess Error: source postions attempted to be read from empty histo (" << fHistPos->GetName() << ")" << endl;
-	      return kFALSE;
-	    }
-	}
-    }
-  return kTRUE;
-}
-
-// -------------------------------------------------------------------------
-//
-// Call to compute a new position and then save it in the histogram (fMode==kOn) 
-// of to read the new position from the histogram (fMode==kOff)
-//
-Int_t MSrcPlace::Process()
-{  
-  switch(fMode)
-    {
-    case kOn:
-      if(!ComputeNewSrcPosition())
-	return kFALSE;
-      SavePosIntoHisto();
-      break;
-    case kOff:
-      ReadPosFromHisto();
-      break;
-    default:
-      *fLog << err << "MSrcPlace::Process Warning: Wrong mode " << fMode << endl;
-      return kFALSE;
-    }
-  return kTRUE;
-}
-
-// -------------------------------------------------------------------------
-//
-// Dump 2D histo statistics
-//
-Int_t MSrcPlace::PostProcess()
-{
-  if(fMode==kOn && fHistPos)
-    {
-      *fLog << inf << endl;
-      *fLog << inf << "MSrcPlace::PostProcess Message: Created internal histogram with: " << endl;
-      *fLog << inf << "Entries: " << fHistPos->GetEntries() << endl;
-      *fLog << inf << "X projection mean: " << fHistPos->ProjectionX()->GetMean() << endl;
-      *fLog << inf << "X projection rms:  " << fHistPos->ProjectionX()->GetRMS() << endl;
-      *fLog << inf << "Y projection mean: " << fHistPos->ProjectionY()->GetMean() << endl;
-      *fLog << inf << "Y projection rms:  " << fHistPos->ProjectionY()->GetRMS() << endl;
-    }
-  return kTRUE;
-}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPlace.h	(revision 7135)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifndef MARS_MSrcPlace
-#define MARS_MSrcPlace
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-class MSrcPosCam;
-class TH2F;
-
-class MSrcPlace : public MTask
-{
- public:
-  enum OnOffMode_t {kOn=0,kOff};
-  
- private:
-  MSrcPosCam*  fSrcPosIn;       //  Pointer to the input source position container
-  MSrcPosCam*  fSrcPosOut;      //  Pointer to the output source position container
-  
-  TString      fSrcPosInName;   //  Name of the input MSrcPosCam object
-  TString      fSrcPosOutName;  //  Name of the output MSrcPosCam object
-
-  TString      fHistoName;      //  Name of internal histogram
-  Float_t      fHistoBinPrec;   //  [mm] internal histo bin size 
-
-  TH2F*        fHistPos;     //  histogram of the used source positions
-  OnOffMode_t   fMode;        //  On/Off data mode (write/read to/from the histogram)
-  Bool_t       fCreateHisto; //  flag to decide whether internal histo is created or not
-
-  void  SavePosIntoHisto();
-  void  ReadPosFromHisto();
-
-  virtual Int_t Process();
-  virtual Int_t PostProcess();
-
- protected:
-  virtual Int_t PreProcess(MParList *plist);
-
- public:
-  MSrcPlace(const char* srcin="MSrcPosCam",const char* srcout="MSrcPosCam", 
-	    const char* name=NULL, const char* title=NULL);
-
-  virtual ~MSrcPlace();
-
-  void SetMode(OnOffMode_t mode)            {fMode=mode;}
-  void SetInputSrcPosName(TString name)     {fSrcPosInName=name;}
-  void SetOutputSrcPosName(TString name)    {fSrcPosOutName=name;}
-  void SetInternalHistoName(TString name)   {fHistoName=name;}
-  void SetInternalHistoBinSize(Float_t size){fHistoBinPrec=size;}
-  void SetPositionHisto(TH2F* histo)     {fHistPos=histo;}
-  void SetCreateHisto(Bool_t inp=kTRUE)     {fCreateHisto=inp;}
-
-  OnOffMode_t   GetMode()              {return fMode;}
-  TH2F*         GetPositionHisto()     {return fHistPos;}
-  MSrcPosCam*   GetInputSrcPosCam()    {return fSrcPosIn;}
-  MSrcPosCam*   GetOutputSrcPosCam()   {return fSrcPosOut;}
-  TString       GetInternalHistoName() {return fHistoName;}
-  
-  virtual Int_t ComputeNewSrcPosition() {return kTRUE;}
-
-  ClassDef(MSrcPlace, 0) // task to rotate the position of the source as a function of Azimuth and Zenith angles
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc	(revision 7135)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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): Javier Rico     04/2004 <mailto:jrico@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// MSrcRotate
-//
-// Task to rotate the position of the source as a function of time
-//
-//  Input Containers:
-//    MSrcPosCam
-//
-//  Output Containers:
-//    MSrcPosCam
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include <fstream>
-#include <math.h>
-
-#include "MParList.h"
-#include "MRawRunHeader.h"
-#include "MRawEvtHeader.h"
-#include "MSrcRotate.h"
-
-#include "MAstroSky2Local.h"
-#include "MObservatory.h"
-#include "MSrcPosCam.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MSrcRotate);
-
-using namespace std;
-
-static const TString gsDefName  = "MSrcRotate";
-static const TString gsDefTitle = "Rotate position of the source";
-
-// -------------------------------------------------------------------------
-//
-// Default constructor. The first (second) argument is the name of the
-// input (output) MSrcPosCam object containing the source position in the 
-// camera plain
-//
-MSrcRotate::MSrcRotate(const char* srcPosIn, const char* srcPosOut, const char *name, const char *title)
-  : fRA(0), fDEC(0), fRefMJD(0), fRunNumber(0)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    SetInputSrcPosName(srcPosIn);
-    SetOutputSrcPosName(srcPosOut);
-
-    SetInternalHistoName(TString(fName)+"Hist");
-}
-
-// -------------------------------------------------------------------------
-//
-// Look for/create the needed containers
-// Check whether RA and DEC have been initialized
-//
-Int_t MSrcRotate::PreProcess(MParList *pList)
-{
-  if(!MSrcPlace::PreProcess(pList))
-    return kFALSE;
-  
-  // look for MRawRunHeader
-  fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
-  if (!fRunHeader)
-    {
-      *fLog << err << "MSrcRotate::PreProcess Error: MRawRunHeader not found... aborting" << endl;
-      return kFALSE;
-    }
-  
-  // look for MRawEvtHeader
-  fEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
-  if (!fEvtHeader)
-    {
-      *fLog << err << "MSrcRotate::PreProcess Error: MRawEvtHeader not found... aborting." << endl;
-      return kFALSE;
-    }
-  
-  // look for/create the MObservatory
-  fObservatory = (MObservatory*)pList->FindCreateObj("MObservatory");
-  if(!fObservatory)
-    {
-      *fLog << err << "MSrcRotate::PreProcess Error: MObservatory not found... aborting." << endl;
-      return kFALSE;
-    }
-
-  // check RA and DEC
-  if(fRA==0. || fDEC ==0)
-    *fLog << warn << "MSrcRotate::PreProcess Warning: RA=" << fRA << "or DEC=" << fDEC << " could be not initialized" << endl;    
-	
-  return kTRUE;
-}
-
-// -------------------------------------------------------------------------
-//
-// Perform the rotation of the source position 
-// 
-// FIXME: for the time being, this is computed by assuming constant event rate
-//
-Int_t MSrcRotate::ComputeNewSrcPosition()
-{  
-  if(fRunHeader->GetRunNumber()!=fRunNumber)
-    {
-      fRunNumber=fRunHeader->GetRunNumber();
-      
-      // save the number of events, initial and final times
-      fNEvts    = fRunHeader->GetNumEvents();
-      fIniTime  = fRunHeader->GetRunStart();
-      fFinTime  = fRunHeader->GetRunEnd();
-      fDeltaT   = (fFinTime.GetMjd()-fIniTime.GetMjd())/fNEvts;
-      
-      if((ULong_t)TMath::Nint(fIniTime.GetMjd())!=(ULong_t)TMath::Nint(fFinTime.GetMjd()))
-	{
-	  *fLog << err << "MSrcRotate::ComputeNewSrcPosition Error: Inial and final MJDs are different ("<<fIniTime.GetMjd()<<"!="<<fFinTime.GetMjd()<<")" << endl;
-	  return kFALSE;
-	}
-      
-#ifdef DEBUG
-      cout << endl << "********************"  << endl;
-      cout << "Run number: " << fRunHeader->GetRunNumber() << endl;
-      cout << "Number of events: " << fNEvts << endl;
-      cout << "Initial MJD date: " << fIniTime.GetMjd() << endl;
-      cout << "Final MJD   date: " << fFinTime.GetMjd() << endl;
-      cout << "Delta t: " << fDeltaT << endl;
-#endif
-    }
-  
-  
-  // Compute the event time
-  // FIXME: for the time being, this is computed by assuming constant event rate
-  MTime eventTime;
-  Double_t newMJD = fIniTime.GetMjd() + (fFinTime.GetMjd()-fIniTime.GetMjd())*fEvtHeader->GetDAQEvtNumber()/fNEvts;  
-  eventTime.SetMjd(newMJD);    
-  MTime refTime;
-  refTime.SetMjd(fRefMJD);
-  
-  // de-rotate the source position
-  const MAstroSky2Local Observation(eventTime, *fObservatory);
-  const MAstroSky2Local RefObservation(refTime, *fObservatory);
-  
-#ifdef DEBUG
-  printf("Run:%d, Event:%d, iniMJD=%15.5f, finMJD=%15.5f, fDeltaT=%15.5f, newMJD=%15.5f, fRefMJD=%15.5f, rotation=%15.5f, ref=%15.5f\n",
-	 fRunHeader->GetRunNumber(),fEvtHeader->GetDAQEvtNumber(),
-	 fIniTime.GetMjd(),fFinTime.GetMjd(),fDeltaT,
-	 newMJD,fRefMJD,Observation.RotationAngle(fRA,fDEC),
-	 RefObservation.RotationAngle(fRA,fDEC));
-  //  cout << "newMJD=" << newMJD << ", fRefMJD="<<fRefMJD<<", rotation="<<Observation.RotationAngle(fRA,fDEC)<<", ref="<<RefObservation.RotationAngle(fRA,fDEC)<< endl;
-#endif
-  
-  Double_t rotationAngle = fRefMJD ? 
-    Observation.RotationAngle(fRA,fDEC)-RefObservation.RotationAngle(fRA,fDEC) :
-    Observation.RotationAngle(fRA,fDEC) ;
-  MSrcPosCam* srcposIn  = GetInputSrcPosCam();
-  MSrcPosCam* srcposOut = GetOutputSrcPosCam();
-  
-  Float_t c = TMath::Cos(rotationAngle);
-  Float_t s = TMath::Sin(rotationAngle);
-  // perform a rotation of -rotationAngle to move the source back to the "initial" position
-  Float_t newX = c*srcposIn->GetX()-s*srcposIn->GetY();
-  Float_t newY = s*srcposIn->GetX()+c*srcposIn->GetY();
-  
-#ifdef DEBUG
-  Double_t rotationAngleComp = fObservatory->RotationAngle(0.1256,2.63);
-  cout << "Event " << fEvtHeader->GetDAQEvtNumber() << endl;
-  cout << "newMJD=" << newMJD <<", rotationAngle=" << rotationAngle <<", rotationAngleComp=" << rotationAngleComp << ", oldX="<<fIniSrcPosIn.GetX()<< ", oldY="<<fIniSrcPosIn.GetY()<< ", newX="<<newX<< ", newY="<<newY << endl;
-#endif
-  
-  srcposOut->SetXY(newX,newY);
-
-  return kTRUE;
-}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h	(revision 7135)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#ifndef MARS_MSrcRotate
-#define MARS_MSrcRotate
-
-#ifndef MARS_MSrcPlace
-#include "MSrcPlace.h"
-#endif
-
-#include "MTime.h"
-
-class MObservatory;
-class MRawEvtHeader;
-class MRawRunHeader;
-
-class MSrcRotate : public MSrcPlace
-{
- private:
-  MRawEvtHeader* fEvtHeader;   //  Pointer to the event header
-  MRawRunHeader* fRunHeader;   //  Pointer to the run header
-  MObservatory*  fObservatory; //  Pointer to the MObservatory    
-  
-  Double_t   fRA;          //  [rad] Right ascenssion 
-  Double_t   fDEC;         //  [rad] Declination
-  Double_t   fRefMJD;      //  [MJ date] reference time for rotation
-  UInt_t     fNEvts;       //  Number of events in file
-  MTime      fIniTime;     //  Run initial time 
-  MTime      fFinTime;     //  Run final time 
-  Double_t   fDeltaT;      //  DeltaT between two events
-  UInt_t     fRunNumber;   //  Current run number
-  
-  virtual Int_t PreProcess(MParList *plist);
-  
- public:
-  MSrcRotate(const char* srcIn="MSrcPosCam",const char* srcOut="MSrcPosCam",
-	     const char* name=NULL, const char* title=NULL);
-  
-  void SetRAandDECandRefMJD(Double_t ra, Double_t dec, Double_t ref=0) {fRA=ra;fDEC=dec;fRefMJD=ref;}
-  void SetRAandDEC(Double_t ra, Double_t dec){SetRAandDECandRefMJD(ra,dec);}
-  virtual Int_t ComputeNewSrcPosition();
-  
-  ClassDef(MSrcRotate, 0) // task to rotate the position of the source as a function of Azimuth and Zenith angles
-};
-
-#endif
-
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc	(revision 7135)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/* ======================================================================== *\
-!
-! *
-! * 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): Javier Rico     04/2004 <mailto:jrico@ifae.es>
-!
-!   Copyright: MAGIC Software Development, 2000-2004
-!
-!
-\* ======================================================================== */
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// MSrcTranslate
-//
-// Task to translate the position of the source, starting from previous source
-// position (fTranslationIsRelative=kTRUE) or from camera center 
-// (fTranslationIsRelative=kFALSE). This task allows you to modify the position
-// of the source in an event-by-event basis
-//
-//  Input Containers:
-//    MSrcPosCam
-//
-//  Output Containers:
-//    MSrcPosCam
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#include <fstream>
-#include <math.h>
-
-#include "MParList.h"
-
-#include "MSrcTranslate.h"
-#include "MSrcPosCam.h"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-ClassImp(MSrcTranslate);
-
-using namespace std;
-
-static const TString gsDefName  = "MSrcTranslate";
-static const TString gsDefTitle = "De-rotate position of the source";
-
-// -------------------------------------------------------------------------
-//
-// Default constructor. The first (second) argument is the name of the
-// input (output) MSrcPosCam object containing the source position in the 
-// camera plain
-//
-MSrcTranslate::MSrcTranslate(const char* srcPosIn, const char* srcPosOut, const char *name, const char *title)
-  : fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE)
-{
-    fName  = name  ? name  : gsDefName.Data();
-    fTitle = title ? title : gsDefTitle.Data();
-
-    SetInputSrcPosName(srcPosIn);
-    SetOutputSrcPosName(srcPosOut);
-
-    SetInternalHistoName(TString(fName)+"Hist");
-}
-
-// -------------------------------------------------------------------------
-//
-// Look for/create the needed containers
-//
-Int_t MSrcTranslate::PreProcess(MParList *pList)
-{
-  // look for/create MSrcPosCam 
-  if(!MSrcPlace::PreProcess(pList))
-    return kFALSE;
-
-  if(fShiftX==0. && fShiftY==0.)
-    *fLog << warn << "MSrcTranslate::PreProcess Warning: Null translation" << endl;    
-
-  return kTRUE;
-}
-
-// -------------------------------------------------------------------------
-//
-// Perform the translation of the source position 
-// 
-Int_t MSrcTranslate::ComputeNewSrcPosition()
-{  
-  Double_t newX,newY;
-
-  MSrcPosCam* srcPosOut = GetOutputSrcPosCam();
-  
-  if(fTranslationIsRelative)
-    {
-      MSrcPosCam* srcPosIn  = GetInputSrcPosCam();
-      newX=srcPosIn->GetX()+fShiftX;
-      newY=srcPosIn->GetY()+fShiftY;
-    }
-  else
-    {
-      newX=fShiftX;
-      newY=fShiftY;
-    }
-
-  srcPosOut->SetXY(newX,newY);
-
-  return kTRUE;
-}
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h	(revision 7135)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#ifndef MARS_MSrcTranslate
-#define MARS_MSrcTranslate
-
-#ifndef MARS_MSrcPlace
-#include "MSrcPlace.h"
-#endif
-
-class MSrcTranslate : public MSrcPlace
-{
- private:
-  
-  Double_t fShiftX;
-  Double_t fShiftY;
-  Bool_t   fTranslationIsRelative;
-  
-  Int_t PreProcess(MParList *plist);
-
- public:
-  MSrcTranslate(const char* srcIn="MSrcPosCam", const char* srcOut="MSrcPosCam", 
-		const char* name=NULL, const char* title=NULL);
-  
-  void SetTranslation(Double_t x=0.,Double_t y=0) {fShiftX=x,fShiftY=y;};
-  void SetRelativeTranslation(Bool_t inp=kTRUE) {fTranslationIsRelative=inp;};
-  virtual Int_t ComputeNewSrcPosition();
-
-  ClassDef(MSrcTranslate, 0) // task to set the position of the source within the camera in an event by event basis
-};
-
-#endif
-
