Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 7181)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 7188)
@@ -141,9 +141,9 @@
     Float_t maxpix2 = 0;                                 // [#phot]
 
-    /*
-    MSignalPix *pix = 0;
-    TIter Next(evt);
-    while ((pix=(MSignalPix*)Next()))
-    */
+    const Bool_t ismagiclike =
+        geom.GetNumPixels() == 577 &&
+        geom.GetNumAreas()  == 2   &&
+        geom.GetPixRatio(396) > geom.GetPixRatio(397);
+
     UInt_t npix = evt.GetNumPixels();
     for (UInt_t i=0; i<npix; i++)
@@ -182,22 +182,31 @@
            edgepix2 += nphot;
 
-        //
-        // Now we are working on absolute values of nphot, which
-        // must take pixel size into account
-        //
-        nphot *= geom.GetPixRatio(i/*pixid*/);
-
-	// count inner pixels: To dependent on MAGIC Camera --> FIXME
-
-        if (i<397){
+        const Double_t ratio = geom.GetPixRatio(i);
+        if (TMath::Nint(ratio)==1) // Means this is a small (= inner pixel)
+        {
             fInnerSize += nphot;
-            if(i>270){
-                edgepixin2 += nphot;
-                if(i>330)
-                    edgepixin1 += nphot;
+
+            // Do calculation of "inner leakage" only for MAGIC-like geometry,
+            // i.e., 577 pixels, pixels of 2 different areas, inner part
+            // from pixel 0 to 396:
+            if (ismagiclike)
+            {
+                if(i > 270) // last two "rings" of inner pixels
+                {
+                    edgepixin2 += nphot;
+                    if(i > 330)  // last "ring" of inner pixels
+                        edgepixin1 += nphot;
+                }
             }
         }
 
-	// Compute Concentration 1-2
+        //
+        // Now convert nphot from absolute number of photons or phe to signal
+        // density (divide by pixel area), to find the pixel with highest signal
+        // density:
+        //
+        nphot *= ratio;
+
+ 	// Look for signal density in two highest pixels:
         if (nphot>maxpix1)
         {
@@ -213,7 +222,12 @@
     fInnerLeakage1 = edgepixin1 / fInnerSize;
     fInnerLeakage2 = edgepixin2 / fInnerSize;
+
     fLeakage1 = edgepix1 / hillas.GetSize();
     fLeakage2 = edgepix2 / hillas.GetSize();
 
+    // FIXME?: in case the pixel with highest signal density is an outer pixel,
+    // the value of fConc (ratio of signal in two highest pixels to SIZE) should
+    // rather be 2*fConc1, under the simplest assumption that the light density 
+    // inside the outer (large) pixel is uniform.
     fConc  = (maxpix1+maxpix2)/hillas.GetSize();         // [ratio]
     fConc1 = maxpix1/hillas.GetSize();                   // [ratio]
