Index: trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- trunk/FACT++/src/EventBuilderWrapper.h	(revision 11126)
+++ trunk/FACT++/src/EventBuilderWrapper.h	(revision 11127)
@@ -719,4 +719,5 @@
     DimDescribedService fDimEvents;
     DimDescribedService fDimCurrentEvent;
+    DimDescribedService fDimEventData;
 
     bool fDebugStream;
@@ -735,6 +736,7 @@
         fDimEvents("FAD_CONTROL/EVENTS",        "I:2", ""),
         fDimCurrentEvent("FAD_CONTROL/CURRENT_EVENT", "I:1", ""),
+	fDimEventData("FAD_CONTROL/EVENT_DATA", "S:1;I:1;S:1;I:2;S:1;S", ""),
         fDebugStream(false), fDebugRead(false)
-    {
+   {
         if (This)
             throw logic_error("EventBuilderWrapper cannot be instantiated twice.");
@@ -1083,4 +1085,151 @@
     }
 
+    	struct DimEventData
+	{
+	    uint16_t Roi ;            // #slices per pixel (same for all pixels and tmarks)
+	    uint32_t EventNum ;       // EventNumber as from FTM
+	    uint16_t TriggerType ;    // Trigger Type from FTM
+
+	    uint32_t PCTime ;         // when did event start to arrive at PC
+	    uint32_t BoardTime;       //
+
+	    int16_t StartPix;         // First Channel per Pixel (Pixels sorted according Software ID)  ; -1 if not filled
+	    int16_t StartTM;          // First Channel for TimeMark (sorted Hardware ID) ; -1 if not filled
+
+	    uint16_t Adc_Data[];     // final length defined by malloc ....
+
+	} __attribute__((__packed__));;
+
+        template<typename T>
+        vector<T> Check(const PEVNT_HEADER *fadhd, const T &val, bool &rc)
+        {
+            const size_t offset = reinterpret_cast<const char*>(&val)-reinterpret_cast<const char*>(fadhd);
+
+            vector<T> vec(40);
+
+            vec[0] = val;
+
+            rc = true;
+            for (int i=1; i<40; i++)
+            {
+
+                const T &t = *reinterpret_cast<const T*>(reinterpret_cast<const char*>(fadhd+i)+offset);
+                if (t!=val)
+                    rc = false;
+
+                vec[i] = t;
+            }
+
+            return vec;
+        }
+
+        template<typename T>
+        vector<uint8_t> CheckBits(const PEVNT_HEADER *fadhd, const T &val, T &rc)
+        {
+            const size_t offset = reinterpret_cast<const char*>(&val)-reinterpret_cast<const char*>(fadhd);
+
+            vector<uint8_t> vec(40);
+
+            rc = 0;
+            for (int i=0; i<40; i++)
+            {
+                const T &t = *reinterpret_cast<const T*>(reinterpret_cast<const char*>(fadhd+i)+offset);
+
+                rc |= val^t;
+
+                vec[i] = t;
+            }
+
+            // Return 1 for all bits which are identical
+            //        0 for all other bits
+            rc = ~rc;
+            return vec;
+        }
+
+
+    int eventCheck(PEVNT_HEADER *fadhd, EVENT *event)
+    {
+        /*
+         fadhd[i] ist ein array mit den 40 fad-headers
+         (falls ein board nicht gelesen wurde, ist start_package_flag =0 )
+
+         event  ist die Struktur, die auch die write routine erhaelt;
+         darin sind im header die 'soll-werte' fuer z.B. eventID
+         als auch die ADC-Werte (falls Du die brauchst)
+
+         Wenn die routine einen negativen Wert liefert, wird das event
+         geloescht (nicht an die write-routine weitergeleitet [mind. im Prinzip]
+         */
+
+        bool     ok_verno;
+        bool     ok_runno;
+        uint16_t ok_bitmask;
+
+        const vector<uint16_t> verno   = Check(fadhd, fadhd->version_no, ok_verno);
+        const vector<uint32_t> runno   = Check(fadhd, fadhd->runnumber,  ok_runno);
+        const vector<uint8_t>  bitmask = CheckBits(fadhd, fadhd->PLLLCK, ok_bitmask);
+
+        /*
+         uint16_t start_package_flag;
+         uint16_t package_length;
+         uint16_t version_no;
+         uint16_t PLLLCK;
+
+         uint16_t trigger_crc;
+         uint16_t trigger_type;
+         uint32_t trigger_id;
+
+         uint32_t fad_evt_counter;
+         uint32_t REFCLK_frequency;
+
+         uint16_t board_id;
+         uint8_t  zeroes;
+         int8_t   adc_clock_phase_shift;
+         uint16_t number_of_triggers_to_generate;
+         uint16_t trigger_generator_prescaler;
+
+         uint64_t DNA;
+
+         uint32_t time;
+         uint32_t runnumber;
+
+         int16_t  drs_temperature[NTemp];
+
+         uint16_t dac[NDAC];
+         */
+
+	static DimEventData *data = 0;
+
+	const size_t sz = sizeof(DimEventData)+event->Roi*2;
+
+	if (data && data->Roi != event->Roi)
+	{
+	    delete data;
+	    data = 0;
+	}
+
+        if (!data)
+	    data = reinterpret_cast<DimEventData*>(new char[sz]);
+
+//        cout << sizeof(DimEventData) << " " << event->Roi << " " << sz << " " << sizeof(*data) << endl;
+
+	data->Roi         = event->Roi;
+	data->EventNum    = event->EventNum;
+	data->TriggerType = event->TriggerType;
+	data->PCTime      = event->PCTime;
+	data->BoardTime   = event->BoardTime[0];
+	data->StartPix    = event->StartPix[0];
+	data->StartTM     = event->StartTM[0];
+
+        memcpy(data->Adc_Data, event->Adc_Data, event->Roi*2);
+
+        fDimEventData.setData(data, sz);
+	fDimEventData.updateService();
+
+        //delete data;
+
+	return 0;
+    }
+
 };
 
