Changeset 16104 for trunk/FACT++
- Timestamp:
- 05/24/13 13:54:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/FAD.h
r15490 r16104 8 8 //--------------------------------------------------------------- 9 9 10 //11 // Other definitions12 //13 #define MAX_ADDR 0xFF // highest address in Config-RAM14 #define BADDR_ROI 0x00 // Baseaddress ROI-Values15 #define BADDR_DAC 0x24 // Baseaddress DAC-Values16 #define BADDR_CONT_TRIGGER_TIME 0x2C // Baseaddress for the continouus trigger timing.17 #define ADDR_RUNNUMBER 0x2D //18 #define MAX_VAL 6553519 #define MAX_ROIVAL 102420 #define MAX_DACVAL 6553521 22 #define NChannels 923 #define NBins 102424 #define NChips 425 10 #define NTemp 4 26 11 #define NDAC 8 27 28 //29 // Data structures30 //31 32 typedef struct{33 int hardID ; //hardware ID34 int pos_i ; //geometrical positon row35 int pos_j ; // column36 int G_APD ; //G-APD identifier37 double V_op ; //operation voltage38 int HV_B ; //HV Board39 int HV_C ; //HV Channel40 double pos_X ; //geometrical position in pixel units41 double pos_Y ; //42 } PIX_MAP ;43 44 12 45 13 typedef struct { … … 91 59 #define NPIX 1440 // max. number of pixels 92 60 #define NTMARK 160 // max. number of timeMarker signals 93 //#define MAX_SOCK 280 // NBOARDS * 794 95 96 typedef union {97 uint8_t B[8] ; //8 bytes98 uint16_t S[4] ; //4 short99 uint32_t I[2] ; //2 int100 uint64_t L ; //1 long101 } L_WORD ;102 103 typedef union {104 uint8_t B[4] ; //4 bytes105 uint16_t S[2] ; //2 short106 uint32_t I ; //1 int107 } I_WORD ;108 109 61 110 62 //--------------------------------------------------------------- … … 138 90 } __attribute__((__packed__)) EVENT ; 139 91 140 141 142 92 //--------------------------------------------------------------- 143 93 144 typedef struct _RUN_HEAD { 94 struct RUN_HEAD 95 { 145 96 uint32_t Version ; 146 97 uint32_t RunType ; … … 156 107 PEVNT_HEADER FADhead[NBOARDS]; // [ NBoards ] sorted Board Headers (according Hardware ID) 157 108 158 //do we also have info about FTM config we want to add here ??? 159 } __attribute__((__packed__)) RUN_HEAD ; 109 RUN_HEAD() : Version(1), RunType(-1), NBoard(NBOARDS), NPix(NPIX), NTm(NTMARK) 110 { 111 } 160 112 161 113 162 //--------------------------------------------------------------- 114 //do we also have info about FTM config we want to add here ??? 115 } __attribute__((__packed__)); 163 116 164 typedef struct _RUN_TAIL {165 /* uint32_t nEventsOk ; //how many events were written166 uint32_t nEventsRej; //how many events were rejected by SW-trig167 uint32_t nEventsBad; //how many events were rejected by Error168 169 uint32_t PCtime0 ; //time when first event received170 uint32_t PCtimeX ; //time when last event received171 172 */173 //probably more to come ...174 } __attribute__((__packed__)) RUN_TAIL ;175 176 177 178 //---------------------------------------------------------------179 180 typedef void* FileHandle_t ;181 182 typedef struct {183 uint32_t runId ; //run number184 // uint32_t firstTime ; //epoch of first event received185 // uint32_t firstUsec ; //epoch of first event received186 uint32_t lastTime ; //time when last event written so far187 uint32_t closeTime ; //time when run should be closed188 uint32_t maxEvt ; //maximum number of events to write189 uint32_t actEvt ; //actual number of events written so far190 uint32_t procEvt ; //actual number of events processed so far191 int32_t lastEvt ; //last event of this run read so far192 // uint32_t nextEvt ; //next event number to be written193 // uint32_t waitEvt ; //event that would be ready to be written194 int16_t fileId ; //<0 never opened, 0=open, >0 closed195 int16_t procId ; //processing <0 never opened, 0=open, >0 closed196 int16_t roi0 ; //roi for normal pixels197 int16_t roi8 ; //roi for pixels8198 199 FileHandle_t fileHd ; //fileHandle (NULL if not open)200 // int16_t ctrlId[MAX_EVT] ; //index to buffId (sorted list; -1 =end)201 // uint16_t buffId[MAX_EVT] ; //index to mBuffer(buffered raw data)202 } RUN_CTRL ;203 204 205 206 //---------------------------------------------------------------207 208 /*209 typedef struct {210 int32_t evNum ;211 int32_t fadNum ;212 int32_t trgNum ;213 int32_t trgTyp ;214 uint32_t runNum ;215 int32_t fadLen ;216 int32_t nBoard ;217 int16_t board[ NBOARDS ];218 int16_t nRoi ;219 int16_t nRoiTM ;220 uint32_t pcTime[2] ;221 // int32_t evtLen ;222 uint8_t Errors[4] ;223 224 uint32_t evtCtrl_idx;225 226 EVENT *fEvent ;227 PEVNT_HEADER *FADhead; //228 // int8_t *buffer ;229 230 } WRK_DATA ; //internal to eventbuilder231 */232 233 //---------------------------------------------------------------234 235 236 typedef struct {237 // int frstPtr ; //first used index238 // int lastPtr ; //last used index239 // int mBuffer_idx;//[MAX_EVT*MAX_RUN] ; //index of event in mBuffer240 int evtStat;//[MAX_EVT*MAX_RUN] ; //status of event:241 // -1=empty242 // 1..NBoards reading #Boards243 // 90-99 : end reading244 //128-255: processing245 //256-246 //201=start processing247 //299=end processing248 //901=start writing249 //999=finished writing250 //(TO BE REVISED)251 252 // uint32_t lastRecv;//[MAX_EVT*MAX_RUN] ; //time when last action happened253 254 255 // ====================================================256 257 258 int32_t evNum;259 int32_t fadNum;260 int32_t trgNum;261 int32_t trgTyp;262 uint32_t runNum;263 int32_t fadLen;264 int32_t nBoard;265 int16_t board[NBOARDS];266 int16_t nRoi;267 int16_t nRoiTM;268 uint32_t pcTime[2] ;269 uint8_t Errors[4] ;270 271 //uint32_t evtCtrl_idx;272 uint32_t runCtrl_idx;273 274 EVENT *fEvent ;275 PEVNT_HEADER *FADhead; //276 277 // ====================================================278 279 280 } EVT_CTRL ; //internal to eventbuilder281 117 282 118 //--------------------------------------------------------------- … … 294 130 295 131 //--------------------------------------------------------------- 296 297 typedef struct {298 299 //some info about what happened since start of program (or last 'reset')300 uint32_t reset ; //#if increased, reset all counters301 uint32_t numRead[NBOARDS] ; //how often succesfull read from N sockets per loop302 303 uint64_t gotByte[NBOARDS] ; //#Bytes read per Board304 uint32_t gotErr[NBOARDS] ; //#Communication Errors per Board305 uint32_t evtGet; //#new Start of Events read306 uint32_t evtTot; //#complete Events read307 uint32_t evtErr; //#Events with Errors308 uint32_t evtSkp; //#Events incomplete (timeout)309 310 uint32_t procTot; //#Events processed311 uint32_t procErr; //#Events showed problem in processing312 uint32_t procTrg; //#Events accepted by SW trigger313 uint32_t procSkp; //#Events rejected by SW trigger314 315 uint32_t feedTot; //#Events used for feedBack system316 uint32_t feedErr; //#Events rejected by feedBack317 318 uint32_t wrtTot; //#Events written to disk319 uint32_t wrtErr; //#Events with write-error320 321 uint32_t runOpen; //#Runs opened322 uint32_t runClose; //#Runs closed323 uint32_t runErr; //#Runs with open/close errors324 325 326 //info about current connection status327 uint8_t numConn[NBOARDS] ; //#Sockets succesfully open per board328 329 } __attribute__((__packed__)) EVT_STAT ; //EventBuilder Status330 132 331 133 typedef struct {
Note:
See TracChangeset
for help on using the changeset viewer.