Index: /trunk/FACT++/src/FAD.h
===================================================================
--- /trunk/FACT++/src/FAD.h	(revision 16103)
+++ /trunk/FACT++/src/FAD.h	(revision 16104)
@@ -8,38 +8,6 @@
 //---------------------------------------------------------------
 
-    //
-// Other definitions
-//
-#define MAX_ADDR 0xFF           // highest address in Config-RAM
-#define BADDR_ROI 0x00          // Baseaddress ROI-Values
-#define BADDR_DAC 0x24          // Baseaddress DAC-Values
-#define BADDR_CONT_TRIGGER_TIME 0x2C // Baseaddress for the continouus trigger timing.
-#define ADDR_RUNNUMBER 0x2D //
-#define MAX_VAL 65535
-#define MAX_ROIVAL 1024
-#define MAX_DACVAL 65535
-
-#define NChannels      9
-#define NBins       1024
-#define NChips         4
 #define NTemp          4
 #define NDAC           8
-
-//
-// Data structures
-//
-
-typedef struct{
-  int hardID ;       //hardware ID
-  int pos_i ;        //geometrical positon row 
-  int pos_j ;        //                    column
-  int G_APD ;        //G-APD identifier
-  double V_op ;      //operation voltage
-  int HV_B ;         //HV Board
-  int HV_C ;         //HV Channel
-  double pos_X ;     //geometrical position in pixel units
-  double pos_Y ;     //
-} PIX_MAP ;
-
 
 typedef struct {
@@ -91,20 +59,4 @@
 #define NPIX       1440      // max. number of pixels
 #define NTMARK      160      // max. number of timeMarker signals
-//#define MAX_SOCK    280      // NBOARDS * 7
-
-
-typedef union {
-  uint8_t   B[8] ;        //8 bytes
-  uint16_t  S[4] ;        //4 short
-  uint32_t  I[2] ;        //2 int
-  uint64_t  L    ;        //1 long
-} L_WORD ;
-
-typedef union {
-  uint8_t   B[4] ;        //4 bytes
-  uint16_t  S[2] ;        //2 short
-  uint32_t  I    ;        //1 int
-} I_WORD ;
-
 
 //---------------------------------------------------------------
@@ -138,9 +90,8 @@
 } __attribute__((__packed__)) EVENT ;
 
-
-
 //---------------------------------------------------------------
 
-typedef struct _RUN_HEAD {
+struct RUN_HEAD
+{
   uint32_t Version ;
   uint32_t RunType ;
@@ -156,127 +107,12 @@
   PEVNT_HEADER FADhead[NBOARDS];    // [ NBoards ] sorted Board Headers (according Hardware ID)
 
-//do we also have info about FTM config we want to add here ???
-} __attribute__((__packed__)) RUN_HEAD ;
+  RUN_HEAD() : Version(1), RunType(-1), NBoard(NBOARDS), NPix(NPIX), NTm(NTMARK)
+  {
+  }
 
 
-//---------------------------------------------------------------
+//do we also have info about FTM config we want to add here ???
+} __attribute__((__packed__));
 
