Index: trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc	(revision 4043)
+++ trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc	(revision 4044)
@@ -38,4 +38,9 @@
 #include "MHillasSrcCalc.h"
 #include "MHillasCalc.h"
+#include "MArrivalTimeCam.h"
+#include "MArrivalTimeCalc2.h"
+#include "MIslands.h"
+#include "MIslandCalc.h"
+#include "MIslandClean.h"
 #include "MWriteRootFile.h"
 #include "MProgressBar.h"
@@ -70,4 +75,7 @@
 Float_t  lcore = 3.0;
 Float_t  ltail = 1.5;
+Int_t islflag = 0;
+Float_t  lnew  = 40;
+Int_t  kmethod = 1;
 Int_t    nfiles = 0;
 
@@ -213,4 +221,23 @@
   MSrcPosCam    source;
   MRawRunHeader runhead;
+
+  MArrivalTimeCam   timecam;
+     
+  MIslands      isl;
+  isl.SetName("MIslands1");
+  
+  MIslands      isl2;
+  isl2.SetName("MIslands2");
+
+  if (islflag == 1 || islflag == 2)
+    {
+      plist4.AddToList(&timecam);
+      plist4.AddToList(&isl);
+    }
+  
+  if (islflag == 2)
+    {
+      plist4.AddToList(&isl2);
+    }
   
   plist4.AddToList(&geomcam);
@@ -241,9 +268,23 @@
   
   MImgCleanStd      clean(lcore,ltail);
+
+  MArrivalTimeCalc2 timecalc;
+  
+  MIslandCalc       island;
+  island.SetOutputName("MIslands1");
+
+  MIslandClean      islclean(lnew);
+  islclean.SetInputName("MIslands1");
+  islclean.SetMethod(kmethod);
+      
+  MIslandCalc       island2;
+  island2.SetOutputName("MIslands2");  
+  
+  
   MHillasCalc       hcalc;
   MHillasSrcCalc    csrc1;
   
   MWriteRootFile write(outname,"RECREATE");
-
+  
   write.AddContainer("MHillas"        , "Parameters");
   write.AddContainer("MHillasSrc"     , "Parameters");
@@ -254,5 +295,10 @@
   write.AddContainer("MConcentration" , "Parameters");
   write.AddContainer("MSrcPosCam"     , "Parameters");
-  
+
+  if (islflag == 1 || islflag == 2)
+    write.AddContainer("MIslands1" , "Parameters");
+  if (islflag == 2) 
+    write.AddContainer("MIslands2" , "Parameters");
+
   tlist4.AddToList(&read4);
   tlist4.AddToList(&geomapl);
@@ -261,4 +307,17 @@
   //tlist4.AddToList(&blind);
   tlist4.AddToList(&clean);
+
+  if (islflag == 1 || islflag == 2)
+    {
+      tlist4.AddToList(&timecalc);
+      tlist4.AddToList(&island);
+    }
+
+  if (islflag == 2)
+    {
+      tlist4.AddToList(&islclean);
+      tlist4.AddToList(&island2);
+    }
+  
   //tlist4.AddToList(&blind2);
   tlist4.AddToList(&hcalc);
@@ -360,4 +419,18 @@
 	  ifun >> ltail;
 	}
+
+      if(strcmp(word.Data(),"ISLFLAG")==0)
+	{
+	  ifun >> islflag;
+	}
+
+      // island cleaning 
+      if (islflag == 2){
+	if(strcmp(word.Data(),"ISLANDCLEAN")==0)
+	  {
+	    ifun >> kmethod;
+	    ifun >> lnew;
+	  }
+      }
     }
 
@@ -384,6 +457,12 @@
   cout << "Calibration flag: " << calflag << endl;
   cout << "Cleaning level: ("<<lcore<<","<<ltail<<")" << endl;
+  if (islflag == 1 || islflag == 2)
+    cout << "Island calcultation..." << endl;
+  if (islflag == 2)
+    {
+      cout << "Island Cleaning: "<< kmethod <<" method  "<< lnew << " new threshold" << endl;
+    }
   cout << "***********" << endl << endl;
-
+  
   if(!pediter.GetNumEntries())
     {
Index: trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard	(revision 4043)
+++ trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard	(revision 4044)
@@ -23,2 +23,13 @@
 // Cleaning level
 CLEANLEVEL 3.0 1.5
+
+//Island calculations
+// 0  nothing about islands 
+// 1  islands w/o cleaning
+// 2  islands  w  cleaning
+ISLFLAG 0
+
+// island cleaning:
+// 0: timing method     val:0.2, 0.3, 0.5... 
+// 1: no timing method  val: 40, 50, 60...
+ISLANDCLEAN 1 40
