Index: /trunk/FACT++/src/smartfact.cc
===================================================================
--- /trunk/FACT++/src/smartfact.cc	(revision 17028)
+++ /trunk/FACT++/src/smartfact.cc	(revision 17029)
@@ -1078,31 +1078,34 @@
         double power_apd = 0;
 
-        // Calibrate the data (subtract offset)
-        for (int i=0; i<320; i++)
-        {
-            // Group index (0 or 1) of the of the pixel (4 or 5 pixel patch)
-            const int N = fPixelMap.hv(i).count();
-
-            // Serial resistor of the individual G-APDs
-            double R5 = 3900/N;
-
-            // This is also valid for the patches with wrong resistors,
-            // because Iapd is a factor f larger but R a factor f smaller
-            double Iapd = ptr[i] * 1e-6;  // [A]
-            double Iout = Iapd*N;         // [A]
-
-            double UdrpCam =     1000 *Iout;  // Voltage seen by everything in Camera
-            double UdrpApd = (R5+2000)*Iout;  // Voltage seen by G-APD
-
-            const double pwrCam = Iapd * (fBiasControlVoltageVec[i]-UdrpCam);
-            const double pwrApd = Iapd * (fBiasControlVoltageVec[i]-UdrpApd);
-
-            // Total power participated in the camera at the G-APD
-            // and the serial resistors (total voltage minus voltage
-            // drop at resistors in bias crate)
-            power_tot += pwrCam;
-
-            // Power consumption per G-APD
-            power_apd += pwrApd;
+        if (fBiasControlVoltageVec.size()>0)
+        {
+            // Calibrate the data (subtract offset)
+            for (int i=0; i<320; i++)
+            {
+                // Group index (0 or 1) of the of the pixel (4 or 5 pixel patch)
+                const int N = fPixelMap.hv(i).count();
+
+                // Serial resistor of the individual G-APDs
+                double R5 = 3900/N;
+
+                // This is also valid for the patches with wrong resistors,
+                // because Iapd is a factor f larger but R a factor f smaller
+                double Iapd = ptr[i] * 1e-6;  // [A]
+                double Iout = Iapd*N;         // [A]
+
+                double UdrpCam =     1000 *Iout;  // Voltage seen by everything in Camera
+                double UdrpApd = (R5+2000)*Iout;  // Voltage seen by G-APD
+
+                const double pwrCam = Iapd * (fBiasControlVoltageVec[i]-UdrpCam);
+                const double pwrApd = Iapd * (fBiasControlVoltageVec[i]-UdrpApd);
+
+                // Total power participated in the camera at the G-APD
+                // and the serial resistors (total voltage minus voltage
+                // drop at resistors in bias crate)
+                power_tot += pwrCam;
+
+                // Power consumption per G-APD
+                power_apd += pwrApd;
+            }
         }
 
