93 vector<int> DTTFWordContainer;
94 vector<int>::iterator DTTFiterator;
101 int DTTFChan, bitsID;
102 int addr1[2] = { 3, 3};
103 int addr2[2] = {15, 15};
104 int addr3[2] = {15, 15};
105 int addr4[2] = {15, 15};
115 if ( dttfdata.
size() == 0 )
return;
117 int* dataWord1 =
new int;
118 int* dataWord2 =
new int;
119 unsigned char* LineFED=dttfdata.
data();
120 *dataWord2=*((
int*)LineFED);
122 *dataWord1=*((
int*)LineFED);
125 BOEevTy = ((*dataWord1)&0xFF000000)>>24;
126 DTTFId = ((*dataWord2)&0x000FFF00)>>8;
128 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;
166 <<
"Warning : number of DTTF lines > 3026 ";
177 evtLgth = ((*dataWord1)&0x00FFFFFF);
178 CRC = ((*dataWord2)&0xFFFF0000)>>16;
184 <<
"Calculated CRC " << hex << newCRC <<
" differs from CRC in trailer " << hex << CRC;
190 if( lines != evtLgth){
192 <<
"Number of words read != event length " <<
dec << lines <<
" " << evtLgth;
201 for( DTTFiterator = DTTFWordContainer.begin();
202 DTTFiterator != DTTFWordContainer.end();
205 DTTFChan = ((*DTTFiterator)&0xFF000000)>>24;
207 bitsID = ((*DTTFiterator)&0xF0000000)>>28;
209 int bxID =
bxNr(DTTFChan);
210 if(bxID == -999)
continue;
211 int wheelID =
wheel(DTTFChan);
212 if(wheelID == -999)
continue;
213 int sectorID =
sector(DTTFChan);
214 if(sectorID == -999)
continue;
217 if(wheelID!=0 && bitsID<=0x9){
219 int wheelPh = (
abs(wheelID)-1)*wheelID/
abs(wheelID);
226 if ( ( bitsID >> 1 ) == 0 ){ stationID = 1;}
227 if ( ( bitsID >> 1 ) == 1 ){ stationID = 2;}
228 if ( ( bitsID >> 1 ) == 4 ){ stationID = 3;}
229 if ( ( bitsID >> 1 ) == 2 ){ stationID = 4;}
233 ts2tag = (bitsID)&0
x1;
234 tsqual = (~(*DTTFiterator)&0x07)-1;
235 ba = (~(*DTTFiterator)&0x1FF8)>>3;
236 if( ba>0x1FF) ba-=0x400;
237 ra = (~(*DTTFiterator)&0x1FFE000)>>13;
238 if( ra>0x7FF) ra-=0x1000;
242 ts2tag = (bitsID)&0
x1;
243 tsqual = (~(*DTTFiterator)&0x07)-1;
244 ra = (~(*DTTFiterator)&0x7FF8)>>3;
245 if( ra>0x7FF) ra-=0x1000;
248 if(tsqual!=7 && wheelID!=-1){
251 ra, ba, tsqual, ts2tag, 0) );
257 if(wheelID==0 && bitsID<=0x4){
259 int wheelTh = bitsID-2;
261 int posALL, posBTI[7];
263 if ( wheelTh == -2 || wheelTh == -1 ||
264 ( wheelTh == 0 && (sectorID == 0 || sectorID == 3 || sectorID == 4 || sectorID == 7 || sectorID == 8 || sectorID == 11) ) ) {
266 posALL = ~(*DTTFiterator)&0x7F;
267 posBTI[0] = ~(*DTTFiterator)&0x01;
268 posBTI[1] = (~(*DTTFiterator)&0x02)>>1;
269 posBTI[2] = (~(*DTTFiterator)&0x04)>>2;
270 posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
271 posBTI[4] = (~(*DTTFiterator)&0x10)>>4;
272 posBTI[5] = (~(*DTTFiterator)&0x20)>>5;
273 posBTI[6] = (~(*DTTFiterator)&0x40)>>6;
280 posALL = ~(*DTTFiterator)&0x3F80;
281 posBTI[0] = (~(*DTTFiterator)&0x0080)>>7;
282 posBTI[1] = (~(*DTTFiterator)&0x0100)>>8;
283 posBTI[2] = (~(*DTTFiterator)&0x0200)>>9;
284 posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
285 posBTI[4] = (~(*DTTFiterator)&0x0800)>>11;
286 posBTI[5] = (~(*DTTFiterator)&0x1000)>>12;
287 posBTI[6] = (~(*DTTFiterator)&0x2000)>>13;
294 posALL = ~(*DTTFiterator)&0x1FC000;
295 posBTI[0] = (~(*DTTFiterator)&0x004000)>>14;
296 posBTI[1] = (~(*DTTFiterator)&0x008000)>>15;
297 posBTI[2] = (~(*DTTFiterator)&0x010000)>>16;
298 posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
299 posBTI[4] = (~(*DTTFiterator)&0x040000)>>18;
300 posBTI[5] = (~(*DTTFiterator)&0x080000)>>19;
301 posBTI[6] = (~(*DTTFiterator)&0x100000)>>20;
311 posALL = ~(*DTTFiterator)&0x7F;
312 posBTI[6] = ~(*DTTFiterator)&0x01;
313 posBTI[5] = (~(*DTTFiterator)&0x02)>>1;
314 posBTI[4] = (~(*DTTFiterator)&0x04)>>2;
315 posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
316 posBTI[2] = (~(*DTTFiterator)&0x10)>>4;
317 posBTI[1] = (~(*DTTFiterator)&0x20)>>5;
318 posBTI[0] = (~(*DTTFiterator)&0x40)>>6;
325 posALL = ~(*DTTFiterator)&0x3F80;
326 posBTI[6] = (~(*DTTFiterator)&0x0080)>>7;
327 posBTI[5] = (~(*DTTFiterator)&0x0100)>>8;
328 posBTI[4] = (~(*DTTFiterator)&0x0200)>>9;
329 posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
330 posBTI[2] = (~(*DTTFiterator)&0x0800)>>11;
331 posBTI[1] = (~(*DTTFiterator)&0x1000)>>12;
332 posBTI[0] = (~(*DTTFiterator)&0x2000)>>13;
339 posALL = ~(*DTTFiterator)&0x1FC000;
340 posBTI[6] = (~(*DTTFiterator)&0x004000)>>14;
341 posBTI[5] = (~(*DTTFiterator)&0x008000)>>15;
342 posBTI[4] = (~(*DTTFiterator)&0x010000)>>16;
343 posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
344 posBTI[2] = (~(*DTTFiterator)&0x040000)>>18;
345 posBTI[1] = (~(*DTTFiterator)&0x080000)>>19;
346 posBTI[0] = (~(*DTTFiterator)&0x100000)>>20;
357 if(wheelID!=0 && bitsID>=0xA && bitsID<=0xB){
359 int candID = bitsID - 0xA;
361 addr4[candID] = ((*DTTFiterator)&0x0F);
362 addr3[candID] = ((*DTTFiterator)&0xF0)>>4;
363 addr2[candID] = ((*DTTFiterator)&0xF00)>>8;
364 addr1[candID] = ((*DTTFiterator)&0x3000)>>12;
369 if(wheelID!=0 && bitsID>=0xC){
377 muonID = (bitsID&0x1);
378 qual = (~(*DTTFiterator)&0x07);
379 phi = ((*DTTFiterator)&0x7F8)>>3;
380 ch = (~(*DTTFiterator)&0x800)>>11;
381 pt = (~(*DTTFiterator)&0x1F000)>>12;
385 L1MuDTTrackCand( 0, phi, 0, pt, ch, 1, 0, qual, bxID, wheelID, sectorID,
386 muonID, addr1[muonID], addr2[muonID], addr3[muonID], addr4[muonID] ) );
392 if(wheelID==0 && bitsID>=0x8){
394 int wheelTh = bitsID&0x7;
398 etaALL = ~(*DTTFiterator)&0x007F;
400 etTrack[bxID+1][sectorID][wheelTh][0] = (*DTTFiterator)&0x003F;
401 efTrack[bxID+1][sectorID][wheelTh][0] = (~(*DTTFiterator)&0x0040)>>6;
404 etaALL = (~(*DTTFiterator)&0x3F80)>>7;
406 etTrack[bxID+1][sectorID][wheelTh][1]= ( (*DTTFiterator)&0x1F80)>>7;
407 efTrack[bxID+1][sectorID][wheelTh][1]= (~(*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.