Index: /trunk/FACT++/src/smartfact.cc
===================================================================
--- /trunk/FACT++/src/smartfact.cc	(revision 17375)
+++ /trunk/FACT++/src/smartfact.cc	(revision 17376)
@@ -1617,10 +1617,8 @@
             return GetCurrentState();
 
-        //const float *avg = d.Ptr<float>();
-        //const float *rms = d.Ptr<float>(1440*sizeof(float));
         const float *dat = d.Ptr<float>(1440*sizeof(float)*2);
-        //const float *pos = d.Ptr<float>(1440*sizeof(float)*3);
-
-        vector<float> max(320, -2);
+
+        /*
+        vector<float> max(320, 0);
         for (int i=0; i<1440; i++)
         {
@@ -1630,13 +1628,19 @@
             const int idx = (fPixelMap.hw(i).hw()/9)*2+fPixelMap.hw(i).group();
             const double v = dat[i]/1000;
-            if (v>max[idx])
-                max[idx]=v;
-        }
+            //if (v>max[idx])
+            //    max[idx]=v;
+
+            max[idx] += v/4;
+        } */
+
+        vector<float> max(1440);
+        for (int i=0; i<1440; i++)
+            max[i] = dat[i%9==8 ? i-2 : i]/1000;
 
         const uint32_t trig = d.GetQoS() & FAD::EventHeader::kLPext;
 
+        const float min = fFadControlDrsRuns[0]==0 ? -1 : 0;
+
         float scale = 2;
-        float min   = fFadControlDrsRuns[0]==0 ? -1 : 0;
-
         if (trig&FAD::EventHeader::kLPext)
             scale = 1;
