StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
trgStructures2013.h
1 #ifndef trgStructures2013_h
2 #define trgStructures2013_h
3 /******
4 *
5 * Layout of new Trigger Data Block
6 *
7 * J.M. Nelson November 2008
8 *
9 * Notes: This is illustrative only since the definition of the
10 * Event Descriptor will change once the new TCU has been commissioned.
11 * Similarly, the data from Level 1 (L1_DSM_Data) will be radically
12 * different. The amount of trigger summary data is also likely to
13 * change.
14 *
15 * The data block structure will always begin with a 4 character
16 * name, followed by the byte-count of data following. The structure of
17 * data will depend on the configuration of particular crates.
18 *
19 * Note: PrePost data will only be available on local trigger disks and
20 * will not be present in event files.
21 ******************************************************************************/
22 #define y13FORMAT_VERSION 0x12112942 /* Format: yymmddvv */
23 #define y13MAX_TRG_BLK_SIZE 122896 /* Estimated at 100k bytes including pre/post */
24 #define y13MAX_OFFLEN 20 /* Depends on the number of crates in the system */
25 
26 #define y13L1_CONF_NUM 1
27 #define y13BC1_CONF_NUM 2
28 #define y13MXQ_CONF_NUM 3
29 #define y13MIX_CONF_NUM 4
30 #define y13BCW_CONF_NUM 5
31 #define y13BCE_CONF_NUM 6
32 #define y13FEQ_CONF_NUM 7
33 #define y13BBC_CONF_NUM 8
34 #define y13BBQ_CONF_NUM 9
35 #define y13FMS_CONF_NUM 10
36 #define y13QT1_CONF_NUM 11
37 #define y13QT2_CONF_NUM 12
38 #define y13QT3_CONF_NUM 13
39 #define y13QT4_CONF_NUM 14
40 
41 #define y13ADD_BIT_PILEUP 0 /* Contamination/Pileup bit in event descriptor add-bits */
42 #define y13ADD_BIT_FORCE 5 /* Force store of this event */
43 #define y13ADD_BIT_L2_5 6 /* Level 2.5 abort */
44 #define y13ADD_BIT_SIM 7 /* Simulated event - used by DAQ */
45 
46 #define L2RESULTS_2013_OFFSET_EMC_CHECK 1
47 #define L2RESULTS_2013_OFFSET_EMC_PED 2
48 #define L2RESULTS_2013_OFFSET_BGAMMA 3
49 #define L2RESULTS_2013_OFFSET_EGAMMA 6
50 #define L2RESULTS_2013_OFFSET_DIJET 9
51 #define L2RESULTS_2013_OFFSET_UPSILON 17
52 #define L2RESULTS_2013_OFFSET_BEMCW 20
53 #define L2RESULTS_2013_OFFSET_BHIEN 42
54 #define L2RESULTS_2013_OFFSET_EHIEN 0
55 #define L2RESULTS_2013_OFFSET_BTOW_CAL 0
56 #define L2RESULTS_2013_OFFSET_ETOW_CAL 0
57 
58  /* Event Descriptor Data Structures */
59 
60 typedef struct {
61  char name[3]; /* Contains EVD */
62  char TrgDataFmtVer; /* Exception for use by DAQ */
63  int length; /* Byte count of data that follows */
64  unsigned int bunchXing_hi;
65  unsigned int bunchXing_lo; /* Two parts of RHIC bunch crossing number */
66  unsigned short actionWdDetectorBitMask; /* from Fifo 1 */
67  unsigned char actionWdTrgCommand; /* from Fifo 1 */
68  unsigned char actionWdDaqCommand; /* from Fifo 1 */
69  unsigned short TrgToken; /* from Fifo 2 */
70  unsigned short addBits; /* used by trigger/daq: bit 5=Force store; bit 6=L2.5 abort; bit 7=1 is fake data */
71  unsigned short DSMInput; /* only for use with Mk1 TCU. 0 if Mk2 TCU is used */
72  unsigned short externalBusy; /* from Fifo 9 (Fifo 3 Mk1 TCU) */
73  unsigned short internalBusy; /* from Fifo 9 (Mk2 TCU) */
74  unsigned short physicsWord; /* Fifo 4 Mk1 TCU. 0 if Mk2 TCU is used */
75  unsigned short TriggerWord; /* Fifo 5 Mk1 TCU. 0 if Mk2 TCU is used */
76  unsigned short DSMAddress; /* from Fifo 10 (Fifo 6 Mk1 TCU) */
77  unsigned short TCU_Mark; /* TCU_Mark Mk1=1 Mk2=2 */
78  unsigned short npre; /* pre value for detector raw data */
79  unsigned short npost; /* post value for detector raw data */
80  unsigned short res1; /* Reserved for future use */
82 
83  /* L1 DSM data structures */
84 
85 typedef struct {
86  char name[4]; /* Contains L1DS */
87  int length; /* Byte count of data that follows */
88  unsigned short TOF[8]; /* TOF and MTD data */
89  unsigned short VTX[8]; /* Separate VPD, ZDC and BBC DSMs have been replaced with this one */
90  unsigned short EMC[8]; /* Contents of 1 EMC IB - results of separate BEMC and EEMC DSMs */
91  unsigned short TPCMask[8]; /* TPC mask for DAQ10K */
92  unsigned short BCdata[16]; /* Contents of 2 Bunch Crossing DSMs IB's */
93  unsigned short specialTriggers[8]; /* Contents of 1 Special Trigger DSM - all the special trigger requests */
94  unsigned short FPD[8]; /* Contents of 1 FMS and FPD IB */
95  unsigned short lastDSM[8]; /* Contents of last DSM IB - results of all DSM trees */
97 
98  /* Trigger Summary Data Structures */
99 
100 typedef struct {
101  char name[4]; /* Contains TSUM */
102  int length; /* Byte count of data that follows */
103  unsigned int L1Sum[2]; /* L1 Summary */
104  unsigned int L2Sum[2]; /* L2 Summary */
105  unsigned int L1Result[32]; /* Result from L1 CPU */
106  unsigned int L2Result[64]; /* Result from L2 CPU */
107  unsigned int CResult[64]; /* Result from last algorithm */
109 
110 typedef struct {
111  char name[4];
112  int length; /* Byte count of data that follows */
113  unsigned int data[1]; /* NB: this definition is generic but would vary depending on actual data */
114 } DataBlock2013;
115 
116 typedef struct {
117  char name[4]; /* Contains BBC */
118  int length; /* Byte count of data that follows */
119  unsigned short BBClayer1[16]; /* This is the layer1 DSM that feeds the VTX DSM */
120  unsigned short ZDClayer1[8]; /* This is the new layer1 ZDC DSM that also feeds the VTX DSM */
121  unsigned short VPD[8]; /* ADC & TAC values for VPD detectors*/
122 } BBCBlock2013;
123 
124 typedef struct {
125  char name[4]; /* Contains MIX */
126  int length; /* Byte count of data that follows */
127  unsigned short FPDEastNSLayer1[8]; /* FPD east north/south layer 1 */
128  unsigned char MTD_P2PLayer1[16]; /* Data from MTD and PP2PP */
129  unsigned short TOFLayer1[8]; /* This is TOF Layer 1 */
130  unsigned short TOF[48]; /* TOF data */
131  unsigned short TPCpreMask[24]; /* EMC, MTD, & TOF TPC Grid Masks */
132 } MIXBlock2013;
133 
134 typedef struct {
135  char name[4];
136  int length; /* Byte count of data that follows */
137  int dataLoss; /* Byte count of data truncated due to buffer limitations */
138  unsigned int data[1]; /* NB: this definition is generic but would vary depending on actual data */
139 } QTBlock2013;
140 
141 typedef struct {
142  char name[4];
143  int length;
144  unsigned char BEMCEast[240]; /* 15 DSMs covering the East half of BEMC */
145 } BEastBlock2013;
146 
147 typedef struct {
148  char name[4];
149  int length;
150  unsigned char BEMCWest[240]; /* 15 DSMs covering the West half of BEMC */
152 
153 typedef struct {
154  char name[4];
155  int length;
156  unsigned short BEMClayer1[48]; /* 6 DSMs for BEMC at layer1 */
157  unsigned short EEMClayer1[16]; /* 2 DSMs for EEMC at layer1 */
158  unsigned char EEMC[144]; /* 9 DSMs for EEMC at layer0 */
160 
161 typedef struct {
162  char name[4];
163  int length;
164  unsigned char FMS[256]; /* 16 DSMs for FMS */
165 } FMSBlock2013;
166 
167 typedef struct {
168  int offset; /* Offset (in bytes) from the start of Trigger block to data */
169  int length; /* Length (in bytes) of data */
170 } TrgOfflen2013;
171 
172 typedef struct {
173  int FormatVersion; /* Trigger Data Definition Version yymmddvv */
174  int totalTriggerLength; /* Total length (bytes) of complete Trigger Block */
175  int eventNumber; /* Event number in this run */
176  TrgOfflen2013 EventDesc_ofl; /* Offset/length pair to Event Descriptor */
177  TrgOfflen2013 L1_DSM_ofl; /* Offset/length pair to L1 DSM Data */
178  TrgOfflen2013 Summary_ofl; /* Offset/length pair to Summary Data */
179  TrgOfflen2013 MainX[y13MAX_OFFLEN]; /* Offset/length pairs for main crossing */
180  int PrePostList[10]; /* Offsets to offset/length pairs to (5) Pre and (5) Post crossing */
181  int raw_data[y13MAX_TRG_BLK_SIZE/4]; /* Storage for raw data */
183 
184 
185 #endif
186