6 #include <rtsSystems.h>
11 #include <SFS/sfs_index.h>
12 #include <DAQ_READER/daqReader.h>
13 #include <DAQ_READER/daq_dta.h>
18 extern int tpc_reader(
char *m,
tpc_t *tpc,
int sec,
int flag) ;
25 daq_det_factory::det_factories[TPC_ID] = this ;
41 name = sfs_name = rts2name(rts_id) ;
44 if(caller) caller->insert(
this, rts_id) ;
48 LOG(DBG,
"%s: constructor: caller %p",name,rts_caller) ;
54 LOG(DBG,
"%s: DEstructor",name) ;
63 daq_dta *daq_tpc::get(
const char *bank,
int sec,
int row,
int pad,
void *p1,
void *p2)
66 if(!present)
return 0 ;
69 if(!bank || (strcasecmp(bank,
"legacy")==0)) bank =
"legacy" ;
72 if(strcasecmp(bank,
"legacy")==0) {
73 return handle_legacy(sec,row) ;
78 LOG(ERR,
"%s: unknown bank type \"%s\"",name,bank) ;
82 daq_dta *daq_tpc::handle_legacy(
int sec,
int rdo)
85 int found_something = 0 ;
95 legacy->create((max_s-min_s+1)*
sizeof(
tpc_t),
"tpc_t",rts_id,DAQ_DTA_STRUCT(
tpc_t)) ;
97 for(
int s=min_s;s<=max_s;s++) {
103 have = tpc_reader(caller->mem, tpc_p, s-1, m_Debug) ;
106 found_something = 1 ;
107 legacy->finalize(1,s,0,0) ;
110 LOG(NOTE,
"%s: sector %d: not found",name,s) ;
117 LOG(NOTE,
"%s: done",name) ;
119 if(found_something)
return legacy ;
124 int daq_tpc::get_l2(
char *buff,
int buff_bytes,
struct daq_trg_word *trg,
int prompt)