ATLAS Offline Software
PixelByteStreamModuleMask.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PIXELRAWDATABYTESTREAMCNV_PIXELBYTESTREAMMODULEMASK_H
6 #define PIXELRAWDATABYTESTREAMCNV_PIXELBYTESTREAMMODULEMASK_H
7 
8 //#include <cstdint>
9 // Pixel module header word
10 static const uint32_t PRB_BCIDmask = 0xFF; // BCID header word mask
11 static const uint32_t PRB_BCIDskip = 0; // BCID header word skip
12 static const uint32_t PRB_L1IDmask = 0xF; // L1ID header word mask
13 static const uint32_t PRB_L1IDskip = 8; // L1ID header word skip
14 static const uint32_t PRB_L1IDSKIPmask = 0xF; // L1ID skip header word mask
15 static const uint32_t PRB_L1IDSKIPskip = 12; // L1ID skip header word skip
16 static const uint32_t PRB_MODULEmask = 0x7F; // module link header word mask
17 static const uint32_t PRB_MODULEskip = 16; // module link header word skip
18 //static const uint32_t PRB_MODULEerrormask = 0x4; // module link header boundary check mask
19 static const uint32_t PRB_HEADERERRORSmask = 0xF; // header errors header word mask
20 static const uint32_t PRB_HEADERERRORSskip = 25; // header errors header word skip
21 static const uint32_t PRB_HEADERBITFLIPmask = 0x3;
22 static const uint32_t PRB_HEADERBITFLIPskip = 23;
23 
24 // IBL module header word
25 static const uint32_t PRB_BCIDskip_IBL = 0; // IBL BCID header word skip => B
26 static const uint32_t PRB_BCIDmask_IBL = 0x3FF; // IBL BCID header word mask
27 static const uint32_t PRB_L1IDskip_IBL = 10; // IBL L1ID header word skip => L
28 static const uint32_t PRB_L1IDmask_IBL = 0x1FFF; // IBL L1ID header word mask
29 static const uint32_t PRB_FeI4BFLAGskip_IBL = 23; // IBL FeI4B flag bit skip => F
30 static const uint32_t PRB_FeI4BFLAGmask_IBL = 0x1; // IBL FeI4 flag bit mask
31 static const uint32_t PRB_ZERO_skip_IBL = 16; // skip to go to the 0's in the header of the IBL // OBSOLETE! REMOVE IT
32 static const uint32_t PRB_ZERO_mask_IBL = 0xFF; // mask needed to check if the 0's are in the right position // OBSOLETE! REMOVE IT (or modify it)
33 static const uint32_t PRB_MODULEskip_IBL = 24; // IBL module link header word skip => n
34 static const uint32_t PRB_MODULEmask_IBL = 0x1F; // IBL module link header word mask
35 
36 
37 // Pixel module hit word
38 static const uint32_t PRB_ROWmask = 0xFF; // row hit word mask
39 static const uint32_t PRB_ROWskip = 0; // row hit word skip
40 static const uint32_t PRB_COLUMNmask = 0x1F; // column hit word mask
41 static const uint32_t PRB_COLUMNskip = 8; // column hit word skip
42 static const uint32_t PRB_TOTmask = 0xFF; // TOT hit word mask
43 static const uint32_t PRB_TOTskip = 16; // TOT hit word skip
44 static const uint32_t PRB_FEmask = 0xF; // FE hit word mask
45 static const uint32_t PRB_FEskip = 24; // FE hit word skip
46 static const uint32_t PRB_HITBITFLIPmask = 0x8007;
47 static const uint32_t PRB_HITBITFLIPskip = 13;
48 
49 // IBL module (condensed) hit word
50 static const uint32_t PRB_FIRSTHITCONDENSEDWORD = 0xA0000000; // mask for the first hit condensed
51 //static const uint32_t PRB_HITDATAMASK = 0xE0000000; // probe first and last hit condensed words
52 static const uint32_t PRB_MIDDLEHITCONDENSEDWORD = 0x80000000; // probe second and third hit condensed words
53 static const uint32_t PRB_LASTHITCONDENSEDWORD = 0xE0000000; // probe to last of 4 hit condensed words (IBL)
54 
55 static const uint32_t nHits = 5; // number of consecutive IBL hits that are condensed into 4 ROD words
56 static const int nCondensedWords = 4; // number of condensed hit words sent to the ROD
57 static const uint32_t mask3 = 0x7; // mask to select first 3 bits
58 //static const uint32_t mask4 = 0xF; // mask to select first 4 bits
59 static const uint32_t mask5 = 0x1F; // mask to select first 5 bits
60 static const uint32_t mask12 = 0x00000FFF; // mask to select 12 bits
61 static const uint32_t mask19 = 0x0007FFFF; // mask to select 19 bits
62 static const uint32_t mask24 = 0x00FFFFFF; // mask to select 24 bits = bits Row+bits Column + bits TOT;
63 
64 static const uint32_t skip3 = 3; // mask to skip first 3 bits
65 static const uint32_t skip4 = 4; // mask to skip first 4 bits
66 static const uint32_t skip5 = 5; // mask to skip first 5 bits
67 static const uint32_t skipRow = 9; // length of Row information in IBL
68 static const uint32_t skipCol = 7; // length of Column information in IBL
69 static const uint32_t skipTOT = 8; // length of TOT information in IBL
70 
71 //static const uint32_t cond_IBL_first_mask = 0x1FFFFFFF; //PRB_DATAWORD_SHORT_IBL_first = 0xA0000000; // condensed first hit word - for IBL
72 //static const uint32_t cond_IBL_middle_mask = 0x7FFFFFFF; //const uint32_t PRB_DATAWORD_SHORT_IBL_middle = 0x10000000; // condensed middle hit words - for IBL
73 //static const uint32_t cond_IBL_last_mask = 0x1FFFFFFF; //const uint32_t PRB_DATAWORD_SHORT_IBL_last = 0xE0000000; // condensed last hit word - for IBL
74 //static const uint32_t PRB_HIT_IBL = 0x601F0000; // IBL not-condensed hit word mask
75 //static const uint32_t PRB_HIT_IBL_EMPTY = 0x00000000; // IBL not condensed hit word probe
76 
77 //static const uint32_t PRB_HIT_IBL_MASK = 0xE0000000; // mask to recognise IBL not-condensed hit word
78 //static const uint32_t PRB_HIT_NOTCONDENSED = 0x80000000; //
79 static const uint32_t PRB_HIT_PIXEL_MASK = 0xF000E000; // mask to recognise Pixel hit word
80 
81 // IBL module (not-condensed) hit word
82 static const uint32_t PRB_ROWskip_IBL = 0; // row not-condensed hit word skip
83 static const uint32_t PRB_ROWmask_IBL = 0x1FF; // row not-condensed hit word mask
84 static const uint32_t PRB_COLUMNskip_IBL = 9; // column not-condensed hit word skip => need to skip the Row bits
85 static const uint32_t PRB_COLUMNmask_IBL = 0x7F; // column not-condensed hit word mask
86 static const uint32_t PRB_TOTskip_IBL = 16; // TOT not-condensed hit word skip => need to skip the Row and the Column
87 static const uint32_t PRB_TOTmask_IBL = 0xFF; // TOT non-condensed hit word mask
88 static const uint32_t PRB_LINKNUMHITskip_IBL = 24;
89 static const uint32_t PRB_LINKNUMHITmask_IBL = 0x1F; // link number for the IBl, containing the SLink (2 MSB) and the FE w.r.t. the SLink (3 LSB)
90 //static const uint32_t PRB_LINKNUMHITmask_IBL = 0x7; // link number for the IBL (= number of the FE w.r.t. the SLink)
91 
92 // Pixel module trailer word
93 static const uint32_t PRB_TRAILERERRORSmask = 0x7; // trailer errors trailer word mask
94 static const uint32_t PRB_TRAILERERRORSskip = 26; // trailer errors trailer word skip
95 static const uint32_t PRB_TRAILERBITFLIPmask = 0x3FFFFFF;
96 static const uint32_t PRB_TRAILERBITFLIPskip = 0;
97 
98 // IBL module trailer word
99 static const uint32_t PRB_SKIPPEDTRIGGERTRAILERskip_IBL = 5; // IBL L1IDskip in trailer word skip
100 static const uint32_t PRB_SKIPPEDTRIGGERTRAILERmask_IBL = 0x3FF; // IBL L1IDskip in trailer word mask
101 static const uint32_t PRB_TRAILERERRORSskip_IBL = 15; // IBL skipped trigger counter skip in the trailer word. In the data format, they're called z,h and v.
102 static const uint32_t PRB_TRAILERERRORSmask_IBL = 0x1FF; // IBL skipped trigger counter mask in the trailer word
103 static const uint32_t PRB_LINKNUMTRAILERskip_IBL = 24; // IBL link number (= number of the FE chip linked to the S-Link that is sending the stream, and corresponding SLink) in the trailer word
104 static const uint32_t PRB_LINKNUMTRAILERmask_IBL = 0x1F; // IBL link number (= number of the FE chip linked to the S-Link that is sending the stream) in the trailer word
105 //static const uint32_t PRB_LINKNUMTRAILERmask_IBL = 0x7; // IBL link number (= number of the FE chip linked to the S-Link that is sending the stream) in the trailer word
106 static const uint32_t PRB_BITFLIPSTRAILERskip_IBL = 0; // IBL bitflips skip in the trailer word
107 static const uint32_t PRB_BITFLIPSTRAILERmask_IBL = 0x1F; // IBL bitflips mask in the trailer word
108 // the following words at the moment are used for the encoder, but not for the decoder.
109 //In the decoder, no separate classification of the errors has been done yet.
110 static const uint32_t PRB_BCIDSKIPTRAILERskip_IBL = 0x0; // IBL BCIDskip in trailer word skip
111 static const uint32_t PRB_BCIDSKIPTRAILERmask_IBL = 0x1F; // IBL BCIDskip in trailer word mask
112 static const uint32_t PRB_L1IDSKIPTRAILERskip_IBL = 19; // IBL L1IDskip in trailer word skip
113 static const uint32_t PRB_L1IDSKIPTRAILERmask_IBL = 0x1; // IBL L1IDskip in trailer word mask
114 static const uint32_t PRB_PREAMBLEERRORTRAILERskip_IBL = 20; // IBL L1IDskip in trailer word skip
115 static const uint32_t PRB_PREAMBLEERRORTRAILERmask_IBL = 0x1; // IBL L1IDskip in trailer word mask
116 static const uint32_t PRB_LINKMASKEDskip_IBL = 21;
117 static const uint32_t PRB_LINKMASKEDmask_IBL = 0x1;
118 static const uint32_t PRB_CONDENSEDMODEskip_IBL = 22;
119 static const uint32_t PRB_CONDENSEDMODEmask_IBL = 0x1;
120 static const uint32_t PRB_TIMEOUTERRORskip_IBL = 23;
121 static const uint32_t PRB_TIMEOUTERRORmask_IBL = 0x1;
122 
123 
124 // OBSOLETE. Flag type 1 is not used anymore in the code
125 // Pixel module flag type 1 words
126 //static const uint32_t PRB_FEFlagmask1 = 0xF; // FE flags type 1 word mask
127 //static const uint32_t PRB_FEFlagskip1 = 0; // FE flags type 1 word skip
128 //static const uint32_t PRB_FE2mask = 0xF; // FE flag second FE number mask (to compare with first Circuitnumber)
129 //static const uint32_t PRB_FE2skip = 4; // FE flag second FE number skip
130 //static const uint32_t PRB_FEFLAG1BITFLIPmask = 0x7FF;
131 //static const uint32_t PRB_FEFLAG1BITFLIPskip = 13;
132 
133 // Pixel module flag type 2 words
134 static const uint32_t PRB_FEFlagmask2 = 0xFF; // FE flags type 2 word mask
135 static const uint32_t PRB_FEFlagskip2 = 0; // FE flags type 2 word skip
136 static const uint32_t PRB_MCCFlagmask = 0x1F; // FE flags type 2 word mask
137 static const uint32_t PRB_MCCFlagskip = 8; // FE flags type 2 word skip
138 static const uint32_t PRB_FEFLAG2BITFLIPmask = 0x7;
139 static const uint32_t PRB_FEFLAG2BITFLIPskip = 21;
140 
141 // IBL module FE flag words
142 static const uint32_t PRB_SERVICECODECOUNTERskip_IBL = 0; // Service code counter in the IBL FE flag word
143 static const uint32_t PRB_SERVICECODECOUNTERmask_IBL = 0x3FF; // Service code counter in the IBL FE flag word
144 static const uint32_t PRB_BITFLIPSFEFLAGskip_IBL = 10; // bit flips in the IBL FE flag word
145 static const uint32_t PRB_BITFLIPSFEFLAGmask_IBL = 0x207F; // bit flips in the IBL FE flag word
146 static const uint32_t PRB_SERVICECODEskip_IBL = 17; // Service code in the IBL FE Flag word
147 static const uint32_t PRB_SERVICECODEmask_IBL = 0x3F; // Service code in the IBL FE Flag word
148 static const uint32_t PRB_LINKNUMBERFEFLAGskip_IBL = 24; // Link number (= FE number linked to the S-Link sending the stream and S-Link itself) in the IBL FE Flag word
149 static const uint32_t PRB_LINKNUMBERFEFLAGmask_IBL = 0x1F; // Link number (= FE number linked to the S-Link sending the stream) in the IBL FE Flag word
150 
151 
152 // Pixel RawData word // Not used at the moment
153 //static const uint32_t PRB_RAWDATAskip = 0; // Raw data word skip
154 //static const uint32_t PRB_RAWDATAmask = 0x1FFFFFFF; // Raw Data word mask
155 
156 
157 // word type masks (just use bits 29-31)
158 static const uint32_t PRB_DATAMASK = 0xE0000000; // word type mask
159 static const uint32_t PRB_HITMASK = 0x80000000; // word hit mask
160 static const uint32_t PRB_LINKHEADER = 0x20000000; // module header word mask
161 static const uint32_t PRB_LINKTRAILER = 0x40000000; // module trailer word mask
162 static const uint32_t PRB_RAWDATA = 0x60000000; // raw data word mask
163 static const uint32_t PRB_DATAWORD = 0x80000000; // hit word mask
164 // special word type masks
165 static const uint32_t PRB_TIMEOUT = 0x20004000; // timeout word mask - does not use word type mask
166 static const uint32_t PRB_FEERRORMASK = 0xF0000000; // flag word type mask -- for Pixel and IBL
167 //static const uint32_t PRB_FEERROR1 = 0x00000000; // type 1 flag word -- for Pixel and IBL: for the IBL, it is used for the FE Flag error Short
168 static const uint32_t PRB_FEERROR2 = 0x10000000; // type 2 flag word -- for Pixel and IBL: for the IBL, it is used for the FE Flag error (normal)
169 
170 static const uint32_t PRB_UNKNOWNWORD = 0xFFFFFFFF; // unknown word
171 // word empty bits (filled by ROD with 0's) masks
172 //static const uint32_t PRB_LINKHEADEREMPTY = 0x01800000; // module header word empty bits (filled by ROD with 0's) mask - for Pixel
173 static const uint32_t PRB_DATAWORDEMPTY = 0x1000E000; // hit word empty bits (filled by ROD with 0's) mask - for Pixel
174 static const uint32_t PRB_LINKTRAILEREMPTY = 0x03FFFFFF; // module trailer word empty bits (filled by ROD with 0's) mask - for Pixel
175 //static const uint32_t PRB_FEERROR1CHECK = 0x00FFFF00; // flag word type 1 determined bits mask - for Pixel
176 static const uint32_t PRB_FEERROR2CHECK = 0x001F0000; // flag word type 2 determined bits mask - for Pixel
177 
178 //static const uint32_t PRB_FEERRORCHECK_IBL = 0x0F81FC00; // flag word determined bits mask - for IBL
179 //static const uint32_t PRB_FEERROR2CHECK_IBL = 0xF81FC00;
180 static const uint32_t PRB_FEERROR_IBL = 0x00000000;
181 //static const uint32_t PRB_FEERROR1CHECK_IBL = 0x0F800000;
182 //static const uint32_t PRB_FEERROR1CHECKRESULT = 0x00001E00; // flag word type 1 determined bits mask result - for Pixel
183 //static const uint32_t PRB_FEERROR2CHECKRESULT = 0x001F0000; // flag word type 2 determined bits mask result - for Pixel
184 //static const uint32_t PRB_FEERRORCHECKRESULT_IBL = 0x00000000; // flag word type normal and Short - for IBL
185 
186 
187 
188 const uint32_t PRB_LINKTRAILEREMPTY_IBL = 0x0000001F; // trailer word empty bits (filled by ROD with 0's) mask - for IBL
189 
190 // words for the IBL which are different from those for the Pixel detector
191 /*const uint32_t PRB_LINKHEADER_IBL = 0x200000A0; // header word for the IBL found
192 const uint32_t PRB_DATAWORD_IBL = 0x800000A0; // hit word for the IBL found
193 const uint32_t PRB_LINKTRAILER_IBL = 0x400000A0; // trailer word for the IBL found
194 const uint32_t PRB_DATAWORD_SHORT_IBL_first = 0xA0000000; // condensed first hit word - for IBL
195 const uint32_t PRB_DATAWORD_SHORT_IBL_middle = 0x10000000; // condensed middle hit words - for IBL
196 const uint32_t PRB_DATAWORD_SHORT_IBL_last = 0xE0000000; // condensed last hit word - for IBL
197 const uint32_t PRB_FEERROR_CHECK_IBL_short = 0xFF800000; // FE flag error short word mask - for IBL
198 const uint32_t PRB_FERROR2CHECK_IBL = 0xEF81FC00; // FE flag error word mask - for IBL
199 const uint32_t PRB_LINKTRAILEREMPTY_IBL = 0x000007FF; // trailer word empty bits (filled by ROD with 0's) mask - for IBL
200 const uint32_t PRB_DATAWORDEMPTY_IBL = 0x001F0000; // hit word empty bits (filled by ROD with 0's) mask - for IBL
201 */
202 #endif
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PRB_LINKTRAILEREMPTY_IBL
const uint32_t PRB_LINKTRAILEREMPTY_IBL
Definition: PixelByteStreamModuleMask.h:188