Index: trunk/MagicSoft/Mars/mtemp/mpisa/macros/test_findstar.C
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mpisa/macros/test_findstar.C	(revision 4426)
+++ trunk/MagicSoft/Mars/mtemp/mpisa/macros/test_findstar.C	(revision 4427)
@@ -9,8 +9,9 @@
   MParList plist;
   MTaskList tlist;
-  
+
+  //  cout << "0" <<endl;  
   plist.AddToList(&tlist);
 
-  MCerPhotEvt DCEvt;
+  MCerPhotEvt *DCEvt;
 
   MGeomCamMagic *geom; 
@@ -18,30 +19,57 @@
   const Int_t gsNpix = 577;
 
-  Int_t startpixs[gsNpix];
+  TArrayF *startpixs(gsNpix);
   Int_t cluster[gsNpix];
   memset(cluster,-1,gsNpix*sizeof(Int_t));
   memset(startpixs,-1,gsNpix*sizeof(Int_t));
 
+  // fill a fake MCerPhotEvt 
 
-  MCerPhotPix DCpix;
-  for (int t=0;i<gsNpix;i++)
-    DCpix = DCevt.AddPixel(i,0.,0.);
+// loop over all pixels
   
-  // a fake cluster:
+  for (Int_t pixid = 0; pixid <gsNpix ; pixid++)
+    {
+      MCerPhotPix dcpix =  DCEvt[pixid];
+
+      cout << "1" <<endl;  
+      // a fake cluster:
+      dcpix->SetNumPhotons(0.);
+      
+      switch (pixid)
+      {
+      case 10:
+	dcpix->SetNumPhotons(1.5);
+      case 3:
+	dcpix->SetNumPhotons(1.1);
+      case 9:
+	dcpix->SetNumPhotons(1.1);
+      case 22:
+	dcpix->SetNumPhotons(1.1);
+      case 23:
+	dcpix->SetNumPhotons(1.1);
+      case 24:
+	dcpix->SetNumPhotons(1.1);
+      case 11:
+	dcpix->SetNumPhotons(1.1);
+      };
+    }; // end loop over pixels
+
   
+  if (!(FindStartPixels(DCEvt, startpixs, geom)))
+    cout << "Error calling the FindStartPixels function!!" << endl;
+  
+  return;
+};  
 
-
-}
-
-Int_t FindStartPixels(MCerPhotEvt *evt, Int_t startpixs, MGeomCam *geom)
+Int_t FindStartPixels(MCerPhotEvt *evt, TArrayF *startpixs, MGeomCam *geom)
 {
   // look for all the pixels with a DC higher than the DC of neighbour pixels 
 
   // loop over all pixels
-  MCerPhotEvtIter Next(fEvt, kFALSE);
+  MCerPhotEvtIter Next(evt, kFALSE);
   
-  while ((dcpix=static_cast<MCerPhotPix*>(Next())))
+  for (Int_t pixid=0; pixid<gsNPix; pixid++)
     {
-      const Int_t pixid = dcpix->GetPixId();  //pixid  of current pixel
+      MCerPhotPix dcpix =  DCEvt[pixid]; // curren pix with DC
 
       const MGeomPix &pix = (*geom)[pixid]; // MGeomCam pixel
@@ -60,9 +88,11 @@
 	*(startpixs++) = currDC;
     }
+
+  return 1;
 }
 
 Int_t FindCluster(Int_t startpix, Int_t cluster, MGeomCam *geom)
 {
+  return 1;
 
-
-} 
+} ;
