test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDCCUnpacker.cc
Go to the documentation of this file.
2 
3 //Framework stuff
12 
13 //FEDRawData
16 
17 //Digi stuff
26 
48 
50 
68 
69 #include <iostream>
70 #include <sstream>
71 #include <string>
72 #include <iomanip>
73 #include <cstdio>
74 
76  numOfEvents(0)
77 {
78 
79  // Tracked
80  i_token = consumes<FEDRawDataCollection>( pset.getParameter<edm::InputTag>("InputObjects") );
81 
82  useExaminer = pset.getParameter<bool>("UseExaminer");
83  examinerMask = pset.getParameter<unsigned int>("ExaminerMask");
85  useSelectiveUnpacking = pset.getParameter<bool>("UseSelectiveUnpacking");
86  errorMask = pset.getParameter<unsigned int>("ErrorMask");
87  unpackStatusDigis = pset.getParameter<bool>("UnpackStatusDigis");
89  useFormatStatus = pset.getParameter<bool>("UseFormatStatus");
90 
91  // Untracked
92 
93  printEventNumber = pset.getUntrackedParameter<bool>("PrintEventNumber", true);
94  debug = pset.getUntrackedParameter<bool>("Debug", false);
95  instantiateDQM = pset.getUntrackedParameter<bool>("runDQM", false);
96 
98  visualFEDInspect = pset.getUntrackedParameter<bool>("VisualFEDInspect", false);
99  visualFEDShort = pset.getUntrackedParameter<bool>("VisualFEDShort", false);
100  formatedEventDump = pset.getUntrackedParameter<bool>("FormatedEventDump", false);
101 
103  SuppressZeroLCT = pset.getUntrackedParameter<bool>("SuppressZeroLCT", true);
104 
105 
106 
107  if (instantiateDQM)
108  {
110  }
111 
112  produces<CSCWireDigiCollection>("MuonCSCWireDigi");
113  produces<CSCStripDigiCollection>("MuonCSCStripDigi");
114  produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
115  produces<CSCALCTDigiCollection>("MuonCSCALCTDigi");
116  produces<CSCCLCTDigiCollection>("MuonCSCCLCTDigi");
117  produces<CSCRPCDigiCollection>("MuonCSCRPCDigi");
118  produces<CSCCorrelatedLCTDigiCollection>("MuonCSCCorrelatedLCTDigi");
119 
120  if (unpackStatusDigis)
121  {
122  produces<CSCCFEBStatusDigiCollection>("MuonCSCCFEBStatusDigi");
123  produces<CSCTMBStatusDigiCollection>("MuonCSCTMBStatusDigi");
124  produces<CSCDMBStatusDigiCollection>("MuonCSCDMBStatusDigi");
125  produces<CSCALCTStatusDigiCollection>("MuonCSCALCTStatusDigi");
126  produces<CSCDDUStatusDigiCollection>("MuonCSCDDUStatusDigi");
127  produces<CSCDCCStatusDigiCollection>("MuonCSCDCCStatusDigi");
128  }
129 
130  if (useFormatStatus)
131  {
132  produces<CSCDCCFormatStatusDigiCollection>("MuonCSCDCCFormatStatusDigi");
133  }
134  //CSCAnodeData::setDebug(debug);
136  CSCCLCTData::setDebug(debug);
137  CSCEventData::setDebug(debug);
138  CSCTMBData::setDebug(debug);
141  CSCTMBHeader::setDebug(debug);
142  CSCRPCData::setDebug(debug);
144 
145 }
146 
148 {
149  //fill destructor here
150 }
151 
154  desc.add<edm::InputTag>("InputObjects",edm::InputTag("rawDataCollector"))->setComment("# Define input to the unpacker");
155  desc.add<bool>("UseExaminer",true)->setComment("# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes");
156  desc.add<unsigned int>("ExaminerMask",535557110)->setComment("# This mask is needed by the examiner");
157  desc.add<bool>("UseSelectiveUnpacking",true)->setComment("# Use Examiner to unpack good chambers and skip only bad ones");
158  desc.add<unsigned int>("ErrorMask",0)->setComment("# This mask simply reduces error reporting");
159  desc.add<bool>("UnpackStatusDigis",false)->setComment("# Unpack general status digis?");
160  desc.add<bool>("UseFormatStatus",true)->setComment("# Unpack FormatStatus digi?");
161  desc.addUntracked<bool>("Debug",false)->setComment("# Turn on lots of output");
162  desc.addUntracked<bool>("PrintEventNumber",false);
163  desc.addUntracked<bool>("runDQM",false);
164  desc.addUntracked<bool>("VisualFEDInspect",false)->setComment("# Visualization of raw data in corrupted events");
165  desc.addUntracked<bool>("VisualFEDShort",false)->setComment("# Visualization of raw data in corrupted events");
166  desc.addUntracked<bool>("FormatedEventDump",false);
167  desc.addUntracked<bool>("SuppressZeroLCT",true);
168  descriptions.add("muonCSCDCCUnpacker",desc);
169  descriptions.setComment(" This is the generic cfi file for CSC unpacking");
170 }
171 
173 {
174 
176  // Do we really have to do this every event???
177  // ... Yes, because framework is more efficient than you are at caching :)
178  // (But if you want to actually DO something specific WHEN the mapping changes, check out ESWatcher)
180  c.get<CSCCrateMapRcd>().get(hcrate);
181  const CSCCrateMap* pcrate = hcrate.product();
182 
183  // Need access to CSCChamberMap for chamber<->FED/DDU mapping consistency checks
185  c.get<CSCChamberMapRcd>().get(cscmap);
186  const CSCChamberMap* cscmapping = cscmap.product();
187 
189 
192  e.getByToken( i_token, rawdata);
193 
195  std::auto_ptr<CSCWireDigiCollection> wireProduct(new CSCWireDigiCollection);
196  std::auto_ptr<CSCStripDigiCollection> stripProduct(new CSCStripDigiCollection);
197  std::auto_ptr<CSCALCTDigiCollection> alctProduct(new CSCALCTDigiCollection);
198  std::auto_ptr<CSCCLCTDigiCollection> clctProduct(new CSCCLCTDigiCollection);
199  std::auto_ptr<CSCComparatorDigiCollection> comparatorProduct(new CSCComparatorDigiCollection);
200  std::auto_ptr<CSCRPCDigiCollection> rpcProduct(new CSCRPCDigiCollection);
201  std::auto_ptr<CSCCorrelatedLCTDigiCollection> corrlctProduct(new CSCCorrelatedLCTDigiCollection);
202  std::auto_ptr<CSCCFEBStatusDigiCollection> cfebStatusProduct(new CSCCFEBStatusDigiCollection);
203  std::auto_ptr<CSCDMBStatusDigiCollection> dmbStatusProduct(new CSCDMBStatusDigiCollection);
204  std::auto_ptr<CSCTMBStatusDigiCollection> tmbStatusProduct(new CSCTMBStatusDigiCollection);
205  std::auto_ptr<CSCDDUStatusDigiCollection> dduStatusProduct(new CSCDDUStatusDigiCollection);
206  std::auto_ptr<CSCDCCStatusDigiCollection> dccStatusProduct(new CSCDCCStatusDigiCollection);
207  std::auto_ptr<CSCALCTStatusDigiCollection> alctStatusProduct(new CSCALCTStatusDigiCollection);
208 
209  std::auto_ptr<CSCDCCFormatStatusDigiCollection> formatStatusProduct(new CSCDCCFormatStatusDigiCollection);
210 
211 
212  // If set selective unpacking mode
213  // hardcoded examiner mask below to check for DCC and DDU level errors will be used first
214  // then examinerMask for CSC level errors will be used during unpacking of each CSC block
215  unsigned long dccBinCheckMask = 0x06080016;
216 
217  // Post-LS1 FED/DDU ID mapping fix
218  const unsigned postLS1_map [] = { 841, 842, 843, 844, 845, 846, 847, 848, 849,
219  831, 832, 833, 834, 835, 836, 837, 838, 839,
220  861, 862, 863, 864, 865, 866, 867, 868, 869,
221  851, 852, 853, 854, 855, 856, 857, 858, 859 };
222 
223 
224  // For new CSC readout layout, which wont include DCCs need to loop over DDU FED IDs. DCC IDs are included for backward compatibility with old data
225  std::vector<unsigned int> cscFEDids;
226 
227  for (unsigned int id=FEDNumbering::MINCSCFEDID;
228  id<=FEDNumbering::MAXCSCFEDID; ++id) // loop over DCCs
229  {
230  cscFEDids.push_back(id);
231  }
232 
233  for (unsigned int id=FEDNumbering::MINCSCDDUFEDID;
234  id<=FEDNumbering::MAXCSCDDUFEDID; ++id) // loop over DDUs
235  {
236  cscFEDids.push_back(id);
237  }
238 
239  for (unsigned int i=0; i<cscFEDids.size(); i++) // loop over all CSC FEDs (DCCs and DDUs)
240  {
241  unsigned int id = cscFEDids[i];
242  bool isDDU_FED = ((id >= FEDNumbering::MINCSCDDUFEDID) && (id <= FEDNumbering::MAXCSCDDUFEDID))?true:false;
243 
244 
247 
249  const FEDRawData& fedData = rawdata->FEDData(id);
250  unsigned long length = fedData.size();
251 
252 
253  if (length>=32)
254  {
255  CSCDCCExaminer* examiner = NULL;
256  goodEvent = true;
257  if (useExaminer)
258  {
259  // CSCDCCExaminer examiner;
260  examiner = new CSCDCCExaminer();
261  if ( examinerMask&0x40000 ) examiner->crcCFEB(1);
262  if ( examinerMask&0x8000 ) examiner->crcTMB (1);
263  if ( examinerMask&0x0400 ) examiner->crcALCT(1);
264  examiner->setMask(examinerMask);
265 
267  if ( isDDU_FED )
268  {
269  if (examiner != NULL) examiner->modeDDU(true);
270  }
271 
272  const short unsigned int *data = (short unsigned int *)fedData.data();
273 
274  LogTrace("badData") << "Length: "<< length/2;
275  // Event data hex dump
276  /*
277  short unsigned * buf = (short unsigned int *)fedData.data();
278  std::cout <<std::endl<<length/2<<" words of data:"<<std::endl;
279  for (short unsigned int i=0;i<length/2;i++) {
280  printf("%04x %04x %04x %04x\n",buf[i+3],buf[i+2],buf[i+1],buf[i]);
281  i+=3;
282  }
283  */
284 
285  int res = examiner->check(data,long(fedData.size()/2));
286  if ( res < 0 )
287  {
288  goodEvent=false;
289  }
290  else
291  {
292  if (useSelectiveUnpacking) goodEvent=!(examiner->errors()&dccBinCheckMask);
293  else goodEvent=!(examiner->errors()&examinerMask);
294  }
295 
296  /*
297  std::cout << "FED" << id << " " << fedData.size() << " " << goodEvent << " "
298  << std::hex << examiner->errors() << std::dec << " " << status << std::endl;
299  */
300 
301  // Fill Format status digis per FED
302  // Remove examiner->errors() != 0 check if we need to put status digis for every event
303  if (useFormatStatus && (examiner->errors() !=0))
304  // formatStatusProduct->insertDigi(CSCDetId(1,1,1,1,1), CSCDCCFormatStatusDigi(id,examiner,dccBinCheckMask));
305  formatStatusProduct->insertDigi(CSCDetId(1,1,1,1,1),
306  CSCDCCFormatStatusDigi(id,dccBinCheckMask,
307  examiner->getMask(),
308  examiner->errors(),
309  examiner->errorsDetailedDDU(),
310  examiner->errorsDetailed(),
311  examiner->payloadDetailed(),
312  examiner->statusDetailed()));
313  }
314 
317  {
319  {
320  short unsigned * buf = (short unsigned int *)fedData.data();
321  visual_raw(length/2, id,(int)e.id().run(),(int)e.id().event(),
323  }
324  }
325 
326  if (goodEvent)
327  {
329 
330 
331  CSCDCCExaminer * ptrExaminer = examiner;
332  if (!useSelectiveUnpacking) ptrExaminer = NULL;
333 
334 
335 
336  std::vector<CSCDDUEventData> fed_Data;
337  std::vector<CSCDDUEventData>* ptr_fedData = &fed_Data;
338 
340  CSCDetId layer(1, 1, 1, 1, 1);
341 
342  if (isDDU_FED) // Use new DDU FED readout mode
343  {
344 
345  CSCDDUEventData single_dduData((short unsigned int *) fedData.data(), ptrExaminer);
346  fed_Data.push_back(single_dduData);
347 
348 
349  // if(instantiateDQM) monitor->process(examiner, &single_dduData);
350 
351 
352  }
353  else // Use old DCC FED readout mode
354  {
355 
356  CSCDCCEventData dccData((short unsigned int *) fedData.data(), ptrExaminer);
357 
358  //std::cout << " DCC Size [UNPK] " << dccData.sizeInWords() << std::endl;
359 
360  if (instantiateDQM) monitor->process(examiner, &dccData);
361 
363  // const std::vector<CSCDDUEventData> & dduData = dccData.dduData();
364  // ptr_fedData = &(dccData.dduData());
365  fed_Data = dccData.dduData();
366 
367 
368  if (unpackStatusDigis)
369  {
370 
372  short unsigned * bufForDcc = (short unsigned int *)fedData.data();
373 
374  //std::cout << "FED Length: " << std::dec << length/2 <<
375  //" Trailer 2: " << std::hex << bufForDcc[length/2-4] << std::endl;
376 
377  dccStatusProduct->insertDigi(layer, CSCDCCStatusDigi(dccData.dccHeader().data(),
378  dccData.dccTrailer().data(),
379  examiner->errors(),
380  bufForDcc[length/2-4]));
381 
382  }
383  }
384 
385  const std::vector<CSCDDUEventData> & dduData = *ptr_fedData;
386 
387 
388  for (unsigned int iDDU=0; iDDU<dduData.size(); ++iDDU) // loop over DDUs
389  {
390 
391 
394  if (dduData[iDDU].trailer().errorstat()&errorMask)
395  {
396  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "FED ID" << id << " DDU# " << iDDU << " has serious error - no digis unpacked! " <<
397  std::hex << dduData[iDDU].trailer().errorstat();
398  continue; // to next iteration of DDU loop
399  }
400 
401  if (unpackStatusDigis) dduStatusProduct->
402  insertDigi(layer, CSCDDUStatusDigi(dduData[iDDU].header().data(),
403  dduData[iDDU].trailer().data(),
405  dduData[iDDU].trailer0()));
406 
408  const std::vector<CSCEventData> & cscData = dduData[iDDU].cscData();
409 
410  // if (cscData.size() != 0) std::cout << "FED" << id << " DDU Source ID: " << dduData[iDDU].header().source_id() << " firmware version: " << dduData[iDDU].header().format_version() << std::endl;
411 
412  for (unsigned int iCSC=0; iCSC<cscData.size(); ++iCSC) // loop over CSCs
413  {
414 
416  int vmecrate = cscData[iCSC].dmbHeader()->crateID();
417  int dmb = cscData[iCSC].dmbHeader()->dmbID();
418 
419  int icfeb = 0;
420  int ilayer = 0;
421 
422  if (debug)
423  LogTrace ("CSCDCCUnpacker|CSCRawToDigi") << "crate = " << vmecrate << "; dmb = " << dmb;
424 
425 
426 
427  if ((vmecrate>=1)&&(vmecrate<=60) && (dmb>=1)&&(dmb<=10)&&(dmb!=6))
428  {
429  layer = pcrate->detId(vmecrate, dmb,icfeb,ilayer );
430  }
431  else
432  {
433  LogTrace ("CSCDCCUnpacker|CSCRawToDigi") << " detID input out of range!!! ";
434  LogTrace ("CSCDCCUnpacker|CSCRawToDigi")
435  << " skipping chamber vme= " << vmecrate << " dmb= " << dmb;
436  continue; // to next iteration of iCSC loop
437  }
438 
441  if (isDDU_FED)
442  {
443  unsigned int dduid = cscmapping->ddu(layer);
444  if ((dduid>=1) && (dduid <= 36)) dduid = postLS1_map[dduid-1]; // Fix for Post-LS1 FED/DDU IDs mappings
445  // std::cout << "CSC " << layer << " -> " << id << ":" << dduid << ":" << vmecrate << ":" << dmb ;
446  if (id != dduid )
447  {
448  LogTrace ("CSCDDUUnpacker|CSCRawToDigi") << " CSC->FED/DDU mapping inconsistency!!! ";
449  LogTrace ("CSCDCCUnpacker|CSCRawToDigi")
450  << "readout FED/DDU ID=" << id << " expected ID=" << dduid
451  << ", skipping chamber " << layer << " vme= " << vmecrate << " dmb= " << dmb;
452  continue;
453  }
454  }
455 
457  int nalct = cscData[iCSC].dmbHeader()->nalct();
458  bool goodALCT=false;
459  //if (nalct&&(cscData[iCSC].dataPresent>>6&0x1)==1) {
460  if (nalct&&cscData[iCSC].alctHeader())
461  {
462  if (cscData[iCSC].alctHeader()->check())
463  {
464  goodALCT=true;
465  }
466  else
467  {
468  LogTrace ("CSCDCCUnpacker|CSCRawToDigi") <<
469  "not storing ALCT digis; alct is bad or not present";
470  }
471  }
472  else
473  {
474  if (debug) LogTrace ("CSCDCCUnpacker|CSCRawToDigi") << "nALCT==0 !!!";
475  }
476 
478  if (goodALCT)
479  {
480  std::vector <CSCALCTDigi> alctDigis =
481  cscData[iCSC].alctHeader()->ALCTDigis();
482  if (SuppressZeroLCT)
483  {
484  std::vector<CSCALCTDigi> alctDigis_0;
485  for (int unsigned i=0; i<alctDigis.size(); ++i)
486  {
487  if (alctDigis[i].isValid())
488  alctDigis_0.push_back(alctDigis[i]);
489  }
490  alctProduct->move(std::make_pair(alctDigis_0.begin(), alctDigis_0.end()),layer);
491  }
492  else
493  alctProduct->move(std::make_pair(alctDigis.begin(), alctDigis.end()),layer);
494  }
495 
496 
498  int nclct = cscData[iCSC].dmbHeader()->nclct();
499  bool goodTMB=false;
500  // if (nclct&&(cscData[iCSC].dataPresent>>5&0x1)==1) {
501  if (nclct&&cscData[iCSC].tmbData())
502  {
503  if (cscData[iCSC].tmbHeader()->check())
504  {
505  if (cscData[iCSC].clctData()->check()) goodTMB=true;
506  }
507  else
508  {
509  LogTrace ("CSCDCCUnpacker|CSCRawToDigi") <<
510  "one of TMB checks failed! not storing TMB digis ";
511  }
512  }
513  else
514  {
515  if (debug) LogTrace ("CSCDCCUnpacker|CSCRawToDigi") << "nCLCT==0 !!!";
516  }
517 
519  if (goodTMB)
520  {
521  std::vector <CSCCorrelatedLCTDigi> correlatedlctDigis =
522  cscData[iCSC].tmbHeader()->CorrelatedLCTDigis(layer.rawId());
523  if (SuppressZeroLCT)
524  {
525  std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis_0;
526  for (int unsigned i=0; i<correlatedlctDigis.size(); ++i)
527  {
528  if (correlatedlctDigis[i].isValid())
529  correlatedlctDigis_0.push_back(correlatedlctDigis[i]);
530  }
531  corrlctProduct->move(std::make_pair(correlatedlctDigis_0.begin(),
532  correlatedlctDigis_0.end()),layer);
533  }
534  else
535  corrlctProduct->move(std::make_pair(correlatedlctDigis.begin(),
536  correlatedlctDigis.end()),layer);
537 
538  std::vector <CSCCLCTDigi> clctDigis =
539  cscData[iCSC].tmbHeader()->CLCTDigis(layer.rawId());
540  if (SuppressZeroLCT)
541  {
542  std::vector<CSCCLCTDigi> clctDigis_0;
543  for (int unsigned i=0; i<clctDigis.size(); ++i)
544  {
545  if (clctDigis[i].isValid())
546  clctDigis_0.push_back(clctDigis[i]);
547  }
548  clctProduct->move(std::make_pair(clctDigis_0.begin(), clctDigis_0.end()),layer);
549  }
550  else
551  clctProduct->move(std::make_pair(clctDigis.begin(), clctDigis.end()),layer);
552 
554  if (cscData[iCSC].tmbData()->checkSize())
555  {
556  if (cscData[iCSC].tmbData()->hasRPC())
557  {
558  std::vector <CSCRPCDigi> rpcDigis =
559  cscData[iCSC].tmbData()->rpcData()->digis();
560  rpcProduct->move(std::make_pair(rpcDigis.begin(), rpcDigis.end()),layer);
561  }
562  }
563  else LogTrace("CSCDCCUnpacker|CSCRawToDigi") <<" TMBData check size failed!";
564  }
565 
566 
568  if (unpackStatusDigis)
569  {
570  for ( icfeb = 0; icfeb < 7; ++icfeb )
571  {
572  if ( cscData[iCSC].cfebData(icfeb) != NULL )
573  cfebStatusProduct->
574  insertDigi(layer, cscData[iCSC].cfebData(icfeb)->statusDigi());
575  }
577  dmbStatusProduct->insertDigi(layer, CSCDMBStatusDigi(cscData[iCSC].dmbHeader()->data(),
578  cscData[iCSC].dmbTrailer()->data()));
579  if (goodTMB) tmbStatusProduct->
580  insertDigi(layer, CSCTMBStatusDigi(cscData[iCSC].tmbHeader()->data(),
581  cscData[iCSC].tmbData()->tmbTrailer()->data()));
582  if (goodALCT) alctStatusProduct->
583  insertDigi(layer, CSCALCTStatusDigi(cscData[iCSC].alctHeader()->data(),
584  cscData[iCSC].alctTrailer()->data()));
585  }
586 
587 
589  for (int ilayer = 1; ilayer <= 6; ++ilayer)
590  {
592  // (You have to be kidding. Line 240 in whose universe?)
593 
594  // Allocate all ME1/1 wire digis to ring 1
595  layer = pcrate->detId( vmecrate, dmb, 0, ilayer );
596  {
597  std::vector <CSCWireDigi> wireDigis = cscData[iCSC].wireDigis(ilayer);
598  wireProduct->move(std::make_pair(wireDigis.begin(), wireDigis.end()),layer);
599  }
600 
601  for ( icfeb = 0; icfeb < 7; ++icfeb )
602  {
603  layer = pcrate->detId( vmecrate, dmb, icfeb,ilayer );
604  if (cscData[iCSC].cfebData(icfeb) && cscData[iCSC].cfebData(icfeb)->check())
605  {
606  std::vector<CSCStripDigi> stripDigis;
607  cscData[iCSC].cfebData(icfeb)->digis(layer.rawId(),stripDigis);
608  stripProduct->move(std::make_pair(stripDigis.begin(),
609  stripDigis.end()),layer);
610  }
611  }
612 
613 
614  if (goodTMB && (cscData[iCSC].tmbHeader() != NULL))
615  {
616  int nCFEBs = cscData[iCSC].tmbHeader()->NCFEBs();
617  for ( icfeb = 0; icfeb < nCFEBs; ++icfeb )
618  {
619  layer = pcrate->detId( vmecrate, dmb, icfeb,ilayer );
620  std::vector <CSCComparatorDigi> comparatorDigis =
621  cscData[iCSC].clctData()->comparatorDigis(layer.rawId(), icfeb);
622  // Set cfeb=0, so that ME1/a and ME1/b comparators go to
623  // ring 1.
624  layer = pcrate->detId( vmecrate, dmb, 0, ilayer );
625  comparatorProduct->move(std::make_pair(comparatorDigis.begin(),
626  comparatorDigis.end()),layer);
627  }
628  } // end of loop over cfebs
629  } // end of loop over layers
630  } // end of loop over chambers
631  } // endof loop over DDUs
632  } // end of good event
633  else
634  {
635  LogTrace("CSCDCCUnpacker|CSCRawToDigi") <<
636  "ERROR! Examiner rejected FED #" << id;
637  if (examiner)
638  {
639  for (int i=0; i<examiner->nERRORS; ++i)
640  {
641  if (((examinerMask&examiner->errors())>>i)&0x1)
642  LogTrace("CSCDCCUnpacker|CSCRawToDigi")<<examiner->errName(i);
643  }
644  if (debug)
645  {
646  LogTrace("CSCDCCUnpacker|CSCRawToDigi")
647  << " Examiner errors:0x" << std::hex << examiner->errors()
648  << " & 0x" << examinerMask
649  << " = " << (examiner->errors()&examinerMask);
650  }
651  }
652 
653  // dccStatusProduct->insertDigi(CSCDetId(1,1,1,1,1), CSCDCCStatusDigi(examiner->errors()));
654  // if(instantiateDQM) monitor->process(examiner, NULL);
655  }
656  if (examiner!=NULL) delete examiner;
657  } // end of if fed has data
658  } // end of loop over DCCs
659  // put into the event
660  e.put(wireProduct, "MuonCSCWireDigi");
661  e.put(stripProduct, "MuonCSCStripDigi");
662  e.put(alctProduct, "MuonCSCALCTDigi");
663  e.put(clctProduct, "MuonCSCCLCTDigi");
664  e.put(comparatorProduct, "MuonCSCComparatorDigi");
665  e.put(rpcProduct, "MuonCSCRPCDigi");
666  e.put(corrlctProduct, "MuonCSCCorrelatedLCTDigi");
667 
668  if (useFormatStatus) e.put(formatStatusProduct, "MuonCSCDCCFormatStatusDigi");
669 
670  if (unpackStatusDigis)
671  {
672  e.put(cfebStatusProduct, "MuonCSCCFEBStatusDigi");
673  e.put(dmbStatusProduct, "MuonCSCDMBStatusDigi");
674  e.put(tmbStatusProduct, "MuonCSCTMBStatusDigi");
675  e.put(dduStatusProduct, "MuonCSCDDUStatusDigi");
676  e.put(dccStatusProduct, "MuonCSCDCCStatusDigi");
677  e.put(alctStatusProduct, "MuonCSCALCTStatusDigi");
678  }
679  if (printEventNumber) LogTrace("CSCDCCUnpacker|CSCRawToDigi")
680  <<"[CSCDCCUnpacker]: " << numOfEvents << " events processed ";
681 }
682 
683 
685 
686 void CSCDCCUnpacker::visual_raw(int hl,int id, int run, int event,bool fedshort,
687  bool fDump, short unsigned int *buf) const
688 {
689 
690  std::cout << std::endl << std::endl << std::endl;
691  std::cout << "Run: "<< run << " Event: " << event << std::endl;
692  std::cout << std::endl << std::endl;
693  if (formatedEventDump)
694  std::cout << "FED-" << id << " " << "(scroll down to see summary)" << std::endl;
695  else
696  std::cout << "Problem seems in FED-" << id << " " << "(scroll down to see summary)" << std::endl;
697  std::cout <<"********************************************************************************" << std::endl;
698  std::cout << hl <<" words of data:" << std::endl;
699 
700  //================================================
701  // FED codes in DCC
702  std::vector<int> dcc_id;
703  int dcc_h1_id=0;
704  // Current codes
705  for (int i=750; i<758; i++)
706  dcc_id.push_back(i);
707  // Codes for upgrade
708  for (int i=830; i<838; i++)
709  dcc_id.push_back(i);
710 
711  char dcc_common[]="DCC-";
712 
713  //================================================
714  // DDU codes per FED
715  std::vector<int> ddu_id;
716  int ddu_h1_12_13=0;
717  for (int i=1; i<37; i++)
718  ddu_id.push_back(i);
719  // For DDU Headers and tarailers
720  char ddu_common[]="DDU-";
721  char ddu_header1[]="Header 1";
722  char ddu_header2[]="Header 2";
723  char ddu_header3[]="Header 3";
724  char ddu_trail1[]="Trailer 1", ddu_trail2[]="Trailer 2", ddu_trail3[]="Trailer 3";
725  // For Header 2
726  char ddu_trailer1_bit[]= {'8','0','0','0','f','f','f','f','8','0','0','0','8','0','0','0'};
727  char ddu_trailer3_bit[]= {'a'};
728  // Corrupted Trailers
729  char ddu_tr1_err_common[]="Incomplet";
730  //====================================================
731 
732  //DMB
733  char dmb_common[]="DMB", dmb_header1[]="Header 1", dmb_header2[]="Header 2";
734  char dmb_common_crate[]="crate:", dmb_common_slot[]="slot:";
735  char dmb_common_l1a[]="L1A:";
736  char dmb_header1_bit[]= {'9','9','9','9'};
737  char dmb_header2_bit[]= {'a','a','a','a'};
738  char dmb_tr1[]="Trailer 1", dmb_tr2[]="Trailer 2";
739  char dmb_tr1_bit[]= {'f','f','f','f'}, dmb_tr2_bit[]= {'e','e','e','e'};
740 
741 
742  //=====================================================
743 
744  // ALCT
745  char alct_common[]="ALCT", alct_header1[]="Header 1", alct_header2[]="Header 2";
746  char alct_common_bxn[]="BXN:";
747  char alct_common_wcnt2[]="| Actual word count:";
748  char alct_common_wcnt1[]="Expected word count:";
749  char alct_header1_bit[]= {'d','d','d','d','b','0','a'};
750  char alct_header2_bit[]= {'0','0','0','0'};
751  char alct_tr1[]="Trailer 1";
752 
753  //======================================================
754 
755  //TMB
756  char tmb_common[]="TMB", tmb_header1[]="Header", tmb_tr1[]="Trailer";
757  char tmb_header1_bit[]= {'d','d','d','d','b','0','c'};
758  char tmb_tr1_bit[]= {'d','d','d','d','e','0','f'};
759 
760  //======================================================
761 
762  //CFEB
763  char cfeb_common[]="CFEB", cfeb_tr1[]="Trailer", cfeb_b[]="B-word";
764  char cfeb_common_sample[]="sample:";
765 
766  //======================================================
767 
768  //Auxiliary variables
769 
770  // Bufers
771  int word_lines=hl/4;
772  char tempbuf[80];
773  char tempbuf1[80];
774  char tempbuf_short[17];
775  char sign1[]=" --->| ";
776 
777  // Counters
778  int word_numbering=0;
779  int ddu_inst_i=0, ddu_inst_n=0, ddu_inst_l1a=0;
780  int ddu_inst_bxn=0;
781  int dmb_inst_crate=0, dmb_inst_slot=0, dmb_inst_l1a=0;
782  int cfeb_sample=0;
783  int alct_inst_l1a=0;
784  int alct_inst_bxn=0;
785  int alct_inst_wcnt1=0;
786  int alct_inst_wcnt2=0;
787  int alct_start=0;
788  int alct_stop=0;
789  int tmb_inst_l1a=0;
790  int tmb_inst_wcnt1=0;
791  int tmb_inst_wcnt2=0;
792  int tmb_start=0;
793  int tmb_stop=0;
794  int dcc_h1_check=0;
795 
796  //Flags
797  int ddu_h2_found=0; //DDU Header 2 found
798  int w=0;
799 
800  //Logic variables
801  const int sz1=5;
802  bool dcc_check=false;
803  bool ddu_h2_check[sz1]= {false};
804  bool ddu_h1_check=false;
805  bool dmb_h1_check[sz1]= {false};
806  bool dmb_h2_check[sz1]= {false};
807  bool ddu_h2_h1=false;
808  bool ddu_tr1_check[sz1]= {false};
809  bool alct_h1_check[sz1]= {false};
810  bool alct_h2_check[sz1]= {false};
811  bool alct_tr1_check[sz1]= {false};
812  bool dmb_tr1_check[sz1]= {false};
813  bool dmb_tr2_check[sz1]= {false};
814  bool tmb_h1_check[sz1]= {false};
815  bool tmb_tr1_check[sz1]= {false};
816  bool cfeb_tr1_check[sz1]= {false};
817  bool cfeb_b_check[sz1]= {false};
818  bool ddu_tr1_bad_check[sz1]= {false};
819  bool extraction=fedshort;
820 
821  //Summary vectors
822  //DDU
823  std::vector<int> ddu_h1_coll;
824  std::vector<int> ddu_h1_n_coll;
825  std::vector<int> ddu_h2_coll;
826  std::vector<int> ddu_h3_coll;
827  std::vector<int> ddu_t1_coll;
828  std::vector<int> ddu_t2_coll;
829  std::vector<int> ddu_t3_coll;
830  std::vector<int> ddu_l1a_coll;
831  std::vector<int> ddu_bxn_coll;
832  //DMB
833  std::vector<int> dmb_h1_coll;
834  std::vector<int> dmb_h2_coll;
835  std::vector<int> dmb_t1_coll;
836  std::vector<int> dmb_t2_coll;
837  std::vector<int> dmb_crate_coll;
838  std::vector<int> dmb_slot_coll;
839  std::vector<int> dmb_l1a_coll;
840  //ALCT
841  std::vector<int> alct_h1_coll;
842  std::vector<int> alct_h2_coll;
843  std::vector<int> alct_t1_coll;
844  std::vector<int> alct_l1a_coll;
845  std::vector<int> alct_bxn_coll;
846  std::vector<int> alct_wcnt1_coll;
847  std::vector<int> alct_wcnt2_coll;
848  std::vector<int> alct_wcnt2_id_coll;
849  //TMB
850  std::vector<int> tmb_h1_coll;
851  std::vector<int> tmb_t1_coll;
852  std::vector<int> tmb_l1a_coll;
853  std::vector<int> tmb_wcnt1_coll;
854  std::vector<int> tmb_wcnt2_coll;
855  //CFEB
856  std::vector<int> cfeb_t1_coll;
857 
858  //========================================================
859 
860  // DCC Header and Ttrailer information
861  char dcc_header1[]="DCC Header 1";
862  char dcc_header2[]="DCC Header 2";
863  char dcc_trail1[]="DCC Trailer 1", dcc_trail1_bit[]= {'e'};
864  char dcc_trail2[]="DCC Trailer 2", dcc_trail2_bit[]= {'a'};
865  //=========================================================
866 
867  for (int i=0; i < hl; i++)
868  {
869  ++word_numbering;
870  for (int j=-1; j<4; j++)
871  {
872 
873  sprintf(tempbuf_short,"%04x%04x%04x%04x",buf[i+4*(j-1)+3],buf[i+4*(j-1)+2],buf[i+4*(j-1)+1],buf[i+4*(j-1)]);
874 
875  // WARNING in 5_0_X for time being
876  ddu_h2_found++;
877  ddu_h2_found--;
878 
879  ddu_h2_check[j]=((buf[i+4*(j-1)+1]==0x8000)&&
880  (buf[i+4*(j-1)+2]==0x0001)&&(buf[i+4*(j-1)+3]==0x8000));
881 
882  ddu_tr1_check[j]=((tempbuf_short[0]==ddu_trailer1_bit[0])&&(tempbuf_short[1]==ddu_trailer1_bit[1])&&
883  (tempbuf_short[2]==ddu_trailer1_bit[2])&&(tempbuf_short[3]==ddu_trailer1_bit[3])&&
884  (tempbuf_short[4]==ddu_trailer1_bit[4])&&(tempbuf_short[5]==ddu_trailer1_bit[5])&&
885  (tempbuf_short[6]==ddu_trailer1_bit[6])&&(tempbuf_short[7]==ddu_trailer1_bit[7])&&
886  (tempbuf_short[8]==ddu_trailer1_bit[8])&&(tempbuf_short[9]==ddu_trailer1_bit[9])&&
887  (tempbuf_short[10]==ddu_trailer1_bit[10])&&(tempbuf_short[11]==ddu_trailer1_bit[11])&&
888  (tempbuf_short[12]==ddu_trailer1_bit[12])&&(tempbuf_short[13]==ddu_trailer1_bit[13])&&
889  (tempbuf_short[14]==ddu_trailer1_bit[14])&&(tempbuf_short[15]==ddu_trailer1_bit[15]));
890 
891  dmb_h1_check[j]=((tempbuf_short[0]==dmb_header1_bit[0])&&(tempbuf_short[4]==dmb_header1_bit[1])&&
892  (tempbuf_short[8]==dmb_header1_bit[2])&&(tempbuf_short[12]==dmb_header1_bit[3]));
893 
894  dmb_h2_check[j]=((tempbuf_short[0]==dmb_header2_bit[0])&&(tempbuf_short[4]==dmb_header2_bit[1])&&
895  (tempbuf_short[8]==dmb_header2_bit[2])&&(tempbuf_short[12]==dmb_header2_bit[3]));
896  alct_h1_check[j]=((tempbuf_short[0]==alct_header1_bit[0])&&(tempbuf_short[4]==alct_header1_bit[1])&&
897  (tempbuf_short[8]==alct_header1_bit[2])&&(tempbuf_short[12]==alct_header1_bit[3])&&
898  (tempbuf_short[13]==alct_header1_bit[4])&&(tempbuf_short[14]==alct_header1_bit[5])&&
899  (tempbuf_short[15]==alct_header1_bit[6]));
900  alct_h2_check[j]=(((tempbuf_short[0]==alct_header2_bit[0])&&(tempbuf_short[1]==alct_header2_bit[1])&&
901  (tempbuf_short[2]==alct_header2_bit[2])&&(tempbuf_short[3]==alct_header2_bit[3]))||
902  ((tempbuf_short[4]==alct_header2_bit[0])&&(tempbuf_short[5]==alct_header2_bit[1])&&
903  (tempbuf_short[6]==alct_header2_bit[2])&&(tempbuf_short[7]==alct_header2_bit[3]))||
904  ((tempbuf_short[8]==alct_header2_bit[0])&&(tempbuf_short[9]==alct_header2_bit[1])&&
905  (tempbuf_short[10]==alct_header2_bit[2])&&(tempbuf_short[11]==alct_header2_bit[3]))||
906  ((tempbuf_short[12]==alct_header2_bit[0])&&(tempbuf_short[13]==alct_header2_bit[1])&&
907  (tempbuf_short[14]==alct_header2_bit[2])&&(tempbuf_short[15]==alct_header2_bit[3]))
908  //(tempbuf_short[4]==alct_header2_bit[4])&&(tempbuf_short[5]==alct_header2_bit[5])
909  );
910  // ALCT Trailers
911  alct_tr1_check[j]=(((buf[i+4*(j-1)]&0xFFFF)==0xDE0D)&&((buf[i+4*(j-1)+1]&0xF800)==0xD000)&&
912  ((buf[i+4*(j-1)+2]&0xF800)==0xD000)&&((buf[i+4*(j-1)+3]&0xF000)==0xD000));
913  // DMB Trailers
914  dmb_tr1_check[j]=((tempbuf_short[0]==dmb_tr1_bit[0])&&(tempbuf_short[4]==dmb_tr1_bit[1])&&
915  (tempbuf_short[8]==dmb_tr1_bit[2])&&(tempbuf_short[12]==dmb_tr1_bit[3]));
916  dmb_tr2_check[j]=((tempbuf_short[0]==dmb_tr2_bit[0])&&(tempbuf_short[4]==dmb_tr2_bit[1])&&
917  (tempbuf_short[8]==dmb_tr2_bit[2])&&(tempbuf_short[12]==dmb_tr2_bit[3]));
918  // TMB
919  tmb_h1_check[j]=((tempbuf_short[0]==tmb_header1_bit[0])&&(tempbuf_short[4]==tmb_header1_bit[1])&&
920  (tempbuf_short[8]==tmb_header1_bit[2])&&(tempbuf_short[12]==tmb_header1_bit[3])&&
921  (tempbuf_short[13]==tmb_header1_bit[4])&&(tempbuf_short[14]==tmb_header1_bit[5])&&
922  (tempbuf_short[15]==tmb_header1_bit[6]));
923  tmb_tr1_check[j]=((tempbuf_short[0]==tmb_tr1_bit[0])&&(tempbuf_short[4]==tmb_tr1_bit[1])&&
924  (tempbuf_short[8]==tmb_tr1_bit[2])&&(tempbuf_short[12]==tmb_tr1_bit[3])&&
925  (tempbuf_short[13]==tmb_tr1_bit[4])&&(tempbuf_short[14]==tmb_tr1_bit[5])&&
926  (tempbuf_short[15]==tmb_tr1_bit[6]));
927  // CFEB
928  cfeb_tr1_check[j]=(((buf[i+4*(j-1)+1]&0xF000)==0x7000) &&
929  ((buf[i+4*(j-1)+2]&0xF000)==0x7000) &&
930  (( buf[i+4*(j-1)+1]!= 0x7FFF) || (buf[i+4*(j-1)+2] != 0x7FFF)) &&
931  ((buf[i+4*(j-1)+3] == 0x7FFF) ||
932  ((buf[i+4*(j-1)+3]&buf[i+4*(j-1)]) == 0x0&&(buf[i+4*(j-1)+3] + buf[i+4*(j-1)] == 0x7FFF ))) );
933  cfeb_b_check[j]=(((buf[i+4*(j-1)+3]&0xF000)==0xB000)&&((buf[i+4*(j-1)+2]&0xF000)==0xB000) &&
934  ((buf[i+4*(j-1)+1]&0xF000)==0xB000)&&((buf[i+4*(j-1)]=3&0xF000)==0xB000) );
935  // DDU Trailers with errors
936  ddu_tr1_bad_check[j]=((tempbuf_short[0]!=ddu_trailer1_bit[0])&&
937  //(tempbuf_short[1]!=ddu_trailer1_bit[1])&&(tempbuf_short[2]!=ddu_trailer1_bit[2])&&
938  //(tempbuf_short[3]==ddu_trailer1_bit[3])&&
939  (tempbuf_short[4]!=ddu_trailer1_bit[4])&&
940  //(tempbuf_short[5]==ddu_trailer1_bit[5])&&
941  //(tempbuf_short[6]==ddu_trailer1_bit[6])&&(tempbuf_short[7]==ddu_trailer1_bit[7])&&
942  (tempbuf_short[8]==ddu_trailer1_bit[8])&&(tempbuf_short[9]==ddu_trailer1_bit[9])&&
943  (tempbuf_short[10]==ddu_trailer1_bit[10])&&(tempbuf_short[11]==ddu_trailer1_bit[11])&&
944  (tempbuf_short[12]==ddu_trailer1_bit[12])&&(tempbuf_short[13]==ddu_trailer1_bit[13])&&
945  (tempbuf_short[14]==ddu_trailer1_bit[14])&&(tempbuf_short[15]==ddu_trailer1_bit[15]));
946  }
947 
948  // DDU Header 2 next to Header 1
949  ddu_h2_h1=ddu_h2_check[2];
950 
951  sprintf(tempbuf_short,"%04x%04x%04x%04x",buf[i+3],buf[i+2],buf[i+1],buf[i]);
952 
953  // Looking for DDU Header 1
954  ddu_h1_12_13=(buf[i]>>8);
955  for (int kk=0; kk<36; kk++)
956  {
957  if (((buf[i+3]&0xF000)==0x5000)&&(ddu_h1_12_13==ddu_id[kk])&&ddu_h2_h1)
958  {
959  ddu_h1_coll.push_back(word_numbering);
960  ddu_h1_n_coll.push_back(ddu_id[kk]);
961  ddu_inst_l1a=((buf[i+2]&0xFFFF)+((buf[i+3]&0x00FF)<<16));
962  ddu_l1a_coll.push_back(ddu_inst_l1a);
963  ddu_inst_bxn=(buf[i+1]&0xFFF0)>>4;
964  ddu_bxn_coll.push_back(ddu_inst_bxn);
965  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s%s %s %i %s %i",
966  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
967  sign1,ddu_common,ddu_id[kk],ddu_header1,sign1,dmb_common_l1a,ddu_inst_l1a,alct_common_bxn,ddu_inst_bxn);
968  std::cout << tempbuf1 << std::endl;
969  w=0;
970  ddu_h1_check=true;
971  ddu_inst_l1a=0;
972  cfeb_sample=0;
973  }
974  }
975 
976 
977 
978  // Looking for DCC Header 1
979  dcc_h1_id=(((buf[i+1]<<12)&0xF000)>>4)+(buf[i]>>8);
980  for (int dcci=0; dcci<16; dcci++)
981  {
982  if ((dcc_id[dcci]==dcc_h1_id)&&(((buf[i+3]&0xF000)==0x5000)&&(!ddu_h1_check)))
983  {
984  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
985  sign1,dcc_common,dcc_h1_id,dcc_header1);
986  dcc_h1_check=word_numbering;
987  w=0;
988  dcc_check=true;
989  std::cout << tempbuf1 << std::endl;
990  }
991  }
992 
993  // Looking for DCC Header 2 and trailers
994  if (((word_numbering-1)==dcc_h1_check)&&((buf[i+3]&0xFF00)==0xD900))
995  {
996  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
997  sign1,dcc_header2);
998  std::cout << tempbuf1 << std::endl;
999  w=0;
1000  }
1001  else if ((word_numbering==word_lines-1)&&(tempbuf_short[0]==dcc_trail1_bit[0]))
1002  {
1003  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1004  sign1,dcc_trail1);
1005  std::cout << tempbuf1 << std::endl;
1006  w=0;
1007  }
1008  else if ((word_numbering==word_lines)&&(tempbuf_short[0]==dcc_trail2_bit[0]))
1009  {
1010  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1011  sign1,dcc_trail2);
1012  std::cout << tempbuf1 << std::endl;
1013  w=0;
1014  }
1015 
1016  // DDU Header 2
1017  else if (ddu_h2_check[1])
1018  {
1019  ddu_inst_i = ddu_h1_n_coll.size(); //ddu_inst_n=ddu_h1_n_coll[0];
1020  if (ddu_inst_i>0)
1021  {
1022  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1023  }
1024  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",
1025  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,ddu_common,
1026  ddu_inst_n, ddu_header2);
1027  ddu_h2_coll.push_back(word_numbering);
1028  std::cout << tempbuf1 << std::endl;
1029  w=0;
1030  ddu_h2_found=1;
1031  }
1032 
1033  // DDU Header 3 (either between DDU Header 2 DMB Header or DDU Header 2 DDU Trailer1)
1034  else if ((ddu_h2_check[0]&&dmb_h1_check[2])||(ddu_h2_check[0]&&ddu_tr1_check[2]))
1035  {
1036  ddu_inst_i = ddu_h1_n_coll.size();
1037  if (ddu_inst_i>0)
1038  {
1039  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1040  }
1041  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1042  sign1,ddu_common,ddu_inst_n,ddu_header3);
1043  ddu_h3_coll.push_back(word_numbering);
1044  std::cout << tempbuf1 << std::endl;
1045  w=0;
1046  ddu_h2_found=0;
1047  }
1048 
1049  // DMB Header 1,2
1050 
1051  else if (dmb_h1_check[1])
1052  {
1053  dmb_inst_crate=0;
1054  dmb_inst_slot=0;
1055  dmb_inst_l1a=0;
1056  dmb_inst_l1a=((buf[i]&0x0FFF)+((buf[i+1]&0xFFF)<<12));
1057  dmb_l1a_coll.push_back(dmb_inst_l1a);
1058  if (dmb_h2_check[2])
1059  {
1060  dmb_inst_crate=((buf[i+4+1]>>4)&0xFF);
1061  dmb_inst_slot=(buf[i+4+1]&0xF);
1062  dmb_crate_coll.push_back(dmb_inst_crate);
1063  dmb_slot_coll.push_back(dmb_inst_slot);
1064  }
1065  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1066  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1067  sign1,dmb_common,dmb_header1,sign1,dmb_common_crate,dmb_inst_crate,
1068  dmb_common_slot,dmb_inst_slot,dmb_common_l1a,dmb_inst_l1a);
1069  dmb_h1_coll.push_back(word_numbering);
1070  std::cout << tempbuf1 << std::endl;
1071  w=0;
1072  ddu_h2_found=1;
1073  }
1074 
1075  else if (dmb_h2_check[1])
1076  {
1077  dmb_inst_crate=((buf[i+1]>>4)&0xFF);
1078  dmb_inst_slot=(buf[i+1]&0xF);
1079  dmb_h2_coll.push_back(word_numbering);
1080  if (dmb_h1_check[0])
1081  dmb_inst_l1a=((buf[i-4]&0x0FFF)+((buf[i-4+1]&0xFFF)<<12));
1082  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1083  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1084  sign1,dmb_common,dmb_header2,sign1,dmb_common_crate,dmb_inst_crate,
1085  dmb_common_slot,dmb_inst_slot,dmb_common_l1a,dmb_inst_l1a);
1086  std::cout << tempbuf1 << std::endl;
1087  w=0;
1088  ddu_h2_found=1;
1089  }
1090 
1091  //DDU Trailer 1
1092 
1093  else if (ddu_tr1_check[1])
1094  {
1095  ddu_inst_i = ddu_h1_n_coll.size();
1096  if (ddu_inst_i>0)
1097  {
1098  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1099  }
1100  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1101  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",
1102  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,ddu_common,ddu_inst_n,ddu_trail1);
1103  ddu_t1_coll.push_back(word_numbering);
1104  std::cout << tempbuf1 << std::endl;
1105  w=0;
1106  }
1107 
1109  else if (alct_h1_check[1])
1110  {
1111  alct_start=word_numbering;
1112  alct_inst_l1a=(buf[i+2]&0x0FFF);
1113  alct_l1a_coll.push_back(alct_inst_l1a);
1114  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1115  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1116  sign1,alct_common,alct_header1,sign1,dmb_common_l1a,alct_inst_l1a);
1117  alct_h1_coll.push_back(word_numbering);
1118  std::cout << tempbuf1 << std::endl;
1119  w=0;
1120  alct_inst_l1a=0;
1121  }
1122 
1123  else if ((alct_h1_check[0])&&(alct_h2_check[2]))
1124  {
1125  alct_inst_bxn=(buf[i]&0x0FFF);
1126  alct_bxn_coll.push_back(alct_inst_bxn);
1127  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1128  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1129  sign1,alct_common,alct_header2,sign1,alct_common_bxn,alct_inst_bxn);
1130  alct_h2_coll.push_back(word_numbering);
1131  std::cout << tempbuf1 << std::endl;
1132  w=0;
1133  alct_inst_bxn=0;
1134  }
1135 
1136  //ALCT Trailer 1
1137  else if (alct_tr1_check[1])
1138  {
1139  alct_stop=word_numbering;
1140  if ((alct_start!=0)&&(alct_stop!=0)&&(alct_stop>alct_start))
1141  {
1142  alct_inst_wcnt2=4*(alct_stop-alct_start+1);
1143  alct_wcnt2_coll.push_back(alct_inst_wcnt2);
1144  alct_wcnt2_id_coll.push_back(alct_start);
1145  }
1146  alct_inst_wcnt1=(buf[i+3]&0x7FF);
1147  alct_wcnt1_coll.push_back(alct_inst_wcnt1);
1148  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1149  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1150  sign1,alct_common,alct_tr1,sign1,alct_common_wcnt1,alct_inst_wcnt1,
1151  alct_common_wcnt2,alct_inst_wcnt2);
1152  alct_t1_coll.push_back(word_numbering);
1153  std::cout << tempbuf1 << std::endl;
1154  w=0;
1155  alct_inst_wcnt1=0;
1156  alct_inst_wcnt2=0;
1157  }
1158 
1159  //DDU Trailer 3
1160 
1161 // else if ((ddu_tr1_check[-1])&&(tempbuf_short[0]==ddu_trailer3_bit[0])) { // !!! TO FIX: negative index
1162  else if((ddu_h2_h1)&&(tempbuf_short[0]==ddu_trailer3_bit[0])){
1163  //&&(tempbuf_short[0]==ddu_trailer3_bit[0])){
1164  ddu_inst_i = ddu_h1_n_coll.size();
1165  if (ddu_inst_i>0)
1166  {
1167  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1168  }
1169  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1170  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",
1171  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,ddu_common,ddu_inst_n,ddu_trail3);
1172  ddu_t3_coll.push_back(word_numbering);
1173  std::cout << tempbuf1 << std::endl;
1174  w=0;
1175  }
1176  //DDU Trailer 2
1177  else if ((ddu_tr1_check[0])&&(tempbuf_short[0]!=ddu_trailer3_bit[0]))
1178  {
1179  //&&(tempbuf_short[0]==ddu_trailer3_bit[0])){
1180  ddu_inst_i = ddu_h1_n_coll.size();
1181  if (ddu_inst_i>0)
1182  {
1183  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1184  }
1185  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1186  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s",
1187  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,ddu_common,ddu_inst_n,ddu_trail2);
1188  ddu_t2_coll.push_back(word_numbering);
1189  std::cout << tempbuf1 << std::endl;
1190  w=0;
1191  }
1192 
1193  //DMB Trailer 1,2
1194  else if (dmb_tr1_check[1])
1195  {
1196  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s",
1197  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,dmb_common,dmb_tr1);
1198  dmb_t1_coll.push_back(word_numbering);
1199  std::cout << tempbuf1 << std::endl;
1200  w=0;
1201  cfeb_sample=0;
1202  }
1203 
1204  else if (dmb_tr2_check[1])
1205  {
1206  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s",
1207  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,dmb_common,dmb_tr2);
1208  dmb_t2_coll.push_back(word_numbering);
1209  std::cout << tempbuf1 << std::endl;
1210  w=0;
1211  }
1212  // TMB
1213  else if (tmb_h1_check[1])
1214  {
1215  tmb_start=word_numbering;
1216  tmb_inst_l1a=(buf[i+2]&0x000F);
1217  tmb_l1a_coll.push_back(tmb_inst_l1a);
1218  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1219  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,tmb_common,tmb_header1,
1220  sign1,dmb_common_l1a,tmb_inst_l1a);
1221  tmb_h1_coll.push_back(word_numbering);
1222  std::cout << tempbuf1 << std::endl;
1223  w=0;
1224  tmb_inst_l1a=0;
1225  }
1226  else if (tmb_tr1_check[1])
1227  {
1228  tmb_stop=word_numbering;
1229  if ((tmb_start!=0)&&(tmb_stop!=0)&&(tmb_stop>tmb_start))
1230  {
1231  tmb_inst_wcnt2=4*(tmb_stop-tmb_start+1);
1232  tmb_wcnt2_coll.push_back(tmb_inst_wcnt2);
1233  }
1234  tmb_inst_wcnt1=(buf[i+3]&0x7FF);
1235  tmb_wcnt1_coll.push_back(tmb_inst_wcnt1);
1236  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1237  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1238  sign1,tmb_common,tmb_tr1,sign1,alct_common_wcnt1,tmb_inst_wcnt1,
1239  alct_common_wcnt2,tmb_inst_wcnt2);
1240  tmb_t1_coll.push_back(word_numbering);
1241  std::cout << tempbuf1 << std::endl;
1242  w=0;
1243  tmb_inst_wcnt2=0;
1244  }
1245  // CFEB
1246  else if (cfeb_tr1_check[1])
1247  {
1248  ++cfeb_sample;
1249  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1250  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],
1251  sign1,cfeb_common,cfeb_tr1,sign1,cfeb_common_sample,cfeb_sample);
1252  cfeb_t1_coll.push_back(word_numbering);
1253  w=0;
1254  std::cout << tempbuf1 << std::endl;
1255  w=0;
1256  }
1257  else if (cfeb_b_check[1])
1258  {
1259  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s %s",
1260  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,cfeb_common,cfeb_b);
1261  std::cout << tempbuf1 << std::endl;
1262  w=0;
1263  }
1264 
1265  //ERRORS ddu_tr1_bad_check
1266 
1267  else if (ddu_tr1_bad_check[1])
1268  {
1269  ddu_inst_i = ddu_h1_n_coll.size();
1270  ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1271  sprintf(tempbuf1,"%6i %04x %04x %04x %04x%s%s%i %s %s",
1272  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i],sign1,ddu_common,ddu_inst_n,
1273  ddu_trail1,ddu_tr1_err_common);
1274  std::cout << tempbuf1 << std::endl;
1275  w=0;
1276  }
1277 
1278  else if (extraction&&(!ddu_h1_check)&&(!dcc_check))
1279  {
1280  if (w<3)
1281  {
1282  sprintf(tempbuf,"%6i %04x %04x %04x %04x",
1283  word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i]);
1284  std::cout << tempbuf << std::endl;
1285  w++;
1286  }
1287  if (w==3)
1288  {
1289  std::cout << "..................................................." << std::endl;
1290  w++;
1291  }
1292  }
1293 
1294  else if ((!ddu_h1_check)&&(!dcc_check))
1295  {
1296  sprintf(tempbuf,"%6i %04x %04x %04x %04x",word_numbering,buf[i+3],buf[i+2],buf[i+1],buf[i]);
1297  std::cout << tempbuf << std::endl;
1298  }
1299 
1300  i+=3;
1301  ddu_h1_check=false;
1302  dcc_check=false;
1303  }
1304  //char sign[30]; //WARNING 5_0_X
1305  std::cout <<"********************************************************************************" <<
1306  std::endl << std::endl;
1307  if (fedshort)
1308  std::cout << "For complete output turn off VisualFEDShort in muonCSCDigis configuration file." << std::endl;
1309  std::cout <<"********************************************************************************" <<
1310  std::endl << std::endl;
1311  std::cout << std::endl << std::endl;
1312  std::cout <<" Summary " << std::endl;
1313  std::cout << std::endl << std::endl;
1314  std::cout << ddu_h1_coll.size() <<" "<< ddu_common << " "<<ddu_header1 << " "<< "found" << std::endl;
1315  /*
1316  std::cout << ddu_h1_coll.size() << " " << ddu_h1_n_coll.size() << " " << ddu_l1a_coll.size() <<
1317  " " << ddu_bxn_coll.size() << std::endl;
1318  */
1319  for (unsigned int k=0; k<ddu_h1_coll.size(); ++k)
1320  {
1321  /*
1322  sprintf(sign,"%s%6i%5s %s%i %s %i %s %i","Line: ",
1323  ddu_h1_coll[k],sign1,ddu_common,ddu_h1_n_coll[k],dmb_common_l1a,ddu_l1a_coll[k],
1324  alct_common_bxn,ddu_bxn_coll[k]);
1325  */
1326  std::cout << "Line: " << " " << ddu_h1_coll[k] << " " << sign1 << " " <<
1327  ddu_common << " " << ddu_h1_n_coll[k] << " " << dmb_common_l1a << " " << ddu_l1a_coll[k] << " " <<
1328  alct_common_bxn << " " << ddu_bxn_coll[k] << std::endl;
1329  }
1330 
1331 
1332  std::cout << std::endl << std::endl;
1333  std::cout << "||||||||||||||||||||" << std::endl;
1334  std::cout << std::endl << std::endl;
1335  std::cout << ddu_h2_coll.size() <<" "<< ddu_common << " "<<ddu_header2 << " "<< "found" << std::endl;
1336  for (unsigned int k=0; k<ddu_h2_coll.size(); ++k)
1337  std::cout << "Line: " << ddu_h2_coll[k] << std::endl;
1338  std::cout << std::endl << std::endl;
1339  std::cout << "||||||||||||||||||||" << std::endl;
1340  std::cout << std::endl << std::endl;
1341  std::cout << ddu_h3_coll.size() <<" "<< ddu_common << " "<<ddu_header3 << " "<< "found" << std::endl;
1342  for (unsigned int k=0; k<ddu_h3_coll.size(); ++k)
1343  std::cout << "Line: " << ddu_h3_coll[k] << std::endl;
1344  std::cout << std::endl << std::endl;
1345  std::cout << "||||||||||||||||||||" << std::endl;
1346  std::cout << std::endl << std::endl;
1347  std::cout << ddu_t1_coll.size() <<" "<< ddu_common << " "<<ddu_trail1 << " "<< "found" << std::endl;
1348  for (unsigned int k=0; k<ddu_t1_coll.size(); ++k)
1349  std::cout << "Line: " << ddu_t1_coll[k] << std::endl;
1350  std::cout << std::endl << std::endl;
1351  std::cout << "||||||||||||||||||||" << std::endl;
1352  std::cout << std::endl << std::endl;
1353  std::cout << ddu_t2_coll.size() <<" "<< ddu_common << " "<<ddu_trail2 << " "<< "found" << std::endl;
1354  for (unsigned int k=0; k<ddu_t2_coll.size(); ++k)
1355  std::cout << "Line: " << ddu_t2_coll[k] << std::endl;
1356  std::cout << std::endl << std::endl;
1357  std::cout << "||||||||||||||||||||" << std::endl;
1358  std::cout << std::endl << std::endl;
1359  std::cout << ddu_t3_coll.size() <<" "<< ddu_common << " "<<ddu_trail3 << " "<< "found" << std::endl;
1360  for (unsigned int k=0; k<ddu_t3_coll.size(); ++k)
1361  std::cout << "Line: " << ddu_t3_coll[k] << std::endl;
1362  std::cout << std::endl << std::endl;
1363  std::cout << "||||||||||||||||||||" << std::endl;
1364  std::cout << std::endl << std::endl;
1365  std::cout << dmb_h1_coll.size() <<" "<< dmb_common << " "<<dmb_header1 << " "<< "found" << std::endl;
1366 
1367  for (unsigned int k=0; k<dmb_h1_coll.size(); ++k)
1368  {
1369  /*
1370  sprintf(sign,"%s%6i%5s %s %s %i %s %i %s %i","Line: ",
1371  dmb_h1_coll[k],sign1,dmb_common,dmb_common_crate,dmb_crate_coll[k],dmb_common_slot,
1372  dmb_slot_coll[k],dmb_common_l1a,dmb_l1a_coll[k]);
1373  */
1374  std::cout << "Line: " << " " << dmb_h1_coll[k] << " " << sign1 << dmb_common
1375  << " " << dmb_common_crate << " " << dmb_crate_coll[k] << " " << dmb_common_slot << " " <<
1376  dmb_slot_coll[k] << " " << dmb_common_l1a << " " << dmb_l1a_coll[k] << std::endl;
1377  }
1378  std::cout << std::endl << std::endl;
1379  std::cout << "||||||||||||||||||||" << std::endl;
1380  std::cout << std::endl << std::endl;
1381  std::cout << dmb_h2_coll.size() <<" "<< dmb_common << " "<<dmb_header2 << " "<< "found" << std::endl;
1382  for (unsigned int k=0; k<dmb_h2_coll.size(); ++k)
1383  std::cout << "Line: " << dmb_h2_coll[k] << std::endl;
1384  std::cout << std::endl << std::endl;
1385  std::cout << "||||||||||||||||||||" << std::endl;
1386  std::cout << std::endl << std::endl;
1387  std::cout << dmb_t1_coll.size() <<" "<< dmb_common << " "<<dmb_tr1 << " "<< "found" << std::endl;
1388  for (unsigned int k=0; k<dmb_t1_coll.size(); ++k)
1389  std::cout << "Line: " << dmb_t1_coll[k] << std::endl;
1390  std::cout << std::endl << std::endl;
1391  std::cout << "||||||||||||||||||||" << std::endl;
1392  std::cout << std::endl << std::endl;
1393  std::cout << dmb_t2_coll.size() <<" "<< dmb_common << " "<<dmb_tr2 << " "<< "found" << std::endl;
1394  for (unsigned int k=0; k<dmb_t2_coll.size(); ++k)
1395  std::cout << "Line: " << dmb_t2_coll[k] << std::endl;
1396  std::cout << std::endl << std::endl;
1397  std::cout << "||||||||||||||||||||" << std::endl;
1398  std::cout << std::endl << std::endl;
1399  std::cout << alct_h1_coll.size() <<" "<< alct_common << " "<<alct_header1 << " "<< "found" << std::endl;
1400  for (unsigned int k=0; k<alct_h1_coll.size(); ++k)
1401  {
1402  /*
1403  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1404  alct_h1_coll[k],sign1,alct_common,
1405  dmb_common_l1a,alct_l1a_coll[k]);
1406  std::cout << sign << std::endl;
1407  */
1408  std::cout << "Line: " << " " <<
1409  alct_h1_coll[k] << " " << sign1 << " " << alct_common << " " <<
1410  dmb_common_l1a << " " << alct_l1a_coll[k] << std::endl;
1411  }
1412 
1413  std::cout << std::endl << std::endl;
1414  std::cout << "||||||||||||||||||||" << std::endl;
1415  std::cout << std::endl << std::endl;
1416  std::cout << alct_h2_coll.size() <<" "<< alct_common << " "<<alct_header2 << " "<< "found" << std::endl;
1417  for (unsigned int k=0; k<alct_h2_coll.size(); ++k)
1418  {
1419  /*
1420  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1421  alct_h1_coll[k],sign1,alct_common,
1422  alct_common_bxn,alct_bxn_coll[k]);
1423  std::cout << sign << std::endl;
1424  */
1425  std::cout << "Line: " << " " <<
1426  alct_h1_coll[k] << " " << sign1 << " " << alct_common << " " <<
1427  alct_common_bxn << " " << alct_bxn_coll[k] << std::endl;
1428  }
1429 
1430  std::cout << std::endl << std::endl;
1431  std::cout << "||||||||||||||||||||" << std::endl;
1432  std::cout << std::endl << std::endl;
1433  std::cout << alct_t1_coll.size() <<" "<< alct_common << " "<<alct_tr1 << " "<< "found" << std::endl;
1434  for (unsigned int k=0; k<alct_t1_coll.size(); ++k)
1435  {
1436  /*
1437  sprintf(sign,"%s%6i%5s %s %s %i %s %i","Line: ",
1438  alct_t1_coll[k],sign1,alct_common,
1439  alct_common_wcnt1,alct_wcnt1_coll[k],alct_common_wcnt2,alct_wcnt2_coll[k]);
1440  std::cout << sign << std::endl;
1441  */
1442  std::cout << "Line: " << " " << alct_t1_coll[k] << " " << sign1 << " " << alct_common << " " <<
1443  alct_common_wcnt1 << " " << alct_wcnt1_coll[k] << " " << alct_common_wcnt2 << " ";
1444  if (alct_wcnt2_coll.size()>0)
1445  {
1446  std::cout << alct_wcnt2_coll[k] << std::endl;
1447  }
1448  else
1449  {
1450  std::cout << "Undefined (ALCT Header is not found) " << std::endl;
1451  }
1452  }
1453 
1454  std::cout << std::endl << std::endl;
1455  std::cout << "||||||||||||||||||||" << std::endl;
1456  std::cout << std::endl << std::endl;
1457  std::cout << tmb_h1_coll.size() <<" "<< tmb_common << " "<<tmb_header1 << " "<< "found" << std::endl;
1458  for (unsigned int k=0; k<tmb_h1_coll.size(); ++k)
1459  {
1460  /*
1461  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1462  tmb_h1_coll[k],sign1,tmb_common,
1463  dmb_common_l1a,tmb_l1a_coll[k]);
1464  std::cout << sign << std::endl;
1465  */
1466  std::cout << "Line: " << " " << tmb_h1_coll[k] << " " << sign1 << " " << tmb_common << " " <<
1467  dmb_common_l1a << " " << tmb_l1a_coll[k] << std::endl;
1468  }
1469 
1470  std::cout << std::endl << std::endl;
1471  std::cout << "||||||||||||||||||||" << std::endl;
1472  std::cout << std::endl << std::endl;
1473  std::cout << tmb_t1_coll.size() <<" "<< tmb_common << " "<<tmb_tr1 << " "<< "found" << std::endl;
1474  for (unsigned int k=0; k<tmb_t1_coll.size(); ++k)
1475  {
1476  /*
1477  sprintf(sign,"%s%6i%5s %s %s %i %s %i","Line: ",
1478  tmb_t1_coll[k],sign1,tmb_common,
1479  alct_common_wcnt1,tmb_wcnt1_coll[k],alct_common_wcnt2,tmb_wcnt2_coll[k]);
1480  std::cout << sign << std::endl;
1481  */
1482  std::cout << "Line: " << " " << tmb_t1_coll[k] << " " << sign1 << " " << tmb_common << " " <<
1483  alct_common_wcnt1 << " " << tmb_wcnt1_coll[k] << " " << alct_common_wcnt2 << " " << tmb_wcnt2_coll[k]
1484  << std::endl;
1485  }
1486 
1487 
1488  std::cout << std::endl << std::endl;
1489  std::cout << "||||||||||||||||||||" << std::endl;
1490  std::cout << std::endl << std::endl;
1491  std::cout << cfeb_t1_coll.size() <<" "<< cfeb_common << " "<<cfeb_tr1 << " "<< "found" << std::endl;
1492  for (unsigned int k=0; k<cfeb_t1_coll.size(); ++k)
1493  std::cout << "Line: " << cfeb_t1_coll[k] << std::endl;
1494  std::cout <<"********************************************************************************" << std::endl;
1495 
1496 }
RunNumber_t run() const
Definition: EventID.h:39
01/20/05 A.Tumanov
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
void crcCFEB(bool enable)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
bool SuppressZeroLCT
Suppress zeros LCTs.
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
const double w
Definition: UKUtility.cc:23
static void setDebug(bool value)
void modeDDU(bool enable)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
Definition: CSCCrateMap.cc:11
int ddu(const CSCDetId &) const
ddu id for given DetId
const uint16_t nERRORS
CSCMonitorInterface * monitor
#define NULL
Definition: scimark2.h:8
ExaminerStatusType errors(void) const
void crcALCT(bool enable)
const char * errName(int num) const
bool visualFEDInspect
Visualization of raw data.
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
Definition: CSCMap.h:8
void produce(edm::Event &e, const edm::EventSetup &c)
Produce digis out of raw data.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual void process(CSCDCCExaminer *examiner, CSCDCCEventData *dccData)=0
static void setDebug(const bool value)
Definition: CSCTMBHeader.h:122
static void setDebug(const bool value)
Definition: CSCTMBData.h:37
void visual_raw(int hl, int id, int run, int event, bool fedshort, bool fDump, short unsigned int *buf) const
Visualization of raw data in FED-less events (Robert Harr and Alexander Sakharov) ...
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
static void setErrorMask(unsigned int value)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
static void setDebug(bool value)
void crcTMB(bool enable)
int j
Definition: DBlmapReader.cc:9
ParameterDescriptionBase * add(U const &iLabel, T const &value)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::map< CSCIdType, ExaminerStatusType > statusDetailed(void) const
#define LogTrace(id)
static void setDebug(const bool value)
Definition: CSCCLCTData.h:35
ExaminerMaskType getMask() const
void setComment(std::string const &value)
edm::EDGetTokenT< FEDRawDataCollection > i_token
Token for consumes interface &amp; access to data.
unsigned int errorMask
unsigned int examinerMask
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
static void setDebug(bool value)
to access data by via status digis
Definition: CSCALCTHeader.h:30
bool useSelectiveUnpacking
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int32_t check(const uint16_t *&buffer, int32_t length)
std::map< CSCIdType, ExaminerStatusType > payloadDetailed(void) const
edm::EventID id() const
Definition: EventBase.h:59
CSC Format Status Object.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
CSCDCCUnpacker(const edm::ParameterSet &pset)
Constructor.
tuple cout
Definition: gather_cfg.py:145
std::map< DDUIdType, ExaminerStatusType > errorsDetailedDDU(void) const
dictionary rawdata
Definition: lumiPlot.py:393
virtual ~CSCDCCUnpacker()
Destructor.
void setMask(ExaminerMaskType mask)
static void setDebug(const bool value)
Definition: CSCEventData.h:58
static void setDebug(bool debugValue)
Definition: CSCRPCData.h:27