4 #include <rtsSystems.h>
5 #include <daqFormats.h>
8 #include <DAQ_READER/daq_det.h>
16 { CHAR_EMCP, CHAR_EMCSECP, CHAR_EMCRBP, CHAR_EMCADCR },
17 { CHAR_EECP, CHAR_EECSECP, CHAR_EECRBP, CHAR_EECADCR }
25 char *emc_single_reader(
char *e,
int *bytes,
int rts_id)
27 struct EMCP *emcp = (
struct EMCP *)e ;
52 if(checkBank(emcp->bh.bank_type,
hdrs[hdr_ix].emcp)<0)
return 0 ;
54 off = b2h32(emcp->sec[sec_ix].off) ;
55 len = b2h32(emcp->sec[sec_ix].len) ;
57 if((len==0) || (off==0))
return 0 ;
59 struct EMCSECP *emcsecp = (
struct EMCSECP *)((u_int *)emcp + off) ;
61 if(checkBank(emcsecp->bh.bank_type,
hdrs[hdr_ix].secp)<0)
return 0 ;
64 len = b2h32(emcsecp->fiber[0].len) ;
65 off = b2h32(emcsecp->fiber[0].off) ;
67 if((len==0) || (off==0))
return 0 ;
69 struct EMCRBP *emcrbp = (
struct EMCRBP *)((u_int *)emcsecp + off) ;
71 if(checkBank(emcrbp->bh.bank_type,
hdrs[hdr_ix].rbp)< 0)
return 0 ;
74 len = b2h32(emcrbp->banks[0].len) ;
75 off = b2h32(emcrbp->banks[0].off) ;
77 if((len==0) || (off==0))
return 0 ;
81 if(checkBank(emcadc->bh.bank_type,
hdrs[hdr_ix].adc)<0)
return 0 ;
84 *bytes = l2h32(emcadc->bh.length)*4 - 40 ;
85 return ((
char *)emcadc + 40) ;