StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
trgStructures2002.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 "ushort ZDCDSM[8]" to "BYTE ZDC[16]" in L0_DSM_Data structure */
13 /* 22Jul00 egj Added L0RegBytes and L0RegHeader to trgDataHeaders and TrgSumData. */
14 /* Also added Mult_Reg, ZDC_Reg and Spare_Reg to TrgSumData, making a */
15 /* total of 16 extra bytes. I compensated for this by removing 16 bytes, */
16 /* (4 uints) from L2Result, wich is currently unused. */
17 /* 08Dec00 JMN Changed char hdr[2] in TrgSummary to unsigned short, which is packed */
18 /* 25Feb01 JMN Redesigned and expanded abbreviations to full. */
19 /* 12Mar01 JMN Added additional changes from ZM */
20 /* 30May01 JMN NBNBNBNB Changed FORMAT version from 0x12 to 0x13 */
21 /* 02Jun01 zm defined bit 6 in addBits info FIFO3 for L2.5 abort */
22 /* 27Jun01 JMN Added definition of number of bytes used in trigger summary headers */
23 /* 28Jun01 JMN Added definition of ADD_BITs */
24 /***************************************************************************************/
25 
26 #define y2MAX_RAW_DATA_BLOCKS 11 /* Maximum number of Raw Data Blocks: current + npre + npost */
27 #define y2FORMAT_VERSION 0x13 /* Format Version number for trigger data */
28 #define y2EVT_HEAD_LEN sizeof(TrgEvtHeader) /* Trigger Event Header Length */
29 #define y2EV_DESC_LEN sizeof(EvtDescData) /* Number of bytes in event descriptor */
30 #define y2L0DSM_DATA_LEN sizeof(L0_DSM_Data) /* Size of data block in L0 DSM Tree */
31 #define y2RAW_DET_DATA_LEN sizeof(RawTrgDet) /* Size of Raw Detector Data from CTB, MWC with headers */
32 #define y2TRG_SUM_LEN sizeof(TrgSumData) /* Number of bytes in the trigger summary for DAQ with headers */
33 
34 #define y2L1_DATA_LEN (y2EVT_HEAD_LEN+y2EV_DESC_LEN+y2TRG_SUM_LEN) /* Size of data passed from L1ANA to L1DC */
35 #define y2TRG_EVT_LEN (y2L1_DATA_LEN+(y2MAX_RAW_DATA_BLOCKS*y2RAW_DET_DATA_LEN)) /* Max size of a trigger event */
36 #define y2TDI_EVT_LEN (y2EV_DESC_LEN+y2TRG_SUM_LEN+(y2MAX_RAW_DATA_BLOCKS*y2RAW_DET_DATA_LEN)) /* size of event sent to TDI */
37 
38 #define y2L0_SUM_LEN 148 /* Number of bytes in L0 Summary + Header */
39 #define y2L1_SUM_LEN 132 /* Number of bytes in L1 Summary + Header */
40 #define y2L2_SUM_LEN 116 /* Number of bytes in L2 Summary + Header */
41 #define y2L0_REG_LEN 16 /* Number of bytes in L0 Register + Header */
42 
43 #define y2CTB_DATA_OFFSET 8 /* Number of bytes CTB Raw data is offset in raw trigger structure */
44 #define y2RAW_CTB_LEN 256 /* Number of bytes in raw CTB DSMs */
45 #define y2MWC_DATA_OFFSET 272 /* Number of bytes MWC Raw data is offset in raw trigger structure */
46 #define y2RAW_MWC_LEN 128 /* Number of bytes in raw CTB DSMs */
47 #define y2BEMC_DATA_OFFSET 408 /* Number of bytes MWC Raw data is offset in raw trigger structure */
48 #define y2RAW_BEMC_LEN 128 /* Number of bytes in raw CTB DSMs */
49 
50 #define y2ADD_BIT_PILEUP 0 /* Pileup bit in event descriptor add-bits */
51 #define y2ADD_BIT_PRIORITY 1 /* Priority bit */
52 #define y2ADD_BIT_FORCE 5 /* Force store of this event */
53 #define y2ADD_BIT_L2_5 6 /* Level 2.5 abort */
54 #define y2ADD_BIT_SIM 7 /* Simulated event - used by DAQ */
55 /********** Trigger Structures ***********/
56 
57 /*
58  *
59  * Trigger Data Headers
60  *
61  */
62 
63 typedef struct {
64  unsigned short TrgDataBytes;
65  unsigned short TrgFiller;
66  unsigned short TCUdataBytes;
67  unsigned char TrgDataFmtVer;
68  char TCUEvtDesc;
69  unsigned short TrgSumBytes;
70  unsigned short TrgSumHeader;
71  unsigned short L0SumBytes;
72  unsigned short L0SumHeader;
73  unsigned short L1SumBytes;
74  unsigned short L1SumHeader;
75  unsigned short L2SumBytes;
76  unsigned short L2SumHeader;
77  unsigned short L0RegBytes;
78  unsigned short L0RegHeader;
79  unsigned short RawDetBytes;
80  char RawDetHeader[2];
81  unsigned short CTBdataBytes;
82  char CTBdataHeader[2];
83  unsigned short MWCdataBytes;
84  char MWCdataHeader[2];
85  unsigned short EMCdataBytes;
86  char EMCdataHeader[2];
88 
89 /* Trigger Event Header */
90 
91 typedef struct {
92  unsigned short TrgDataBytes; /* Total bytes in trigger data */
93  unsigned short TrgFiller;
94 } TrgEvtHeader2002; /* 4 Bytes total */
95 
96 /* Event Descriptor Data Structures */
97 
98 typedef union { /* The contents of Info Fifo 1 */
99  struct {
100  unsigned short TrgToken; /* Trigger Token */
101  unsigned short TrgActionWd; /* Trigger Action Word */
102  } FIFO1;
103  unsigned int fifo1;
104 } Info12002; /* 32 bits total */
105 
106 
107 typedef union { /* The contents of Info Fifo 2 */
108  struct {
109  unsigned short DSMInput; /* Last DSM */
110  unsigned short DSMAddress; /* DSM address */
111  } FIFO2;
112  unsigned int fifo2;
113 } Info22002; /* 32 bits total */
114 
115 
116 typedef union { /* The contents of Info Fifo 3 */
117  struct {
118  unsigned char DetectorBusy; /* Detector Busy Bits */
119  unsigned char addBits; /* Filler Bits - bit 0=pileup; bit 1=priority; bit 6=L2.5 abort; bit 7=1 is fake data */
120  unsigned short TriggerWd; /* Trigger Word */
121  } FIFO3;
122  unsigned int fifo3;
123 } Info32002; /* 32 bits total */
124 
125 /* Data structure passed from L1CTL to L1ANA */
126 
127 typedef struct {
128  unsigned short TCUdataBytes;
129  char TCUEvtDesc;
130  unsigned char TrgDataFmtVer;
131  unsigned int bunchXing_hi;
132  unsigned int bunchXing_lo; /* Two parts of RHIC bunch crossing number */
133  Info12002 TCU1; /* TCU Info Fifo's */
134  Info22002 TCU2;
135  Info32002 TCU3;
136  unsigned short npre;
137  unsigned short npost; /* Dummy to bring total size of struct to modulo 8 bytes */
138 } EvtDescData2002; /* 28 bytes total */
139 
140 /* Trigger Summary Data Structures */
141 
142 /* L0 DSM data structures */
143 
144 typedef struct {
145  unsigned short CPA[32]; /* Contents of 4 CTB+MWC DSM Input Buffers (IB's) - coarse pixel array*/
146  unsigned short quadDSM[8]; /* Contents of 1 CTB+MWC DSM IB - outputs of previous 4 */
147  unsigned short lastDSM[8]; /* Contents of last DSM IB - results of all DSM trees */
148  unsigned char ZDC[16]; /* Contents of ZDC DSM IB - raw data from ZDC */
149  unsigned short BCdata[16]; /* Contents of 2 Bunch Crossing DSMs IB's */
150 } L0_DSM_Data2002; /* 144 bytes total */
151 
152 /* Summary data */
153 
154 typedef struct {
155  unsigned short TrgSumBytes;
156  unsigned short TrgSumHeader;
157  unsigned int L1Sum[2]; /* L1 Summary */
158  unsigned int L2Sum[2]; /* L2 Summary */
159  unsigned short L0SumBytes;
160  unsigned short L0SumHeader;
161  L0_DSM_Data2002 DSM; /* L0 DSM Data from DSM Tree */
162  unsigned short L1SumBytes;
163  unsigned short L1SumHeader;
164  unsigned int L1Result[32]; /* Result from L1 CPU */
165  unsigned short L2SumBytes;
166  unsigned short L2SumHeader;
167  unsigned int L2Result[28]; /* Result from L2 CPU */
168  unsigned short L0RegBytes;
169  unsigned short L0RegHeader;
170  unsigned short Mult_Reg[3]; /* The 3 multiplcity thresholds */
171  unsigned short ZDC_Reg[2]; /* The 2 ZDC thresholds */
172  unsigned short Spare_Reg; /* A spare, brings total for Reg to 16 bytes */
173 } TrgSumData2002; /* 432 bytes total */
174 
175 /* Data structure passed between L1ANA and L1DC */
176 
177 typedef struct {
178  TrgEvtHeader2002 TrgHead;
179  EvtDescData2002 EvtDesc; /* L1 Event Descriptor Data */
180  TrgSumData2002 TrgSum; /* Summary data */
181 } L1dataType2002; /* 464 bytes */
182 
183 /* Raw Trigger Detector data structures */
184 
185 typedef struct {
186  unsigned short RawDetBytes;
187  char RawDetHeader[2];
188  unsigned short CTBdataBytes;
189  char CTBdataHeader[2];
190  unsigned char CTB[256]; /* CTB raw data */
191  unsigned short MWCdataBytes;
192  char MWCdataHeader[2];
193  unsigned int MWCfiller; /* Dummy to bring header to mod 8 */
194  unsigned char MWC[128]; /* MWC raw data */
195  unsigned short EMCdataBytes;
196  char EMCdataHeader[2];
197  unsigned int EMCfiller; /* Dummy to bring header to mod 8 */
198  unsigned char BEMC[128]; /* BEMC raw data */ /* NOTE!!!! THIS IS TEMPORARY _ MAY CHANGE */
199 } RawTrgDet2002; /* 536 bytes total */
200 
201 /* Trigger Event Structure */
202 
204  TrgEvtHeader2002 TrgHead;
205  EvtDescData2002 EvtDesc; /* L1 Event Descriptor Data */
206  TrgSumData2002 TrgSum; /* Summary data */
207  RawTrgDet2002 RAW[MAX_RAW_DATA_BLOCKS]; /* Raw Detector Data with pre and post History */
208 }; /* 6360 bytes */
209 
210 
Definition: DSM.hh:16