2 #ifndef _RTS_SYSTEMS_H_
3 #define _RTS_SYSTEMS_H_
33 #define TRG_BSMD_BIT 2
35 #define TRG_FTPC_BIT 3
39 #define TRG_SSD_BIT 5 // used to be RICH
41 #define TRG_BTOW_BIT 6
42 #define TRG_EMC_BIT TRG_BTOW_BIT // use "BTOW"
46 #define TRG_ETOW_BIT 8
47 #define TRG_EEC_BIT TRG_ETOW_BIT // use "ETOW"
49 #define TRG_ESMD_BIT 9
51 #define TRG_PMD_BIT 10
55 #define TRG_CTB_BIT 14 // does not have a LIVE bit
57 #define TRG_BBC_BIT 15 // does not have a LIVE bit
73 #define TCD_ESMD 6 //0x10,
74 #define TCD_BBC 7 //0x11, trigger-only; unused
75 #define TCD_ETOW 8 //0x12,
76 #define TCD_STGC 9 //0x13, was trigger-only; unused
77 #define TCD_FST 10 //0x14, was RHICF; Sep 16: was IST, Jun 2013: was FGT before; Aug 26, 2009: was FPD's before
78 #define TCD_TOF 11 //0x15,
79 #define TCD_PP 12 //0x16
80 #define TCD_MTD 13 //0x17
81 #define TCD_TPX 14 //0x18
82 #define TCD_BSMD 15 //0x19
83 #define TCD_CTB 16 //0x1A, trigger-only; unused
84 #define TCD_BTOW 17 //0x1B
85 #define TCD_ETOF 18 //0x1C; Sep 16: was SST; was FTPC; gone in Sep '11
86 #define TCD_FCS 19 //0x1D; Sep 16: was PXL; was PMD; gone in Sep '11
87 #define TCD_GMT 20 //0x1E; WAS: empty, Nov, 2008
88 #define TCD_VPD 21 //0x1F trigger-only; unused
102 #define FST_GRP 9 // was RHICF; still not used in FY19
103 #define STGC_GRP 10 // was unused
112 #define EVP_GRP_FMS 0 //FMS,FPS: FMS_xxx triggers
113 #define EVP_GRP_RP 1 //RomanPots RP_xxx triggers
114 #define EVP_GRP_ZEROBIAS 2 // and similar;
171 #define LOCALHOST_NODE 0
173 #define ERROR_NODE 0xFFFF
182 #define TPC_ID TPC_SYSTEM
185 #define SVT_ID SVT_SYSTEM
188 #define TOF_ID TOF_SYSTEM
191 #define BTOW_SYSTEM 3
192 #define BTOW_ID BTOW_SYSTEM
197 #define FPD_ID FPD_SYSTEM
200 #define FTP_ID FTP_SYSTEM
204 #define EXT_ID EXT_SYSTEM
208 #define RIC_ID RIC_SYSTEM
211 #define TRG_ID TRG_SYSTEM
214 #define L3_ID L3_SYSTEM
217 #define SC_ID SC_SYSTEM
220 #define EXT2_SYSTEM 11
221 #define EXT2_ID EXT2_SYSTEM
223 #define PMD_SYSTEM 12
224 #define PMD_ID PMD_SYSTEM
226 #define SSD_SYSTEM 13
227 #define SSD_ID SSD_SYSTEM
230 #define ETOW_SYSTEM 14
231 #define ETOW_ID ETOW_SYSTEM
233 #define DAQ_SYSTEM 15
234 #define DAQ_ID DAQ_SYSTEM
235 #define RTS_SYSTEM DAQ_SYSTEM
238 #define FGT_SYSTEM 16
239 #define FGT_ID FGT_SYSTEM
242 #define PP_ID PP_SYSTEM
244 #define BSMD_SYSTEM 18
245 #define BSMD_ID BSMD_SYSTEM
247 #define ESMD_SYSTEM 19
248 #define ESMD_ID ESMD_SYSTEM
250 #define TPX_SYSTEM 20
251 #define TPX_ID TPX_SYSTEM
253 #define PXL_SYSTEM 21
254 #define PXL_ID PXL_SYSTEM
256 #define MTD_SYSTEM 22
257 #define MTD_ID MTD_SYSTEM
259 #define IST_SYSTEM 23
260 #define IST_ID IST_SYSTEM
262 #define SST_SYSTEM 24
263 #define SST_ID SST_SYSTEM
266 #define ETOF_SYSTEM 25
267 #define ETOF_ID ETOF_SYSTEM
269 #define GMT_SYSTEM 26
270 #define GMT_ID GMT_SYSTEM
273 #define L4_ID L4_SYSTEM
275 #define FPS_SYSTEM 28
276 #define FPS_ID FPS_SYSTEM
279 #define RHICF_SYSTEM 29
280 #define RHICF_ID RHICF_SYSTEM
283 #define FCS_SYSTEM 30
284 #define FCS_ID FCS_SYSTEM
286 #define ITPC_SYSTEM 31
287 #define ITPC_ID ITPC_SYSTEM
289 #define STGC_SYSTEM 32
290 #define STGC_ID STGC_SYSTEM
293 #define FST_SYSTEM 33
294 #define FST_ID FST_SYSTEM
296 #define RTS_NUM_SYSTEMS 34
298 #define PP_SEQE_INSTANCE 1
299 #define PP_SEQW_INSTANCE 2
300 #define PP_TRG_INSTANCE 3
301 #define PP_TEST_INSTANCE 4
310 #define TRGDET_BEMC 6
311 #define TRGDET_EEMC 7
312 #define TRGDET_PP2PP 8
314 #define TRGDET_FPS 10
315 #define TRGDET_FCAL 11
317 extern inline int getTrgDetBit(
char *str) {
318 if(strcmp(str,
"zdc")==0)
return TRGDET_ZDC;
319 if(strcmp(str,
"bbc")==0)
return TRGDET_BBC;
320 if(strcmp(str,
"vpd")==0)
return TRGDET_VPD;
321 if(strcmp(str,
"tof")==0)
return TRGDET_TOF;
322 if(strcmp(str,
"epd")==0)
return TRGDET_EPD;
323 if(strcmp(str,
"mtd")==0)
return TRGDET_MTD;
324 if(strcmp(str,
"bemc")==0)
return TRGDET_BEMC;
325 if(strcmp(str,
"eemc")==0)
return TRGDET_EEMC;
326 if(strcmp(str,
"pp2pp")==0)
return TRGDET_PP2PP;
327 if(strcmp(str,
"fms")==0)
return TRGDET_FMS;
328 if(strcmp(str,
"fps")==0)
return TRGDET_FPS;
329 if(strcmp(str,
"fcal")==0)
return TRGDET_FCAL;
333 extern inline const char *getTrgDetBitName(
int x) {
335 case TRGDET_ZDC:
return "zdc";
336 case TRGDET_BBC:
return "bbc";
337 case TRGDET_VPD:
return "vpd";
338 case TRGDET_TOF:
return "tof";
339 case TRGDET_EPD:
return "epd";
340 case TRGDET_MTD:
return "mtd";
341 case TRGDET_BEMC:
return "bemc";
342 case TRGDET_EEMC:
return "eemc";
343 case TRGDET_PP2PP:
return "pp2pp";
344 case TRGDET_FMS:
return "fms";
345 case TRGDET_FPS:
return "fps";
346 case TRGDET_FCAL:
return "fcal";
355 #define TRG_L1_SUBSYS 1
356 #define TRG_L2_SUBSYS 2
363 #define EVBL_SUBSYS 3
369 #ifndef RTS_PROJECT_PP
370 #define DAQMAN_INSTANCE 1
373 #define BB_INSTANCE 2
375 #ifndef RTS_PROJECT_PP
376 #define EVP_INSTANCE 3
380 #define BDB_INSTANCE 4 // we'll keep the BDB controller's node_id the same...
382 #define TOKEN_MANAGER_INSTANCE 5
384 #define TCD_LX_INSTANCE 6
386 #define CONTROLS_INSTANCE 7
388 #define TPC_GG_INSTANCE 8
395 #define RC_CLIENT_INSTANCE 14
396 #define CLIENT_INSTANCE 15
399 #ifdef RTS_PROJECT_PP
400 #define DAQMAN_INSTANCE BB_INSTANCE
401 #define EVP_INSTANCE BB_INSTANCE
404 #define TRG_INSTANCE 1
405 #define TRG_L1_INSTANCE 2
406 #define TRG_L2_INSTANCE 3
407 #define TRG_TCD_INSTANCE 4
408 #define TRG_RCC_INSTANCE 5
409 #define TRG_CTB_INSTANCE 6
410 #define TRG_MIX_INSTANCE 6
412 #define TRG_SCALER48_INSTANCE 7
414 #define TRG_BC1_INSTANCE 9
415 #define TRG_BCE_INSTANCE 10
416 #define TRG_BCW_INSTANCE 11
417 #define TRG_SCALER_INSTANCE 12
418 #define TRG_BBC_INSTANCE 13
420 #define TRG_FMS_INSTANCE 15
421 #define TRG_L0_INSTANCE 16 // Tonko. Feb25,03
422 #define TRG_QT1_INSTANCE 17
423 #define TRG_QT2_INSTANCE 18
424 #define TRG_QT3_INSTANCE 19
425 #define TRG_QT4_INSTANCE 20
426 #define TRG_BBQ_INSTANCE 21
427 #define TRG_MXQ_INSTANCE 22
429 #define TRG_EQ3_INSTANCE 23 // Rename EPQ EQ3. JMN 8/15/17
430 #define TRG_TCD_NEW_INSTANCE 24
431 #define TRG_EQ1_INSTANCE 25 // Rename FQ1 EQ1. JMN 8/15/17
432 #define TRG_EQ2_INSTANCE 26 // Rename FQ2 EQ2. JMN 8/15/17
435 #define TRG_STP2_INSTANCE 27
436 #define TRG_L1_DSM2_INSTANCE 28
437 #define TRG_BBC_DSM2_INSTANCE 29
438 #define TRG_BBQ_QTD_INSTANCE 30
439 #define TRG_MIX_DSM2_INSTANCE 31
440 #define TRG_MXQ_QTD_INSTANCE 32
441 #define TRG_BCE_DSM2_INSTANCE 33
442 #define TRG_BCW_DSM2_INSTANCE 34
443 #define TRG_BC1_DSM2_INSTANCE 35
444 #define TRG_EQ1_QTD_INSTANCE 36
445 #define TRG_EQ2_QTD_INSTANCE 37
446 #define TRG_EQ3_QTD_INSTANCE 38
447 #define TRG_EQ4_QTD_INSTANCE 39
449 #define TRG_EQ4_INSTANCE 40
452 #define L3EVP_INSTANCE 1
453 #define L3DISP_INSTANCE 2
467 #define EVBL_NODES(x) ((DAQ_SYSTEM<<12) | (EVBL_SUBSYS<<8) | (x))
468 #define EVBX_NODES(x) ((DAQ_SYSTEM<<12) | (EVB_SUBSYS<<8) | (x))
469 #define EVBX_NODE_COUNT 24 // was 14 before FY23; was 6 before FY13; in a run epoch, used by monitoring and RICH scalers!
471 #define MAX_EVB_NODES 24
473 #define GB_NODES(x) ((DAQ_SYSTEM<<12) | (GB_SUBSYS<<8 ) | (x))
474 #define GB_NODE GB_NODES(1)
477 #define BB_NODE ((DAQ_SYSTEM<<12) | BB_INSTANCE)
479 #ifdef RTS_PROJECT_PP
481 #define DAQMAN_NODE BB_NODE
482 #define EVP_NODE BB_NODE
483 #define BB2_NODE BB_NODE
487 #define DAQMAN_NODE ((DAQ_SYSTEM<<12) | DAQMAN_INSTANCE)
488 #define EVP_NODE ((DAQ_SYSTEM<<12) | EVP_INSTANCE)
489 #define BB2_NODE ((DAQ_SYSTEM<<12) | BB2_INSTANCE)
495 #define RC_NODE DAQMAN_NODE
496 #define LOG_NODE DAQMAN_NODE
497 #define MON_NODE DAQMAN_NODE
500 #define RC_CLIENT_NODE ((DAQ_SYSTEM<<12) | RC_CLIENT_INSTANCE)
501 #define CLIENT_NODE ((DAQ_SYSTEM<<12) | CLIENT_INSTANCE)
511 #define BDB_NODE ((DAQ_SYSTEM<<12) | BDB_INSTANCE) // old GB...
513 #define TOKEN_MANAGER_NODE ((DAQ_SYSTEM<<12) | TOKEN_MANAGER_INSTANCE)
515 #define TCD_LX_NODE ((DAQ_SYSTEM<<12) | TCD_LX_INSTANCE)
517 #define TPC_GG_NODE ((DAQ_SYSTEM<<12) | TPC_GG_INSTANCE)
519 #define CONTROLS_NODE ((DAQ_SYSTEM<<12) | CONTROLS_INSTANCE)
522 #define RIC01_NODE ((RIC_SYSTEM<<12) | 1)
523 #define RIC02_NODE ((RIC_SYSTEM<<12) | 2)
524 #define RIC_NODE RIC01_NODE
526 #define TOF01_NODE ((TOF_SYSTEM<<12) | 1) // DAQ end
527 #define TOF02_NODE ((TOF_SYSTEM<<12) | 2) // Platform
528 #define TOF03_NODE ((TOF_SYSTEM<<12) | 3) // new, test node
529 #define TOF_NODE TOF01_NODE
530 #define TOF_NODES ((TOF_SYSTEM<<12) | (x)) // shorthand
532 #define FPD01_NODE ((FPD_SYSTEM<<12) | 1)
533 #define FPD02_NODE ((FPD_SYSTEM<<12) | 2)
534 #define FPD_NODE FPD01_NODE
536 #define FPD_DEST_HOST "gb.daq.bnl.local"
537 #define FPD_PORT 5211
540 #define TPC_NODES(x) ((TPC_SYSTEM<<12) | (x))
542 #define FTP_NODES(x) ((FTP_SYSTEM<<12) | (x))
544 #define SVT_NODES(x) ((SVT_SYSTEM<<12) | (x))
549 #define BTOW_NODE ((BTOW_SYSTEM<<12) | 1)
551 #define BSMD_NODE ((EXT_SYSTEM<<12)|(BSMD_SYSTEM<<4)|1)
552 #define BSMD_NODES(x) ((EXT_SYSTEM<<12)|(BSMD_SYSTEM<<4) | (x))
554 #define BPRE_NODE ((BTOW_SYSTEM<<12) | 2)
557 #define PMD01_NODE ((EXT_SYSTEM<<12)|(PMD_SYSTEM<<4) | 1)
558 #define PMD02_NODE ((EXT_SYSTEM<<12)|(PMD_SYSTEM<<4) | 2)
559 #define PMD03_NODE ((EXT_SYSTEM<<12)|(PMD_SYSTEM<<4) | 3)
560 #define PMD_NODES(x) ((EXT_SYSTEM<<12)|(PMD_SYSTEM<<4) | (x))
562 #define PMD_NODE PMD03_NODE
564 #define PMD_DEST_HOST "gb.daq.bnl.local"
565 #define PMD_PORT_1 5201
566 #define PMD_PORT_2 5202 // becomes 5202 soon!
568 #define SSD01_NODE ((EXT_SYSTEM<<12)|(SSD_SYSTEM<<4) | 1)
569 #define SSD_NODE SSD01_NODE
572 #define FGT01_NODE ((EXT_SYSTEM<<12)|(FGT_SYSTEM<<4) | 1)
573 #define FGT_NODE FGT01_NODE
578 #define ETOW_NODE ((EXT_SYSTEM<<12)|(ETOW_SYSTEM<<4)|1)
579 #define ESMD_NODE ((EXT_SYSTEM<<12)|(ESMD_SYSTEM<<4)|1)
583 #define L3_NODES(x) ((L3_SYSTEM<<12) | (SL3_SUBSYS<<8) | (x))
584 #define SL3_NODES(x) ((L3_SYSTEM<<12) | (SL3_SUBSYS<<8) | (x))
585 #define GL3_NODES(x) ((L3_SYSTEM<<12) | (GL3_SUBSYS<<8) | (x))
586 #define GL3_NODE GL3_NODES(1)
587 #define GL3_NODE_COUNT 10 // maximum count of nodes per run epoch
589 #define L3EVP_NODE ((L3_SYSTEM<<12) | 1)
590 #define L3DISP_NODE ((L3_SYSTEM<<12) | 2)
592 #define L4_NODES(x) ((EXT2_SYSTEM<<12) | (L4_SYSTEM<<7) | (x))
593 #define L4_CAL_INSTANCE 120
594 #define L4_EVP_INSTANCE 121
595 #define L4_CAL_NODE ((EXT2_SYSTEM<<12) | (L4_SYSTEM<<7) | L4_CAL_INSTANCE)
596 #define L4_EVP ((EXT2_SYSTEM<<12) | (L4_SYSTEM<<7) | L4_EVP_INSTANCE)
597 #define L4_EVP_NODE L4_EVP
598 #define L4_EVB(x) ((EXT2_SYSTEM<<12) | (L4_SYSTEM<<7) | (L4_EVP_INSTANCE + 1 + x))
601 #define TRG_NODE ((TRG_SYSTEM<<12) | TRG_INSTANCE)
602 #define TRG_L1_NODE ((TRG_SYSTEM<<12) | TRG_L1_INSTANCE)
604 #define TRG_L2_NODE ((TRG_SYSTEM<<12) | (TRG_L2_SUBSYS<<8) | (1))
605 #define TRG_TCD_NODE ((TRG_SYSTEM<<12) | TRG_TCD_INSTANCE)
606 #define TRG_RCC_NODE ((TRG_SYSTEM<<12) | TRG_RCC_INSTANCE)
607 #define TRG_CTB_NODE ((TRG_SYSTEM<<12) | TRG_CTB_INSTANCE)
608 #define TRG_MIX_NODE ((TRG_SYSTEM<<12) | TRG_MIX_INSTANCE)
609 #define TRG_L1_NODES(x) ((TRG_SYSTEM<<12) | (TRG_L1_SUBSYS<<8) | (x))
610 #define TRG_L2_NODES(x) ((TRG_SYSTEM<<12) | (TRG_L2_SUBSYS<<8) | (x))
612 #define TRG_BC1_NODE ((TRG_SYSTEM<<12) | TRG_BC1_INSTANCE)
613 #define TRG_BCE_NODE ((TRG_SYSTEM<<12) | TRG_BCE_INSTANCE)
614 #define TRG_BCW_NODE ((TRG_SYSTEM<<12) | TRG_BCW_INSTANCE)
615 #define TRG_SCALER_NODE ((TRG_SYSTEM<<12) | TRG_SCALER_INSTANCE)
616 #define TRG_BBC_NODE ((TRG_SYSTEM<<12) | TRG_BBC_INSTANCE)
618 #define TRG_FMS_NODE ((TRG_SYSTEM<<12) | TRG_FMS_INSTANCE)
619 #define TRG_L0_NODE ((TRG_SYSTEM<<12) | TRG_L0_INSTANCE) // Tonko, Feb25,03
620 #define TRG_QT1_NODE ((TRG_SYSTEM<<12) | TRG_QT1_INSTANCE)
621 #define TRG_QT2_NODE ((TRG_SYSTEM<<12) | TRG_QT2_INSTANCE)
622 #define TRG_QT3_NODE ((TRG_SYSTEM<<12) | TRG_QT3_INSTANCE)
623 #define TRG_QT4_NODE ((TRG_SYSTEM<<12) | TRG_QT4_INSTANCE)
624 #define TRG_BBQ_NODE ((TRG_SYSTEM<<12) | TRG_BBQ_INSTANCE)
625 #define TRG_MXQ_NODE ((TRG_SYSTEM<<12) | TRG_MXQ_INSTANCE)
628 #define TRG_EQ3_NODE ((TRG_SYSTEM<<12) | TRG_EQ3_INSTANCE) // Rename EPQ > EQ3. JMN 8/15/17
629 #define TRG_EQ1_NODE ((TRG_SYSTEM<<12) | TRG_EQ1_INSTANCE) // Rename FQ1 > EQ1. JMN
630 #define TRG_EQ2_NODE ((TRG_SYSTEM<<12) | TRG_EQ2_INSTANCE) // Rename FQ2 > EQ2. JMN
631 #define TRG_EQ4_NODE ((TRG_SYSTEM<<12) | TRG_EQ4_INSTANCE)
633 #define TRG_STP2_NODE ((TRG_SYSTEM<<12) | TRG_STP2_INSTANCE)
634 #define TRG_L1_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_L1_DSM2_INSTANCE)
635 #define TRG_BBC_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_BBC_DSM2_INSTANCE)
636 #define TRG_BBQ_QTD_NODE ((TRG_SYSTEM<<12) | TRG_BBQ_QTD_INSTANCE)
637 #define TRG_MIX_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_MIX_DSM2_INSTANCE)
638 #define TRG_MXQ_QTD_NODE ((TRG_SYSTEM<<12) | TRG_MXQ_QTD_INSTANCE)
639 #define TRG_BCE_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_BCE_DSM2_INSTANCE)
640 #define TRG_BCW_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_BCW_DSM2_INSTANCE)
641 #define TRG_BC1_DSM2_NODE ((TRG_SYSTEM<<12) | TRG_BC1_DSM2_INSTANCE)
642 #define TRG_EQ1_QTD_NODE ((TRG_SYSTEM<<12) | TRG_EQ1_QTD_INSTANCE)
643 #define TRG_EQ2_QTD_NODE ((TRG_SYSTEM<<12) | TRG_EQ2_QTD_INSTANCE)
644 #define TRG_EQ3_QTD_NODE ((TRG_SYSTEM<<12) | TRG_EQ3_QTD_INSTANCE)
645 #define TRG_EQ4_QTD_NODE ((TRG_SYSTEM<<12) | TRG_EQ4_QTD_INSTANCE)
647 #define TRG_SCALER48_NODE ((TRG_SYSTEM<<12) | TRG_SCALER48_INSTANCE)
652 #define TRG_TCD_NEW_NODE ((TRG_SYSTEM<<12) | TRG_TCD_NEW_INSTANCE)
654 #define L201_NODE TRG_L2_NODES(1)
657 #define SC_NODE ((SC_SYSTEM<<12) | 1)
660 #define PP_SEQE_NODE ((EXT_SYSTEM<<12) | ((PP_SYSTEM)<<4) | PP_SEQE_INSTANCE)
663 #define PP_SEQ1_NODE PP_SEQE_NODE
665 #define PP_SEQW_NODE ((EXT_SYSTEM<<12) | ((PP_SYSTEM)<<4) | PP_SEQW_INSTANCE)
667 #define PP_SEQ2_NODE PP_SEQW_NODE
669 #define PP_TRG_NODE ((EXT_SYSTEM<<12) | ((PP_SYSTEM)<<4) | PP_TRG_INSTANCE)
670 #define PP_TEST_NODE ((EXT_SYSTEM<<12) | ((PP_SYSTEM)<<4) | PP_TEST_INSTANCE)
673 #define PP_NODES(x) ((EXT_SYSTEM<<12) | ((PP_SYSTEM)<<4) | (x))
675 #define TPX_NODES(x) ((EXT2_SYSTEM<<12) | (TPX_SYSTEM<<7) | (x))
676 #define MTD_NODES(x) ((EXT2_SYSTEM<<12) | (MTD_SYSTEM<<7) | (x))
678 #define PXL_NODES(x) ((EXT2_SYSTEM<<12) | (PXL_SYSTEM<<7) | (x))
679 #define IST_NODES(x) ((EXT2_SYSTEM<<12) | (IST_SYSTEM<<7) | (x))
680 #define SST_NODES(x) ((EXT2_SYSTEM<<12) | (SST_SYSTEM<<7) | (x))
683 #define GMT_NODES(x) ((EXT2_SYSTEM<<12) | (GMT_SYSTEM<<7) | (x))
685 #define FPS_NODES(x) ((EXT2_SYSTEM<<12) | (FPS_SYSTEM<<7) | (x))
687 #define ETOF_NODES(x) ((EXT2_SYSTEM<<12) | (ETOF_SYSTEM<<7) | (x))
689 #define RHICF_NODES(x) ((EXT2_SYSTEM<<12) | (RHICF_SYSTEM<<7) | (x))
691 #define FCS_NODES(x) ((EXT2_SYSTEM<<12) | (FCS_SYSTEM<<7) | (x))
693 #define ITPC_NODES(x) ((EXT2_SYSTEM<<12) | (ITPC_SYSTEM<<7) | (x))
696 #define STGC_NODES(x) ((FPD_SYSTEM<<12) | (STGC_SYSTEM<<6) | (x))
698 #define FST_NODES(x) ((FPD_SYSTEM<<12) | (FST_SYSTEM<<6) | (x))
700 extern inline const char *rts2name(
int rts_id)
768 return (
const char *)NULL ;
772 extern inline const char *rts2sfs_name(
int rts_id)
840 return (
const char *)NULL ;
845 extern inline int name2rts(
const char *name)
847 for(
int rts_id=0;rts_id<48;rts_id++) {
848 const char *r_name = rts2name(rts_id) ;
849 if(r_name && name && (strncasecmp(name,r_name,strlen(r_name))==0))
return rts_id ;
859 extern inline int rts2det(
int ix)
899 extern inline int rts2_32(
int rts)
911 extern inline int rts2tcd(
int rts)
949 extern inline int tcd2rts(
int tcd)
985 #define LEGACY_DETS (1<<FTP_ID)
988 #define DAQ1000_DETS ((1<<TPX_ID) | (1<<TOF_ID) | (1<<PMD_ID) | (1<<ESMD_ID) | (1<<PP_ID) | (1<<FGT_ID) | \
989 (1<<L3_ID) | (1 << BSMD_ID) | (1 << MTD_ID) | (1<<ETOF_ID) | (1<<GMT_ID) | (1<<BTOW_ID) | (1<<ETOW_ID)) | (1<<FPS_ID) |\
990 (1<<FCS_ID) | (1<<ITPC_ID) | (1<<RHICF_ID) | (1LL<<STGC_ID) | (1LL<<FST_ID)
994 extern inline unsigned long long grp2rts_mask(
int grp)
996 unsigned long long ret ;
1000 if(grp & (1ll<<ETOF_GRP)) {
1001 ret |= (1ll<<ETOF_SYSTEM) ;
1003 if(grp & (1ll << PP_GRP)) {
1004 ret |= (1ll << PP_SYSTEM);
1006 if(grp & (1ll << ETOW_GRP)) {
1007 ret |= (1ll << ETOW_SYSTEM) ;
1009 if(grp & (1ll << BTOW_GRP)) {
1010 ret |= (1ll << BTOW_SYSTEM) ;
1012 if(grp & (1ll << BSMD_GRP)) {
1013 ret |= (1ll << BSMD_SYSTEM) ;
1015 if(grp & (1ll << TOF_GRP)) {
1016 ret |= (1ll << TOF_SYSTEM) ;
1018 if(grp & (1ll << ESMD_GRP)) {
1019 ret |= (1ll << ESMD_SYSTEM) ;
1021 if(grp & (1ll << TPX_GRP)) {
1022 ret |= (1ll << TPX_SYSTEM);
1023 ret |= (1ll << ITPC_SYSTEM);
1025 if(grp & (1ll << STGC_GRP)) {
1026 ret |= (1LL << STGC_SYSTEM);
1028 if(grp & (1ll << FCS_GRP)) {
1029 ret |= (1ll << FCS_SYSTEM);
1032 if(grp & (1ll << MTD_GRP)) {
1033 ret |= (1ll << MTD_SYSTEM);
1035 if(grp & (1ll << FST_GRP)) {
1036 ret |= (1ll << FST_SYSTEM);
1038 if(grp & (1ll << GMT_GRP)) {
1039 ret |= (1ll << GMT_SYSTEM);
1046 extern inline int rts2grp(
int rts)
1087 extern inline int GET_NODE(
int sys,
int subsys,
int inst)
1091 if((sys <= 10) || (sys==15)) {
1092 node = (sys<<12) | (subsys<<8) | (inst);
1094 else if (sys < 20) {
1095 node = (EXT_SYSTEM << 12) | (sys<<4) | (inst);
1098 node = (EXT2_SYSTEM << 12) | (sys<<7) | (inst);
1101 node = (FPD_SYSTEM<<12) | (sys<<6) | (inst) ;
1107 extern inline int GET_SYSTEM(
unsigned short node)
1109 int id = (node & 0xf000) >> 12;
1111 if(
id == EXT_SYSTEM)
return (node & 0x03f0) >> 4;
1112 if(
id == EXT2_SYSTEM)
return (node & 0x0f80) >> 7;
1113 if(
id == FPD_SYSTEM) {
1114 u_int sys = node & 0x0FC0 ;
1116 if(sys)
return sys ;
1117 else return FPD_SYSTEM ;
1123 extern inline int GET_INSTANCE(
unsigned short node)
1127 id = (node & 0xf000) >> 12;
1128 if(
id == EXT_SYSTEM)
return node & 0xf;
1129 if(
id == EXT2_SYSTEM)
return node & 0x7f;
1130 if(
id == FPD_SYSTEM)
return node & 0x3F ;
1135 extern inline int GET_SUBSYSTEM(
unsigned short node)
1137 int id = (node & 0xf000) >> 12;
1139 if(
id == EXT_SYSTEM)
return 0;
1140 if(
id == EXT2_SYSTEM)
return 0;
1141 if(
id == FPD_SYSTEM)
return 0 ;
1143 return (node & 0x0300) >> 8;
1147 #define GET_NODE_PRE_APR2002(sys,subsys,inst) ((sys<<12) | (subsys<<8) | (inst))
1148 #define GET_SYSTEM_PRE_APR2002(x) (((x) >> 12) & 0xf)
1149 #define GET_INSTANCE_PRE_APR2002(x) ((x) & 0xff)
1150 #define GET_SUBSYSTEM_PRE_APR2002(x) (((x) >> 8) & 0x3)
1152 #define GET_ROUTE(x) (((x) >> 10) & 0x3)