CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTTFFEDReader.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTTFFEDReader
4 //
5 // L1 DT Track Finder Raw-to-Digi
6 //
7 //
8 // $Date: 2009/11/18 13:27:12 $
9 // $Revision: 1.16 $
10 //
11 // Author :
12 // J. Troconiz UAM Madrid
13 //
14 //--------------------------------------------------
15 
17 
21 
24 
25 #include <iostream>
26 
27 using namespace std;
28 
29 
31 
32  produces<L1MuDTChambPhContainer>();
33  produces<L1MuDTChambThContainer>();
34  produces<L1MuDTTrackContainer>("DATA");
35 
36  DTTFInputTag = pset.getParameter<edm::InputTag>("DTTF_FED_Source");
37 
38  verbose_ = pset.getUntrackedParameter<bool>("verbose",false);
39 
40 }
41 
43 
45 
46  auto_ptr<L1MuDTChambPhContainer> phi_product(new L1MuDTChambPhContainer);
47  auto_ptr<L1MuDTChambThContainer> the_product(new L1MuDTChambThContainer);
48  auto_ptr<L1MuDTTrackContainer> tra_product(new L1MuDTTrackContainer);
49 
53 
54  if (!fillRawData(e, phi_data, the_data, tra_data)) return;
55 
56  phi_product->setContainer(phi_data);
57  the_product->setContainer(the_data);
58  tra_product->setContainer(tra_data);
59 
60  e.put(phi_product);
61  e.put(the_product);
62  e.put(tra_product,"DATA");
63 
64 }
65 
70 
71  analyse(e);
72 
73  phi_data = p_data();
74  the_data = t_data();
75  tra_data = k_data();
76 
77  return true;
78 }
79 
80 //--------------
81 // Operations --
82 //--------------
84  clear();
85  process(e);
86  match();
87  return;
88 }
89 
90 // process data
92 
93  // Container
94  vector<int> DTTFWordContainer;
95  vector<int>::iterator DTTFiterator;
96 
97  // Header constituents
98  int BOEevTy, DTTFId;
99 
100  // DTTF Payload constituents
101  int DTTFWord;
102  int DTTFChan, bitsID;
103  int addr1[2] = { 3, 3};
104  int addr2[2] = {15, 15};
105  int addr3[2] = {15, 15};
106  int addr4[2] = {15, 15};
107 
108  // Trailer constituents
109  int evtLgth , CRC;
110 
111  //--> Header
112 
114  e.getByLabel(getDTTFInputTag(),data);
115  FEDRawData dttfdata = data->FEDData(0x030C);
116  if ( dttfdata.size() == 0 ) return;
117 
118  int* dataWord1 = new int;
119  int* dataWord2 = new int;
120  unsigned char* LineFED=dttfdata.data();
121  *dataWord2=*((int*)LineFED);
122  LineFED+=4;
123  *dataWord1=*((int*)LineFED);
124  int lines = 1; // already counting header
125 
126  BOEevTy = ((*dataWord1)&0xFF000000)>>24; // positions 57 ->64
127  DTTFId = ((*dataWord2)&0x000FFF00)>>8; // positions 9 ->20
128 
129  if( (BOEevTy != 0x50) || ( DTTFId != 0x030C) ){
130  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
131  << "Not a DTTF header " << hex << *dataWord1;
132  delete dataWord1;
133  delete dataWord2;
134  return;
135  }
136 
137  int newCRC = 0xFFFF;
138  calcCRC(*dataWord1, *dataWord2, newCRC);
139 
140 
141  //--> DTTF data
142 
143  LineFED+=4;
144  *dataWord2=*((int*)LineFED);
145  LineFED+=4;
146  *dataWord1=*((int*)LineFED);
147  int chkEOE = ((*dataWord1)&0xFFF00000)>>20;
148  lines++;
149 
150  while(chkEOE != 0xA00){
151 
152  calcCRC(*dataWord1, *dataWord2, newCRC);
153 
154  DTTFWord = *dataWord1;
155  DTTFWordContainer.push_back(DTTFWord);
156  DTTFWord = *dataWord2;
157  DTTFWordContainer.push_back(DTTFWord);
158 
159  LineFED+=4;
160  *dataWord2=*((int*)LineFED);
161  LineFED+=4;
162  *dataWord1=*((int*)LineFED);
163  chkEOE = ((*dataWord1)&0xFFF00000)>>20;
164  lines++;
165 
166  if(lines > 3026){
167  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
168  << "Warning : number of DTTF lines > 3026 "; // 3026 = 1(header) + 3024(max # PHTF-ETTF 64 bits words) + 1(trailer)
169  delete dataWord1;
170  delete dataWord2;
171  return;
172  }
173 
174  } // end while-Data loop
175 
176 
177  //--> Trailer
178 
179  evtLgth = ((*dataWord1)&0x00FFFFFF); // positions 33 ->56
180  CRC = ((*dataWord2)&0xFFFF0000)>>16; // positions 17 ->32
181 
182  calcCRC(*dataWord1, (*dataWord2)&0xFFFF, newCRC);
183  if( newCRC != CRC){
184  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
185  << "Calculated CRC " << hex << newCRC << " differs from CRC in trailer " << hex << CRC;
186  delete dataWord1;
187  delete dataWord2;
188  return;
189  }
190 
191  if( lines != evtLgth){
192  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
193  << "Number of words read != event length " << dec << lines << " " << evtLgth;
194  delete dataWord1;
195  delete dataWord2;
196  return;
197  }
198 
199 
200  // --> analyse event
201 
202  for( DTTFiterator = DTTFWordContainer.begin();
203  DTTFiterator != DTTFWordContainer.end();
204  DTTFiterator++ ){
205 
206  DTTFChan = ((*DTTFiterator)&0xFF000000)>>24;
207  DTTFiterator++;
208  bitsID = ((*DTTFiterator)&0xF0000000)>>28;
209 
210  int bxID = bxNr(DTTFChan);
211  if(bxID == -999) continue;
212  int wheelID = wheel(DTTFChan);
213  if(wheelID == -999) continue;
214  int sectorID = sector(DTTFChan);
215  if(sectorID == -999) continue;
216 
217  //Input
218  if(wheelID!=0 && bitsID<=0x9){
219 
220  int wheelPh = (abs(wheelID)-1)*wheelID/abs(wheelID);
221  int stationID = 0;
222  int ra = 0;
223  int ba = 0;
224  int tsqual = 0;
225  int ts2tag = 0;
226 
227  if ( ( bitsID >> 1 ) == 0 ){ stationID = 1;}
228  if ( ( bitsID >> 1 ) == 1 ){ stationID = 2;}
229  if ( ( bitsID >> 1 ) == 4 ){ stationID = 3;}
230  if ( ( bitsID >> 1 ) == 2 ){ stationID = 4;}
231 
232  if(stationID != 3){
233 
234  ts2tag = (bitsID)&0x1;
235  tsqual = (~(*DTTFiterator)&0x07)-1;
236  ba = (~(*DTTFiterator)&0x1FF8)>>3;
237  if( ba>0x1FF) ba-=0x400;
238  ra = (~(*DTTFiterator)&0x1FFE000)>>13;
239  if( ra>0x7FF) ra-=0x1000;
240  }
241  else{
242 
243  ts2tag = (bitsID)&0x1;
244  tsqual = (~(*DTTFiterator)&0x07)-1;
245  ra = (~(*DTTFiterator)&0x7FF8)>>3;
246  if( ra>0x7FF) ra-=0x1000;
247  }
248 
249  if(tsqual!=7 && wheelID!=-1){
250  phiSegments.push_back(
251  L1MuDTChambPhDigi( bxID+ts2tag, wheelPh, sectorID, stationID,
252  ra, ba, tsqual, ts2tag, 0) );
253  }
254  }
255  //Input
256 
257  //Input
258  if(wheelID==0 && bitsID<=0x4){
259 
260  int wheelTh = bitsID-2;
261 
262  int posALL, posBTI[7];
263 
264  if ( wheelTh == -2 || wheelTh == -1 ||
265  ( wheelTh == 0 && (sectorID == 0 || sectorID == 3 || sectorID == 4 || sectorID == 7 || sectorID == 8 || sectorID == 11) ) ) {
266 
267  posALL = ~(*DTTFiterator)&0x7F;
268  posBTI[0] = ~(*DTTFiterator)&0x01;
269  posBTI[1] = (~(*DTTFiterator)&0x02)>>1;
270  posBTI[2] = (~(*DTTFiterator)&0x04)>>2;
271  posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
272  posBTI[4] = (~(*DTTFiterator)&0x10)>>4;
273  posBTI[5] = (~(*DTTFiterator)&0x20)>>5;
274  posBTI[6] = (~(*DTTFiterator)&0x40)>>6;
275 
276  if(posALL){
277  theSegments.push_back(
278  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 1, posBTI) );
279  }
280 
281  posALL = ~(*DTTFiterator)&0x3F80;
282  posBTI[0] = (~(*DTTFiterator)&0x0080)>>7;
283  posBTI[1] = (~(*DTTFiterator)&0x0100)>>8;
284  posBTI[2] = (~(*DTTFiterator)&0x0200)>>9;
285  posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
286  posBTI[4] = (~(*DTTFiterator)&0x0800)>>11;
287  posBTI[5] = (~(*DTTFiterator)&0x1000)>>12;
288  posBTI[6] = (~(*DTTFiterator)&0x2000)>>13;
289 
290  if(posALL){
291  theSegments.push_back(
292  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 2, posBTI) );
293  }
294 
295  posALL = ~(*DTTFiterator)&0x1FC000;
296  posBTI[0] = (~(*DTTFiterator)&0x004000)>>14;
297  posBTI[1] = (~(*DTTFiterator)&0x008000)>>15;
298  posBTI[2] = (~(*DTTFiterator)&0x010000)>>16;
299  posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
300  posBTI[4] = (~(*DTTFiterator)&0x040000)>>18;
301  posBTI[5] = (~(*DTTFiterator)&0x080000)>>19;
302  posBTI[6] = (~(*DTTFiterator)&0x100000)>>20;
303 
304  if(posALL){
305  theSegments.push_back(
306  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 3, posBTI) );
307  }
308  }
309 
310  else {
311 
312  posALL = ~(*DTTFiterator)&0x7F;
313  posBTI[6] = ~(*DTTFiterator)&0x01;
314  posBTI[5] = (~(*DTTFiterator)&0x02)>>1;
315  posBTI[4] = (~(*DTTFiterator)&0x04)>>2;
316  posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
317  posBTI[2] = (~(*DTTFiterator)&0x10)>>4;
318  posBTI[1] = (~(*DTTFiterator)&0x20)>>5;
319  posBTI[0] = (~(*DTTFiterator)&0x40)>>6;
320 
321  if(posALL){
322  theSegments.push_back(
323  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 1, posBTI) );
324  }
325 
326  posALL = ~(*DTTFiterator)&0x3F80;
327  posBTI[6] = (~(*DTTFiterator)&0x0080)>>7;
328  posBTI[5] = (~(*DTTFiterator)&0x0100)>>8;
329  posBTI[4] = (~(*DTTFiterator)&0x0200)>>9;
330  posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
331  posBTI[2] = (~(*DTTFiterator)&0x0800)>>11;
332  posBTI[1] = (~(*DTTFiterator)&0x1000)>>12;
333  posBTI[0] = (~(*DTTFiterator)&0x2000)>>13;
334 
335  if(posALL){
336  theSegments.push_back(
337  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 2, posBTI) );
338  }
339 
340  posALL = ~(*DTTFiterator)&0x1FC000;
341  posBTI[6] = (~(*DTTFiterator)&0x004000)>>14;
342  posBTI[5] = (~(*DTTFiterator)&0x008000)>>15;
343  posBTI[4] = (~(*DTTFiterator)&0x010000)>>16;
344  posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
345  posBTI[2] = (~(*DTTFiterator)&0x040000)>>18;
346  posBTI[1] = (~(*DTTFiterator)&0x080000)>>19;
347  posBTI[0] = (~(*DTTFiterator)&0x100000)>>20;
348 
349  if(posALL){
350  theSegments.push_back(
351  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 3, posBTI) );
352  }
353  }
354  }
355  //Input
356 
357  //Addresses
358  if(wheelID!=0 && bitsID>=0xA && bitsID<=0xB){
359 
360  int candID = bitsID - 0xA;
361 
362  addr4[candID] = ((*DTTFiterator)&0x0F);
363  addr3[candID] = ((*DTTFiterator)&0xF0)>>4;
364  addr2[candID] = ((*DTTFiterator)&0xF00)>>8;
365  addr1[candID] = ((*DTTFiterator)&0x3000)>>12;
366  }
367  //Addresses
368 
369  //Output
370  if(wheelID!=0 && bitsID>=0xC){
371 
372  int muonID = 0;
373  int pt = 0;
374  int ch = 0;
375  int phi = 0;
376  int qual = 0;
377 
378  muonID = (bitsID&0x1);
379  qual = (~(*DTTFiterator)&0x07);
380  phi = ((*DTTFiterator)&0x7F8)>>3;
381  ch = (~(*DTTFiterator)&0x800)>>11;
382  pt = (~(*DTTFiterator)&0x1F000)>>12;
383 
384  if(qual!=0){
385  dtTracks.push_back(
386  L1MuDTTrackCand( 0, phi, 0, pt, ch, 1, 0, qual, bxID, wheelID, sectorID,
387  muonID, addr1[muonID], addr2[muonID], addr3[muonID], addr4[muonID] ) );
388  }
389  }
390  //Output
391 
392  //Output
393  if(wheelID==0 && bitsID>=0x8){
394 
395  int wheelTh = bitsID&0x7;
396 
397  int etaALL;
398 
399  etaALL = ~(*DTTFiterator)&0x007F;
400  if (etaALL) {
401  etTrack[bxID+1][sectorID][wheelTh][0] = (*DTTFiterator)&0x003F;
402  efTrack[bxID+1][sectorID][wheelTh][0] = (~(*DTTFiterator)&0x0040)>>6;
403  }
404 
405  etaALL = (~(*DTTFiterator)&0x3F80)>>7;
406  if (etaALL) {
407  etTrack[bxID+1][sectorID][wheelTh][1]= ( (*DTTFiterator)&0x1F80)>>7;
408  efTrack[bxID+1][sectorID][wheelTh][1]= (~(*DTTFiterator)&0x2000)>>13;
409  }
410  }
411  //Output
412 
413  } // end for-loop container content
414 
415  delete dataWord1;
416  delete dataWord2;
417  return;
418 }
419 
421 
422  for ( L1MuDTTrackContainer::TrackIterator i = dtTracks.begin();
423  i != dtTracks.end();
424  i++ ) {
425  int bxTh = i->bx()+1;
426  int sectorTh = i->scNum();
427  int wheelTh = i->whNum()+3;
428  if(wheelTh > 3) wheelTh-=1;
429  int muonTh = i->TrkTag();
430 
431  i->setEtaPacked(etTrack[bxTh][sectorTh][wheelTh][muonTh]);
432  i->setFineHaloPacked(efTrack[bxTh][sectorTh][wheelTh][muonTh]);
433  }
434 
435  return;
436 }
437 
438 // access data
440  return phiSegments;
441 }
442 
444  return theSegments;
445 }
446 
448  return dtTracks;
449 }
450 
452  phiSegments.clear();
453  theSegments.clear();
454  dtTracks.clear();
455 
456  for(int i=0; i<3; i++){
457  for(int j=0; j<12; j++){
458  for(int k=0; k<6; k++){
459  for(int l=0; l<2; l++){
460  etTrack[i][j][k][l] = 0;
461  efTrack[i][j][k][l] = 0;
462  }
463  }
464  }
465  }
466 
467  return;
468 }
469 
470 int DTTFFEDReader::channel( int wheel, int sector, int bx ){
471 
472  // wheel : -3 -2 -1 +1 +2 +3 <=> PHTF's : N2, N1, N0, P0, P1, P2
473  // 0 <=> ETTF
474  // sector : 0 -> 11
475  // bx : -1 -> +1
476 
477  int myChannel = 255;
478 
479  if ( abs(bx) > 1) { return myChannel; }
480  if ( sector < 0 || sector > 11) { return myChannel; }
481  if ( abs(wheel) > 3) { return myChannel; }
482 
483  myChannel = sector*21 + wheel*3 - bx + 10 ;
484 
485  if (myChannel > 125) myChannel += 2;
486 
487  return myChannel;
488 }
489 
490 int DTTFFEDReader::bxNr( int channel ){
491 
492  int myChannel = channel;
493 
494  if (myChannel > 127) myChannel -= 2;
495 
496  if (myChannel < 0 || myChannel > 251 ){ return -999; }
497 
498  int myBx = 1-(myChannel%3);
499 
500  return myBx;
501 }
502 
503 int DTTFFEDReader::sector( int channel ){
504 
505  int myChannel = channel;
506 
507  if (myChannel > 127) myChannel -= 2;
508 
509  if (myChannel < 0 || myChannel > 251 ){ return -999; }
510 
511  return myChannel/21;
512 }
513 
514 int DTTFFEDReader::wheel( int channel ){
515 
516  int myChannel = channel;
517 
518  if (myChannel > 127) myChannel -= 2;
519 
520  if (myChannel < 0 || myChannel > 251 ){ return -999; }
521 
522  int myWheel = ((myChannel%21)/3)-3;
523 
524  return myWheel;
525 }
526 
527 void DTTFFEDReader::calcCRC(int myD1, int myD2, int &myC){
528 
529  int myCRC[16],D[64],C[16];
530 
531  for( int i=0; i < 32; i++ ){ D[i]=(myD2>>i)&0x1; }
532  for( int i=0; i < 32; i++ ){ D[i+32]=(myD1>>i)&0x1; }
533  for( int i=0; i < 16; i++ ){ C[i]=(myC>>i)&0x1; }
534 
535  myCRC[0] = ( D[63] + D[62] + D[61] + D[60] + D[55] + D[54] +
536  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
537  D[47] + D[46] + D[45] + D[43] + D[41] + D[40] +
538  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
539  D[33] + D[32] + D[31] + D[30] + D[27] + D[26] +
540  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
541  D[19] + D[18] + D[17] + D[16] + D[15] + D[13] +
542  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
543  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
544  D[0] + C[0] + C[1] + C[2] + C[3] + C[4] +
545  C[5] + C[6] + C[7] + C[12] + C[13] + C[14] +
546  C[15] )%2;
547 
548  myCRC[1] = ( D[63] + D[62] + D[61] + D[56] + D[55] + D[54] +
549  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
550  D[47] + D[46] + D[44] + D[42] + D[41] + D[40] +
551  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
552  D[33] + D[32] + D[31] + D[28] + D[27] + D[26] +
553  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
554  D[19] + D[18] + D[17] + D[16] + D[14] + D[13] +
555  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
556  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
557  C[0] + C[1] + C[2] + C[3] + C[4] + C[5] +
558  C[6] + C[7] + C[8] + C[13] + C[14] + C[15] )%2;
559 
560  myCRC[2] = ( D[61] + D[60] + D[57] + D[56] + D[46] + D[42] +
561  D[31] + D[30] + D[29] + D[28] + D[16] + D[14] +
562  D[1] + D[0] + C[8] + C[9] + C[12] + C[13] )%2;
563 
564  myCRC[3] = ( D[62] + D[61] + D[58] + D[57] + D[47] + D[43] +
565  D[32] + D[31] + D[30] + D[29] + D[17] + D[15] +
566  D[2] + D[1] + C[9] + C[10] + C[13] + C[14] )%2;
567 
568  myCRC[4] = ( D[63] + D[62] + D[59] + D[58] + D[48] + D[44] +
569  D[33] + D[32] + D[31] + D[30] + D[18] + D[16] +
570  D[3] + D[2] + C[0] + C[10] + C[11] + C[14] +
571  C[15] )%2;
572 
573  myCRC[5] = ( D[63] + D[60] + D[59] + D[49] + D[45] + D[34] +
574  D[33] + D[32] + D[31] + D[19] + D[17] + D[4] +
575  D[3] + C[1] + C[11] + C[12] + C[15] )%2;
576 
577  myCRC[6] = ( D[61] + D[60] + D[50] + D[46] + D[35] + D[34] +
578  D[33] + D[32] + D[20] + D[18] + D[5] + D[4] +
579  C[2] + C[12] + C[13] )%2;
580 
581  myCRC[7] = ( D[62] + D[61] + D[51] + D[47] + D[36] + D[35] +
582  D[34] + D[33] + D[21] + D[19] + D[6] + D[5] +
583  C[3] + C[13] + C[14] )%2;
584 
585  myCRC[8] = ( D[63] + D[62] + D[52] + D[48] + D[37] + D[36] +
586  D[35] + D[34] + D[22] + D[20] + D[7] + D[6] +
587  C[0] + C[4] + C[14] + C[15] )%2;
588 
589  myCRC[9] = ( D[63] + D[53] + D[49] + D[38] + D[37] + D[36] +
590  D[35] + D[23] + D[21] + D[8] + D[7] + C[1] +
591  C[5] + C[15] )%2;
592 
593  myCRC[10] = ( D[54] + D[50] + D[39] + D[38] + D[37] + D[36] +
594  D[24] + D[22] + D[9] + D[8] + C[2] + C[6] )%2;
595 
596  myCRC[11] = ( D[55] + D[51] + D[40] + D[39] + D[38] + D[37] +
597  D[25] + D[23] + D[10] + D[9] + C[3] + C[7] )%2;
598 
599  myCRC[12] = ( D[56] + D[52] + D[41] + D[40] + D[39] + D[38] +
600  D[26] + D[24] + D[11] + D[10] + C[4] + C[8] )%2;
601 
602  myCRC[13] = ( D[57] + D[53] + D[42] + D[41] + D[40] + D[39] +
603  D[27] + D[25] + D[12] + D[11] + C[5] + C[9] )%2;
604 
605  myCRC[14] = ( D[58] + D[54] + D[43] + D[42] + D[41] + D[40] +
606  D[28] + D[26] + D[13] + D[12] + C[6] + C[10] )%2;
607 
608  myCRC[15] = ( D[63] + D[62] + D[61] + D[60] + D[59] + D[54] +
609  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
610  D[47] + D[46] + D[45] + D[44] + D[42] + D[40] +
611  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
612  D[33] + D[32] + D[31] + D[30] + D[29] + D[26] +
613  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
614  D[19] + D[18] + D[17] + D[16] + D[15] + D[14] +
615  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
616  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
617  D[0] + C[0] + C[1] + C[2] + C[3] + C[4] +
618  C[5] + C[6] + C[11] + C[12] + C[13] + C[14] +
619  C[15] )%2;
620 
621  int tempC = 0x0;
622  for(int i=0; i<16 ; i++){ tempC = tempC + (myCRC[i]<<i); }
623  myC = tempC ;
624  return;
625 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void produce(edm::Event &e, const edm::EventSetup &c)
Produce digis out of raw data.
#define abs(x)
Definition: mlp_lapack.h:159
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
const L1MuDTChambThContainer::The_Container & t_data()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
virtual ~DTTFFEDReader()
Destructor.
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:168
DTTFFEDReader(const edm::ParameterSet &pset)
Constructor.
std::vector< L1MuDTTrackCand > TrackContainer
int j
Definition: DBlmapReader.cc:9
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
int k[5][pyjets_maxn]
TrackContainer::iterator TrackIterator
void process(edm::Event &e)
static const int muonID
Definition: TopGenEvent.h:20
void calcCRC(int myD1, int myD2, int &myC)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const L1MuDTTrackContainer::TrackContainer & k_data()
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
int channel(int wheel, int sector, int bx)
void analyse(edm::Event &e)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
int wheel(int channel)
bool fillRawData(edm::Event &e, L1MuDTChambPhContainer::Phi_Container &phi_data, L1MuDTChambThContainer::The_Container &the_data, L1MuDTTrackContainer::TrackContainer &tra_data)
Generate and fill FED raw data for a full event.
const L1MuDTChambPhContainer::Phi_Container & p_data()
tuple process
Definition: LaserDQM_cfg.py:3
int bxNr(int channel)
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
int sector(int channel)
Definition: DDAxes.h:10