Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 8375)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 8376)
@@ -1,3 +1,31 @@
                                                                   -*-*- END -*-*-
+
+ 2007/03/14 Thomas Bretz
+
+   * bend.cc, cosy.cc, starg.cc, testse.cc, base/MStarList.cc,
+     base/MThread.cc, base/log.h, base/msgqueue.cc, candrv/nodedrv.cc,
+     candrv/sdolist.cc, catalog/SlaPlanets.cc, catalog/Slalib.cc,
+     catalog/StarCatalog.cc, gui/MGAccuracy.cc, gui/MGCoordinate.cc,
+     gui/MGCoordinates.cc, gui/MGCosy.cc, gui/MGNumStars.cc,
+     gui/MGSkyPosition.cc, main/MBending.cc, main/MStargHistograms.cc:
+     - replaced obsolete .h by C++ headers
+     - added namespace std
+
+   * base/MStarList.h:
+     - fixed warnings about overwriting of Delete
+
+   * base/MStopwatch.h, gui/MGCoordinate.h, gui/MGCoordinates.h:
+     - fixed warning about overwriting of Print()
+
+   * base/MTimeout.cc, candrv/nodedrv.cc, devdrv/macs.cc:
+     - fixed default argument is declaration
+
+   * catalog/StarCatalog.cc, gui/MGAccuracy.cc:
+     - fixed a type problem (int instead of double) 
+
+   * gui/MGCoordinate.cc, gui/MGCosy.cc:
+     - fixed a warning about double declaration
+
+
 
  2006/11/01 Thomas Bretz
Index: trunk/MagicSoft/Cosy/base/MStarList.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MStarList.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/MStarList.cc	(revision 8376)
@@ -1,5 +1,7 @@
 #include "MStarList.h"
 
-#include <iostream.h>
+#include <iostream>
+
+using namespace std;
 
 void MStarList::RemoveTwins(Double_t radius)
Index: trunk/MagicSoft/Cosy/base/MStarList.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MStarList.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/MStarList.h	(revision 8376)
@@ -31,6 +31,7 @@
     }
 
-    void Delete(Int_t i)    { delete fStars.RemoveAt(i); }
-    void Delete(MStar *obj) { delete fStars.Remove(obj); }
+    void Delete(Option_t *o="") { }
+    void Delete(Int_t i)        { delete fStars.RemoveAt(i); }
+    void Delete(MStar *obj)     { delete fStars.Remove(obj); }
 
     Int_t GetMax() const { return fStars.GetLast()+1; }
Index: trunk/MagicSoft/Cosy/base/MStopwatch.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MStopwatch.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/MStopwatch.h	(revision 8376)
@@ -8,4 +8,5 @@
 public:
     void Print(Float_t i);
+    void Print(Option_t *o="") const { }
 };
 
Index: trunk/MagicSoft/Cosy/base/MThread.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MThread.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/MThread.cc	(revision 8376)
@@ -1,5 +1,5 @@
 #include <MThread.h>
 
-#include <iostream.h>
+#include <iostream>
 
 #include <pthread.h>
@@ -8,4 +8,6 @@
 #undef DEBUG
 //#define DEBUG
+
+using namespace std;
 
 // ----------------------------------------------------------------------
Index: trunk/MagicSoft/Cosy/base/MTimeout.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MTimeout.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/MTimeout.cc	(revision 8376)
@@ -3,5 +3,5 @@
 #include <TSystem.h>
 
-MTimeout::MTimeout(unsigned long ms=500) : fTimeout((ULong_t)gSystem->Now()+ms)
+MTimeout::MTimeout(unsigned long ms) : fTimeout((ULong_t)gSystem->Now()+ms)
 {
     // Use SetTime to change the timing
@@ -14,5 +14,5 @@
 }
 
