StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
trgStructures2022.h
1 #ifndef trgStructures2022_h
2 #define trgStructures2022_h
3 /******
4 *
5 * Layout of new Trigger Data Block
6 *
7 * J.M. Nelson 30 January 2009
8 *
9 * Notes: The event descriptor will describe data from either
10 * the Mk1 or Mk2 TCUs. The variable TCU_Mark will be 1 for Mk1
11 * and 2 for the Mk2 TCU. Variables not used by one or other of the
12 * TCUs will be zero.
13 *
14 * The data block structure will always begin with a 4 character
15 * name, followed by the byte-count of data following. The structure of
16 * data will depend on the configuration of particular crates.
17 *
18 * Note: PrePost data will only be available on local trigger disks and
19 * will not be present in event files.
20 *
21 * 8Dec16: JMN changed FORMAT_VERSION
22 * 3Oct17: je - removed DAQ10k TPCpreMask from MIX added EPDlayer# to BBC
23 * 6Dec18: je - modified BBCBlock structure for added EPD DSMs
24 * 4Jan19: JMN removed redundant info from BBCBlock
25 * 12Oct21: JMN and JE: remove FPD[8] from L1_DSM_Data and
26 * FPDEastNSLayer1[8] from MIXBlock
27 * Updated FORMAT_VERSION to 47
28 *
29 ******************************************************************************/
30 #define y22FORMAT_VERSION 0x21101247 /* Format: yymmddvv */
31 #define y22MAX_TRG_BLK_SIZE 122896 /* Current total: 113.25k bytes for pre/post non-zero suppressed data. Allow 120k */
32 #define y22MAX_OFFLEN 20 /* Depends on the number of crates in the system */
33 
34 #define y22MAX_CONF_NUM 20
35 #define y22RCC_CONF_NUM 0
36 #define y22L1_CONF_NUM 1
37 #define y22BC1_CONF_NUM 2
38 #define y22MXQ_CONF_NUM 3
39 #define y22MIX_CONF_NUM 4
40 #define y22BCW_CONF_NUM 5
41 #define y22BCE_CONF_NUM 6
42 #define y22EQ3_CONF_NUM 7
43 #define y22BBC_CONF_NUM 8
44 #define y22BBQ_CONF_NUM 9
45 #define y22FMS_CONF_NUM 10
46 #define y22QT1_CONF_NUM 11
47 #define y22QT2_CONF_NUM 12
48 #define y22QT3_CONF_NUM 13
49 #define y22QT4_CONF_NUM 14
50 #define y22EQ1_CONF_NUM 15
51 #define y22EQ2_CONF_NUM 16
52 #define y22EQ4_CONF_NUM 17
53 #define y22CLK_CONF_NUM 19
54 #define y22INF_CONF_NUM 20
55 
56 #define y22ADD_BIT_PREPILEUP 0 /* pileup present */
57 #define y22ADD_BIT_POSTPILEUP 1
58 #define y22ADD_BIT_FORCE 5 /* Force store of this event */
59 #define y22ADD_BIT_L2_5 6 /* Level 2.5 abort */
60 #define y22ADD_BIT_SIM 7 /* Simulated event - used by DAQ */
61 
62  /* Event Descriptor Data Structures */
63 
64 //#pragma pack(1)
65 
66 typedef struct {
67  char name[3]; /* Contains EVD */
68  char TrgDataFmtVer; /* Exception for use by DAQ (LS byte of FORMAT_VERSION) */
69  int length; /* Byte count of data that follows */
70  unsigned int bunchXing_hi;
71  unsigned int bunchXing_lo; /* Two parts of RHIC bunch crossing number */
72  unsigned short actionWdDetectorBitMask; /* from Fifo 1 */
73  unsigned char actionWdTrgCommand; /* from Fifo 1 */
74  unsigned char actionWdDaqCommand; /* from Fifo 1 */
75  unsigned short TrgToken; /* from Fifo 2 */
76  unsigned short addBits; /* used by trigger/daq: bit 5=Force store; bit 6=L2.5 abort; bit 7=1 is fake data */
77  unsigned short DSMInput; /* only for use with Mk1 TCU. 0 if Mk2 TCU is used */
78  unsigned short externalBusy; /* from Fifo 9 (Fifo 3 Mk1 TCU) */
79  unsigned short internalBusy; /* from Fifo 9 (Mk2 TCU) */
80  unsigned short trgDetMask; // After 11/8/16
81  unsigned short tcuCtrBunch_hi; // After 11/8/16
82  unsigned short DSMAddress; /* from Fifo 10 (Fifo 6 Mk1 TCU) */
83  unsigned short TCU_Mark; /* TCU_Mark Mk1=1 Mk2=2 */
84  unsigned short npre; // (crate_mask & 0xfff) << 4 | npre (after 11/8/16)
85 
86  unsigned short npost; // (crate_mask & 0xfff000)>>8| npost (after 11/8/16)
87  unsigned short res1; // (crate_mask & 0xff000000)>>20 | res1&0xf (after 11/8/16)
89 
90  /* L1 DSM data structures */
91 
92 typedef struct {
93  char name[4]; /* Contains L1DS */
94  int length; /* Byte count of data that follows */
95  unsigned short TOF[8]; /* TOF and MTD data */
96  unsigned short VTX[8]; /* Separate VPD, ZDC and BBC DSMs have been replaced with this one */
97  unsigned short EMC[8]; /* Contents of 1 EMC IB - results of separate BEMC and EEMC DSMs */
98  unsigned short TPCMask[8]; /* TPC mask for DAQ10K */
99  unsigned short BCdata[16]; /* Contents of 2 Bunch Crossing DSMs IB's */
100  unsigned short specialTriggers[8]; /* Contents of 1 Special Trigger DSM - all the special trigger requests */
101  unsigned short lastDSM[8]; /* Contents of last DSM IB - results of all DSM trees */
103 
104  /* Trigger Summary Data Structures */
105 
106 typedef struct {
107  char name[4]; /* Contains TSUM */
108  int length; /* Byte count of data that follows */
109  unsigned int L1Sum[2]; /* L1 Summary */
110  unsigned int L2Sum[2]; /* L2 Summary */
111  unsigned int L1Result[32]; /* Result from L1 CPU */
112  unsigned int L2Result[64]; /* Result from L2 CPU */
113  unsigned int C2Result[64]; /* Result from last algorithm */
114  unsigned int LocalClocks[32]; /* localClock values from RCC2*/
116 
117 typedef struct {
118  char name[4];
119  int length; /* Byte count of data that follows */
120  unsigned int data[1]; /* NB: this definition is generic but would vary depending on actual data */
121 } DataBlock2022;
122 
123 typedef struct {
124  char name[4]; /* Contains BBC */
125  int length; /* Byte count of data that follows */
126  unsigned short BBClayer1[8]; /* BBC-small layer1 DSM feeding VT201 DSM */
127  unsigned short EPDlayer1a[8]; /* layer1 DSM feeding QT32C TAC info to VT201 DSM */
128  unsigned short ZDClayer1[8]; /* layer1 ZDC DSM that feeds the VT201 DSM */
129  unsigned short VPD[8]; /* layer1 VPD DSM feeding ADC & TAC values to VT201*/
130  unsigned short EPDlayer0t[16]; /* layer0 EPD DSM feeding east & west TAC to EP101 */
131 } BBCBlock2022;
132 
133 typedef struct {
134  char name[4]; /* Contains MIX */
135  int length; /* Byte count of data that follows */
136  unsigned char MTD_P2PLayer1[16]; /* Data from MTD and PP2PP */
137  unsigned short TOFLayer1[8]; /* This is TOF Layer 1 */
138  unsigned short TOF[48]; /* TOF data */
139 /* unsigned short TPCpreMask[24]; */ /* EMC, MTD, & TOF TPC Grid Masks je-removed starting run 18 */
140 } MIXBlock2022;
141 
142 typedef struct {
143  char name[4];
144  int length; /* Byte count of data that follows */
145  int dataLoss; /* Byte count of data truncated due to buffer limitations */
146  unsigned int data[1]; /* NB: this definition is generic but would vary depending on actual data */
147 } QTBlock2022;
148 
149 typedef struct {
150  char name[4];
151  int length;
152  unsigned char BEMCEast[240]; /* 15 DSMs covering the East half of BEMC */
153 } BEastBlock2022;
154 
155 typedef struct {
156  char name[4];
157  int length;
158  unsigned char BEMCWest[240]; /* 15 DSMs covering the West half of BEMC */
160 
161 typedef struct {
162  char name[4];
163  int length;
164  unsigned short BEMClayer1[48]; /* 6 DSMs for BEMC at layer1 */
165  unsigned short EEMClayer1[16]; /* 2 DSMs for EEMC at layer1 */
166  unsigned char EEMC[144]; /* 9 DSMs for EEMC at layer0 */
168 
169 typedef struct {
170  char name[4];
171  int length;
172  unsigned char FMS[256]; /* 16 DSMs for FMS */
173 } FMSBlock2022;
174 
175 typedef struct {
176  int offset; /* Offset (in bytes) from the start of Trigger block to data */
177  int length; /* Length (in bytes) of data */
178 } TrgOfflen2022;
179 
180 typedef struct {
181  int FormatVersion; /* Trigger Data Definition Version yymmddvv */
182  int totalTriggerLength; /* Total length (bytes) of complete Trigger Block */
183  int eventNumber; /* Event number in this run */
184  TrgOfflen2022 EventDesc_ofl; /* Offset/length pair to Event Descriptor */
185  TrgOfflen2022 L1_DSM_ofl; /* Offset/length pair to L1 DSM Data */
186  TrgOfflen2022 Summary_ofl; /* Offset/length pair to Summary Data */
187  TrgOfflen2022 MainX[y22MAX_OFFLEN]; /* Offset/length pairs for main crossing */
188  int PrePostList[10]; /* Offsets to offset/length pairs to Pre and Post crossing */
189  int raw_data[y22MAX_TRG_BLK_SIZE/4]; /* Storage for raw data */
191 
192 #endif
193