Index: trunk/MagicSoft/Mars/mimage/MConcentration.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MConcentration.cc	(revision 3543)
+++ trunk/MagicSoft/Mars/mimage/MConcentration.cc	(revision 3568)
@@ -116,64 +116,48 @@
 Int_t MConcentration::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hillas)
 {
-    const UInt_t npixevt = evt.GetNumPixels();
-
     Float_t maxpix[9] = {0,0,0,0,0,0,0,0,0};             // [#phot]
 
-    for (UInt_t i=0; i<npixevt; i++)
+    TIter Next(evt);
+    MCerPhotPix *pix = 0;
+    while ((pix=(MCerPhotPix*)Next()))
     {
-        const MCerPhotPix &pix = evt[i];
-
-        // skip unused pixels
-        if (!pix.IsPixelUsed())
-            continue;
-
-        const Int_t pixid = pix.GetPixId();
-
-        const MGeomPix &gpix = geom[pixid];
-
-        Double_t nphot = pix.GetNumPhotons();
-
-        //
-        // Now we are working on absolute values of nphot, which
-        // must take pixel size into account
-        //
-        nphot *= geom.GetPixRatio(pixid);
+        const Int_t    pixid = pix->GetPixId();
+        const Double_t nphot = pix->GetNumPhotons()* geom.GetPixRatio(pixid);
 
 	// Get number of photons in the 8 most populated pixels	
+        if (maxpix[0]<=nphot)
+        {
+            for(int i=0;i<8;i++)
+                maxpix[8-i]=maxpix[7-i];
+            maxpix[0]=nphot;
+            continue;
+        }
 
-	if(maxpix[0]<=nphot) {
-	  for(int i=0;i<8;i++)
-	    maxpix[8-i]=maxpix[7-i];
-	  maxpix[0]=nphot;
-	}
-	else 
-	  for(int i=0;i<8;i++){
-	    if (nphot<maxpix[7-i]){
-	      for(int j=0;j<i-1;j++){  
-		maxpix[7-j]=maxpix[6-j];                 // [#phot]
-	      }
-	      maxpix[8-i]=nphot;
-	      break;
-	    }
-	  }
+	// Check if the latest value is 'somewhere in between'
+        for (int i=0; i<8; i++)
+        {
+            if (nphot>=maxpix[7-i])
+                continue;
 
+            for(int j=0;j<i-1;j++)
+                maxpix[7-j]=maxpix[6-j];                 // [#phot]
+
+            maxpix[8-i]=nphot;
+            break;
+        }
     }
 
     // Compute concentrations from the 8 pixels with higher signal
-   
     fConc[0]=maxpix[0];
-    for(int i=1;i<8;i++)
-      {
-	fConc[i]=fConc[i-1]+maxpix[i];
-      }
-    
-    for(int i=0;i<8;i++)
-      {
-	fConc[i]/=hillas.GetSize();                       // [ratio]
-      }
+
+    // No calculate the integral of the n highest pixels
+    for(int i=1; i<8; i++)
+        fConc[i] = fConc[i-1]+maxpix[i];
+
+    for(int i=0; i<8; i++)
+        fConc[i] /= hillas.GetSize();                    // [ratio]
 
     SetReadyToSave();
 
+    return 0;
 }
-
-
Index: trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 3543)
+++ trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc	(revision 3568)
@@ -65,6 +65,6 @@
     fHistLeakage1.SetYTitle("Counts");
     fHistLeakage1.SetDirectory(NULL);
+    fHistLeakage1.UseCurrentStyle();
     fHistLeakage1.SetFillStyle(4000);
-    fHistLeakage1.UseCurrentStyle();
 
     fHistLeakage2.SetName("Leakage2");
@@ -73,7 +73,7 @@
     fHistLeakage2.SetYTitle("Counts");
     fHistLeakage2.SetDirectory(NULL);
+    fHistLeakage2.UseCurrentStyle();
     fHistLeakage2.SetLineColor(kBlue);
     fHistLeakage2.SetFillStyle(4000);
-    fHistLeakage2.UseCurrentStyle();
  
     fHistUsedPix.SetName("UsedPix");
@@ -82,7 +82,7 @@
     fHistUsedPix.SetYTitle("Counts");
     fHistUsedPix.SetDirectory(NULL);
-    fHistUsedPix.SetLineColor(kGreen);
+    fHistUsedPix.UseCurrentStyle();
+    fHistUsedPix.SetLineColor(kBlue);
     fHistUsedPix.SetFillStyle(4000);
-    fHistUsedPix.UseCurrentStyle();
 
     fHistCorePix.SetName("CorePix");
@@ -91,7 +91,7 @@
     fHistCorePix.SetYTitle("Counts");
     fHistCorePix.SetDirectory(NULL);
-    fHistCorePix.SetLineColor(kRed);
+    fHistCorePix.UseCurrentStyle();
+    fHistCorePix.SetLineColor(kBlack);
     fHistCorePix.SetFillStyle(4000);
-    fHistCorePix.UseCurrentStyle();
 
     fHistConc.SetDirectory(NULL);
@@ -105,10 +105,10 @@
     fHistConc.SetYTitle("Counts");
     fHistConc1.SetYTitle("Counts");
+    fHistConc1.UseCurrentStyle();
+    fHistConc.UseCurrentStyle();
     fHistConc.SetFillStyle(4000);
     fHistConc1.SetFillStyle(4000);
     fHistConc1.SetLineColor(kBlue);
     fHistConc.SetFillStyle(0);
-    fHistConc1.UseCurrentStyle();
-    fHistConc.UseCurrentStyle();
 
 
