Index: trunk/FACT++/src/ratecontrol.cc
===================================================================
--- trunk/FACT++/src/ratecontrol.cc	(revision 17025)
+++ trunk/FACT++/src/ratecontrol.cc	(revision 17026)
@@ -428,5 +428,5 @@
     {
         // Check if received event is valid
-        if (!CheckEventSize(evt, (416+6)*4))
+        if (!CheckEventSize(evt, (2*416+8)*4))
             return GetCurrentState();
 
@@ -489,5 +489,5 @@
         avg_dev /= fCurrentsMed.size();
 
-        // One could recalculate the median of all pixels incluing the
+        // One could recalculate the median of all pixels including the
         // correction for the three crazy pixels, but that is three out
         // of 320. The effect on the median should be negligible anyhow.
@@ -497,22 +497,6 @@
             {
                 const PixelMapEntry &hv = fMap.hv(i);
-                if (!hv)
-                    continue;
-
-                // The current is proportional to the rate. To calculate
-                // a measure for the rate, the average current per pixel
-                // is caluclated for the trigger patch.
-                int weight = hv.group() ? 5 : 4;
-
-                // Use only the current in the pixels with the correct
-                // resistor as a reference, ignore the crazy ones.
-                // Effects of these should be corrected by the
-                // rate control later, not the initial setup.
-                if (i==66)           
-                    weight = 4./(3+10);
-                if (i==191 || i==193)
-                    weight = 5./(4+10);
-
-                vec[hv.hw()/9] += it->second[i] * weight;
+                if (hv)
+                    vec[hv.hw()/9] += it->second[i]*hv.count();
             }
 
@@ -531,4 +515,5 @@
         {
             vec[i] /= fCurrentsVec.size()*9;
+
             avg2 += vec[i];
 
