1 #ifndef _DAQ_READERCLASS_HH_
2 #define _DAQ_READERCLASS_HH_
9 #define DAQ_LEGACY_DEF(xxx) \
10 struct _NAME2_(xxx,_t) _NAME1_(xxx);\
12 int _NAME2_(xxx,Reader)(char *m) { \
14 daqReader *rrr = (daqReader *)m; \
15 daq_dta *dd= rrr->det( _QUOTE_(xxx))->get("legacy"); \
17 if (dd && (size = dd->iterate())) { \
18 memcpy(&_NAME1_(xxx),dd->Void,dd->get_size_t());} \
19 return (dd && size) ? dd->ncontent: 0; }
21 #define DAQ_LEGACY_DECL(xxx) \
22 extern struct _NAME2_(xxx,_t) _NAME1_(xxx);\
23 extern int _NAME2_(xxx,Reader)(char *mem)
36 enum Input_Type { none, live, file, pointer, dir };
39 #define _EVP_HOSTNAME "ppdaq1.pp2pp.bnl.gov"
41 #define _EVP_HOSTNAME "evp.starp.bnl.gov"
48 #define EVP_TYPE_PHYS 2
49 #define EVP_TYPE_SPEC 4
50 #define EVP_TYPE_ANY (EVP_TYPE_PHYS|EVP_TYPE_SPEC|EVP_TYPE_0)
51 #define EVT_TYPE_MON 8
55 #define EVP_STAT_EOR (-1)
56 #define EVP_STAT_EVT (-2)
57 #define EVP_STAT_CRIT (-3)
58 #define EVP_STAT_LOG (-4)
60 typedef unsigned int u_int;
61 typedef unsigned long long int u_longlong;
62 typedef unsigned long long int UINT64;
104 int trgIdsNotPresent;
106 static const int DAQ_READER_MAX_DETS = 48 ;
107 daq_det *dets[DAQ_READER_MAX_DETS] ;
108 daq_det *pseudo_dets[DAQ_READER_MAX_DETS] ;
110 daq_det *det(
const char *det) ;
111 void insert(
daq_det *which,
int rts_id) ;
112 void de_insert(
int rts_id) ;
114 char *get_sfs_name(
const char *snippet=0) ;
115 char *
get(
int which,
int type=EVP_TYPE_ANY) ;
116 char *skip_then_get(
int numToSkip,
int num,
int type=EVP_TYPE_ANY);
131 char file_name[256] ;
132 long long int file_size ;
136 int IsEvp() {
return (input_type == live); };
140 int getOfflineId(
int daqId);
151 int getDetectorSize(
const char *str);
153 long long int evt_offset_in_file;
174 int setMmap(
int flag) ;
175 int setOpen(
int flag) ;
176 int setLog(
int flag) ;
177 char *setEvpDisk(
char *fs) ;
181 int writeCurrentEventToDisk(
char *fname);
188 u_int readall_rundone;
189 u_int readall_lastevt;
191 void readall_reset() { readall_rundone = 0; readall_lastevt = 0; readall_run=0; };
216 u_longlong daqbits64;
217 u_longlong daqbits64_l1;
218 u_longlong daqbits64_l2;
228 float triggerFrequency;
229 u_int triggerFrequency_valid;
233 char streaming_node[12];
235 u_int detector_bugs ;
236 UINT64 detector_bugs64;
240 u_int evpgroupsinrun;
248 int fixDatapSummary(
DATAP *datap);
249 const char *getInputType();
250 int getNextEventFilename(
int num,
int type);
251 int getNextEventFilenameFromLive(
int type);
252 int getNextEventFilenameFromDir(
int eventNum);
254 int addToEventSize(
int sz);
257 int hackSummaryInfo();
263 int fillSummaryInfo_v03(
SummaryInfo *info, gbPayload *gbPayload);
274 void setCopyOnWriteMapping();
283 char _static_str_return_[256];
286 int reconnect(
void) ;
288 char _evp_basedir_[40];
289 char _last_evp_dir_[40];
306 int getStatusBasedEventDelay();
307 Input_Type input_type;
309 int allnumeric(
char *str)
312 while(str[i] !=
'\0') {
313 if(!isdigit(str[i]))
return 0;
327 char *map(
int fd,
long long int _offset,
int _size,
int map_prot,
int map_flags);
330 long long int offset;
334 char *map_real_mem(
char *buffer,
int _size);
337 long long int actual_offset;
338 char *actual_mem_start;