Index: trunk/MagicSoft/Mars/mtemp/MObservatory.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/MObservatory.cc	(revision 1758)
+++ trunk/MagicSoft/Mars/mtemp/MObservatory.cc	(revision 1758)
@@ -0,0 +1,87 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Robert Wagner  10/2002 <mailto:magicsoft@rwagner.de>
+!   Author(s): Thomas Bretz   2/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2002-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MObservatory                                                            //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MObservatory.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MObservatory);
+
+void MObservatory::Init(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MObservatory";
+    fTitle = title ? title : "Storage container for coordinates of an observatory";   
+}
+
+MObservatory::MObservatory(const char *name, const char *title)
+{
+    Init(name, title);
+
+    SetLocation(kMagic1);
+}
+
+MObservatory::MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL)
+{
+    Init(name, title);
+
+    SetLocation(key);
+}
+
+void MObservatory::SetLocation(LocationName_t name)
+{
+    switch (name)
+    {
+    case kMagic1:
+        fLatitude  =  Daf2rad( 28, 45, 30.0);
+        fLongitude =  Daf2rad(-17, 52, 48.0);
+        fHeight    = 2326; // m
+        fObservatoryName = "Observatorio del Roque de los Muchachos (Magic1)";
+        return;
+
+    case kWuerzburgCity:
+        fLatitude  = Daf2rad(51, 38, 48.0);
+        fLongitude = Daf2rad( 9, 56, 36.0);
+        fHeight    = 300;
+        fObservatoryName = "Wuerzburg City";
+        return;
+
+    }
+}
+
+void MObservatory::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << fObservatoryName << endl;
+    *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
+    *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
+    *fLog << "Height " << fHeight << "m" << endl;
+}
+
Index: trunk/MagicSoft/Mars/mtemp/MObservatory.h
===================================================================
--- trunk/MagicSoft/Mars/mtemp/MObservatory.h	(revision 1758)
+++ trunk/MagicSoft/Mars/mtemp/MObservatory.h	(revision 1758)
@@ -0,0 +1,64 @@
+#ifndef MARS_MObservatory
+#define MARS_MObservatory
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MObservatory : public MParContainer
+{
+public:
+    enum LocationName_t
+    {
+        kMagic1,
+        kWuerzburgCity
+    };
+
+private:
+    LocationName_t fObservatoryKey;  //!
+
+    TString  fObservatoryName;       //! Name of the observatory
+
+    Double_t fLongitude;             //! [rad] Longitude of observatory (+ east)
+    Double_t fLatitude;              //! [rad] Latitude of observatory (+ north)
+
+    Double_t fHeight;                //! [m] height of observatory
+
+    void Init(const char *name, const char *title);
+
+    Double_t Daf2rad(Int_t deg, UInt_t min, Double_t sec)
+    {
+        /* pi/(180*3600):  arcseconds to radians */
+#define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
+        return DAS2R * (60.0 * (60.0 * (Double_t)deg + (Double_t)min) + sec);
+    }
+
+public:
+    MObservatory(const char *name=NULL, const char *title=NULL);
+    MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL);
+
+    void SetLocation(LocationName_t name);
+
+    void Print(Option_t *) const;
+
+    const TString &GetObservatoryName() const { return fObservatoryName; }
+
+    Double_t GetLatitudeDeg() const     { return fLatitude*kRad2Deg; }  //[deg]
+    Double_t GetLongitudeDeg() const    { return fLongitude*kRad2Deg; } //[deg]
+
+    Double_t GetLatitudeRad() const     { return fLatitude; }           //[rad]
+    Double_t GetLongitudeRad() const    { return fLongitude; }          //[rad]
+
+    Double_t GetPhi() const             { return fLatitude; }           //[rad]
+    Double_t GetElong() const           { return fLongitude; }          //[rad]
+
+    Double_t GetHeight() const          { return fHeight; }
+
+    LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
+
+    ClassDef(MObservatory, 0)
+
+};
+
+#endif
+
