Index: /trunk/FACT++/src/PixelMap.h
===================================================================
--- /trunk/FACT++/src/PixelMap.h	(revision 11971)
+++ /trunk/FACT++/src/PixelMap.h	(revision 11972)
@@ -13,11 +13,14 @@
 #endif
 
+// FIXME: Replace 416 by BIAS::kNumChannels
+
 struct PixelMapEntry
 {
-    int index;               /// Software index
-    int cbpx;                /// Hardware index as CBPX
-    int gapd;                /// gAPD Bias voltage
-    int hv_board;            /// Bias suppply board
-    int hv_channel;          /// Bias supply channel
+    int   index;               /// Software index
+    int   cbpx;                /// Hardware index as CBPX
+    int   gapd;                /// gAPD index
+    float Vgapd;               /// gAPD Bias voltage
+    int   hv_board;            /// Bias suppply board
+    int   hv_channel;          /// Bias supply channel
 
     int crate() const { return cbpx/1000; }
@@ -58,5 +61,4 @@
 
             int   idummy;
-            float fdummy;
 
             PixelMapEntry entry;
@@ -67,5 +69,5 @@
             str >> idummy;
             str >> entry.gapd;
-            str >> fdummy;
+            str >> entry.Vgapd;
             str >> entry.hv_board;
             str >> entry.hv_channel;
@@ -139,5 +141,5 @@
             if (it->hv_board==board && it->hv_channel==channel)
             {
-                avg += it->gapd;
+                avg += it->Vgapd;
                 num ++;
             }
@@ -153,6 +155,6 @@
     std::vector<float> Vgapd() const
     {
-        std::vector<float> avg;
-        std::vector<int>   num;
+        std::vector<float> avg(416);
+        std::vector<int>   num(416);
 
         for (std::vector<PixelMapEntry>::const_iterator it=begin(); it!=end(); it++)
@@ -160,11 +162,13 @@
             const int ch = it->hv_board*32 + it->hv_channel;
 
-            avg[ch] += it->gapd;
+            avg[ch] += it->Vgapd;
             num[ch] ++;
         }
 
         for (int ch=0; ch<416; ch++)
+        {
             if (num[ch])
                 avg[ch] /= num[ch];
+        }
 
         return avg;
