1 #ifndef _FCS_TRG_BASE_H_
2 #define _FCS_TRG_BASE_H_
5 typedef unsigned int u_int;
6 typedef unsigned short u_short;
7 typedef unsigned char u_char;
36 static const int XING_COU = 40 ;
37 static const int DET_COU = 4 ;
38 static const int ADC_DET_COU = 3 ;
39 static const int NS_COU = 2 ;
40 static const int DEP_COU = 24 ;
41 static const int DEP_HCAL_COU = 9 ;
42 static const int DEP_ECAL_COU = 24 ;
43 static const int DEP_PRE_COU = 6 ;
44 static const int DEP_HCAL_TRG_COU = 8 ;
45 static const int DEP_ECAL_TRG_COU = 20 ;
46 static const int DEP_PRE_TRG_COU = 6 ;
58 void stage_1(u_int from_s0[],
geom_t geo,
link_t to_s2[]) ;
59 void stage_1_201900(u_int from_s0[],
geom_t geo,
link_t to_s2[]) ;
60 void stage_1_202201(u_int from_s0[],
geom_t geo,
link_t to_s2[]) ;
75 void stage_3(
link_t from_s2[], u_short *to_dsm) ;
76 void stage_3_201900(
link_t from_s2[], u_short *to_dsm) ;
77 void stage_3_202201(
link_t from_s2[], u_short *to_dsm) ;
78 void stage_3_202203(
link_t from_s2[], u_short *to_dsm) ;
79 void stage_3_202207(
link_t from_s2[], u_short *to_dsm) ;
80 void stage_3_tonko_202101(
link_t from_s2[], u_short *to_dsm) ;
82 virtual u_int get_version() ;
84 void init(
const char* fname) ;
86 void run_start(u_int run) ;
90 void fill_event(
int det,
int ns,
int dep,
int ch, u_short *adc,
int t_cou) ;
92 int verify_event_io() ;
94 u_int run_event_sim(
int xing,
int type) ;
96 int verify_event_sim(
int xing) ;
98 int dump_event_sim(
int xing) ;
105 u_char want_stage_2_io ;
106 u_char want_stage_3_io ;
107 u_char want_stage_1_sim ;
116 u_int io_s1_to_s2[4] ;
126 int self_trg_marker ;
129 u_char self_trigger ;
153 u_short tb_cou[NS_COU][DET_COU][DEP_COU] ;
165 } s1[NS_COU][ADC_DET_COU][DEP_COU] ;
183 link_t s3_from_s2[NS_COU*2] ;
197 } s1[NS_COU][ADC_DET_COU][DEP_COU] ;
217 u_short s2_to_dsm[2] ;
220 static u_int data_format ;
224 static u_int stage_version[4] ;
229 static struct marker_t {
247 static int fcs_trgDebug ;
249 static int run_type ;
254 u_char s2_io_ns_bad ;
255 u_char s2_io_ch_bad ;
257 u_char s3_io_ch_bad ;
267 static u_short stage_params[4][32] ;
270 static ped_gain_t p_g[NS_COU][ADC_DET_COU][DEP_COU][32] ;
275 static u_short ht_threshold[ADC_DET_COU] ;
279 static unsigned long long s2_ch_mask[NS_COU] ;
280 static u_char s2_ch_phase[NS_COU][34] ;
282 static int fcs_readPresMaskFromText;
283 static u_int PRES_MASK[15][9][6];
286 static u_char s3_ch_mask ;
287 static u_char s3_ch_phase[4] ;
288 static u_char s3_out_phase ;
291 static u_short EM_HERATIO_THR ;
292 static u_short HAD_HERATIO_THR ;
293 static u_short EMTHR0 ;
294 static u_short EMTHR1 ;
295 static u_short EMTHR2 ;
296 static u_short EMTHR3 ;
297 static u_short ELETHR0 ;
298 static u_short ELETHR1 ;
299 static u_short ELETHR2 ;
300 static u_short HADTHR0 ;
301 static u_short HADTHR1 ;
302 static u_short HADTHR2 ;
303 static u_short HADTHR3 ;
304 static u_short JETTHR1 ;
305 static u_short JETTHR2 ;
306 static u_short JPATHR2 ;
307 static u_short JPATHR1 ;
308 static u_short JPATHR0 ;
309 static u_short JPBCTHR2 ;
310 static u_short JPBCTHR1 ;
311 static u_short JPBCTHR0 ;
312 static u_short JPBCTHRD ;
313 static u_short JPDETHR2 ;
314 static u_short JPDETHR1 ;
315 static u_short JPDETHR0 ;
316 static u_short JPDETHRD ;
317 static u_short ETOTTHR ;
318 static u_short HTOTTHR ;
319 static u_short EHTTHR ;
320 static u_short HHTTHR ;
321 static u_short PHTTHR ;
324 u_int e2x2[2][16][10];
325 u_int h2x2[2][10][6];
326 u_int esum[2][15][9];
327 u_int epdcoin[2][15][9];
329 u_int padc[2][6][32];
330 u_int phit[2][6][32];
331 u_int sum [2][15][9];
332 u_int summax[2][15][9];
333 float ratio[2][15][9];
334 float ratiomax[2][15][9];