-void MTimeout::Start(unsigned long ms=500)
+void MTimeout::Start(unsigned long ms)
 {
     fTimeout = (ULong_t)gSystem->Now()+ms;
Index: trunk/MagicSoft/Cosy/base/coord.h
===================================================================
--- trunk/MagicSoft/Cosy/base/coord.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/coord.h	(revision 8376)
@@ -3,5 +3,5 @@
 
 #include <math.h>          // floor
-#include <fstream.h>
+#include <iostream>
 
 #include "MAGIC.h"
@@ -37,6 +37,6 @@
 class XY
 {
-    friend ifstream& operator>>(ifstream &in, XY &xy);
-    friend ofstream& operator<<(ofstream &in, XY &xy);
+    friend istream& operator>>(istream &in, XY &xy);
+    friend ostream& operator<<(ostream &in, XY &xy);
 
 protected:
@@ -73,6 +73,6 @@
 };
 
-inline ifstream& operator>>(ifstream &in,  XY &xy) { in  >> xy.fX; in  >> xy.fY; return in; }
-inline ofstream& operator<<(ofstream &out, const XY &xy) { out << xy.X() << " " << xy.Y(); return out; }
+inline std::istream& operator>>(std::istream &in,  XY &xy) { in  >> xy.fX; in  >> xy.fY; return in; }
+inline std::ostream& operator<<(std::ostream &out, const XY &xy) { out << xy.X() << " " << xy.Y(); return out; }
 
 class AltAz : public XY
Index: trunk/MagicSoft/Cosy/base/log.h
===================================================================
--- trunk/MagicSoft/Cosy/base/log.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/log.h	(revision 8376)
@@ -2,5 +2,5 @@
 #define COSY_Log
 
-#include <ostream.h>
+#include <ostream>
 
 #ifndef MARS_MLog
Index: trunk/MagicSoft/Cosy/base/msgqueue.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/base/msgqueue.cc	(revision 8376)
@@ -1,5 +1,5 @@
 #include "msgqueue.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include <unistd.h>        // usleep
@@ -7,4 +7,6 @@
 
 #undef DEBUG
+
+using namespace std;
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Cosy/bend.cc
===================================================================
--- trunk/MagicSoft/Cosy/bend.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/bend.cc	(revision 8376)
@@ -1,6 +1,8 @@
-#include <iomanip.h>
-#include <iostream.h>
+#include <iomanip>
+#include <fstream>
 
 #include <MBending.h>
+
+using namespace std;
 
 /* ---------------------------------------------------------------------- */
Index: trunk/MagicSoft/Cosy/candrv/nodedrv.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/candrv/nodedrv.cc	(revision 8376)
@@ -45,6 +45,6 @@
 #include "nodedrv.h"
 
-#include <iomanip.h>
-#include <iostream.h>
+#include <iomanip>
+#include <iostream>
 
 //#include <TTimer.h>
@@ -55,4 +55,6 @@
 
 ClassImp(NodeDrv);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -217,6 +219,6 @@
 // In this case false is returned, otherwise true
 //
-bool NodeDrv::SendPDO1(BYTE_t m0=0, BYTE_t m1=0, BYTE_t m2=0, BYTE_t m3=0,
-                       BYTE_t m4=0, BYTE_t m5=0, BYTE_t m6=0, BYTE_t m7=0)
+bool NodeDrv::SendPDO1(BYTE_t m0, BYTE_t m1, BYTE_t m2, BYTE_t m3,
+                       BYTE_t m4, BYTE_t m5, BYTE_t m6, BYTE_t m7)
 {
     if (!fIsZombie)
@@ -233,6 +235,6 @@
 // In this case false is returned, otherwise true
 //
-bool NodeDrv::SendPDO2(BYTE_t m0=0, BYTE_t m1=0, BYTE_t m2=0, BYTE_t m3=0,
-                       BYTE_t m4=0, BYTE_t m5=0, BYTE_t m6=0, BYTE_t m7=0)
+bool NodeDrv::SendPDO2(BYTE_t m0, BYTE_t m1, BYTE_t m2, BYTE_t m3,
+                       BYTE_t m4, BYTE_t m5, BYTE_t m6, BYTE_t m7)
 {
     if (!fIsZombie)
@@ -543,5 +545,5 @@
 };
 
-void NodeDrv::StartGuarding(Bool_t real=kTRUE)
+void NodeDrv::StartGuarding(Bool_t real)
 {
     if (fGuard)
Index: trunk/MagicSoft/Cosy/candrv/sdolist.cc
===================================================================
--- trunk/MagicSoft/Cosy/candrv/sdolist.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/candrv/sdolist.cc	(revision 8376)
@@ -1,8 +1,10 @@
 #include "sdolist.h"
 
-#include <iostream.h>
+#include <iostream>
 
 ClassImp(PendingSDO);
 ClassImp(PendingSDOList);
+
+using namespace std;
 
 PendingSDOList::PendingSDOList()
Index: trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/catalog/SlaPlanets.cc	(revision 8376)
@@ -1,9 +1,11 @@
 #include "SlaPlanets.h"
 
-#include <iostream.h>
+#include <iostream>
 
 #include "slalib.h"
 
 ClassImp(SlaPlanets);
+
+using namespace std;
 
 SlaPlanets::SlaPlanets(MObservatory::LocationName_t key) : Slalib(key), fDt(slaDt(2000.0)/60./60./24.)
Index: trunk/MagicSoft/Cosy/catalog/Slalib.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/catalog/Slalib.cc	(revision 8376)
@@ -2,5 +2,5 @@
 
 #include <time.h>
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include "coord.h"
@@ -9,4 +9,6 @@
 
 ClassImp(Slalib);
+
+using namespace std;
 
 Slalib::Slalib(MObservatory::LocationName_t key) : MObservatory(key)
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 8376)
@@ -1,6 +1,6 @@
 #include "StarCatalog.h"
 
-#include <iomanip.h>   // cout
-#include <iostream.h>  // cout
+#include <iomanip>   // cout
+#include <iostream>  // cout
 
 #include <TSystem.h>
@@ -15,4 +15,6 @@
 
 ClassImp(StarCatalog);
+
+using namespace std;
 
 StarCatalog::StarCatalog(MObservatory::LocationName_t key) : SlaStars(key), fW(768), fH(576), fAstro(0), /*fSao(NULL), fSrt(NULL), fEntries(0),*/ fSinAngle(0), fCosAngle(1), fBox(768)
@@ -136,5 +138,5 @@
     {
         const int mag = (10 - (star->GetMag()>1 ? (int)star->GetMag() : 1))/2;
-        Double_t color = 0xf0; //0x0f;       
+        Int_t color = 0xf0; //0x0f;
 	// DrawStars flips the picture in X defaultwise now
         DrawCircle(color, img, 768-(int)star->GetX(), (int)star->GetY(), mag);
@@ -155,5 +157,5 @@
 {
     // For an apropriate unit conversion to pixels [pix/rad]
-    const Double_t scale = TMath::RadToDeg()*sqrt(768*768 + 576*576)/(fAstro->GetRadiusFOV()*2);
+    const Double_t scale = TMath::RadToDeg()*TMath::Sqrt(768*768 + 576*576)/(fAstro->GetRadiusFOV()*2);
 
     // Offsets to shift [-n/2;n/2] to [0;n] and to
Index: trunk/MagicSoft/Cosy/cosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/cosy.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/cosy.cc	(revision 8376)
@@ -11,4 +11,6 @@
 
 #include "MStarguider.h"
+
+using namespace std;
 
 #define EXPERT
Index: trunk/MagicSoft/Cosy/devdrv/macs.cc
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/devdrv/macs.cc	(revision 8376)
@@ -550,6 +550,6 @@
 }
 
-void Macs::SendMsg(BYTE_t d0=0, BYTE_t d1=0, BYTE_t d2=0,
-                   BYTE_t d3=0, BYTE_t d4=0, BYTE_t d5=0)
+void Macs::SendMsg(BYTE_t d0, BYTE_t d1, BYTE_t d2,
+                   BYTE_t d3, BYTE_t d4, BYTE_t d5)
 {
     GetNetwork()->SendCanFrame(fMacId, 0, 0, d0, d1, d2, d3, d4, d5);
Index: trunk/MagicSoft/Cosy/gui/MGAccuracy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGAccuracy.cc	(revision 8376)
@@ -1,5 +1,5 @@
 #include "MGAccuracy.h"
 
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include <TArc.h>
@@ -16,4 +16,6 @@
 
 ClassImp(MGAccuracy);
+
+using namespace std;
 
 void MGAccuracy::DrawText(const char *c1, const char *c2, const char *c3, const char*txt)
@@ -163,5 +165,5 @@
     dist *= 3600.; // [sec]
 
-    int rs = (int)floor(fmod(dist, 60.));
+    int rs = TMath::FloorNint(fmod(dist, (float)60.));
 
     dist /= 60.;   // [min]
Index: trunk/MagicSoft/Cosy/gui/MGCoordinate.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCoordinate.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGCoordinate.cc	(revision 8376)
@@ -8,5 +8,5 @@
 
 #include <stdlib.h>    // atoi
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include <TSystem.h>
@@ -18,4 +18,6 @@
 
 ClassImp(MGCoordinate);
+
+using namespace std;
 
 enum {
@@ -25,5 +27,5 @@
 };
 
-MGCoordinate::MGCoordinate(const TGWindow* p, const Int_t type=kETypeDeg,
+MGCoordinate::MGCoordinate(const TGWindow* p, const Int_t type,
                            const Int_t flag, const char *txt,
                            const Int_t deg, const UInt_t min, const UInt_t sec)
@@ -91,11 +93,11 @@
     TGLabel *label;
 
-    const char *deg = type==kETypeDeg ? "\xb0" : "h";
-    const char *min = type==kETypeDeg ? "'"    : "m";
-    const char *sec = type==kETypeDeg ? "\""   : "s";
+    const char *sdeg = type==kETypeDeg ? "\xb0" : "h";
+    const char *smin = type==kETypeDeg ? "'"    : "m";
+    const char *ssec = type==kETypeDeg ? "\""   : "s";
 
     if (flag==1)
     {
-        label = new TGLabel(this, deg);
+        label = new TGLabel(this, sdeg);
         label->SetTextJustify(kTextLeft);
         label->Move(37, 29-offset);
@@ -103,5 +105,5 @@
         fList->Add(label);
 
-        label = new TGLabel(this, min);
+        label = new TGLabel(this, smin);
         label->SetTextJustify(kTextLeft);
         label->Move(71, 29-offset);
@@ -109,5 +111,5 @@
         fList->Add(label);
 
-        label = new TGLabel(this, sec);
+        label = new TGLabel(this, ssec);
         label->SetTextJustify(kTextLeft);
         label->Move(107, 29-offset);
@@ -116,5 +118,5 @@
     }
 
-    label = new TGLabel(this, deg);
+    label = new TGLabel(this, sdeg);
     label->SetTextJustify(kTextLeft);
     label->Move(39, ypos);
@@ -122,5 +124,5 @@
     fList->Add(label);
 
-    label = new TGLabel(this, min);
+    label = new TGLabel(this, smin);
     label->SetTextJustify(kTextLeft);
     label->Move(73, ypos);
@@ -128,5 +130,5 @@
     fList->Add(label);
  
-    label = new TGLabel(this, sec);
+    label = new TGLabel(this, ssec);
     label->SetTextJustify(kTextLeft);
     label->Move(107, ypos);
@@ -149,5 +151,5 @@
 }
 
-void MGCoordinate::Print()
+void MGCoordinate::Print(Option_t *o) const
 {
     if (fLabel)
Index: trunk/MagicSoft/Cosy/gui/MGCoordinate.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCoordinate.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGCoordinate.h	(revision 8376)
@@ -58,5 +58,5 @@
     Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2);
 
-    void Print();
+    void Print(Option_t *o="") const;
 
     ClassDef(MGCoordinate, 0)
Index: trunk/MagicSoft/Cosy/gui/MGCoordinates.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCoordinates.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGCoordinates.cc	(revision 8376)
@@ -7,5 +7,5 @@
 #include "MGCoordinates.h"
 
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include "MGCoordinate.h"
@@ -13,4 +13,6 @@
 
 ClassImp(MGCoordinates);
+
+using namespace std;
 
 MGCoordinates::MGCoordinates(const TGWindow* p,
@@ -54,5 +56,5 @@
 }
 
-void MGCoordinates::Print()
+void MGCoordinates::Print(Option_t *o) const
 {
     fX->Print();
Index: trunk/MagicSoft/Cosy/gui/MGCoordinates.h
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCoordinates.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGCoordinates.h	(revision 8376)
@@ -37,5 +37,5 @@
     void SetCoordinates(const XY &xy);
 
-    void Print();
+    void Print(Option_t *o="") const;
 
     ClassDef(MGCoordinates, 0)
Index: trunk/MagicSoft/Cosy/gui/MGCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGCosy.cc	(revision 8376)
@@ -1,6 +1,6 @@
 #include "MGCosy.h"
 
-#include <iomanip.h>
-#include <iostream.h>
+#include <iomanip>
+#include <fstream>
 
 #include "msgqueue.h"
@@ -42,4 +42,6 @@
 
 ClassImp(MGCosy);
+
+using namespace std;
 
 #define IDM_EXIT   1
@@ -827,7 +829,7 @@
     cout << "MGCosy: Setting Size" << endl;
 #endif
-    const Int_t w = 1010;
-    const Int_t h =  700;
-    SetWMSizeHints(w, h, w, h, 1, 1);  // set the smallest and biggest size of the Main frame
+    const Int_t ww = 1010;
+    const Int_t hh =  700;
+    SetWMSizeHints(ww, hh, ww, hh, 1, 1);  // set the smallest and biggest size of the Main frame
 
     SetWindowName("Cosy Main Window");
@@ -838,5 +840,5 @@
 #endif
     MapSubwindows();
-    Resize(w, h); //GetDefaultSize());
+    Resize(ww, hh); //GetDefaultSize());
     MapWindow();
 }
Index: trunk/MagicSoft/Cosy/gui/MGNumStars.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGNumStars.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGNumStars.cc	(revision 8376)
@@ -1,5 +1,5 @@
 #include "MGNumStars.h"
 
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include <TLine.h>
@@ -13,4 +13,6 @@
 
 ClassImp(MGNumStars);
+
+using namespace std;
 
 void MGNumStars::DrawText(const char*txt)
Index: trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc
===================================================================
--- trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/gui/MGSkyPosition.cc	(revision 8376)
@@ -7,5 +7,5 @@
 #include "MGSkyPosition.h"
 
-#include <iostream.h>  // cout
+#include <iostream>  // cout
 
 #include <TArc.h>
@@ -21,4 +21,6 @@
 
 ClassImp(MGSkyPosition);
+
+using namespace std;
 
 void MGSkyPosition::InitArc(TArc *arc, Int_t fillstyle, Int_t fillcolor, Int_t linecolor)
Index: trunk/MagicSoft/Cosy/main/MBending.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MBending.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MBending.cc	(revision 8376)
@@ -59,6 +59,6 @@
 #include "MBending.h"
 
-#include <fstream.h>
-#include <iomanip.h>
+#include <fstream>
+#include <iomanip>
 #include <TVector3.h>
 
@@ -68,4 +68,6 @@
 
 ClassImp(MBending);
+
+using namespace std;
 
 #undef DEBUG
Index: trunk/MagicSoft/Cosy/main/MCaos.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MCaos.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MCaos.cc	(revision 8376)
@@ -1,5 +1,5 @@
 #include "MCaos.h"
 
-#include <iostream>
+#include <fstream>
 #include <iomanip>
 
@@ -21,5 +21,7 @@
 #include "coord.h"
 
-void MCaos::ReadResources(const char *name="leds.txt")
+using namespace std;
+
+void MCaos::ReadResources(const char *name)
 {
     ifstream fin(name);
@@ -242,6 +244,6 @@
     c->Update();
 
-    const Int_t n1 = (Int_t)(sqrt(fPositions.GetEntriesFast())+1.0);
-    const Int_t n2 = (Int_t)(sqrt(fPositions.GetEntriesFast())+0.5);
+    const Int_t n1 = (Int_t)(TMath::Sqrt(fPositions.GetEntriesFast())+1.0);
+    const Int_t n2 = (Int_t)(TMath::Sqrt(fPositions.GetEntriesFast())+0.5);
 
     TCanvas *c1 = new TCanvas("cpos", "Led Positions", 800, 600);
@@ -330,5 +332,5 @@
 }
 
-Ring MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t, Double_t box, Double_t cut)
+Ring MCaos::Run(byte *img, bool printl, bool printr, const ZdAz &pos, const MTime &t, Int_t box, Double_t cut)
 {
     Leds &leds = *fLeds;
@@ -355,5 +357,5 @@
         // Try to find Led in this area
         const Led &l0 = fPositions(i);
-        f.Execute(leds, l0.GetX(), l0.GetY());
+        f.Execute(leds, TMath::FloorNint(l0.GetX()), TMath::FloorNint(l0.GetY()));
 
         // Loop over newly found Leds
Index: trunk/MagicSoft/Cosy/main/MCaos.h
===================================================================
--- trunk/MagicSoft/Cosy/main/MCaos.h	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MCaos.h	(revision 8376)
@@ -89,5 +89,5 @@
 
     Ring Run(byte *img, bool printl, bool printr, const ZdAz &pos, 
-	     const MTime &t, Double_t box, Double_t cut);
+	     const MTime &t, Int_t box, Double_t cut);
 };
 
Index: trunk/MagicSoft/Cosy/main/MCosy.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MCosy.cc	(revision 8376)
@@ -1,7 +1,6 @@
 #include "MCosy.h"
 
-#include <iomanip.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <iomanip>
+#include <fstream>
 
 #include <TROOT.h>
@@ -30,4 +29,6 @@
 
 ClassImp(MCosy);
+
+using namespace std;
 
 typedef struct tm tm_t;
@@ -493,9 +494,9 @@
     {
 #ifdef EXPERT
-        fMac1->SetDeceleration(0.5*fMac1->GetVelRes());
-        fMac2->SetDeceleration(0.5*fMac2->GetVelRes());
+        fMac1->SetDeceleration(TMath::Nint(0.5*fMac1->GetVelRes()));
+        fMac2->SetDeceleration(TMath::Nint(0.5*fMac2->GetVelRes()));
 #else
-        fMac1->SetDeceleration(0.3*fMac1->GetVelRes());
-        fMac2->SetDeceleration(0.3*fMac2->GetVelRes());
+        fMac1->SetDeceleration(TMath::Nint(0.3*fMac1->GetVelRes()));
+        fMac2->SetDeceleration(TMath::Nint(0.3*fMac2->GetVelRes()));
 #endif
         fMac1->SetRpmMode(FALSE);
Index: trunk/MagicSoft/Cosy/main/MPointing.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MPointing.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MPointing.cc	(revision 8376)
@@ -6,4 +6,6 @@
 
 ClassImp(MPointing);
+
+using namespace std;
 
 //#define EXPERT
@@ -30,11 +32,11 @@
     if (ratio<1)
     {
-        fCosy->fMac1->SetVelocity(vel);
-        fCosy->fMac2->SetVelocity(vel*ratio);
+        fCosy->fMac1->SetVelocity(TMath::Nint(vel));
+        fCosy->fMac2->SetVelocity(TMath::Nint(vel*ratio));
     }
     else
     {
-        fCosy->fMac1->SetVelocity(vel/ratio);
-        fCosy->fMac2->SetVelocity(vel);
+        fCosy->fMac1->SetVelocity(TMath::Nint(vel/ratio));
+        fCosy->fMac2->SetVelocity(TMath::Nint(vel));
     }
 }
@@ -56,6 +58,6 @@
     fCosy->SetStatus(MDriveCom::kMoving);
 
-    if (axe1) fCosy->fMac2->StartRelPos(rd.Zd());
-    if (axe2) fCosy->fMac1->StartRelPos(rd.Az());
+    if (axe1) fCosy->fMac2->StartRelPos(TMath::Nint(rd.Zd()));
+    if (axe2) fCosy->fMac1->StartRelPos(TMath::Nint(rd.Az()));
 #ifdef EXPERT
     cout << "Waiting for positioning..." << flush;
@@ -73,6 +75,6 @@
 {
     const int vr = mac->GetVelRes();
-    mac->SetAcceleration(acc*vr);
-    mac->SetDeceleration(dec*vr);
+    mac->SetAcceleration(TMath::Nint(acc*vr));
+    mac->SetDeceleration(TMath::Nint(dec*vr));
     return !mac->IsZombieNode();
 }
Index: trunk/MagicSoft/Cosy/main/MStargHistograms.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStargHistograms.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MStargHistograms.cc	(revision 8376)
@@ -22,4 +22,6 @@
 
 #include "coord.h"
+
+using namespace std;
 
 void MStargHistograms::OpenFile()
Index: trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 8376)
@@ -4,7 +4,7 @@
 #include "MStarguider.h"
 
-#include <fstream.h>    // ifstream
-#include <iostream.h>   // cout
-#include <iomanip.h>   // cout
+#include <fstream>    // ifstream
+#include <iostream>   // cout
+#include <iomanip>    // cout
 
 #include <TH2F.h>
@@ -57,4 +57,6 @@
 
 ClassImp(MStarguider);
+
+using namespace std;
 
 enum {
@@ -1457,9 +1459,9 @@
 	    
             const Int_t idx = x.GetSize();
-	    
+
             x.Set(idx+1);
             y.Set(idx+1);
             mag.Set(idx+1);
-	    
+
             x.AddAt(dpos.X(), idx);
             y.AddAt(dpos.Y(), idx);
@@ -1507,5 +1509,4 @@
     fPZdAz->SetCoordinates(cpos);
 
-
     // Check StargTPoint data set request
     if (!fStargTPoint->IsDown())
@@ -1575,5 +1576,5 @@
 }
 
-XY MStarguider::FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, Double_t cut, Double_t box, XY SearchCenter)
+XY MStarguider::FindRoqueLamp(FilterLed &f, FilterLed &f2, Ring &CameraCenter, MTime &t, Double_t cut, Int_t box, XY SearchCenter)
 {
     // Set search Paremeters (FIXME: Get them from user input!)
@@ -1611,5 +1612,5 @@
 }
 
