StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
emcReader.cxx
1 #include <sys/types.h>
2 #include <DAQ_READER/daqReader.h>
3 #include <DAQ_READER/daq_dta.h>
4 #include <DAQ_READER/daq_det.h>
5 #include "emcReader.h"
6 
7 // DAQ_LEGACY_DEF(emc);
8 // We can not use the predefined macro
9 // because very special naming convention is used for "emc" detector
10 // One has to create the code "by hand"
11 // see: http://docs.google.com/View?docid=dgv8pf9t_60dwhg3zd4
12 // Table 1.
13 
14 #define DAQ_LEGACY_EMC_DEF(xxx) \
15 struct _NAME2_(xxx,_t) _NAME1_(xxx);\
16  \
17 int _NAME2_(xxx,Reader)(char *m) { \
18  if(!m) return -1; \
19  daqReader *rrr = (daqReader *)m; \
20  daq_dta *dd= rrr->det("emc_pseudo")->get("legacy"); \
21  int size = 0; \
22  if (dd && (size = dd->iterate())) { \
23  memcpy(&_NAME1_(xxx),dd->Void,dd->get_size_t());} \
24  return (dd && size) ? dd->ncontent: 0; }
25 
26 DAQ_LEGACY_EMC_DEF(emc);