-typedef struct _RUN_TAIL {
-/*  uint32_t nEventsOk ;  //how many events were written
-  uint32_t nEventsRej;  //how many events were rejected by SW-trig
-  uint32_t nEventsBad;  //how many events were rejected by Error
-
-  uint32_t PCtime0 ;    //time when first event received
-  uint32_t PCtimeX ;    //time when last  event received
-
-*/
-//probably more to come ...
-} __attribute__((__packed__)) RUN_TAIL ;
-
-
-
-//---------------------------------------------------------------
-
-typedef void* FileHandle_t ;
-
-typedef struct {
-  uint32_t runId ;       //run number
-//  uint32_t firstTime ;   //epoch of first event received
-//  uint32_t firstUsec ;   //epoch of first event received
-  uint32_t lastTime ;    //time when last event written so far
-  uint32_t closeTime ;   //time when run should be closed
-  uint32_t maxEvt ;      //maximum number of events to write
-  uint32_t actEvt ;      //actual number of events written so far
-  uint32_t procEvt ;     //actual number of events processed so far
-   int32_t lastEvt ;     //last event of this run read so far
-//  uint32_t nextEvt ;     //next event number to be written
-//  uint32_t waitEvt ;     //event that would be ready to be written
-   int16_t fileId  ;     //<0 never opened, 0=open, >0 closed
-   int16_t procId  ;     //processing <0 never opened, 0=open, >0 closed
-   int16_t roi0 ;        //roi for normal pixels
-   int16_t roi8 ;        //roi for pixels8
-
-  FileHandle_t fileHd ;   //fileHandle (NULL if not open)
-//   int16_t ctrlId[MAX_EVT] ; //index to buffId (sorted list; -1 =end)
-//  uint16_t buffId[MAX_EVT] ; //index to mBuffer(buffered raw data)
-} RUN_CTRL ;
-
-
-
-//---------------------------------------------------------------
-
-/*
-typedef struct {
-  int32_t  evNum ;
-  int32_t  fadNum ;
-  int32_t  trgNum ;
-  int32_t  trgTyp ;
-  uint32_t runNum ;
-  int32_t  fadLen ;
-  int32_t  nBoard ;
-  int16_t  board[ NBOARDS ];
-  int16_t  nRoi   ;
-  int16_t  nRoiTM ;
-  uint32_t pcTime[2] ;
-//  int32_t  evtLen ;
-  uint8_t  Errors[4] ;
-
-  uint32_t evtCtrl_idx;
-
-  EVENT   *fEvent ;
-  PEVNT_HEADER *FADhead; //
-//  int8_t  *buffer ;
-
-} WRK_DATA ;             //internal to eventbuilder
-*/
-
-//---------------------------------------------------------------
-
-
-typedef struct {
-//  int frstPtr ;             //first used index
-//  int lastPtr ;             //last  used index
-//    int mBuffer_idx;//[MAX_EVT*MAX_RUN] ;     //index of event in mBuffer
-  int evtStat;//[MAX_EVT*MAX_RUN] ;    //status of event:
-                                      // -1=empty
-                                      //  1..NBoards reading #Boards
-                                      // 90-99 : end reading
-                                      //128-255: processing
-                                      //256-
-                                      //201=start processing
-                                      //299=end processing
-                                      //901=start writing
-                                      //999=finished writing
-                                //(TO BE REVISED)
-
-  //  uint32_t lastRecv;//[MAX_EVT*MAX_RUN] ;     //time when last action happened
-
-
-  // ====================================================
-
-
-  int32_t  evNum;
-  int32_t  fadNum;
-  int32_t  trgNum;
-  int32_t  trgTyp;
-  uint32_t runNum;
-  int32_t  fadLen;
-  int32_t  nBoard;
-  int16_t  board[NBOARDS];
-  int16_t  nRoi;
-  int16_t  nRoiTM;
-  uint32_t pcTime[2] ;
-  uint8_t  Errors[4] ;
-
-  //uint32_t evtCtrl_idx;
-  uint32_t runCtrl_idx;
-
-  EVENT   *fEvent ;
-  PEVNT_HEADER *FADhead; //
-
-  // ====================================================
-
-
-} EVT_CTRL ;     //internal to eventbuilder
 
 //---------------------------------------------------------------
@@ -294,38 +130,4 @@
 
 //---------------------------------------------------------------
-
-typedef struct {
-
-  //some info about what happened since start of program (or last 'reset')
-   uint32_t reset ;             //#if increased, reset all counters
-   uint32_t numRead[NBOARDS] ; //how often succesfull read from N sockets per loop
-
-   uint64_t gotByte[NBOARDS] ;  //#Bytes read per Board
-   uint32_t gotErr[NBOARDS] ;   //#Communication Errors per Board
-   uint32_t evtGet;             //#new Start of Events read
-   uint32_t evtTot;             //#complete Events read
-   uint32_t evtErr;             //#Events with Errors
-   uint32_t evtSkp;             //#Events incomplete (timeout)
-
-   uint32_t procTot;            //#Events processed
-   uint32_t procErr;            //#Events showed problem in processing
-   uint32_t procTrg;            //#Events accepted by SW trigger
-   uint32_t procSkp;            //#Events rejected by SW trigger
-
-   uint32_t feedTot;            //#Events used for feedBack system
-   uint32_t feedErr;            //#Events rejected by feedBack
-
-   uint32_t wrtTot;             //#Events written to disk
-   uint32_t wrtErr;             //#Events with write-error
-
-   uint32_t runOpen;            //#Runs opened
-   uint32_t runClose;           //#Runs closed
-   uint32_t runErr;             //#Runs with open/close errors
-
-
-  //info about current connection status
-   uint8_t  numConn[NBOARDS] ;  //#Sockets succesfully open per board
-
-}  __attribute__((__packed__)) EVT_STAT ;         //EventBuilder Status
 
 typedef struct {
