91 vector<int> DTTFWordContainer;
92 vector<int>::iterator DTTFiterator;
100 int addr1[2] = {3, 3};
101 int addr2[2] = {15, 15};
102 int addr3[2] = {15, 15};
103 int addr4[2] = {15, 15};
113 if (dttfdata.
size() == 0)
116 int *dataWord1 =
new int;
117 int *dataWord2 =
new int;
118 unsigned char *LineFED = dttfdata.
data();
119 *dataWord2 = *((
int *)LineFED);
121 *dataWord1 = *((
int *)LineFED);
124 BOEevTy = ((*dataWord1) & 0xFF000000) >> 24;
125 DTTFId = ((*dataWord2) & 0x000FFF00) >> 8;
127 if ((BOEevTy != 0x50) || (DTTFId != 0x030C)) {
130 <<
"Not a DTTF header " << hex << *dataWord1;
142 *dataWord2 = *((
int *)LineFED);
144 *dataWord1 = *((
int *)LineFED);
145 int chkEOE = ((*dataWord1) & 0xFFF00000) >> 20;
148 while (chkEOE != 0xA00) {
152 DTTFWord = *dataWord1;
153 DTTFWordContainer.push_back(DTTFWord);
154 DTTFWord = *dataWord2;
155 DTTFWordContainer.push_back(DTTFWord);
158 *dataWord2 = *((
int *)LineFED);
160 *dataWord1 = *((
int *)LineFED);
161 chkEOE = ((*dataWord1) & 0xFFF00000) >> 20;
167 <<
"Warning : number of DTTF lines > 3026 ";
180 evtLgth = ((*dataWord1) & 0x00FFFFFF);
181 CRC = ((*dataWord2) & 0xFFFF0000) >> 16;
188 <<
"Calculated CRC " << hex << newCRC
189 <<
" differs from CRC in trailer " << hex << CRC;
195 if (lines != evtLgth) {
198 <<
"Number of words read != event length " <<
dec << lines <<
" " 207 for (DTTFiterator = DTTFWordContainer.begin();
208 DTTFiterator != DTTFWordContainer.end(); DTTFiterator++) {
210 DTTFChan = ((*DTTFiterator) & 0xFF000000) >> 24;
212 bitsID = ((*DTTFiterator) & 0xF0000000) >> 28;
214 int bxID =
bxNr(DTTFChan);
217 int wheelID =
wheel(DTTFChan);
220 int sectorID =
sector(DTTFChan);
221 if (sectorID == -999)
225 if (wheelID != 0 && bitsID <= 0x9) {
227 int wheelPh = (
abs(wheelID) - 1) * wheelID /
abs(wheelID);
234 if ((bitsID >> 1) == 0) {
237 if ((bitsID >> 1) == 1) {
240 if ((bitsID >> 1) == 4) {
243 if ((bitsID >> 1) == 2) {
247 if (stationID != 3) {
249 ts2tag = (bitsID)&0
x1;
250 tsqual = (~(*DTTFiterator) & 0x07) - 1;
251 ba = (~(*DTTFiterator) & 0x1FF8) >> 3;
254 ra = (~(*DTTFiterator) & 0x1FFE000) >> 13;
259 ts2tag = (bitsID)&0
x1;
260 tsqual = (~(*DTTFiterator) & 0x07) - 1;
261 ra = (~(*DTTFiterator) & 0x7FF8) >> 3;
266 if (tsqual != 7 && wheelID != -1) {
268 sectorID, stationID, ra, ba,
275 if (wheelID == 0 && bitsID <= 0x4) {
277 int wheelTh = bitsID - 2;
279 int posALL, posBTI[7];
281 if (wheelTh == -2 || wheelTh == -1 ||
283 (sectorID == 0 || sectorID == 3 || sectorID == 4 || sectorID == 7 ||
284 sectorID == 8 || sectorID == 11))) {
286 posALL = ~(*DTTFiterator) & 0x7F;
287 posBTI[0] = ~(*DTTFiterator) & 0x01;
288 posBTI[1] = (~(*DTTFiterator) & 0x02) >> 1;
289 posBTI[2] = (~(*DTTFiterator) & 0x04) >> 2;
290 posBTI[3] = (~(*DTTFiterator) & 0x08) >> 3;
291 posBTI[4] = (~(*DTTFiterator) & 0x10) >> 4;
292 posBTI[5] = (~(*DTTFiterator) & 0x20) >> 5;
293 posBTI[6] = (~(*DTTFiterator) & 0x40) >> 6;
300 posALL = ~(*DTTFiterator) & 0x3F80;
301 posBTI[0] = (~(*DTTFiterator) & 0x0080) >> 7;
302 posBTI[1] = (~(*DTTFiterator) & 0x0100) >> 8;
303 posBTI[2] = (~(*DTTFiterator) & 0x0200) >> 9;
304 posBTI[3] = (~(*DTTFiterator) & 0x0400) >> 10;
305 posBTI[4] = (~(*DTTFiterator) & 0x0800) >> 11;
306 posBTI[5] = (~(*DTTFiterator) & 0x1000) >> 12;
307 posBTI[6] = (~(*DTTFiterator) & 0x2000) >> 13;
314 posALL = ~(*DTTFiterator) & 0x1FC000;
315 posBTI[0] = (~(*DTTFiterator) & 0x004000) >> 14;
316 posBTI[1] = (~(*DTTFiterator) & 0x008000) >> 15;
317 posBTI[2] = (~(*DTTFiterator) & 0x010000) >> 16;
318 posBTI[3] = (~(*DTTFiterator) & 0x020000) >> 17;
319 posBTI[4] = (~(*DTTFiterator) & 0x040000) >> 18;
320 posBTI[5] = (~(*DTTFiterator) & 0x080000) >> 19;
321 posBTI[6] = (~(*DTTFiterator) & 0x100000) >> 20;
331 posALL = ~(*DTTFiterator) & 0x7F;
332 posBTI[6] = ~(*DTTFiterator) & 0x01;
333 posBTI[5] = (~(*DTTFiterator) & 0x02) >> 1;
334 posBTI[4] = (~(*DTTFiterator) & 0x04) >> 2;
335 posBTI[3] = (~(*DTTFiterator) & 0x08) >> 3;
336 posBTI[2] = (~(*DTTFiterator) & 0x10) >> 4;
337 posBTI[1] = (~(*DTTFiterator) & 0x20) >> 5;
338 posBTI[0] = (~(*DTTFiterator) & 0x40) >> 6;
345 posALL = ~(*DTTFiterator) & 0x3F80;
346 posBTI[6] = (~(*DTTFiterator) & 0x0080) >> 7;
347 posBTI[5] = (~(*DTTFiterator) & 0x0100) >> 8;
348 posBTI[4] = (~(*DTTFiterator) & 0x0200) >> 9;
349 posBTI[3] = (~(*DTTFiterator) & 0x0400) >> 10;
350 posBTI[2] = (~(*DTTFiterator) & 0x0800) >> 11;
351 posBTI[1] = (~(*DTTFiterator) & 0x1000) >> 12;
352 posBTI[0] = (~(*DTTFiterator) & 0x2000) >> 13;
359 posALL = ~(*DTTFiterator) & 0x1FC000;
360 posBTI[6] = (~(*DTTFiterator) & 0x004000) >> 14;
361 posBTI[5] = (~(*DTTFiterator) & 0x008000) >> 15;
362 posBTI[4] = (~(*DTTFiterator) & 0x010000) >> 16;
363 posBTI[3] = (~(*DTTFiterator) & 0x020000) >> 17;
364 posBTI[2] = (~(*DTTFiterator) & 0x040000) >> 18;
365 posBTI[1] = (~(*DTTFiterator) & 0x080000) >> 19;
366 posBTI[0] = (~(*DTTFiterator) & 0x100000) >> 20;
377 if (wheelID != 0 && bitsID >= 0xA && bitsID <= 0xB) {
379 int candID = bitsID - 0xA;
381 addr4[candID] = ((*DTTFiterator) & 0x0F);
382 addr3[candID] = ((*DTTFiterator) & 0xF0) >> 4;
383 addr2[candID] = ((*DTTFiterator) & 0xF00) >> 8;
384 addr1[candID] = ((*DTTFiterator) & 0x3000) >> 12;
389 if (wheelID != 0 && bitsID >= 0xC) {
397 muonID = (bitsID & 0x1);
398 qual = (~(*DTTFiterator) & 0x07);
399 phi = ((*DTTFiterator) & 0x7F8) >> 3;
400 ch = (~(*DTTFiterator) & 0x800) >> 11;
401 pt = (~(*DTTFiterator) & 0x1F000) >> 12;
405 0, phi, 0, pt, ch, 1, 0, qual, bxID, wheelID, sectorID, muonID,
406 addr1[muonID], addr2[muonID], addr3[muonID], addr4[muonID]));
412 if (wheelID == 0 && bitsID >= 0x8) {
414 int wheelTh = bitsID & 0x7;
418 etaALL = ~(*DTTFiterator) & 0x007F;
420 etTrack[bxID + 1][sectorID][wheelTh][0] = (*DTTFiterator) & 0x003F;
421 efTrack[bxID + 1][sectorID][wheelTh][0] =
422 (~(*DTTFiterator) & 0x0040) >> 6;
425 etaALL = (~(*DTTFiterator) & 0x3F80) >> 7;
427 etTrack[bxID + 1][sectorID][wheelTh][1] =
428 ((*DTTFiterator) & 0x1F80) >> 7;
429 efTrack[bxID + 1][sectorID][wheelTh][1] =
430 (~(*DTTFiterator) & 0x2000) >> 13;
bool getByToken(EDGetToken token, Handle< PROD > &result) const
L1MuDTChambPhContainer::Phi_Container phiSegments
unsigned int etTrack[3][12][6][2]
size_t size() const
Lenght of the data buffer in bytes.
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Abs< T >::type abs(const T &t)
L1MuDTChambThContainer::The_Container theSegments
L1MuDTTrackContainer::TrackContainer dtTracks
edm::EDGetTokenT< FEDRawDataCollection > Raw_token
unsigned int efTrack[3][12][6][2]
void calcCRC(long, int &)
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.