-ZdAz MStarguider::FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t, Double_t cut, Double_t box, Double_t scalefactor = 1.0)
+ZdAz MStarguider::FindStar(FilterLed &f, FilterLed &f2, Ring &center, MTime &t, Double_t cut, Int_t box, Double_t scalefactor = 1.0)
 {
     // Set search Paremeters (FIXME: Get them from user input!)
@@ -1850,5 +1851,5 @@
     {
         // SCALE FACTOR ASSUMED TO BE 70
-        FindStar(f, f2, center, t, 3.5, 70);
+        FindStar(f, f2, center, t, 3/*3.5*/, 70);
         SendAmcTrigger("TPoint");
     }
@@ -1920,5 +1921,5 @@
 
         Double_t imageclean = 1.5;
-        Double_t boxradius = 60;
+        Int_t    boxradius = 60;
 	//Double_t scalefactor = 1;
 	XY searchcenter(768/2-1,576/2+25);
@@ -1947,5 +1948,5 @@
 
         Double_t imageclean = 5;
-	Double_t boxradius = 60;
+	Int_t    boxradius = 60;
 	//Double_t scalefactor = 1;
 	//	XY searchcenter(sgcenter.GetX(),sgcenter.GetY());
@@ -2016,5 +2017,5 @@
                      sgcenter.GetY()-293.6+28.5);
 
-        fSao->CalcStars(stars, 530, 292, off.X(), off.Y());
+        fSao->CalcStars(stars, 530, 292, TMath::FloorNint(off.X()), TMath::FloorNint(off.Y()));
 	fSao->DrawStars(stars, cimg);
 
Index: trunk/MagicSoft/Cosy/starg.cc
===================================================================
--- trunk/MagicSoft/Cosy/starg.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/starg.cc	(revision 8376)
@@ -1,3 +1,3 @@
-#include <iostream.h>
+#include <iostream>
 
 #include <TROOT.h>
@@ -5,4 +5,6 @@
 
 #include "MStarguider.h"
+
+using namespace std;
 
 /* ---------------------------------------------------------------------- */
Index: trunk/MagicSoft/Cosy/testse.cc
===================================================================
--- trunk/MagicSoft/Cosy/testse.cc	(revision 8375)
+++ trunk/MagicSoft/Cosy/testse.cc	(revision 8376)
@@ -1,6 +1,8 @@
-#include <iostream.h>
+#include <iostream>
 
 #include "network.h"
 #include "shaftencoder.h"
+
+using namespace std;
 
 TROOT root("Cosy", "Magic Control System");
