7 #define FCS_SECTOR_COU 12
11 #include <sys/types.h>
12 typedef unsigned int u_int;
13 typedef unsigned short u_short;
14 typedef unsigned char u_char;
59 void run_start(u_int run_number,
int type) ;
60 void run_stop(
int bad_ped) ;
63 void ped_stop(
int bad_ped) ;
68 int start(u_short *d16,
int shorts) ;
71 int accum(u_int ch, u_int tb, u_short adc) ;
73 int event_end(
int how) ;
76 int event_pre_fy19() ;
77 int accum_pre_fy19(u_int ch, u_int tb, u_short adc) ;
80 u_short set_rdo(
int rdo1) ;
106 u_int adc_xings[FCS_SECTOR_COU][8][32] ;
109 int zs_start(u_short *results) ;
110 u_char mark[8*1024] ;
124 u_int hdr_rhic_counter ;
125 u_short hdr_board_id ;
139 static u_char ascii_no ;
144 u_short adc[8*1024] ;
147 unsigned long long ch_mask_seen ;
169 unsigned long long ch_mask ;
190 double tmp_val_8[37] ;
191 u_int tmp_cou_8[37] ;
223 unsigned long long ch_mask ;
233 static u_int run_number ;
234 static u_int run_type ;
237 static float n_sigma ;
238 static float n_sigma_epd ;
239 static float n_sigma_hcal ;
241 static short n_post ;
246 static u_short ht_threshold ;
247 static u_short tb_pre ;
248 static u_short tb_all ;
251 static struct fcs_ped_t ped[FCS_SECTOR_COU][8] ;
252 static struct rdo_map_t rdo_map[FCS_SECTOR_COU][8] ;
253 static struct det_map_t det_map[4][2][24] ;
254 static u_char rdo_map_loaded ;
256 static int ped_from_cache(
const char *fname) ;
257 static int gain_from_cache(
const char *fname=0) ;
258 static int load_rdo_map(
const char *fname=0) ;
259 static int load_readout_map(
const char *fname=0) ;
260 static int load_sc_map(
const char *fname=0) ;
262 static u_char fcs_bad_ch_all[FCS_SECTOR_COU][8][34] ;
263 static u_char fcs_bad_ch[8][34] ;
265 static int load_bad_ch(
const char *fname=0,
int sector=0) ;
267 static const char *stage_labels[32] ;
268 static int stage_params_txt[32] ;
269 static int load_stage_params(
int sec1,
const char *fname=0) ;
272 static struct statistics_t {
285 static pthread_mutex_t ped_mutex ;
286 static void ped_lock() {
287 pthread_mutex_lock(&ped_mutex) ;
289 static void ped_unlock() {
290 pthread_mutex_unlock(&ped_mutex) ;
292 static void ped_mutex_init() {
293 pthread_mutex_init(&ped_mutex,0) ;
297 static long dep_to_char(
int det,
int ns,
int dep) ;
300 u_short set_board_id() ;