Index: /trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MSigmabar.cc	(revision 3528)
+++ /trunk/MagicSoft/Mars/manalysis/MSigmabar.cc	(revision 3529)
@@ -149,8 +149,15 @@
         const MGeomPix &gpix = geom[idx];
 
-        Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 
-                       / (TMath::Pi()*2));
-        if (sector<0)
-            sector+=6;
+        // This is wrong : rounding has to be done on positive values
+        //Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 
+        //               / (TMath::Pi()*2));
+        //if (sector<0)
+        //    sector+=6;
+
+        Float_t sectorf = atan2(gpix.GetY(),gpix.GetX()) * 6.0 
+                          / (TMath::Pi()*2);
+        if (sectorf < 0.0)
+          sectorf += 6.0;
+        Int_t sector = (Int_t)sectorf;
 
         // count only those pixels which have a sigma != 0.0
@@ -207,6 +214,6 @@
     }
 
-    //TString opt = "";
-    //Print(opt);
+    TString opt = "";
+    Print(opt);
 
   return fSigmabar;
