StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
daqFormats.h
1 #ifndef _DAQ_FORMATS_H
2 #define _DAQ_FORMATS_H
3 
4 #ifdef VXWORKS
5 #include <vxWorks.h>
6 #else
7 typedef unsigned int UINT32 ;
8 typedef unsigned short UINT16 ;
9 typedef unsigned char UINT8 ;
10 #endif
11 
12 #include "SECTOR/sector.h" // for the size constants
13 
14 
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"
23 #else // default
24 //#define TRG_VERSION 0x30 // changed on Feb 22, 2007
25 //#include "TRG/trgStructures.h"
26 #define TRG_VERSION 0x32
27 #include "TRG/trgStructures2008.h"
28 #endif
29 
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)
35 
36 #define FMT_PADK (1 << 5)
37 #define FMT_SEQD (1 << 6)
38 #define FMT_ADCX (1 << 7)
39 
40 #define FMT_NOT_FREE (FMT_ADCR | FMT_ADCD | FMT_ADCHUF)
41 
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)
48 
49 
50 // Version below corresponds to "DAQ Raw Data Format" document's version
51 // changed from:
52 //#define DAQ_RAW_FORMAT_VERSION 0x00020002 // 2.2
53 // on April 14, 2002. Tonko
54 #define DAQ_RAW_FORMAT_VERSION 0x00020003 // 2.30
55 
56 
57 #define DAQ_RAW_FORMAT_ORDER 0x04030201
58 
59 // changed from
60 //#define DAQ_RAW_FORMAT_WORD9 0x9999c0de
61 // on April 14, 2002. Tonko
62 #define DAQ_RAW_FORMAT_WORD9 0x00000000
63 
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
74 
75 // ALL the structures and defines that share the same structure types as the TPC
76 // (i.e. SVT, FTPC, SSD) will be called, by definition, TPC_
77 
78 // order in the mezzanine bank
79 #define TPC_ADCD 0
80 #define TPC_SEQD 1
81 #define TPC_ADCX 2
82 #define TPC_PADK 3
83 #define SVT_ANODK 3
84 #define TPC_CPPR 4
85 #define TPC_ADCR 5
86 #define TPC_MZCLD 6
87 #define TPC_CFGR 7
88 #define TPC_PEDR 8
89 #define TPC_RMSR 9
90 #define TPC_GAINR 10
91 #define TPC_GAIND 10
92 #define TPC_BADR 11
93 
94 #define TPC_MZP_BANKS_NUM 12
95 
96 // gloabal character names
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 "
102 
103 #define CHAR_DATAP "DATAP "
104 #define CHAR_DATAPX "DATAPX "
105 
106 // real TPC names
107 #define CHAR_TPCP "TPCP "
108 
109 #define CHAR_TPCSECLP "TPCSECLP"
110 #define CHAR_TPCRBCLP "TPCRBCLP"
111 #define CHAR_TPCMZCLD "TPCMZCLD"
112 
113 #define CHAR_TPCSECP "TPCSECP "
114 #define CHAR_TPCRBP "TPCRBP "
115 #define CHAR_TPCMZP "TPCMZP "
116 
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...
129 
130 // real SVT names
131 #define CHAR_SVTP "SVTP "
132 
133 #define CHAR_SVTSECLP "SVTSECLP"
134 #define CHAR_SVTRBCLP "SVTRBCLP"
135 #define CHAR_SVTMZCLD "SVTMZCLD"
136 
137 #define CHAR_SVTSECP "SVTSECP "
138 #define CHAR_SVTRBP "SVTRBP "
139 #define CHAR_SVTMZP "SVTMZP "
140 
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 "
152 
153 // real FTP names
154 #define CHAR_FTPP "FTPP "
155 
156 #define CHAR_FTPSECLP "FTPSECLP"
157 #define CHAR_FTPRBCLP "FTPRBCLP"
158 #define CHAR_FTPMZCLD "FTPMZCLD"
159 
160 #define CHAR_FTPSECP "FTPSECP "
161 #define CHAR_FTPRBP "FTPRBP "
162 #define CHAR_FTPMZP "FTPMZP "
163 
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 "
175 
176 // real SSD names
177 #define CHAR_SSDP "SSDP "
178 
179 #define CHAR_SSDSECLP "SSDSECLP"
180 #define CHAR_SSDRBCLP "SSDRBCLP"
181 #define CHAR_SSDMZCLD "SSDMZCLD"
182 
183 #define CHAR_SSDSECP "SSDSECP "
184 #define CHAR_SSDRBP "SSDRBP "
185 #define CHAR_SSDMZP "SSDMZP "
186 
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 "
198 
199 
200 // real RICH names
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 "
209 
210 // real TOF names
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 "
217 
218 // real FPD names
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 "
225 // BBC comes under FPDP!
226 #define CHAR_BBCDAT "BBCDAT "
227 #define CHAR_BBCPED "BBCPED "
228 #define CHAR_BBCSCL "BBCSCL "
229 
230 
231 // "new" (2002-2003) FPD
232 #define CHAR_FP2P "FP2P "
233 
234 
235 // real EMC names
236 #define CHAR_EMCP "EMCP "
237 #define CHAR_EMCSECP "EMCSECP "
238 #define CHAR_EMCRBP "EMCRBP "
239 
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 "
251 
252 // real EEC names
253 #define CHAR_EECP "EECP "
254 #define CHAR_EECSECP "EECSECP "
255 #define CHAR_EECRBP "EECRBP "
256 
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 "
268 
269 
270 // PMD
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 "
277 
278 // trigger
279 #define CHAR_TRGP "TRGP "
280 #define CHAR_TRGD "TRGD "
281 #define CHAR_TRGID "TRGID "
282 
283 // PP2PP
284 #define CHAR_PP2PPP "PP2PPP "
285 #define CHAR_PP2PPR "PP2PPR "
286 
287 #define CHAR_L3P "L3P "
288 
289 // Slow Controls and friends
290 #define CHAR_SCD "SCD "
291 
292 #define CHAR_TPXP "TPXP "
293 
294 /*
295 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 && defined(__I960)
296 #pragma align 1
297 #pragma pack 1
298 #endif
299 */
300 
301 
302 // generic section for all of DAQ
303 struct bankHeader {
304  char bank_type[8] ;
305  UINT32 length ;
306  UINT32 bank_id ;
307  UINT32 format_ver ;
308  UINT32 byte_order ;
309  UINT32 format_number ;
310  UINT32 token ;
311  UINT32 w9 ;
312  UINT32 crc ;
313 } ;
314 
315 struct logicalHeader {
316  char bank_type[8] ;
317  UINT32 length ;
318  UINT32 run ;
319  UINT32 format_ver ;
320  UINT32 byte_order ;
321  UINT32 w7 ;
322  UINT32 w8 ;
323  UINT32 w9 ;
324  UINT32 crc ;
325 } ;
326 
327 struct offlen {
328  UINT32 off ;
329  UINT32 len;
330 } ;
331 
332 struct row_pad {
333  UINT8 row ;
334  UINT8 pad ;
335 } ;
336 
337 struct LOGREC {
338  struct logicalHeader lh ;
339  UINT32 length ;
340  UINT32 blocking ;
341  char record_type[8] ;
342  UINT32 crc ;
343 } ;
344 
345 
346 
347 // Tonko, 4/11/2002, Changed the name of the EventDescriptor
348 // structure to EventDescriptor2001 since it is still used
349 // in DATAP (i.e.) for backward compatibility
350 
351 // the EventDescriptor is passed to DAQ from Trigger
352 // Tonko, 7/13/00 noticed that detectorMask and TRG_DAQ_cmds were
353 // swapped in real trigger data. Swapped them!
354 
355 #if defined(UNIX_LITTLE_ENDIAN) || defined(RTS_LITTLE_ENDIAN)
356 struct EventDescriptor2001 {
357  UINT8 format_version;
358  UINT8 tag; // 'E'
359  UINT16 byteCount; // 28
360  UINT32 bx_hi; // Bunch Xing hi 32 bits
361  UINT32 bx_lo; // Bunch Xing lo 32 bits
362  UINT8 detectorMask; // makes the Action Word with TRG_DAQ_cmds
363  UINT8 TRG_DAQ_cmds; // 16*TRG_cmd | DAQ_cmd
364  UINT16 token;
365  UINT16 dsm_address; // address of raw data for this crossing
366  UINT16 dsm_data; // output of last DSM
367  UINT16 TRG_word;
368  UINT8 add_bits; // bit 7 - fake data; bit 6 - L2.5 abort; bit 1 - priority; bit 0 - pileup
369  UINT8 busy; // BUSY at start of this Xing
370  UINT16 npost;
371  UINT16 npre;
372 };
373 #else
374 struct EventDescriptor2001 {
375  UINT16 byteCount; // 28
376  UINT8 tag; // 'E'
377  UINT8 format_version;
378  UINT32 bx_hi; // Bunch Xing hi 32 bits
379  UINT32 bx_lo; // Bunch Xing lo 32 bits
380  UINT16 token;
381  UINT8 TRG_DAQ_cmds; // 16*TRG_cmd | DAQ_cmd
382  UINT8 detectorMask; // makes the Action Word with TRG_DAQ_cmds
383  UINT16 dsm_data; // output of last DSM
384  UINT16 dsm_address; // address of raw data for this crossing
385  UINT8 busy; // BUSY at start of this Xing
386  UINT8 add_bits; // bit 7 - fake data; bit 6 - L2.5 abort; bit 1 - priority; bit 0 - pileup
387  UINT16 TRG_word;
388  UINT16 npre;
389  UINT16 npost;
390 } ;
391 #endif
392 
393 
394 struct DATAP {
395  struct bankHeader bh ;
396  UINT32 len ;
397  UINT32 time ;
398  UINT32 seq ;
399  UINT32 trg_word ;
400  UINT32 trg_in_word ;
401  UINT32 detector ;
402  struct offlen det[10] ; // DET_ID "EXT_ID" points to DATAPX if it exists!
403  UINT32 TRG_L1_summary[2];
404  UINT32 TRG_L2_summary[2];
405  UINT32 L3_Summary[4] ;
406  struct EventDescriptor2001 evtdes ;
407  // total data len is 40 words (header not included)
408 } ;
409 
410 struct DATAPX {
411  struct bankHeader bh ;
412  struct offlen det[22] ; // index 0 is det_id 10 !!!!
413 } ;
414 
415 struct TRGID {
416  struct bankHeader bh ;
417  UINT32 triggerId[32] ; // index is the l3 summary bit.
418 };
419 
420 struct DUMMYDATA {
421  struct bankHeader bh ;
422 } ;
423 
424 struct TPCP {
425  struct bankHeader bh ;
426  struct offlen sb[24] ; // 24 sectors
427 } ;
428 
429 struct TPXP {
430  struct bankHeader bh;
431  struct offlen sb;
432 };
433 
434 struct TPXD {
435  struct bankHeader;
436  UINT32 data[1]; // size is actually variable...
437 };
438 
439 
440 struct TRGP {
441  struct bankHeader bh ;
442  struct offlen trgData ;
443  struct offlen trgId;
444 };
445 
446 #if (TRG_VERSION < 0x32)
447 struct TRGD {
448  struct bankHeader bh ;
449  EvtDescData desc ;
450  TrgSumData sum ;
451  RawTrgDet raw[MAX_RAW_DATA_BLOCKS] ;
452 } ;
453 #else
454 struct TRGD {
455  struct bankHeader bh ;
456  /*
457  EvtDescData2008 desc ;
458  TrgSumData2008 sum ;
459  RawTrgDet2008 raw[y8MAX_RAW_DATA_BLOCKS] ;
460  */
461  TrgTowerTrnfer2008 tow ;
462 } ;
463 #endif
464 
465 // Level 3 structures
466 // Level 3 banks - most are defined in file included at end
467 //
468 
469 struct TPCSECLP {
470  struct bankHeader bh ;
471  struct offlen rb[SB_RB_NUM] ;
472 } ;
473 
474 struct TPCRBCLP {
475  struct bankHeader bh ;
476  struct offlen mz[RB_MZ_NUM] ;
477  UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
478 } ;
479 
480 struct mzCentroid {
481  UINT16 x ;
482  UINT16 t ;
483  UINT16 flags ;
484  UINT16 charge ;
485 } ;
486 
487 
488 
489 
490 
491 // Formatting structures
492 struct TPCSECP {
493  struct bankHeader bh ;
494  struct offlen rb[SB_RB_NUM] ;
495 } ;
496 
497 
498 struct TPCRBP {
499  struct bankHeader bh ;
500  struct offlen mz[RB_MZ_NUM] ;
501  UINT8 fiberHdr[RB_FIBER_HDR_LEN] ;
502 } ;
503 
504 struct TPCMZP {
505  struct bankHeader bh ;
506  struct offlen banks[TPC_MZP_BANKS_NUM] ;
507 } ;
508 
509 // this is a local structure that is just used to allocate space
510 // it will be recast to the real TPCMZCLD later...
511 struct TPCMZCLD_local {
512  struct bankHeader bh ;
513  UINT32 rows ; // how many "rowlike" objects follow...
514  UINT32 padrowFiller[2*MZ_MAX_ROWS] ; // max 6 padrows, each occupies 2 UINT32s...
515  struct mzCentroid centroidFiller[MZ_MAX_CLUSTERS] ;
516 } ;
517 
518 // change the name of the "struct row" to something else - Tonko, 2/22/2001
519 struct TPCADCX {
520  struct bankHeader bh ;
521  struct rowx {
522  UINT32 row ;
523  UINT32 offADC ;
524  UINT32 offSEQ ;
525  } lrow[MZ_MAX_ROWS] ; // MAX 6 padrows/hybrids in a mezzanine
526 } ;
527 
528 struct TPCADCD {
529  struct bankHeader bh ;
530  UINT8 adc[MZ_MAX_CHANNELS] ; // this is the worst case
531 } ;
532 
533 struct TPCSEQD {
534  struct bankHeader bh ;
535  UINT16 seq[MZ_MAX_CHANNELS/2] ; // theoretical maximum
536  // see TPCADCD...
537 } ;
538 
539 
540 struct TPCPEDR {
541  struct bankHeader bh ;
542  UINT32 events ;
543  UINT8 ped[MZ_MAX_CHANNELS] ;
544 } ;
545 
546 struct TPCRMSR {
547  struct bankHeader bh ;
548  UINT32 events ;
549  UINT8 rms[MZ_MAX_CHANNELS] ;
550 } ;
551 
552 
553 struct TPCADCR_l {
554  struct bankHeader bh ;
555 } ;
556 
557 struct TPCCPPR_l {
558  struct bankHeader bh ;
559  UINT8 thr_lo ;
560  UINT8 thr_hi ;
561  UINT8 seq_lo ;
562  UINT8 seq_hi ;
563 } ;
564 
565 
566 // structures that are detector dependent
567 
568 struct DETPADK {
569  struct bankHeader bh ;
570  UINT32 bytesADC ;
571  UINT32 bytesCPP ;
572  UINT32 bytesPED ;
573  UINT32 bytesRMS ;
574  UINT32 bytesCFG ;
575  UINT32 bytesGAIN ;
576  struct row_pad rp[MZ_MAX_PADS] ;
577 } ;
578 
579 
580 struct TPCPADK {
581  struct bankHeader bh ;
582  UINT32 bytesADC ;
583  UINT32 bytesCPP ;
584  UINT32 bytesPED ;
585  UINT32 bytesRMS ;
586  UINT32 bytesCFG ;
587  UINT32 bytesGAIN ;
588  struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
589 } ;
590 
591 struct FTPPADK {
592  struct bankHeader bh ;
593  UINT32 bytesADC ;
594  UINT32 bytesCPP ;
595  UINT32 bytesPED ;
596  UINT32 bytesRMS ;
597  UINT32 bytesCFG ;
598  UINT32 bytesGAIN ;
599  struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
600 } ;
601 
602 
603 
604 struct SVTANODK {
605  struct bankHeader bh ;
606  UINT32 bytesADC ;
607  UINT32 bytesCPP ;
608  UINT32 bytesPED ;
609  UINT32 bytesRMS ;
610  UINT32 bytesCFG ;
611  UINT32 bytesGAIN ;
612  UINT32 hybrids[6] ;
613 #ifdef TONKO_ELABORATE
614  struct hybrids {
615  UINT8 barrel ;
616  UINT8 ladder ;
617  UINT8 hy_wf ;
618  UINT8 hybridID ;
619  } hybrids[6] ;
620 #endif
621  // used in SVT specific processing...
622  UINT32 pre ;
623  UINT32 post ;
624  UINT32 pedOff ;
625 } ;
626 
627 
628 struct DETCFGR {
629  struct bankHeader bh ;
630  UINT8 feeId[MZ_MAX_PADS] ;
631 } ;
632 
633 struct TPCCFGR {
634  struct bankHeader bh ;
635  UINT8 feeId[MZ_TPC_MAX_PADS_PER_MEZ] ;
636 } ;
637 
638 struct FTPCFGR {
639  struct bankHeader bh ;
640  UINT8 feeId[MZ_FTP_PADS_PER_MEZ] ;
641 } ;
642 
643 struct SVTCFGR {
644  struct bankHeader bh ;
645  UINT8 feeId[MZ_SVT_MAX_PADS_PER_MEZ] ;
646 } ;
647 
648 
649 struct DETGAINR {
650  struct bankHeader bh ;
651  UINT32 events ;
652  UINT32 meanGain ;
653  struct gain {
654  UINT16 t0 ;
655  UINT8 t0_rms ;
656  UINT8 rel_gain ;
657  } gain[MZ_MAX_PADS] ;
658  UINT8 trans_table[1024] ;
659  UINT16 exp_table[256] ;
660 } ;
661 
662 struct DETGAIND {
663  struct bankHeader bh ;
664  struct gain {
665  short t0 ;
666  unsigned short rel_gain ;
667  } gain[MZ_MAX_PADS] ;
668  UINT8 trans_table[1024] ;
669  UINT16 exp_table[256] ;
670 } ;
671 
672 
673 struct SVTGAINR {
674  struct bankHeader bh ;
675  UINT32 events ;
676  UINT32 meanGain ;
677  struct gain {
678  UINT16 t0 ;
679  UINT8 t0_rms ;
680  UINT8 rel_gain ;
681  } gain[MZ_SVT_MAX_PADS_PER_MEZ] ;
682  UINT8 trans_table[1024] ;
683  UINT16 exp_table[256] ;
684 } ;
685 
686 struct TPCGAINR {
687  struct bankHeader bh ;
688  UINT32 events ;
689  UINT32 meanGain ;
690  struct gain {
691  UINT16 t0 ;
692  UINT8 t0_rms ;
693  UINT8 rel_gain ;
694  } gain[MZ_TPC_MAX_PADS_PER_MEZ] ;
695  UINT8 trans_table[1024] ;
696  UINT16 exp_table[256] ;
697 } ;
698 
699 struct FTPGAINR {
700  struct bankHeader bh ;
701  UINT32 events ;
702  UINT32 meanGain ;
703  struct gain {
704  UINT16 t0 ;
705  UINT8 t0_rms ;
706  UINT8 rel_gain ;
707  } gain[MZ_FTP_PADS_PER_MEZ] ;
708  UINT8 trans_table[1024] ;
709  UINT16 exp_table[256] ;
710 } ;
711 
712 
713 struct DETBADR {
714  struct bankHeader bh ;
715  struct row_pad rp[MZ_MAX_PADS] ;
716 } ;
717 
718 struct TPCBADR {
719  struct bankHeader bh ;
720  struct row_pad rp[MZ_TPC_MAX_PADS_PER_MEZ] ;
721 } ;
722 
723 struct FTPBADR {
724  struct bankHeader bh ;
725  struct row_pad rp[MZ_FTP_PADS_PER_MEZ] ;
726 } ;
727 
728 struct SVTBADR {
729  struct bankHeader bh ;
730  struct row_pad rp[MZ_SVT_MAX_PADS_PER_MEZ] ;
731 } ;
732 
733 
734 // RIC stuff
735 #define RIC_BANK_DATAD 0
736 #define RIC_BANK_DATAR 1
737 #define RIC_BANK_PEDR 2
738 #define RIC_BANK_RMSR 3
739 
740 struct RICP {
741  struct bankHeader bh ;
742  struct offlen crams[18] ;
743 } ;
744 
745 struct RICCRAMP {
746  struct bankHeader bh ;
747  struct offlen banks[8] ;
748 } ;
749 
750 struct RICDATAD {
751  struct bankHeader bh ;
752  unsigned short data[2*960] ;
753 } ;
754 
755 struct RICDATAR {
756  struct bankHeader bh ;
757 } ;
758 
759 struct RICPEDR {
760  struct bankHeader bh ;
761 };
762 
763 struct RICRMSR {
764  struct bankHeader bh ;
765 } ;
766 
767 struct RICTHRER {
768  struct bankHeader bh ;
769 } ;
770 
771 struct RICBADR {
772  struct bankHeader bh ;
773 } ;
774 
775 
776 
777 
778 // FPD
779 #define FPDP_MAX_BANKS 8
780 // index of the banks in FPDP
781 #define FPDP_ADCD 0
782 #define FPDP_TDCD 1
783 #define FPDP_REGD 2
784 #define FPDP_PEDR 3
785 #define FPDP_SCL 4
786 #define FPDP_BBCDAT 5
787 #define FPDP_BBCPED 6
788 #define FPDP_BBCSCL 7
789 
790 
791 struct FPDP {
792  struct bankHeader bh ;
793  struct offlen type[FPDP_MAX_BANKS] ;
794 } ;
795 
796 struct FPDADCD {
797  struct bankHeader bh ;
798  unsigned short data[256] ;
799 } ;
800 
801 struct FPDTDCD {
802  struct bankHeader bh ;
803  unsigned short data[8] ;
804 } ;
805 
806 struct FPDREGD {
807  struct bankHeader bh ;
808  unsigned short data[4] ;
809 } ;
810 
811 struct FPDPEDR {
812  struct bankHeader bh ;
813  unsigned short ped[256] ;
814  unsigned short rms[256] ;
815 } ;
816 
817 struct FPDSCL {
818  struct bankHeader bh ;
819  unsigned int scl[128] ;
820 } ;
821 
822 struct BBCDAT {
823  struct bankHeader bh ;
824  unsigned short pulse[32] ;
825  unsigned short time[32] ;
826  unsigned short proof[2] ;
827  unsigned short spare[6] ;
828 } ;
829 
830 struct BBCPED {
831  struct bankHeader bh ;
832  unsigned short ped[32] ;
833  unsigned short rms[32] ;
834  unsigned short peaks[64] ;
835 } ;
836 
837 struct BBCSCL {
838  struct bankHeader bh ;
839  unsigned int scl[32] ;
840 } ;
841 
842 
843 
844 // TOF
845 // Format Version 2 for FY03
846 // FOrmat Version ? for FY04
847 // Format Version 0x50000 for FY05 - RORC! - changed type count from 4 to 8
848 struct TOFP {
849  struct bankHeader bh ;
850  struct offlen type[8] ;
851 } ;
852 
853 struct TOFADCD {
854  struct bankHeader bh ;
855  unsigned int data[180] ; // 48 in FY02, 132 in FY03
856 } ;
857 
858 struct TOFTDCD {
859  struct bankHeader bh ;
860  unsigned int data[184] ; // 48 in FY02, 120 in FY03
861 } ;
862 
863 struct TOFA2DD {
864  struct bankHeader bh ;
865  unsigned int data[32] ; // 32 in FY02
866 } ;
867 
868 struct TOFSCAD {
869  struct bankHeader bh ;
870  unsigned int data[12] ; // 12 in FY02
871 } ;
872 
873 struct TOFDDLR {
874  struct bankHeader bh ;
875  char data[0] ;
876 } ;
877 
878 // PMP
879 // misc. counters
880 #define PMD_CRAMS_MAX 12
881 #define PMD_CRAMS_CH_MAX 1728
882 
883 // bank seqeuence in the SECP bank
884 #define PMD_ADCD_N 0
885 #define PMD_PEDR_N 1
886 #define PMD_RMSR_N 2
887 #define PMD_THRR_N 3
888 
889 struct PMDP {
890  struct bankHeader bh ;
891  struct offlen sec[2] ;
892 } ;
893 
894 struct PMDSECP {
895  struct bankHeader bh ;
896  struct offlen type[4] ;
897 } ;
898 
899 struct PMDADCD {
900  struct bankHeader bh ;
901  UINT32 data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ; // variable
902 } ;
903 
904 struct PMDPEDR {
905  struct bankHeader bh ;
906  UINT16 data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ; // variable
907 
908 } ;
909 
910 struct PMDRMSR {
911  struct bankHeader bh ;
912  UINT16 data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ; // variable
913 } ;
914 
915 struct PMDTHRR {
916  struct bankHeader bh ;
917  UINT16 data[PMD_CRAMS_MAX*2*(1+PMD_CRAMS_CH_MAX)] ; // variable
918 } ;
919 
920 
921 
922 // EMC
923 /*
924  Tonko, Nov 2, 2004 -- the Barrel people _finally_ decided
925  how the preshower looks like and it will be fibers 9-12
926  in the BSMD. This means:
927  EMC_FIBER_NUM increases from 8 to 12
928  EMC_SEC_NUM stays at 6 but the B_PRE/E_PRE is unused
929 
930  NOTE: the FIBER_NUM increase may cause pain for Offline. *shrug*
931 
932 */
933 #define EMC_SEC_NUM 6 // num. of "sections" i.e. subparts
934 #define EMC_FIBER_NUM 12 // max num of fibers per subemc
935 
936 // indices in the EMCP
937 #define EMC_B_TOW 0
938 #define EMC_B_SMD 1
939 #define EMC_B_PRE 2
940 #define EMC_E_TOW 3
941 #define EMC_E_SMD 4
942 #define EMC_E_PRE 5
943 
944 struct EMCP {
945  struct bankHeader bh ;
946  struct offlen sec[EMC_SEC_NUM] ; // 6 sections...
947 } ;
948 
949 struct EMCSECP {
950  struct bankHeader bh ;
951  struct offlen fiber[EMC_FIBER_NUM] ; // for 8 fibers contribs
952 } ;
953 
954 struct EMCRBP {
955  struct bankHeader bh ;
956  struct offlen banks[TPC_MZP_BANKS_NUM] ; // same number of banks as TPC
957 } ;
958 
959 
960 struct PP2PPP { // main pointer bank
961  struct bankHeader bh ;
962  struct offlen sec[3] ;
963 } ;
964 
965 // WARNING: sizeof() will not give the correct length!
966 struct PP2PPR { // void data dump...
967  struct bankHeader bh ;
968  unsigned int type ;
969  unsigned int xing ;
970  unsigned int seq ;
971  unsigned int hash ; // adjusted seq * 1000 + adjusted xing
972  unsigned int seqAdj ; // sequence adjuster
973  unsigned int xingAdj ; // xing adjuster
974  unsigned int ms ; // miliseconds from the beginning of the run
975  unsigned int res[1] ;
976  char data[0] ; // unknown at compile time...
977 } ;
978 
979 // Slow Controls and Friends
980 #define SCD_FORMAT_VERSION 0x00050001 // Run FY05, version 1
981 struct SCD {
982  struct bankHeader bh ;
983  unsigned int time ; // unix time
984  int mag_field ;
985  unsigned int rich_scalers[16] ; // ask Jamie Dunlop
986 } ;
987 
988 // Level 3 structures
989 // Level 3 banks
990 #include "L3/L3Formats.h"
991 
992 /*
993 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 && defined(__I960)
994 #pragma pack 0
995 #pragma align 0
996 #endif
997 */
998 
999 
1000 
1001 
1002 // Define for linker-level checking only! See comment at the
1003 // end of this file.
1004 //#define VERIFY_SIZES
1005 
1006 #ifdef VERIFY_SIZES
1007 /*
1008 
1009 If this is defined the follwing variables will show up
1010 in the dissaemby of this file when compiled so one can
1011 immediatelly check the sizes of these ovjects without
1012 printf statements and actual code since the sizes (i.e. sizeof)
1013 are knwon at compile time...
1014 
1015 For normal compilation this should be undefined...
1016 
1017 __alignof__ exists in GCC...
1018 */
1019 
1020 static UINT32 sTPCSECP = sizeof(struct TPCSECP) ;
1021 static UINT32 aTPCSECP = __alignof__(struct TPCSECP) ;
1022 
1023 static UINT32 sTPCSECLP = sizeof(struct TPCSECLP) ;
1024 static UINT32 aTPCSECLP = __alignof__(struct TPCSECLP) ;
1025 
1026 static UINT32 sTPCRBCLP = sizeof(struct TPCRBCLP) ;
1027 static UINT32 aTPCRBCLP = __alignof__(struct TPCRBCLP) ;
1028 
1029 static UINT32 sTPCMZCLD_local = sizeof(struct TPCMZCLD_local) ;
1030 static UINT32 aTPCMZCLD_local = __alignof__(struct TPCMZCLD_local) ;
1031 
1032 static UINT32 sTPCRBP = sizeof(struct TPCRBP) ;
1033 static UINT32 aTPCRBP = __alignof__(struct TPCRBP) ;
1034 
1035 static UINT32 sTPCMZP = sizeof(struct TPCMZP) ;
1036 static UINT32 aTPCMZP = __alignof__(struct TPCMZP) ;
1037 
1038 static UINT32 sTPCADCX = sizeof(struct TPCADCX) ;
1039 static UINT32 aTPCADCX = __alignof__(struct TPCADCX) ;
1040 
1041 static UINT32 sTPCADCD = sizeof(struct TPCADCD) ;
1042 static UINT32 aTPCADCD = __alignof__(struct TPCADCD) ;
1043 
1044 static UINT32 sTPCSEQD = sizeof(struct TPCSEQD) ;
1045 static UINT32 aTPCSEQD = __alignof__(struct TPCSEQD) ;
1046 
1047 static UINT32 sTPCPADK = sizeof(struct TPCPADK) ;
1048 static UINT32 aTPCPADK = __alignof__(struct TPCPADK) ;
1049 
1050 static UINT32 sTPCCFGR = sizeof(struct TPCCFGR) ;
1051 static UINT32 aTPCCFGR = __alignof__(struct TPCCFGR) ;
1052 
1053 static UINT32 sTPCGAINR = sizeof(struct TPCGAINR) ;
1054 static UINT32 aTPCGAINR = __alignof__(struct TPCGAINR) ;
1055 
1056 static UINT32 sTPCPEDR = sizeof(struct TPCPEDR) ;
1057 static UINT32 aTPCPEDR = __alignof__(struct TPCPEDR) ;
1058 
1059 static UINT32 sTPCRMSR = sizeof(struct TPCRMSR) ;
1060 static UINT32 aTPCRMSR = __alignof__(struct TPCRMSR) ;
1061 
1062 static UINT32 sTPCBADR = sizeof(struct TPCBADR) ;
1063 static UINT32 aTPCBADR = __alignof__(struct TPCBADR) ;
1064 
1065 static UINT32 sTPCADCR_l = sizeof(struct TPCADCR_l) ;
1066 static UINT32 aTPCADCR_l = __alignof__(struct TPCADCR_l) ;
1067 
1068 static UINT32 sTPCCPPR_l = sizeof(struct TPCCPPR_l) ;
1069 static UINT32 aTPCCPPR_l = __alignof__(struct TPCCPPR_l) ;
1070 
1071 
1072 #endif
1073 
1074 #endif
1075 
Definition: rb.hh:21