2 /* implement functions special for the f2k 1.2 format */
9 const f2000_line_t HT_line_1x2 =
10 {"HT ", HT_LINE, COMP_STRINGWISE, rdmc_amanda_HT_1x2 };
11 const f2000_line_t WF_line_1x2 =
12 {"WF ", WF_LINE, COMP_STRINGWISE, rdmc_amanda_WF_1x2 }; // pd
15 const f2000_event_t f2000_mevt_1x2 =
22 &(HT_line_1x2), &(CH_line_1x1),
24 &(STATUS_line_1x1), &(US_line_1x1),
25 &(FIT_block_1x1), &(FRESULT_line_1x1),
26 &(TRIG_block_1x1), &(USES_line_1x1),
37 const f2000_event_t * f2000_events_1x2[]
44 int rdmc_amanda_HT_1x2( mcfile *fp , array *a,
46 rdmc_f2k_buffer_t *f2k_buff = fp->info.f2000.f2k_buffer;
47 char *s=f2k_buff->line_pt[f2k_buff->iline];
54 args = rdmc_f2k_tokenize(s,&nargs);
67 h.str = 0; /* this is filled later at the end of the event read */
68 h.ch = atoi(args[1])-1;
69 h.amp = rdmc_amanda_strtof(args[2] , RDMC_NA);
70 h.id = rdmc_amanda_strtoi(args[3] ,RDMC_NA);
71 h.ma = h.mt = rdmc_amanda_strtoi(args[4] ,RDMC_PARENT_NA);
72 h.t = rdmc_amanda_strtof(args[5] , RDMC_TDC_NA);
73 h.tot = rdmc_amanda_strtof(args[6], RDMC_NA);
75 if (rdmc_amanda_mhit_stat(&(h.hstat),c_stat) != RDMC_IO_OK)
78 rdmc_add_mhit(e,&h,e->nhits);
79 #if 1 /* no dynamic allocated stuff */
85 } /* rdmc_amanda_HT() */
87 int rdmc_amanda_WF_1x2( mcfile *fp , array *a, mevt *e, void *tmp)
89 rdmc_f2k_buffer_t *f2k_buff = fp->info.f2000.f2k_buffer;
90 char *s=f2k_buff->line_pt[f2k_buff->iline];
99 args = rdmc_f2k_tokenize(s,&nargs); //check the parsing string
101 if ( nargs < 7) return RDMC_ILF; // check #
104 channel = rdmc_amanda_strtof(args[1], RDMC_NA); // fill waveform struct
105 wf.om = rdmc_nint(channel);
106 wf.ch = (channel - wf.om) * 100.;
107 wf.id = rdmc_amanda_strtoi(args[2] ,RDMC_NA);
108 wf.pa = rdmc_amanda_strtoi(args[3] ,RDMC_PARENT_NA);
109 wf.ndigi = atoi(args[4]);
110 wf.t_start = rdmc_amanda_strtof(args[5], RDMC_NA);
111 wf.t_bin = rdmc_amanda_strtof(args[6], RDMC_NA);
112 if ( nargs < 7 + wf.ndigi) return RDMC_ILF; // check #
114 if( wf.ndigi <= 0 || wf.ndigi > RDMC_MAXDIGI )
117 wf.digi = malloc(wf.ndigi*sizeof(float)); // fill digit. of waveform
118 for (i = 0; i < wf.ndigi; i++)
119 wf.digi[i] = rdmc_amanda_strtof(args[7+i], RDMC_TDC_NA);
122 rdmc_add_WF(e,&wf,e->nwf); // add waveform to event
126 } /* rdmc_amanda_WF() */
131 /****************************************************************************
132 ********************************** E O F ***********************************
133 ****************************************************************************/