StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
trgStructures2000.h
1 /***************************************************************************************/
2 /* Header Name: trgStructures.h */
3 /* Header Number: X.Y */
4 /* Package Name: All */
5 /* Created: z. milosevich 06Dec99 */
6 /* Description: Global trigger structure header file. */
7 /* Contains definitions of trigger data structures */
8 /* History: */
9 /* */
10 /* 06Dec99 zm Created so offline can use and after modification for mod 8 DMA reads */
11 /* 08Dec99 zm Changed Event Descriptor Structure to previous length */
12 /* 03Feb00 zm Changed "unsigned short ZDCDSM[8]" to "unsigned char ZDC[16]" in L0_DSM_Data structure */
13 /***************************************************************************************/
14 #ifndef trgStructures2000_h
15 #define trgStructures2000_h
16 
17 /* several shortcut definitions */
18 
19 #define y0MAX_RAW_DATA_BLOCKS 11 /* Maximum number of Raw Data Blocks: current + npre + npost */
20 
21 #define y0FORMAT_VERSION 0x11 /* Format Version number for trigger data */
22 #define y0EVT_HEAD_LEN 4 /* Trigger Event Header Length */
23 #define y0EV_DESC_LEN 28 /* Number of bytes in event descriptor */
24 #define y0L0DSM_DATA_LEN 144 /* Size of data block in L0 DSM Tree */
25 #define y0RAW_DET_DATA_LEN 408 /* Size of Raw Detector Data from CTB, MWC with headers */
26 #define y0TRG_SUM_LEN 432 /* Number of bytes in the trigger summary for DAQ with headers */
27 
28 #define y0L1_DATA_LEN (y0EVT_HEAD_LEN+y0EV_DESC_LEN+y0TRG_SUM_LEN) /* Size of data passed from L1ANA to L1DC */
29 
30 #define y0TRG_EVT_LEN (y0L1_DATA_LEN+(y0MAX_RAW_DATA_BLOCKS*y0RAW_DET_DATA_LEN)) /* Max size of a trigger event */
31 #define y0TDI_EVT_LEN (y0EV_DESC_LEN+y0TRG_SUM_LEN+(y0MAX_RAW_DATA_BLOCKS*y0RAW_DET_DATA_LEN)) /* size of event sent to TDI */
32 
33 #define y0CTB_DATA_OFFSET 8 /* Number of bytes CTB Raw data is offset in raw trigger structure */
34 #define y0RAW_CTB_LEN 256 /* Number of bytes in raw CTB DSMs */
35 
36 /********** trigger structures ***********/
37 
38 /*
39  *
40  * Trigger Data Headers
41  *
42  */
43 
44 typedef struct {
45  unsigned short TrgDataBytes;
46  unsigned short TrgFiller;
47  unsigned short TCUdataBytes;
48  unsigned char TrgDataFmtVer;
49  char TCUEvtDesc;
50  unsigned short TrgSumBytes;
51  char TrgSumHeader[2];
52  unsigned short L0SumBytes;
53  char L0SumHeader[2];
54  unsigned short L1SumBytes;
55  char L1SumHeader[2];
56  unsigned short L2SumBytes;
57  char L2SumHeader[2];
58  unsigned short RawDetBytes;
59  char RawDetHeader[2];
60  unsigned short CTBdataBytes;
61  char CTBdataHeader[2];
62  unsigned short MWCdataBytes;
63  char MWCdataHeader[2];
64  unsigned short EMCdataBytes;
65  char EMCdataHeader[2];
67 
68 /* Trigger Event Header */
69 
70 typedef struct {
71  unsigned short TrgDataBytes; /* total bytes in trigger data */
72  unsigned short TrgFiller;
73 } TrgEvtHeader2000; /* 4 Bytes total */
74 
75 /* Event Descriptor Data Structures */
76 
77 typedef union { /* The contents of Info Fifo 1 */
78  struct {
79  unsigned short TrgToken; /* Trigger Token */
80  unsigned short TrgActionWd; /* Trigger Word */
81  } FIFO1;
82  unsigned long fifo1;
83 } Info12000; /* 32 bits total */
84 
85 
86 typedef union { /* The contents of Info Fifo 2 */
87  struct {
88  unsigned short DSMInput; /* Last DSM */
89  unsigned short DSMAddress; /* DSM address */
90  } FIFO2;
91  unsigned long fifo2;
92 } Info22000; /* 32 bits total */
93 
94 
95 typedef union { /* The contents of Info Fifo 3 */
96  struct {
97  unsigned char DetectorBusy; /* detector Busy Bits */
98  unsigned char addBits; /* filler Bits - bit 0=pileup; bit 1=priority; bit 7=1 is fake data */
99  unsigned short TriggerWd; /* Trigger Word */
100  } FIFO3;
101  unsigned long fifo3;
102 } Info32000; /* 32 bits total */
103 
104 /* Data structure passed from L1CTL to L1ANA */
105 
106 typedef struct {
107  unsigned short TCUdataBytes;
108  char TCUEvtDesc;
109  unsigned char TrgDataFmtVer;
110  unsigned int bunchXing_hi;
111  unsigned int bunchXing_lo; /* Two parts of RHIC bunch crossing number */
112  Info12000 TCU1; /* TCU Info Fifo's */
113  Info22000 TCU2;
114  Info32000 TCU3;
115  unsigned short npre;
116  unsigned short npost; /* Dummy to bring total size of struct to modulo 8 bytes */
117 } EvtDescData2000; /* 28 bytes total */
118 
119 /* Trigger Summary Data Structures */
120 
121 /* L0 DSM data structures */
122 
123 typedef struct {
124  unsigned short CPA[32]; /* Contents of 4 CTB+MWC DSM Input Buffers (IB's) - coarse pixel array*/
125  unsigned short quadDSM[8]; /* Contents of 1 CTB+MWC DSM IB - outputs of previous 4 */
126  unsigned short lastDSM[8]; /* Contents of last DSM IB - results of all DSM trees */
127  unsigned char ZDC[16]; /* Contents of ZDC DSM IB - raw data from ZDC */
128  unsigned short BCdata[16]; /* Contents of 2 Bunch Crossing DSMs IB's */
129 } L0_DSM_Data2000; /* 144 bytes total */
130 
131 
132 /* summary data */
133 
134 typedef struct {
135  unsigned short TrgSumBytes;
136  char TrgSumHeader[2];
137  unsigned int L1Sum[2]; /* L1 Summary */
138  unsigned int L2Sum[2]; /* L2 Summary */
139  unsigned short L0SumBytes;
140  char L0SumHeader[2];
141  L0_DSM_Data2000 DSM; /* L0 DSM Data from DSM Tree */
142  unsigned short L1SumBytes;
143  char L1SumHeader[2];
144  unsigned int L1Result[32]; /* Result from L1 CPU */
145  unsigned short L2SumBytes;
146  char L2SumHeader[2];
147  unsigned int L2Result[32]; /* Result from L2 CPU */
148 } TrgSumData2000; /* 432 bytes total */
149 
150 
151 /* Data structure passed between L1ANA and L1DC */
152 
153 typedef struct {
154  TrgEvtHeader2000 TrgHead;
155  EvtDescData2000 EvtDesc; /* L1 Event Descriptor Data */
156  TrgSumData2000 TrgSum; /* summary data */
157 } L1dataType2000; /* 448 bytes */
158 
159 /* Raw Trigger detector data structures */
160 
161 typedef struct {
162  unsigned short RawDetBytes;
163  char RawDetHeader[2];
164  unsigned short CTBdataBytes;
165  char CTBdataHeader[2];
166  unsigned char CTB[256]; /* CTB raw data */
167  unsigned short MWCdataBytes;
168  char MWCdataHeader[2];
169  unsigned long MWCfiller; /* dummy to bring header to mod 8 */
170  unsigned char MWC[128]; /* MWC raw data */
171  unsigned short EMCdataBytes;
172  char EMCdataHeader[2];
173  unsigned long EMCfiller; /* dummy to bring header to mod 8 */
174 } RawTrgDet2000; /* 408 bytes total */
175 
176 /* Trigger Event Structure */
177 
178 class TrgDataType2000 { public:
179  TrgEvtHeader2000 TrgHead;
180  EvtDescData2000 EvtDesc; /* L1 Event Descriptor Data */
181  TrgSumData2000 TrgSum; /* summary data */
182  RawTrgDet2000 RAW[y0MAX_RAW_DATA_BLOCKS]; /* raw Detector Data with pre and post History */
183 }; /* 4952 bytes */
184 #endif
Definition: DSM.hh:16