7 typedef unsigned int UINT32 ;
8 typedef unsigned short UINT16 ;
9 typedef unsigned char UINT8 ;
12 #include "SECTOR/sector.h"
14 #define FMT_ADCD (1 << 0)
15 #define FMT_ADCR (1 << 1)
16 #define FMT_ADCHUF (1 << 2)
17 #define FMT_CPPR (1 << 3)
18 #define FMT_CLD (1 << 4)
20 #define FMT_NOT_FREE (FMT_ADCR | FMT_ADCD | FMT_ADCHUF)
22 #define FMT_PEDR (1 << 8)
23 #define FMT_RMSR (1 << 9)
24 #define FMT_GAINR (1 << 10)
25 #define FMT_BADR (1 << 11)
26 #define FMT_CFGR (1 << 12)
31 #define DAQ_RAW_FORMAT_VERSION 0x00020002 // 2.2
37 #define DAQ_RAW_FORMAT_ORDER 0x04030201
38 #define DAQ_RAW_FORMAT_WORD9 0x9999c0de
40 #define DATAP_FORMAT_NUMBER 1
41 #define SVTP_FORMAT_NUMBER 1
42 #define TPCP_FORMAT_NUMBER 1
43 #define FTPCP_FORMAT_NUMBER 1
44 #define LRHD_FORMAT_NUMBER 1
45 #define TRGP_FORMAT_NUMBER 1
46 #define EMCP_FORMAT_NUMBER 1
66 #define TPC_MZP_BANKS_NUM 12
69 #define CHAR_LRHD "LRHD "
70 #define CHAR_BEGR "BEGR "
71 #define CHAR_ENDR "ENDR "
72 #define CHAR_DATA "DATA "
73 #define CHAR_SLOW "SLOW "
75 #define CHAR_DATAP "DATAP "
78 #define CHAR_TPCP "TPCP "
80 #define CHAR_TPCSECLP "TPCSECLP"
81 #define CHAR_TPCRBCLP "TPCRBCLP"
82 #define CHAR_TPCMZCLD "TPCMZCLD"
84 #define CHAR_TPCSECP "TPCSECP "
85 #define CHAR_TPCRBP "TPCRBP "
86 #define CHAR_TPCMZP "TPCMZP "
88 #define CHAR_TPCADCD "TPCADCD "
89 #define CHAR_TPCSEQD "TPCSEQD "
90 #define CHAR_TPCADCX "TPCADCX "
91 #define CHAR_TPCPADK "TPCPADK "
92 #define CHAR_TPCCPPR "TPCCPPR "
93 #define CHAR_TPCADCR "TPCADCR "
94 #define CHAR_TPCCFGR "TPCCFGR "
95 #define CHAR_TPCPEDR "TPCPEDR "
96 #define CHAR_TPCRMSR "TPCRMSR "
97 #define CHAR_TPCGAINR "TPCGAINR"
98 #define CHAR_TPCBADR "TPCBADR "
101 #define CHAR_SVTP "SVTP "
103 #define CHAR_SVTSECLP "SVTSECLP"
104 #define CHAR_SVTRBCLP "SVTRBCLP"
105 #define CHAR_SVTMZCLD "SVTMZCLD"
107 #define CHAR_SVTSECP "SVTSECP "
108 #define CHAR_SVTRBP "SVTRBP "
109 #define CHAR_SVTMZP "SVTMZP "
111 #define CHAR_SVTADCD "SVTADCD "
112 #define CHAR_SVTSEQD "SVTSEQD "
113 #define CHAR_SVTADCX "SVTADCX "
114 #define CHAR_SVTANODK "SVTANODK"
115 #define CHAR_SVTCPPR "SVTCPPR "
116 #define CHAR_SVTADCR "SVTADCR "
117 #define CHAR_SVTCFGR "SVTCFGR "
118 #define CHAR_SVTPEDR "SVTPEDR "
119 #define CHAR_SVTRMSR "SVTRMSR "
120 #define CHAR_SVTGAINR "SVTGAINR"
121 #define CHAR_SVTBADR "SVTBADR "
124 #define CHAR_FTPP "FTPP "
126 #define CHAR_FTPSECLP "FTPSECLP"
127 #define CHAR_FTPRBCLP "FTPRBCLP"
128 #define CHAR_FTPMZCLD "FTPMZCLD"
130 #define CHAR_FTPSECP "FTPSECP "
131 #define CHAR_FTPRBP "FTPRBP "
132 #define CHAR_FTPMZP "FTPMZP "
134 #define CHAR_FTPADCD "FTPADCD "
135 #define CHAR_FTPSEQD "FTPSEQD "
136 #define CHAR_FTPADCX "FTPADCX "
137 #define CHAR_FTPPADK "FTPPADK "
138 #define CHAR_FTPCPPR "FTPCPPR "
139 #define CHAR_FTPADCR "FTPADCR "
140 #define CHAR_FTPCFGR "FTPCFGR "
141 #define CHAR_FTPPEDR "FTPPEDR "
142 #define CHAR_FTPRMSR "FTPRMSR "
143 #define CHAR_FTPGAINR "FTPGAINR"
144 #define CHAR_FTPBADR "FTPBADR "
147 #define CHAR_RICP "RICP "
148 #define CHAR_RICCRAMP "RICCRAMP"
149 #define CHAR_RICDATAD "RICDATAD"
150 #define CHAR_RICDATAR "RICDATAR"
151 #define CHAR_RICPEDR "RICPEDR "
152 #define CHAR_RICRMSR "RICRMSR "
153 #define CHAR_RICTHRER "RICTHRER"
154 #define CHAR_RICBADR "RICBADR "
157 #define CHAR_TOFP "TOFP "
158 #define CHAR_TOFADCD "TOFADCD "
159 #define CHAR_TOFTDCD "TOFTDCD "
160 #define CHAR_TOFA2DD "TOFA2DD "
161 #define CHAR_TOFSCAD "TOFSCAD "
164 #define CHAR_FPDP "FPDP "
168 #define CHAR_EMCP "EMCP "
169 #define CHAR_EMCSECP "EMCSECP "
170 #define CHAR_EMCRBP "EMCRBP "
172 #define CHAR_EMCADCD "EMCADCD "
173 #define CHAR_EMCSEQD "EMCSEQD "
174 #define CHAR_EMCADCX "EMCADCX "
175 #define CHAR_EMCPADK "EMCPADK "
176 #define CHAR_EMCCPPR "EMCCPPR "
177 #define CHAR_EMCADCR "EMCADCR "
178 #define CHAR_EMCCFGR "EMCCFGR "
179 #define CHAR_EMCPEDR "EMCPEDR "
180 #define CHAR_EMCRMSR "EMCRMSR "
181 #define CHAR_EMCGAINR "EMCGAINR"
182 #define CHAR_EMCBADR "EMCBADR "
185 #define CHAR_PMDP "PMDP "
188 #define CHAR_FPDP "FPDP "
191 #define CHAR_TRGP "TRGP "
210 UINT32 format_number ;
242 char record_type[8] ;
250 #ifdef UNIX_LITTLE_ENDIAN
252 UINT8 format_version;
272 UINT8 format_version;
297 UINT32 TRG_L1_summary[2];
298 UINT32 TRG_L2_summary[2];
329 struct offlen mz[RB_MZ_NUM] ;
330 UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
353 struct offlen mz[RB_MZ_NUM] ;
354 UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
359 struct offlen banks[TPC_MZP_BANKS_NUM] ;
367 UINT32 padrowFiller[2*MZ_MAX_ROWS] ;
368 struct mzCentroid centroidFiller[MZ_MAX_CLUSTERS] ;
378 } lrow[MZ_MAX_ROWS] ;
383 UINT8 adc[MZ_MAX_CHANNELS] ;
388 UINT16 seq[MZ_MAX_CHANNELS/2] ;
396 UINT8 ped[MZ_MAX_CHANNELS] ;
402 UINT8 rms[MZ_MAX_CHANNELS] ;
429 struct row_pad rp[MZ_MAX_PADS] ;
441 struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
452 struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
466 #ifdef TONKO_ELABORATE
483 UINT8 feeId[MZ_MAX_PADS] ;
488 UINT8 feeId[MZ_TPC_MAX_PADS_PER_MEZ] ;
493 UINT8 feeId[MZ_FTP_PADS_PER_MEZ] ;
498 UINT8 feeId[MZ_SVT_MAX_PADS_PER_MEZ] ;
510 } gain[MZ_MAX_PADS] ;
511 UINT8 trans_table[1024] ;
512 UINT16 exp_table[256] ;
524 } gain[MZ_SVT_MAX_PADS_PER_MEZ] ;
525 UINT8 trans_table[1024] ;
526 UINT16 exp_table[256] ;
537 } gain[MZ_TPC_MAX_PADS_PER_MEZ] ;
538 UINT8 trans_table[1024] ;
539 UINT16 exp_table[256] ;
550 } gain[MZ_FTP_PADS_PER_MEZ] ;
551 UINT8 trans_table[1024] ;
552 UINT16 exp_table[256] ;
558 struct row_pad rp[MZ_MAX_PADS] ;
563 struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
568 struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
573 struct row_pad rp[MZ_SVT_MAX_PADS_PER_MEZ] ;
578 #define RIC_BANK_DATAD 0
579 #define RIC_BANK_DATAR 1
580 #define RIC_BANK_PEDR 2
581 #define RIC_BANK_RMSR 3
595 unsigned short data[2*960] ;
636 unsigned int data[48] ;
641 unsigned int data[48] ;
646 unsigned int data[32] ;
651 unsigned int data[12] ;
658 #define EMC_SEC_NUM 6 // num. of "sections" i.e. subparts
659 #define EMC_FIBER_NUM 8 // max num of fibers per subemc
671 struct offlen sec[EMC_SEC_NUM] ;
676 struct offlen fiber[EMC_FIBER_NUM] ;
681 struct offlen banks[TPC_MZP_BANKS_NUM] ;
688 #include "L3/L3Formats.h"
715 static UINT32 sTPCSECP =
sizeof(
struct TPCSECP) ;
716 static UINT32 aTPCSECP = __alignof__(
struct TPCSECP) ;
718 static UINT32 sTPCSECLP =
sizeof(
struct TPCSECLP) ;
719 static UINT32 aTPCSECLP = __alignof__(
struct TPCSECLP) ;
721 static UINT32 sTPCRBCLP =
sizeof(
struct TPCRBCLP) ;
722 static UINT32 aTPCRBCLP = __alignof__(
struct TPCRBCLP) ;
725 static UINT32 aTPCMZCLD_local = __alignof__(
struct TPCMZCLD_local) ;
727 static UINT32 sTPCRBP =
sizeof(
struct TPCRBP) ;
728 static UINT32 aTPCRBP = __alignof__(
struct TPCRBP) ;
730 static UINT32 sTPCMZP =
sizeof(
struct TPCMZP) ;
731 static UINT32 aTPCMZP = __alignof__(
struct TPCMZP) ;
733 static UINT32 sTPCADCX =
sizeof(
struct TPCADCX) ;
734 static UINT32 aTPCADCX = __alignof__(
struct TPCADCX) ;
736 static UINT32 sTPCADCD =
sizeof(
struct TPCADCD) ;
737 static UINT32 aTPCADCD = __alignof__(
struct TPCADCD) ;
739 static UINT32 sTPCSEQD =
sizeof(
struct TPCSEQD) ;
740 static UINT32 aTPCSEQD = __alignof__(
struct TPCSEQD) ;
742 static UINT32 sTPCPADK =
sizeof(
struct TPCPADK) ;
743 static UINT32 aTPCPADK = __alignof__(
struct TPCPADK) ;
745 static UINT32 sTPCCFGR =
sizeof(
struct TPCCFGR) ;
746 static UINT32 aTPCCFGR = __alignof__(
struct TPCCFGR) ;
748 static UINT32 sTPCGAINR =
sizeof(
struct TPCGAINR) ;
749 static UINT32 aTPCGAINR = __alignof__(
struct TPCGAINR) ;
751 static UINT32 sTPCPEDR =
sizeof(
struct TPCPEDR) ;
752 static UINT32 aTPCPEDR = __alignof__(
struct TPCPEDR) ;
754 static UINT32 sTPCRMSR =
sizeof(
struct TPCRMSR) ;
755 static UINT32 aTPCRMSR = __alignof__(
struct TPCRMSR) ;
757 static UINT32 sTPCBADR =
sizeof(
struct TPCBADR) ;
758 static UINT32 aTPCBADR = __alignof__(
struct TPCBADR) ;
760 static UINT32 sTPCADCR_l =
sizeof(
struct TPCADCR_l) ;
761 static UINT32 aTPCADCR_l = __alignof__(
struct TPCADCR_l) ;
763 static UINT32 sTPCCPPR_l =
sizeof(
struct TPCCPPR_l) ;
764 static UINT32 aTPCCPPR_l = __alignof__(
struct TPCCPPR_l) ;