@@ -1151,17 +1300,5 @@
     int eventCheck(PEVNT_HEADER *fadhd, EVENT *event)
     {
-        /*
-         fadhd[i] ist ein array mit den 40 fad-headers
-         (falls ein board nicht gelesen wurde, ist start_package_flag =0 )
-
-         event  ist die Struktur, die auch die write routine erhaelt;
-         darin sind im header die 'soll-werte' fuer z.B. eventID
-         als auch die ADC-Werte (falls Du die brauchst)
-
-         Wenn die routine einen negativen Wert liefert, wird das event
-         geloescht (nicht an die write-routine weitergeleitet [mind. im Prinzip]
-         */
-
-        return 0;
+        return EventBuilderWrapper::This->eventCheck(fadhd, event);
     }
 }
Index: trunk/FACT++/src/fadctrl.cc
===================================================================
--- trunk/FACT++/src/fadctrl.cc	(revision 11126)
+++ trunk/FACT++/src/fadctrl.cc	(revision 11127)
@@ -1173,7 +1173,7 @@
     }
 
-    bool            fStatusT;
     vector<uint8_t> fStatus1;
     vector<uint8_t> fStatus2;
+    bool            fStatusT;
 
     int Execute()
@@ -1197,5 +1197,5 @@
         vector<uint8_t> stat2(40);
 
-        int cnt = 0; // counter for enbled board
+        int cnt = 0; // counter for enabled board
 
         for (int idx=0; idx<40; idx++)
Index: trunk/FACT++/src/ftmctrl.cc
===================================================================
--- trunk/FACT++/src/ftmctrl.cc	(revision 11126)
+++ trunk/FACT++/src/ftmctrl.cc	(revision 11127)
@@ -1429,18 +1429,17 @@
         //map<uint32_t,uint32_t>::const_iterator = fClockConditionerMap.find(freq);
 
-        static const uint64_t R1  = 0x00010101;
-        static const uint64_t R8  = 0x10000908;
-        static const uint64_t R9  = 0xa0032a09;
-        static const uint64_t R11 = 0x0082000b;
-        static const uint64_t R13 = 0x020a000d;
-
-        static const uint64_t freq0700[8] = { 0x0003e000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400f50f };
-        static const uint64_t freq1000[8] = { 0x0003a000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
-        static const uint64_t freq2000[8] = { 0x00035000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
-        static const uint64_t freq2001[8] = { 0x00038000, R1, R8, R9, R11, R13, 0x0830280e, 0x1400fa0f };
-        static const uint64_t freq3000[8] = { 0x00037200, R1, R8, R9, R11, R13, 0x0830400e, 0x1420a30f };
-//      static const uint64_t freq4000[8] = { 0x00032800, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
-        static const uint64_t freq4000[8] = { 0x00034000, R1, R8, R9, R11, R13, 0x0830280e, 0x1400fa0f };
-        static const uint64_t freq5000[8] = { 0x00032000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
+        static const uint64_t R0hi  = 0x00030000;
+        static const uint64_t R8    = 0x10000908;
+        static const uint64_t R9    = 0xa0032a09;
+        static const uint64_t R11   = 0x0082000b;
+        static const uint64_t R13   = 0x020a000d;
+        static const uint64_t R14hi = 0x08300000;
+
+        static const uint64_t freq0800[8] = { R0hi|0xfe00, 0x00010101, R8, R9, R11, R13, R14hi|0x800e, 0x14027b0f };
+        static const uint64_t freq1000[8] = { R0hi|0xd000, 0x00010101, R8, R9, R11, R13, R14hi|0x400e, 0x1401450f };
+        static const uint64_t freq2000[8] = { R0hi|0x8000, 0x00010101, R8, R9, R11, R13, R14hi|0x280e, 0x1400fa0f };
+        static const uint64_t freq3000[8] = { R0hi|0x9000, 0x00030101, R8, R9, R11, R13, R14hi|0x400e, 0x1402a30f };
+        static const uint64_t freq4000[8] = { R0hi|0x4000, 0x00010100, R8, R9, R11, R13, R14hi|0x280e, 0x1400fa0f };
+        static const uint64_t freq5000[8] = { R0hi|0x8000, 0x00030200, R8, R9, R11, R13, R14hi|0x280e, 0x1402710f };
 
         const uint64_t *reg = 0;
@@ -1448,8 +1447,7 @@
         switch (freq)
         {
-        case  700: reg = freq0700; break;
+        case  800: reg = freq0800; break;
         case 1000: reg = freq1000; break;
         case 2000: reg = freq2000; break;
-        case 2001: reg = freq2001; break;
         case 3000: reg = freq3000; break;
         case 4000: reg = freq4000; break;
