CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCEventData.cc
Go to the documentation of this file.
6 #include <iostream>
7 #include <iterator>
10 
11 
12 bool CSCEventData::debug = false;
13 
14 CSCEventData::CSCEventData(int chamberType) :
15  theDMBHeader(),
16  theALCTHeader(0),
17  theAnodeData(0),
18  theALCTTrailer(0),
19  theTMBData(0),
20  theDMBTrailer(),
21  theChamberType(chamberType),
22  alctZSErecovered(0),
23  zseEnable(0)
24 {
25 
26  for(unsigned i = 0; i < 5; ++i) {
27  theCFEBData[i] = 0;
28  }
29 }
30 
31 
32 CSCEventData::CSCEventData(unsigned short * buf){
33  unpack_data(buf);
34 }
35 
36 
37 void CSCEventData::unpack_data(unsigned short * buf)
38 {
39  // zero everything
40  init();
41  unsigned short * pos = buf;
42  if(debug) {
43  LogTrace ("CSCEventData|CSCRawToDigi") << "The event data ";
44  for(int i = 0; i < 16; ++i){
45  LogTrace ("CSCEventData|CSCRawToDigi") << std::hex << pos[i ] << " ";
46  }
47  }
48 
50  if(!(theDMBHeader.check())) {
51  LogTrace ("CSCEventData|CSCRawToDigi") << "Bad DMB Header??? " << " first four words: ";
52  for(int i = 0; i < 4; ++i){
53  LogTrace ("CSCEventData|CSCRawToDigi") << std::hex << pos[i ] << " ";
54  }
55  }
56 
57 
58  if (debug) {
59  LogTrace ("CSCEventData|CSCRawToDigi") << "nalct = " << nalct();
60  LogTrace ("CSCEventData|CSCRawToDigi") << "nclct = " << nclct();
61  }
62 
63  if (debug) {
64  LogTrace ("CSCEventData|CSCRawToDigi") << "size in words of DMBHeader" << theDMBHeader.sizeInWords();
65  LogTrace ("CSCEventData|CSCRawToDigi") << "sizeof(DMBHeader)" << sizeof(theDMBHeader);
66  }
67 
68  pos += theDMBHeader.sizeInWords();
69 
70  if (nalct() ==1) {
71  if (isALCT(pos)) {//checking for ALCTData
72  theALCTHeader = new CSCALCTHeader( pos );
73  if(!theALCTHeader->check()){
74  LogTrace ("CSCEventData|CSCRawToDigi") <<"+++WARNING: Corrupt ALCT data - won't attempt to decode";
75  }
76  else {
77  //dataPresent|=0x40;
78  pos += theALCTHeader->sizeInWords(); //size of the header
79  //fill ALCT Digis
81 
82  //theAnodeData = new CSCAnodeData(*theALCTHeader, pos);
83 
84 
86  /*
87  std::cout << " ****The ALCT information from CSCEventData.cc (begin)**** " << std::endl; ///to_rm
88  std::cout << " alctHeader2007().size: " << theALCTHeader->alctHeader2007().sizeInWords() << std::endl; ///to_rm
89  std::cout << " ALCT Header Content: " << std::endl; ///to_rm
91  for(int k=0; k<theALCTHeader->sizeInWords(); k+=4){
92  std::cout << std::hex << theALCTHeader->data()[k+3]
93  << " " << theALCTHeader->data()[k+2]
94  << " " << theALCTHeader->data()[k+1]
95  << " " << theALCTHeader->data()[k] << std::dec << std::endl;
96  }
97  */
98  //std::cout << " ALCT Size: " << theAnodeData->sizeInWords() << std::endl;
100  // int zseEnable = 0;
101  zseEnable = (theALCTHeader->data()[5] & 0x1000) >> 12;
102  //std::cout << " ZSE Bit: " << zseEnable << std::endl; /// to_rm
103  int sizeInWord_ZSE =0;
104 
105  //alctZSErecovered = new unsigned short [theAnodeData->sizeInWords()];
106 
107  if(zseEnable){
110  int nWGs_per_layer = ( (theALCTHeader->data()[6]&0x0007) + 1 ) * 16 ;
112  int nWG_round_up = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
113  //std::cout << " Words per layer: " << nWG_round_up << std::endl; ///to_rm
114  unsigned short * posZSE = pos;
115  std::vector<unsigned short> alctZSErecoveredVector;
116  alctZSErecoveredVector.clear();
117 
118  //alctZSErecovered = new unsigned short [theAnodeData->sizeInWords()];
119  //delete [] alctZSErecovered;
120  //std::cout << " ALCT Buffer with ZSE: " << std::endl; ///to_rm
124  //unsigned short * posZSEdebug = pos; ///to_rm
125 
127  /*
128  while (*posZSEdebug != 0xDE0D){
129  unsigned short d = *posZSEdebug;
130  unsigned short c = *(posZSEdebug+1);
131  unsigned short b = *(posZSEdebug+2);
132  unsigned short a = *(posZSEdebug+3);
133  posZSEdebug+=4;
134  std::cout << std::hex << a << " " << b << " " << c << " " << d << std::dec << std::endl;
135  }
136  */
138 
140  int alctZSErecoveredPos=0;
141  while (*posZSE != 0xDE0D){
142  if( (*posZSE == 0x1000) && (*posZSE != 0x3000)){
143  for(int j=0; j<nWG_round_up; j++){
144  alctZSErecoveredVector.push_back(0x0000);
145  }
146  alctZSErecoveredPos+=nWG_round_up;
147  }
148  else {
149  alctZSErecoveredVector.push_back(*posZSE);
150  ++alctZSErecoveredPos;
151  }
152  posZSE++;
153  sizeInWord_ZSE++;
154  }
155 
156  alctZSErecovered = new unsigned short [alctZSErecoveredVector.size()];
157 
159  for(int l=0; l<(int)alctZSErecoveredVector.size(); l++){
160  alctZSErecovered[l]=alctZSErecoveredVector[l];
161  }
162 
163  unsigned short *posRecovered = alctZSErecovered;
164  theAnodeData = new CSCAnodeData(*theALCTHeader, posRecovered);
165 
168  /*
169  std::cout << " The ALCT payload recovered: " << std::endl;
170  for(int k=0; k<theAnodeData->sizeInWords(); k+=4){
171  std::cout << std::hex << alctZSErecovered[k+3] << " "
172  << alctZSErecovered[k+2] << " "
173  << alctZSErecovered[k+1] << " "
174  << alctZSErecovered[k] << std::dec << std::endl;
175  }
176  */
177  //delete [] alctZSErecovered;
178  //std::cout << " ALCT SizeZSE : " << sizeInWord_ZSE << std::endl; ///to_rm
179  //std::cout << " ALCT SizeZSE Recovered: " << alctZSErecoveredPos << std::endl; ///to_rm
180  //std::cout << " ALCT Size Expected: " << theAnodeData->sizeInWords() << std::endl; ///to_rm
181  pos +=sizeInWord_ZSE;
182  }
183  else{
184  //pos +=sizeInWord_ZSE;
186  pos += theAnodeData->sizeInWords(); // size of the data is determined during unpacking
187  }
188  //std::cout << " ****The ALCT information from CSCEventData.cc (end)**** " << std::endl; ///to_rm
189  theALCTTrailer = new CSCALCTTrailer( pos );
190  pos += theALCTTrailer->sizeInWords();
191  }
192  }
193  else {
194  LogTrace ("CSCEventData|CSCRawToDigi") << "Error:nalct reported but no ALCT data found!!!";
195  }
196  }
197 
198  if (nclct() ==1) {
199  if (isTMB(pos)) {
200  //dataPresent|=0x20;
201  theTMBData = new CSCTMBData(pos); //fill all TMB data
202  pos += theTMBData->size();
203  }
204  else {
205  LogTrace ("CSCEventData|CSCRawToDigi") << "Error:nclct reported but no TMB data found!!!";
206  }
207  }
208 
209  //now let's try to find and unpack the DMBTrailer
210  bool dmbTrailerReached= false;
211  for (int i=0; i<12000; ++i) {//8000 max for cfeb + 1980ALCT + 287 TMB
212  dmbTrailerReached =
213  (*(i+pos) & 0xF000) == 0xF000 && (*(i+pos+1) & 0xF000) == 0xF000
214  && (*(i+pos+2) & 0xF000) == 0xF000 && (*(i+pos+3) & 0xF000) == 0xF000
215  && (*(i+pos+4) & 0xF000) == 0xE000 && (*(i+pos+5) & 0xF000) == 0xE000
216  && (*(i+pos+6) & 0xF000) == 0xE000 && (*(i+pos+7) & 0xF000) == 0xE000;
217  if (dmbTrailerReached) {
218  theDMBTrailer = *( (CSCDMBTrailer *) (pos+i) );
219  break;
220  }
221  }
222  if (dmbTrailerReached) {
223  for(int icfeb = 0; icfeb < 5; ++icfeb) {
224  theCFEBData[icfeb] = 0;
225  int cfeb_available = theDMBHeader.cfebAvailable(icfeb);
226  unsigned int cfebTimeout = theDMBTrailer.cfeb_starttimeout | theDMBTrailer.cfeb_endtimeout;
227  //cfeb_available cannot be trusted - need additional verification!
228  if ( cfeb_available==1 ) {
229  if ((cfebTimeout >> icfeb) & 1) {
230  if (debug) LogTrace ("CSCEventData|CSCRawToDigi") << "CFEB Timed out! ";
231  } else {
232  //dataPresent|=(0x1>>icfeb);
233  // Fill CFEB data and convert it into cathode digis
234  theCFEBData[icfeb] = new CSCCFEBData(icfeb, pos);
235  pos += theCFEBData[icfeb]->sizeInWords();
236  }
237  }
238  }
239  pos += theDMBTrailer.sizeInWords();
240  size_ = pos-buf;
241  }
242  else {
243  LogTrace ("CSCEventData|CSCRawToDigi") << "Critical Error: DMB Trailer was not found!!! ";
244  }
245 }
246 
247 bool CSCEventData::isALCT(const short unsigned int * buf) {
248  return (((buf[0]&0xFFFF)==0xDB0A)||(((buf[0]&0xF800)==0x6000)&&((buf[1]&0xF800)==0)));
249 }
250 
251 bool CSCEventData::isTMB(const short unsigned int * buf) {
252  return ((buf[0]&0xFFF)==0xB0C);
253 }
254 
255 
256 
258  copy(data);
259 }
260 
262  destroy();
263 }
264 
265 
267  // check for self-assignment before destructing
268  if(&data != this) destroy();
269  copy(data);
270  return *this;
271 }
272 
273 
275  //dataPresent = 0;
276  theALCTHeader = 0;
277  theAnodeData = 0;
278  theALCTTrailer = 0;
279  theTMBData = 0;
280  for(int icfeb = 0; icfeb < 5; ++icfeb) {
281  theCFEBData[icfeb] = 0;
282  }
284  zseEnable=0;
285 }
286 
287 
289  init();
290  theDMBHeader = data.theDMBHeader;
292  if(data.theALCTHeader != NULL)
294  if(data.theAnodeData != NULL)
295  theAnodeData = new CSCAnodeData(*(data.theAnodeData));
296  if(data.theALCTTrailer != NULL)
298  if(data.theTMBData != NULL)
299  theTMBData = new CSCTMBData(*(data.theTMBData));
300  for(int icfeb = 0; icfeb < 5; ++icfeb) {
301  theCFEBData[icfeb] = 0;
302  if(data.theCFEBData[icfeb] != NULL)
303  theCFEBData[icfeb] = new CSCCFEBData(*(data.theCFEBData[icfeb]));
304  }
305  size_ = data.size_;
307 
308 }
309 
310 
312  if(zseEnable){
313  delete [] alctZSErecovered;
314  }
315  delete theALCTHeader;
316  delete theAnodeData;
317  delete theALCTTrailer;
318  delete theTMBData;
319  for(int icfeb = 0; icfeb < 5; ++icfeb) {
320  delete theCFEBData[icfeb];
321  }
322 /*
323  std::cout << "Before delete alctZSErecovered " << std::endl;
324  delete [] alctZSErecovered;
325  std::cout << "After delete alctZSErecovered " << std::endl;
326 */
327 }
328 
329 
330 std::vector<CSCStripDigi> CSCEventData::stripDigis(const CSCDetId & idlayer) const {
331  std::vector<CSCStripDigi> result;
332  for(unsigned icfeb = 0; icfeb < 5; ++icfeb){
333  std::vector<CSCStripDigi> newDigis = stripDigis(idlayer, icfeb);
334  result.insert(result.end(), newDigis.begin(), newDigis.end());
335  }
336  return result;
337 }
338 
339 
340 std::vector<CSCStripDigi> CSCEventData::stripDigis(unsigned idlayer, unsigned icfeb) const {
341  // assert(ilayer > 0 && ilayer <= 6); // off because now idlayer is raw cscdetid
342  std::vector<CSCStripDigi> result;
343  if(theCFEBData[icfeb] != NULL) {
344  std::vector<CSCStripDigi> newDigis = theCFEBData[icfeb]->digis(idlayer);
345  result.insert(result.end(), newDigis.begin(), newDigis.end());
346  }
347 
348  return result;
349 }
350 
351 
352 std::vector<CSCWireDigi> CSCEventData::wireDigis(unsigned ilayer) const {
353  if(theAnodeData == 0) {
354  return std::vector<CSCWireDigi>();
355  }
356  else {
357  return theAnodeData->wireDigis(ilayer);
358  }
359 }
360 
361 
362 std::vector < std::vector<CSCStripDigi> > CSCEventData::stripDigis() const {
363  std::vector < std::vector<CSCStripDigi> > result;
364  for (int layer = 1; layer <= 6; ++layer) {
365  std::vector<CSCStripDigi> digis = stripDigis(layer);
366  result.push_back(digis);
367  }
368  return result;
369 }
370 
371 std::vector < std::vector<CSCWireDigi> > CSCEventData::wireDigis() const {
372  std::vector < std::vector<CSCWireDigi> > result;
373  for (int layer = 1; layer <= 6; ++layer) {
374  result.push_back(wireDigis(layer));
375  }
376  return result;
377 }
378 
379 
380 CSCCFEBData* CSCEventData::cfebData(unsigned icfeb) const {
381  return theCFEBData[icfeb];
382 }
383 
384 
386  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
387  return theALCTHeader;
388 }
389 
391  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
392  return theALCTTrailer;
393 }
394 
395 
397  if(nalct() == 0) throw cms::Exception("No ALCT for this chamber");
398  return theAnodeData;
399 }
400 
402  if(nclct() == 0) throw cms::Exception("No CLCT for this chamber");
403  return theTMBData;
404 }
405 
406 
408  if((nclct() == 0)||(tmbData()==NULL)) throw cms::Exception("No CLCT header for this chamber");
409  return tmbData()->tmbHeader();
410 }
411 
413  if((nclct() == 0)||(tmbData()==NULL)) throw cms::Exception("No CLCT data for this chamber");
414  return tmbData()->clctData();
415 }
416 
417 
418 void CSCEventData::setEventInformation(int bxnum, int lvl1num) {
419  theDMBHeader.setBXN(bxnum);
420  theDMBHeader.setL1A(lvl1num);
421  if(theALCTHeader) {
423  }
424  if(theTMBData) {
426  }
427 }
428 
429 
431  if(theAnodeData == NULL)
432  {
433  assert(theChamberType>0);
439  // set data available flag
441  }
442 }
443 
444 
446 {
447  if(theTMBData == NULL) {
448  theTMBData = new CSCTMBData();
451  }
452 }
453 
454 
455 void CSCEventData::add(const CSCStripDigi & digi, int layer) {
456  //@@ need special logic here for ME11
457  unsigned cfeb = (digi.getStrip()-1)/16;
458  bool sixteenSamples = false;
459  if (digi.getADCCounts().size()==16) sixteenSamples = true;
460  if(theCFEBData[cfeb] == 0) {
461  theCFEBData[cfeb] = new CSCCFEBData(cfeb, sixteenSamples);
462  theDMBHeader.addCFEB(cfeb);
463  }
464  theCFEBData[cfeb]->add(digi, layer);
465 }
466 
467 
468 void CSCEventData::add(const CSCWireDigi & digi, int layer) {
470  theAnodeData->add(digi, layer);
472 }
473 
474 void CSCEventData::add(const CSCComparatorDigi & digi, int layer) {
475  checkTMBClasses();
476  theTMBData->clctData()->add(digi, layer);
477 }
478 
479 
480 
481 void CSCEventData::add(const std::vector<CSCALCTDigi> & digis) {
483  theALCTHeader->add(digis);
484 }
485 
486 
487 void CSCEventData::add(const std::vector<CSCCLCTDigi> & digis) {
488  checkTMBClasses();
489  theTMBData->tmbHeader()->add(digis);
490 }
491 
492 void CSCEventData::add(const std::vector<CSCCorrelatedLCTDigi> & digis) {
493  checkTMBClasses();
494  theTMBData->tmbHeader()->add(digis);
495 }
496 
497 
498 
499 
500 std::ostream & operator<<(std::ostream & os, const CSCEventData & evt) {
501  for(int ilayer = 1; ilayer <= 6; ++ilayer) {
502  std::vector<CSCStripDigi> stripDigis = evt.stripDigis(ilayer);
503  //copy(stripDigis.begin(), stripDigis.end(), std::ostream_iterator<CSCStripDigi>(os, "\n"));
504  //print your scas here
505  std::vector<CSCWireDigi> wireDigis = evt.wireDigis(ilayer);
506  //copy(wireDigis.begin(), wireDigis.end(), std::ostream_iterator<CSCWireDigi>(os, "\n"));
507  }
508  return os;
509 }
510 
511 boost::dynamic_bitset<> CSCEventData::pack() {
512  boost::dynamic_bitset<> result = bitset_utilities::ushortToBitset( theDMBHeader.sizeInWords()*16,
513  theDMBHeader.data());
514 
515  if(theALCTHeader != NULL) {
516  boost::dynamic_bitset<> alctHeader = theALCTHeader->pack();
517  result = bitset_utilities::append(result, alctHeader);
518  }
519  if(theAnodeData != NULL) {
520  boost::dynamic_bitset<> anodeData = bitset_utilities::ushortToBitset (theAnodeData->sizeInWords()*16,
521  theAnodeData->data());
522  result = bitset_utilities::append(result, anodeData);
523  }
524  if(theALCTTrailer != NULL) {
526  theALCTTrailer->data());
527  result = bitset_utilities::append(result, alctTrailer);
528  }
529  if(theTMBData != NULL) {
530  result = bitset_utilities::append(result, theTMBData->pack());
531  }
532 
533  for(int icfeb = 0; icfeb < 5; ++icfeb) {
534  if(theCFEBData[icfeb] != NULL){
535  boost::dynamic_bitset<> cfebData = bitset_utilities::ushortToBitset(theCFEBData[icfeb]->sizeInWords()*16,
536  theCFEBData[icfeb]->data());
537  result = bitset_utilities::append(result, cfebData);
538  }
539  }
540 
542  theDMBTrailer.data());
543  result = bitset_utilities::append(result, dmbTrailer);
544  return result;
545 }
546 
547 
549  CSCEventData chamberData(5);
550  CSCDetId detId(1, 3, 2, 1, 3);
551  std::vector<CSCCLCTDigi> clctDigis;
552  // Both CLCTs are read-out at the same (pre-trigger) bx, so the last-but-one
553  // arguments in both digis must be the same.
554  clctDigis.push_back(CSCCLCTDigi(1, 1, 4, 1, 0, 30, 3, 2, 1)); // valid for 2007
555  clctDigis.push_back(CSCCLCTDigi(1, 1, 2, 1, 1, 31, 1, 2, 2));
556 
557  // BX of LCT (8th argument) is 1-bit word (the least-significant bit
558  // of ALCT's bx).
559  std::vector<CSCCorrelatedLCTDigi> corrDigis;
560  corrDigis.push_back(CSCCorrelatedLCTDigi(1, 1, 2, 10, 98, 5, 0, 1, 0, 0, 0, 0));
561  corrDigis.push_back(CSCCorrelatedLCTDigi(2, 1, 2, 20, 15, 9, 1, 0, 0, 0, 0, 0));
562 
563  chamberData.add(clctDigis);
564  chamberData.add(corrDigis);
565 
566  CSCWireDigi wireDigi(10, 6);
567  CSCComparatorDigi comparatorDigi(30, 1, 6);
568  chamberData.add(wireDigi, 3);
569  chamberData.add(comparatorDigi, 3);
570 
571  CSCEventData newData = cscPackAndUnpack(chamberData);
572 
573  std::vector<CSCCLCTDigi> clcts = newData.tmbHeader()->CLCTDigis(detId.rawId());
574  assert(cscPackerCompare(clcts[0],clctDigis[0]));
575  assert(cscPackerCompare(clcts[1],clctDigis[1]));
576 
577  std::vector<CSCCorrelatedLCTDigi> lcts = newData.tmbHeader()->CorrelatedLCTDigis(detId.rawId());
578  assert(cscPackerCompare(lcts[0], corrDigis[0]));
579  assert(cscPackerCompare(lcts[1], corrDigis[1]));
580 
581  // test strip digis
582  CSCDetId me1adet1(1, 1, 1, 4, 1);
583  CSCDetId me1bdet1(1, 1, 4, 4, 6);
584  CSCDetId me1adet2(2, 1, 1, 4, 2);
585  CSCDetId me1bdet2(2, 1, 4, 4, 5);
586 
587  std::vector<int> sca(16, 600);
588  std::vector<unsigned short> overflow(16, 0), overlap(16, 0), errorfl(16,0);
589  CSCStripDigi me1a(5, sca, overflow, overlap, errorfl);
590  CSCStripDigi me1b(8, sca, overflow, overlap, errorfl);
591 
592  CSCEventData forward(1);
593  CSCEventData backward(1);
594 
595  forward.add(me1a, me1adet1.layer());
596  forward.add(me1b, me1bdet1.layer());
597  backward.add(me1a, me1adet2.layer());
598  backward.add(me1b, me1adet2.layer());
599  std::vector<CSCStripDigi> me1afs = forward.stripDigis(me1adet1);
600  std::vector<CSCStripDigi> me1bfs = forward.stripDigis(me1bdet1);
601  std::vector<CSCStripDigi> me1abs = backward.stripDigis(me1adet2);
602  std::vector<CSCStripDigi> me1bbs = backward.stripDigis(me1bdet2);
603  //FIXME The current code works under the assumption that ME11 and ME1A
604  // go into separate EventData. They need to be combined.
605  assert(me1afs.size() == 16);
606  assert(me1bfs.size() == 16);
607  assert(me1abs.size() == 16);
608  assert(me1bbs.size() == 16);
609 
610  assert(me1afs[4].getStrip() == 5);
611  assert(me1bfs[7].getStrip() == 8);
612  assert(me1abs[4].getStrip() == 5);
613  assert(me1bbs[7].getStrip() == 8);
614  assert(me1afs[4].pedestal() == 600);
615  assert(me1bfs[7].pedestal() == 600);
616  assert(me1abs[4].pedestal() == 600);
617  assert(me1bbs[7].pedestal() == 600);
618 
619 
620 }
void setEventInformation(const CSCDMBHeader &dmbHeader)
fills fields like bxn and l1a
Definition: CSCTMBHeader.h:28
void setEventInformation(int bxnum, int lvl1num)
CSCCLCTData * clctData()
Definition: CSCTMBData.h:39
int i
Definition: DBlmapReader.cc:9
bool isALCT(const short unsigned int *buf)
if dealing with ALCT data
bool check() const
unsigned short int sizeInWords() const
the amount of the input binary buffer read, in 16-bit words
Definition: CSCAnodeData.h:21
unsigned short * alctZSErecovered
Auxiliary bufer to recove the ALCT raw payload from zero suppression.
Definition: CSCEventData.h:178
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:87
std::vector< std::vector< CSCStripDigi > > stripDigis() const
deprecated. Use the above methods instead
void checkALCTClasses()
makes new ALCT classes, if needed
std::vector< std::vector< CSCWireDigi > > wireDigis() const
deprecated. Use the above method instead.
boost::dynamic_bitset pack()
not const because it sets size int TMBTrailer
Definition: CSCTMBData.cc:406
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:41
const CSCDMBTrailer * dmbTrailer() const
DMB trailer.
Definition: CSCEventData.h:112
void digis(uint32_t idlayer, std::vector< CSCStripDigi > &result)
faster way to get to digis
Definition: CSCCFEBData.cc:202
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
const unsigned short size() const
Definition: CSCTMBData.h:36
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
Definition: CSCTMBHeader.h:86
void checkTMBClasses()
makes new TMB classes, if needed
void add(const CSCStripDigi &, int layer)
Definition: CSCCFEBData.cc:80
#define NULL
Definition: scimark2.h:8
void setL1A(int l1a)
Definition: CSCDMBHeader.cc:80
bool check() const
void add(const std::vector< CSCCLCTDigi > &digis)
these methods need more brains to figure which one goes first
Definition: CSCTMBHeader.cc:99
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
int layer() const
Definition: CSCDetId.h:63
CSCAnodeData * alctData() const
user must check if nalct &gt; 0
void setEventInformation(const CSCDMBHeader &)
std::vector< CSCWireDigi > wireDigis(unsigned ilayer) const
CSCALCTHeader * alctHeader() const
user must check if nalct &gt; 0
void setBXN(int bxn)
Definition: CSCDMBHeader.cc:85
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:84
int getStrip() const
Definition: CSCStripDigi.h:39
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
static int sizeInWords()
in 16-bit frames
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
CSCDMBHeader theDMBHeader
Definition: CSCEventData.h:157
CSCCLCTData * clctData() const
user must check if nclct &gt; 0
unsigned short * data()
Definition: CSCDMBTrailer.h:25
CSCTMBData * theTMBData
Definition: CSCEventData.h:165
static bool debug
Definition: CSCEventData.h:137
CSCALCTTrailer * alctTrailer() const
user must check if nalct &gt; 0
CSCALCTHeader * theALCTHeader
Definition: CSCEventData.h:162
std::vector< CSCStripDigi > stripDigis(const CSCDetId &idlayer) const
returns all the strip digis in the chamber, with the comparator information.
unsigned cfeb_starttimeout
Definition: CSCDMBTrailer.h:45
tuple result
Definition: query.py:137
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
void add(const CSCWireDigi &wireDigi, int layer)
Definition: CSCAnodeData.h:27
int j
Definition: DBlmapReader.cc:9
void add(const std::vector< CSCALCTDigi > &digis)
unsigned sizeInWords() const
Definition: CSCDMBHeader.cc:97
boost::dynamic_bitset pack()
void addCFEB(int icfeb)
CSCDMBTrailer theDMBTrailer
Definition: CSCEventData.h:170
unsigned short * data()
void unpack_data(unsigned short *buf)
Definition: CSCEventData.cc:37
#define LogTrace(id)
CSCEventData operator=(const CSCEventData &data)
int sizeInWords()
in 16-bit words
Definition: CSCALCTHeader.h:98
std::vector< CSCALCTDigi > ALCTDigis() const
CSCALCTTrailer * theALCTTrailer
Definition: CSCEventData.h:164
bool isTMB(const short unsigned int *buf)
if dealing with TMB data
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition: CSCTMBHeader.h:80
unsigned short * data()
Definition: CSCDMBHeader.h:48
unsigned short int alctFirmwareVersion() const
Definition: CSCALCTHeader.h:86
int getWireGroup() const
default
Definition: CSCWireDigi.h:24
void copy(const CSCEventData &)
std::vector< CSCWireDigi > wireDigis(int layer) const
input layer is from 1 to 6
Definition: CSCAnodeData.h:24
unsigned cfeb_endtimeout
Definition: CSCDMBTrailer.h:48
void add(const CSCComparatorDigi &digi, int layer)
TODO for packing. Doesn&#39;t do flipping yet.
Definition: CSCCLCTData.cc:183
unsigned sizeInWords() const
Definition: CSCCFEBData.h:47
unsigned short size() const
size of the data buffer used, in bytes
Definition: CSCEventData.h:49
bool cscPackerCompare(const T &t1, const T &t2)
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:38
CSCTMBHeader * tmbHeader() const
user must check if nclct &gt; 0
T cscPackAndUnpack(T &t)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
CSCCFEBData * cfebData(unsigned icfeb) const
unpacked in long mode: has overflow and error bits decoded
boost::dynamic_bitset ushortToBitset(const unsigned int numberOfBits, unsigned short *buf)
this method takes numberOfBits bits from unsigned short * array and returns them in the bitset obj...
boost::dynamic_bitset pack()
returns the packed event data.
void setDAVForChannel(int wireGroup)
Definition: CSCALCTHeader.h:87
unsigned short * data()
Definition: CSCAnodeData.h:19
static unsigned sizeInWords()
Definition: CSCDMBTrailer.h:75
bool cfebAvailable(unsigned icfeb)
counts from zero
CSCAnodeData * theAnodeData
Definition: CSCEventData.h:163
CSCCFEBData * theCFEBData[5]
for up to 5 CFEB boards
Definition: CSCEventData.h:168
unsigned short int * data()
Definition: CSCALCTHeader.h:95
static void selfTest()