00001 #ifndef _DAQ_EMC_H_
00002 #define _DAQ_EMC_H_
00003
00004
00005 #include <DAQ_READER/daq_det.h>
00006 #include <stdio.h>
00007
00008
00009
00010 #define BTOW_MAXFEE 30
00011 #define BTOW_PRESIZE 4
00012 #define BTOW_DATSIZE 160
00013
00014
00015 #define BSMD_FIBERS 12
00016 #define BSMD_DATSIZE 4800
00017
00018
00019 #define ETOW_MAXFEE 6
00020 #define ETOW_PRESIZE 4
00021 #define ETOW_DATSIZE 160
00022
00023
00024 #define ESMD_MAXFEE 48 // used to be 30
00025 #define ESMD_PRESIZE 4
00026 #define ESMD_DATSIZE 192
00027
00028
00029
00030
00031 struct emc_t {
00032 u_char btow_in ;
00033 u_short btow_max_ch ;
00034 u_short btow_ch ;
00035 u_short btow[4800] ;
00036 u_short *btow_raw ;
00037
00038 u_short btow_new[BTOW_MAXFEE][BTOW_DATSIZE] ;
00039 u_short btow_pre[BTOW_MAXFEE][BTOW_PRESIZE] ;
00040
00041 u_char bsmd_in ;
00042 u_short bsmd_max_ch ;
00043 u_short bsmd_ch ;
00044 u_short bsmd[12][4800] ;
00045 #if 0
00046
00047
00048
00049
00050 u_short bsmd_raw[12][4800] ;
00051
00052 #endif
00053 u_char bsmd_raw_in ;
00054 u_char bsmd_cap[12] ;
00055
00056
00057
00058 u_char etow_in ;
00059 u_short etow_max_ch ;
00060
00061 u_short etow_ch ;
00062 u_short etow[ETOW_MAXFEE][ETOW_DATSIZE] ;
00063 u_short etow_pre[ETOW_MAXFEE][ETOW_PRESIZE];
00064 u_short *etow_raw ;
00065
00066
00067
00068
00069 u_char esmd_in ;
00070 u_short esmd_max_ch ;
00071 u_short esmd_ch ;
00072 u_short esmd_max_fee ;
00073 u_short esmd[ESMD_MAXFEE][ESMD_DATSIZE] ;
00074 u_short esmd_pre[ESMD_MAXFEE][ESMD_PRESIZE];
00075 u_short *esmd_raw ;
00076
00077
00078 } ;
00079
00080 extern char *getEmcTrgData(char *input, int idx, int *bytes) ;
00081 extern char *emc_single_reader(char *e, int *bytes, int rts_id) ;
00082
00083 extern int emc_reader(char *m, struct emc_t *emc, u_int driver, int rts_id, char *ptrs[12], int bytes[12]) ;
00084
00085
00086
00087 class daq_emc : public daq_det {
00088 private:
00089 class daq_dta *handle_legacy() ;
00090
00091 class daq_dta *legacy ;
00092
00093 static const char *help_string ;
00094 protected:
00095
00096 int Make() ;
00097
00098 public:
00099 daq_emc(daqReader *rts_caller=0) ;
00100 ~daq_emc() ;
00101
00102
00103 daq_dta *get(const char *bank="*",int c1=-1, int c2=-1, int c3=-1, void *p1=0, void *p2=0) ;
00104
00105 void help() const {
00106 printf("%s\n%s\n",GetCVS(),help_string) ;
00107 }
00108
00109 const char *GetCVS() const {
00110 static const char cvs[]="Tag $Name: $Id: built "__DATE__" "__TIME__ ; return cvs;
00111 }
00112
00113 } ;
00114
00115
00116 #endif // _DAQ_EMC_H_