Index: /trunk/MagicSoft/Mars/mtemp/MFindStars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MFindStars.cc	(revision 4009)
+++ /trunk/MagicSoft/Mars/mtemp/MFindStars.cc	(revision 4010)
@@ -62,5 +62,5 @@
   fMaxNumIntegratedEvents = 10;
   fRingInterest = 100.; //[mm] ~ 0.3 deg
-  fMinDCForStars = 3.; //[uA]
+  fMinDCForStars = 3.*fMaxNumIntegratedEvents; //[uA]
   
   fPixelsUsed.Set(577);
@@ -79,4 +79,6 @@
     }
 
+    fDisplay.SetGeometry(*fGeomCam);
+    
     fCurr = (MCameraDC*)pList->FindObject(AddSerialNumber("MCameraDC"));
 
@@ -98,8 +100,7 @@
 
     if (!fDrive)
-    {
-      *fLog << err << AddSerialNumber("MReportDrive") << " not found ... aborting" << endl;
-      return kFALSE;
-    }
+      {
+        *fLog << warn << AddSerialNumber("MReportDrive") << " not found ... ignored." << endl;
+      }
     else
       {
@@ -188,9 +189,12 @@
 
           MHCamera cam = fDisplay;
-          // First define a area of interest around the expected position of the star
-
+          cam.PrintInfo();
+
+          // Find the star candidats searching the most brights pairs of pixels
          while(1)
             {
               FindPixelWithMaxDC(maxPixelDC, maxPixel);
+              *fLog << dbg << "Star candidate maxDC(" << setw(3) << maxPixelDC << " uA) x position(" << setw(3) << maxPixel.GetX() <<  " mm) x position(" << setw(3) << maxPixel.GetY() << " mm)" << endl;
+              
               if (maxPixelDC<fMinDCForStars)
                 break;
@@ -198,5 +202,5 @@
               MStarLocalPos *starpos = new MStarLocalPos;
               starpos->SetExpValues(maxPixelDC,maxPixel.GetX(),maxPixel.GetY());
-              starpos->SetCalcValues(maxPixelDC,maxPixel.GetX(),fRingInterest/2,maxPixel.GetY(),fRingInterest/2);
+              starpos->SetCalcValues(maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2);
               fStars->GetList()->Add(starpos);
 
@@ -205,8 +209,14 @@
             }
          fDisplay = cam;
-         
+         *fLog << dbg <<  GetName() << " Found " << fStars->GetList()->GetSize() << " stars candidates in the camera." << endl;
         }
       
       //loop to extract position of stars on the camera
+      if (fStars->GetList()->GetSize() == 0)
+        {
+          *fLog << err << GetName() << " No stars candidates in the camera." << endl;
+          return kFALSE;
+        }
+          
       TIter Next(fStars->GetList());
       MStarLocalPos* star;
@@ -228,6 +238,8 @@
 Int_t MFindStars::PostProcess()
 {
+  if(fStars->GetList()->GetSize() != 0)
     fStars->Print();
-    return kTRUE;
+
+  return kTRUE;
 }
 
@@ -249,8 +261,8 @@
     UInt_t maxPixIdx[2];
 
+    maxDC = 0;
+
     for (UInt_t pix=1; pix<numPixels; pix++)
     {
-	maxDC = 0;
-
 	if(fDisplay.IsUsed(pix))
 	{
@@ -278,4 +290,5 @@
 			maxPixIdx[0] = pix;
 			maxPixIdx[1] = swneighbor;
+                        maxDC = dc[0];
                         }
                       else
@@ -283,6 +296,6 @@
                           maxPixIdx[1] = pix;
                           maxPixIdx[0] = swneighbor;
+                          maxDC = dc[1];
                         }
-                      maxDC = dcsum/2;
 		    }	
 		}
