Index: trunk/MagicSoft/Mars/mtemp/mifae/Changelog
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 4292)
+++ trunk/MagicSoft/Mars/mtemp/mifae/Changelog	(revision 4293)
@@ -25,5 +25,5 @@
       islands
 
-   * library/MIslands.[h,cc],MIslandCalc.cc
+   * library/MIslands.[h,cc],MIslandCalc.[h,cc], MIslandCleaning.[h,cc]
      - add a new island cleaning which consists in removing all the
       islands except the larger one
Index: trunk/MagicSoft/Mars/mtemp/mifae/library/MIslandClean.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/library/MIslandClean.cc	(revision 4292)
+++ trunk/MagicSoft/Mars/mtemp/mifae/library/MIslandClean.cc	(revision 4293)
@@ -26,4 +26,7 @@
 //   islands are supposed to be eliminated.     
 //
+// Other cleanings that are allowed in this code are:
+// 
+//    - Resting only with the continent, i.e. the larger island
 //    
 //  Example:
@@ -164,6 +167,6 @@
     
   //
-  //eliminates the island with a signal-to-noise 
-  //lower than a given limit 
+  //eliminates the island with a time spread  
+  //higher than a given limit 
   //
   //else if( fIslandCleaningMethod == kTiming ){
@@ -188,4 +191,38 @@
       }	    
   }
+
+  //
+  //eliminates all the islands except the continent, 
+  //i.e. the larger island in the event
+  //
+  else if( fIslandCleaningMethod == 3 ){
+    Int_t nisl = fIsl->GetIslNum();
+
+    Int_t max = -1000;    
+    Int_t idMax;
+
+    for(Int_t isl = 0; isl<nisl ; isl++)
+      {
+	if (fIsl->GetPixNum(isl)>max)
+	 {
+	   max = fIsl->GetPixNum(isl);
+	   idMax = isl;
+	 } 
+      }	    
+
+    for(Int_t isl = 0; isl<nisl ; isl++)
+      {
+	if (isl != idMax)
+	  {
+	    for(Int_t idx = 0;idx<577; idx++)
+	      {
+		MCerPhotPix &pix  = (*fEvt)[idx];
+		
+		if (fIsl->GetIslId(idx) == isl)
+		  pix.SetPixelUnused();
+	      }
+	  }
+      }
+  }
   
   fEvt->SetReadyToSave();
