11 #include <DAQ_READER/daqReader.h>
12 #include <DAQ_READER/daq_dta.h>
13 #include <DAQ_TPX/daq_tpx.h>
14 #include <DAQ_TPX/tpxGain.h>
17 int main(
int argc,
char *argv[])
19 rtsLogOutput(RTS_LOG_STDERR) ;
27 tpx->fcf_run_compatibility = 10 ;
28 tpx->fcf_do_cuts = 1 ;
34 tpx->gain_algo->from_file((
char *)
"tpx_gains.txt.20191216.060513",0) ;
39 int got_adc_data = 0 ;
42 #define DUMP_CLD_IN_FILE
43 #ifdef DUMP_CLD_IN_FILE
45 dd = dr->det(
"tpx")->get(
"cld") ;
46 while(dd && dd->iterate()) {
47 for(u_int i=0;i<dd->ncontent;i++) {
60 printf(
"in file: row %2d: pad %f [%d:%d], tb %f [%d:%d], charge %d, flags 0x%X\n",dd->row,
80 dd = dr->det(
"tpx")->get(
"adc") ;
82 LOG(WARN,
"No adc data in this event...") ;
87 sim_dta = dr->det(
"tpx")->put(
"adc_sim") ;
91 while(dd->iterate()) {
96 for(u_int i=0;i<dd->ncontent;i++) {
97 sim_d[i].adc = dd->adc[i].adc ;
98 sim_d[i].tb = dd->adc[i].tb ;
99 sim_d[i].track_id = 0xFFFF ;
103 sim_dta->finalize(dd->ncontent,dd->sec,dd->row,dd->pad) ;
108 LOG(WARN,
"No ADC data in this event...") ;
111 LOG(NOTE,
"Doing adc data...") ;
116 dd = dr->det(
"tpx")->get(
"cld_sim") ;
117 if(dd == 0) continue ;
120 while(dd->iterate()) {
123 for(u_int i=0;i<dd->ncontent;i++) {
125 u_short tid = dd->sim_cld[i].track_id ;
127 daq_dta *dta = dr->det(
"tpx")->get(
"adc_sim") ;
128 while(dta && dta->iterate()) {
131 for(
int i=0;i<dta->ncontent;i++) {
132 if(sim_d[i].track_id == tid) {
133 printf(
"%5d %d %d %d %d\n",tid,dta->row,dta->pad,sim_d[i].tb,sim_d[i].adc) ;
152 printf(
"rerun: row %2d: pad %f [%d:%d], tb %f [%d:%d], charge %d, flags 0x%X: track %d, Q %d\n",dd->row,
153 dd->sim_cld[i].cld.pad,
154 dd->sim_cld[i].cld.p1,
155 dd->sim_cld[i].cld.p2,
156 dd->sim_cld[i].cld.tb,
157 dd->sim_cld[i].cld.t1,
158 dd->sim_cld[i].cld.t2,
159 dd->sim_cld[i].cld.charge,
160 dd->sim_cld[i].cld.flags,
161 dd->sim_cld[i].track_id,
162 dd->sim_cld[i].quality) ;