7 typedef unsigned int UINT32 ;
8 typedef unsigned short UINT16 ;
9 typedef unsigned char UINT8 ;
12 #include "SECTOR/sector.h"
15 #if (TRG_VERSION == 0x20)
16 #include "TRG/trgStructures_20.h"
17 #elif (TRG_VERSION == 0x12)
18 #include "TRG/trgStructures-Jan2002.h"
19 #elif (TRG_VERSION == 0x21)
20 #include "TRG/trgStructures_21.h"
21 #elif (TRG_VERSION == 0x22)
22 #include "TRG/trgStructures_v22.h"
26 #define TRG_VERSION 0x32
27 #include "TRG/trgStructures2008.h"
30 #define FMT_ADCD (1 << 0)
31 #define FMT_ADCR (1 << 1)
32 #define FMT_ADCHUF (1 << 2)
33 #define FMT_CPPR (1 << 3)
34 #define FMT_CLD (1 << 4)
36 #define FMT_PADK (1 << 5)
37 #define FMT_SEQD (1 << 6)
38 #define FMT_ADCX (1 << 7)
40 #define FMT_NOT_FREE (FMT_ADCR | FMT_ADCD | FMT_ADCHUF)
42 #define FMT_PEDR (1 << 8)
43 #define FMT_RMSR (1 << 9)
44 #define FMT_GAINR (1 << 10)
45 #define FMT_BADR (1 << 11)
46 #define FMT_CFGR (1 << 12)
47 #define FMT_NONE (1 << 13)
54 #define DAQ_RAW_FORMAT_VERSION 0x00020003 // 2.30
57 #define DAQ_RAW_FORMAT_ORDER 0x04030201
62 #define DAQ_RAW_FORMAT_WORD9 0x00000000
64 #define DATAP_FORMAT_NUMBER 1
65 #define SVTP_FORMAT_NUMBER 1
66 #define TPCP_FORMAT_NUMBER 1
67 #define FTPCP_FORMAT_NUMBER 1
68 #define LRHD_FORMAT_NUMBER 1
69 #define TRGP_FORMAT_NUMBER 1
70 #define EMCP_FORMAT_NUMBER 1
71 #define SSDP_FORMAT_NUMBER 1
72 #define TRGID_FORMAT_NUMBER 1
73 #define TPXP_FORMAT_NUMBER 1
94 #define TPC_MZP_BANKS_NUM 12
97 #define CHAR_LRHD "LRHD "
98 #define CHAR_BEGR "BEGR "
99 #define CHAR_ENDR "ENDR "
100 #define CHAR_DATA "DATA "
101 #define CHAR_SLOW "SLOW "
103 #define CHAR_DATAP "DATAP "
104 #define CHAR_DATAPX "DATAPX "
107 #define CHAR_TPCP "TPCP "
109 #define CHAR_TPCSECLP "TPCSECLP"
110 #define CHAR_TPCRBCLP "TPCRBCLP"
111 #define CHAR_TPCMZCLD "TPCMZCLD"
113 #define CHAR_TPCSECP "TPCSECP "
114 #define CHAR_TPCRBP "TPCRBP "
115 #define CHAR_TPCMZP "TPCMZP "
117 #define CHAR_TPCADCD "TPCADCD "
118 #define CHAR_TPCSEQD "TPCSEQD "
119 #define CHAR_TPCADCX "TPCADCX "
120 #define CHAR_TPCPADK "TPCPADK "
121 #define CHAR_TPCCPPR "TPCCPPR "
122 #define CHAR_TPCADCR "TPCADCR "
123 #define CHAR_TPCCFGR "TPCCFGR "
124 #define CHAR_TPCPEDR "TPCPEDR "
125 #define CHAR_TPCRMSR "TPCRMSR "
126 #define CHAR_TPCGAINR "TPCGAINR"
127 #define CHAR_TPCGAIND "TPCGAIND" // new, sane gain bank
128 #define CHAR_TPCBADR "TPCBADR " // this is obsolete...
131 #define CHAR_SVTP "SVTP "
133 #define CHAR_SVTSECLP "SVTSECLP"
134 #define CHAR_SVTRBCLP "SVTRBCLP"
135 #define CHAR_SVTMZCLD "SVTMZCLD"
137 #define CHAR_SVTSECP "SVTSECP "
138 #define CHAR_SVTRBP "SVTRBP "
139 #define CHAR_SVTMZP "SVTMZP "
141 #define CHAR_SVTADCD "SVTADCD "
142 #define CHAR_SVTSEQD "SVTSEQD "
143 #define CHAR_SVTADCX "SVTADCX "
144 #define CHAR_SVTANODK "SVTANODK"
145 #define CHAR_SVTCPPR "SVTCPPR "
146 #define CHAR_SVTADCR "SVTADCR "
147 #define CHAR_SVTCFGR "SVTCFGR "
148 #define CHAR_SVTPEDR "SVTPEDR "
149 #define CHAR_SVTRMSR "SVTRMSR "
150 #define CHAR_SVTGAINR "SVTGAINR"
151 #define CHAR_SVTBADR "SVTBADR "
154 #define CHAR_FTPP "FTPP "
156 #define CHAR_FTPSECLP "FTPSECLP"
157 #define CHAR_FTPRBCLP "FTPRBCLP"
158 #define CHAR_FTPMZCLD "FTPMZCLD"
160 #define CHAR_FTPSECP "FTPSECP "
161 #define CHAR_FTPRBP "FTPRBP "
162 #define CHAR_FTPMZP "FTPMZP "
164 #define CHAR_FTPADCD "FTPADCD "
165 #define CHAR_FTPSEQD "FTPSEQD "
166 #define CHAR_FTPADCX "FTPADCX "
167 #define CHAR_FTPPADK "FTPPADK "
168 #define CHAR_FTPCPPR "FTPCPPR "
169 #define CHAR_FTPADCR "FTPADCR "
170 #define CHAR_FTPCFGR "FTPCFGR "
171 #define CHAR_FTPPEDR "FTPPEDR "
172 #define CHAR_FTPRMSR "FTPRMSR "
173 #define CHAR_FTPGAINR "FTPGAINR"
174 #define CHAR_FTPBADR "FTPBADR "
177 #define CHAR_SSDP "SSDP "
179 #define CHAR_SSDSECLP "SSDSECLP"
180 #define CHAR_SSDRBCLP "SSDRBCLP"
181 #define CHAR_SSDMZCLD "SSDMZCLD"
183 #define CHAR_SSDSECP "SSDSECP "
184 #define CHAR_SSDRBP "SSDRBP "
185 #define CHAR_SSDMZP "SSDMZP "
187 #define CHAR_SSDADCD "SSDADCD "
188 #define CHAR_SSDSEQD "SSDSEQD "
189 #define CHAR_SSDADCX "SSDADCX "
190 #define CHAR_SSDPADK "SSDPADK "
191 #define CHAR_SSDCPPR "SSDCPPR "
192 #define CHAR_SSDADCR "SSDADCR "
193 #define CHAR_SSDCFGR "SSDCFGR "
194 #define CHAR_SSDPEDR "SSDPEDR "
195 #define CHAR_SSDRMSR "SSDRMSR "
196 #define CHAR_SSDGAINR "SSDGAINR"
197 #define CHAR_SSDBADR "SSDBADR "
201 #define CHAR_RICP "RICP "
202 #define CHAR_RICCRAMP "RICCRAMP"
203 #define CHAR_RICDATAD "RICDATAD"
204 #define CHAR_RICDATAR "RICDATAR"
205 #define CHAR_RICPEDR "RICPEDR "
206 #define CHAR_RICRMSR "RICRMSR "
207 #define CHAR_RICTHRER "RICTHRER"
208 #define CHAR_RICBADR "RICBADR "
211 #define CHAR_TOFP "TOFP "
212 #define CHAR_TOFADCD "TOFADCD "
213 #define CHAR_TOFTDCD "TOFTDCD "
214 #define CHAR_TOFA2DD "TOFA2DD "
215 #define CHAR_TOFSCAD "TOFSCAD "
216 #define CHAR_TOFDDLR "TOFDDLR "
219 #define CHAR_FPDP "FPDP "
220 #define CHAR_FPDADCD "FPDADCD "
221 #define CHAR_FPDTDCD "FPDTDCD "
222 #define CHAR_FPDREGD "FPDREGD "
223 #define CHAR_FPDPEDR "FPDPEDR "
224 #define CHAR_FPDSCL "FPDSCL "
226 #define CHAR_BBCDAT "BBCDAT "
227 #define CHAR_BBCPED "BBCPED "
228 #define CHAR_BBCSCL "BBCSCL "
232 #define CHAR_FP2P "FP2P "
236 #define CHAR_EMCP "EMCP "
237 #define CHAR_EMCSECP "EMCSECP "
238 #define CHAR_EMCRBP "EMCRBP "
240 #define CHAR_EMCADCD "EMCADCD "
241 #define CHAR_EMCSEQD "EMCSEQD "
242 #define CHAR_EMCADCX "EMCADCX "
243 #define CHAR_EMCPADK "EMCPADK "
244 #define CHAR_EMCCPPR "EMCCPPR "
245 #define CHAR_EMCADCR "EMCADCR "
246 #define CHAR_EMCCFGR "EMCCFGR "
247 #define CHAR_EMCPEDR "EMCPEDR "
248 #define CHAR_EMCRMSR "EMCRMSR "
249 #define CHAR_EMCGAINR "EMCGAINR"
250 #define CHAR_EMCBADR "EMCBADR "
253 #define CHAR_EECP "EECP "
254 #define CHAR_EECSECP "EECSECP "
255 #define CHAR_EECRBP "EECRBP "
257 #define CHAR_EECADCD "EECADCD "
258 #define CHAR_EECSEQD "EECSEQD "
259 #define CHAR_EECADCX "EECADCX "
260 #define CHAR_EECPADK "EECPADK "
261 #define CHAR_EECCPPR "EECCPPR "
262 #define CHAR_EECADCR "EECADCR "
263 #define CHAR_EECCFGR "EECCFGR "
264 #define CHAR_EECPEDR "EECPEDR "
265 #define CHAR_EECRMSR "EECRMSR "
266 #define CHAR_EECGAINR "EECGAINR"
267 #define CHAR_EECBADR "EECBADR "
271 #define CHAR_PMDP "PMDP "
272 #define CHAR_PMDSECP "PMDSECP "
273 #define CHAR_PMDADCD "PMDADCD "
274 #define CHAR_PMDRMSR "PMDRMSR "
275 #define CHAR_PMDPEDR "PMDPEDR "
276 #define CHAR_PMDTHRR "PMDTHRR "
279 #define CHAR_TRGP "TRGP "
280 #define CHAR_TRGD "TRGD "
281 #define CHAR_TRGID "TRGID "
284 #define CHAR_PP2PPP "PP2PPP "
285 #define CHAR_PP2PPR "PP2PPR "
287 #define CHAR_L3P "L3P "
290 #define CHAR_SCD "SCD "
292 #define CHAR_TPXP "TPXP "
309 UINT32 format_number ;
341 char record_type[8] ;
355 #if defined(UNIX_LITTLE_ENDIAN) || defined(RTS_LITTLE_ENDIAN)
357 UINT8 format_version;
377 UINT8 format_version;
403 UINT32 TRG_L1_summary[2];
404 UINT32 TRG_L2_summary[2];
417 UINT32 triggerId[32] ;
446 #if (TRG_VERSION < 0x32)
476 struct offlen mz[RB_MZ_NUM] ;
477 UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
500 struct offlen mz[RB_MZ_NUM] ;
501 UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
506 struct offlen banks[TPC_MZP_BANKS_NUM] ;
514 UINT32 padrowFiller[2*MZ_MAX_ROWS] ;
515 struct mzCentroid centroidFiller[MZ_MAX_CLUSTERS] ;
525 } lrow[MZ_MAX_ROWS] ;
530 UINT8 adc[MZ_MAX_CHANNELS] ;
535 UINT16 seq[MZ_MAX_CHANNELS/2] ;
543 UINT8 ped[MZ_MAX_CHANNELS] ;
549 UINT8 rms[MZ_MAX_CHANNELS] ;
576 struct row_pad rp[MZ_MAX_PADS] ;
588 struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
599 struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
613 #ifdef TONKO_ELABORATE
630 UINT8 feeId[MZ_MAX_PADS] ;
635 UINT8 feeId[MZ_TPC_MAX_PADS_PER_MEZ] ;
640 UINT8 feeId[MZ_FTP_PADS_PER_MEZ] ;
645 UINT8 feeId[MZ_SVT_MAX_PADS_PER_MEZ] ;
657 } gain[MZ_MAX_PADS] ;
658 UINT8 trans_table[1024] ;
659 UINT16 exp_table[256] ;
666 unsigned short rel_gain ;
667 } gain[MZ_MAX_PADS] ;
668 UINT8 trans_table[1024] ;
669 UINT16 exp_table[256] ;
681 } gain[MZ_SVT_MAX_PADS_PER_MEZ] ;
682 UINT8 trans_table[1024] ;
683 UINT16 exp_table[256] ;
694 } gain[MZ_TPC_MAX_PADS_PER_MEZ] ;
695 UINT8 trans_table[1024] ;
696 UINT16 exp_table[256] ;
707 } gain[MZ_FTP_PADS_PER_MEZ] ;
708 UINT8 trans_table[1024] ;
709 UINT16 exp_table[256] ;
715 struct row_pad rp[MZ_MAX_PADS] ;
720 struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
725 struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
730 struct row_pad rp[MZ_SVT_MAX_PADS_PER_MEZ] ;
735 #define RIC_BANK_DATAD 0
736 #define RIC_BANK_DATAR 1
737 #define RIC_BANK_PEDR 2
738 #define RIC_BANK_RMSR 3
752 unsigned short data[2*960] ;
779 #define FPDP_MAX_BANKS 8
786 #define FPDP_BBCDAT 5
787 #define FPDP_BBCPED 6
788 #define FPDP_BBCSCL 7
793 struct offlen type[FPDP_MAX_BANKS] ;
798 unsigned short data[256] ;
803 unsigned short data[8] ;
808 unsigned short data[4] ;
813 unsigned short ped[256] ;
814 unsigned short rms[256] ;
819 unsigned int scl[128] ;
824 unsigned short pulse[32] ;
825 unsigned short time[32] ;
826 unsigned short proof[2] ;
827 unsigned short spare[6] ;
832 unsigned short ped[32] ;
833 unsigned short rms[32] ;
834 unsigned short peaks[64] ;
839 unsigned int scl[32] ;
855 unsigned int data[180] ;
860 unsigned int data[184] ;
865 unsigned int data[32] ;
870 unsigned int data[12] ;
880 #define PMD_CRAMS_MAX 12
881 #define PMD_CRAMS_CH_MAX 1728
901 UINT32
data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ;
906 UINT16
data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ;
912 UINT16
data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ;
917 UINT16
data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ;
933 #define EMC_SEC_NUM 6 // num. of "sections" i.e. subparts
934 #define EMC_FIBER_NUM 12 // max num of fibers per subemc
946 struct offlen sec[EMC_SEC_NUM] ;
951 struct offlen fiber[EMC_FIBER_NUM] ;
956 struct offlen banks[TPC_MZP_BANKS_NUM] ;
972 unsigned int seqAdj ;
973 unsigned int xingAdj ;
975 unsigned int res[1] ;
980 #define SCD_FORMAT_VERSION 0x00050001 // Run FY05, version 1
985 unsigned int rich_scalers[16] ;
990 #include "L3/L3Formats.h"
1020 static UINT32 sTPCSECP =
sizeof(
struct TPCSECP) ;
1021 static UINT32 aTPCSECP = __alignof__(
struct TPCSECP) ;
1023 static UINT32 sTPCSECLP =
sizeof(
struct TPCSECLP) ;
1024 static UINT32 aTPCSECLP = __alignof__(
struct TPCSECLP) ;
1026 static UINT32 sTPCRBCLP =
sizeof(
struct TPCRBCLP) ;
1027 static UINT32 aTPCRBCLP = __alignof__(
struct TPCRBCLP) ;
1030 static UINT32 aTPCMZCLD_local = __alignof__(
struct TPCMZCLD_local) ;
1032 static UINT32 sTPCRBP =
sizeof(
struct TPCRBP) ;
1033 static UINT32 aTPCRBP = __alignof__(
struct TPCRBP) ;
1035 static UINT32 sTPCMZP =
sizeof(
struct TPCMZP) ;
1036 static UINT32 aTPCMZP = __alignof__(
struct TPCMZP) ;
1038 static UINT32 sTPCADCX =
sizeof(
struct TPCADCX) ;
1039 static UINT32 aTPCADCX = __alignof__(
struct TPCADCX) ;
1041 static UINT32 sTPCADCD =
sizeof(
struct TPCADCD) ;
1042 static UINT32 aTPCADCD = __alignof__(
struct TPCADCD) ;
1044 static UINT32 sTPCSEQD =
sizeof(
struct TPCSEQD) ;
1045 static UINT32 aTPCSEQD = __alignof__(
struct TPCSEQD) ;
1047 static UINT32 sTPCPADK =
sizeof(
struct TPCPADK) ;
1048 static UINT32 aTPCPADK = __alignof__(
struct TPCPADK) ;
1050 static UINT32 sTPCCFGR =
sizeof(
struct TPCCFGR) ;
1051 static UINT32 aTPCCFGR = __alignof__(
struct TPCCFGR) ;
1053 static UINT32 sTPCGAINR =
sizeof(
struct TPCGAINR) ;
1054 static UINT32 aTPCGAINR = __alignof__(
struct TPCGAINR) ;
1056 static UINT32 sTPCPEDR =
sizeof(
struct TPCPEDR) ;
1057 static UINT32 aTPCPEDR = __alignof__(
struct TPCPEDR) ;
1059 static UINT32 sTPCRMSR =
sizeof(
struct TPCRMSR) ;
1060 static UINT32 aTPCRMSR = __alignof__(
struct TPCRMSR) ;
1062 static UINT32 sTPCBADR =
sizeof(
struct TPCBADR) ;
1063 static UINT32 aTPCBADR = __alignof__(
struct TPCBADR) ;
1065 static UINT32 sTPCADCR_l =
sizeof(
struct TPCADCR_l) ;
1066 static UINT32 aTPCADCR_l = __alignof__(
struct TPCADCR_l) ;
1068 static UINT32 sTPCCPPR_l =
sizeof(
struct TPCCPPR_l) ;
1069 static UINT32 aTPCCPPR_l = __alignof__(
struct TPCCPPR_l) ;