CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CSCDCCUnpacker Class Reference

#include <CSCDCCUnpacker.h>

Inheritance diagram for CSCDCCUnpacker:
edm::stream::EDProducer<>

Public Member Functions

 CSCDCCUnpacker (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 Produce digis out of raw data. More...
 
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) More...
 
 ~CSCDCCUnpacker () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

bool debug
 
unsigned int errorMask
 
unsigned int examinerMask
 
bool formatedEventDump
 
bool goodEvent
 
edm::EDGetTokenT< FEDRawDataCollectioni_token
 Token for consumes interface & access to data. More...
 
bool instantiateDQM
 
CSCMonitorInterfacemonitor
 
int numOfEvents
 
bool printEventNumber
 
bool SuppressZeroLCT
 Suppress zeros LCTs. More...
 
bool unpackStatusDigis
 
bool useExaminer
 
bool useFormatStatus
 
bool useSelectiveUnpacking
 
bool visualFEDInspect
 Visualization of raw data. More...
 
bool visualFEDShort
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Author
Alex Tumanov

Definition at line 17 of file CSCDCCUnpacker.h.

Constructor & Destructor Documentation

◆ CSCDCCUnpacker()

CSCDCCUnpacker::CSCDCCUnpacker ( const edm::ParameterSet pset)

Constructor.

Selective unpacking mode will skip only troublesome CSC blocks and not whole DCC/DDU block

Enable Format Status Digis

Visualization of raw data

Suppress zeros LCTs

Definition at line 75 of file CSCDCCUnpacker.cc.

75  : numOfEvents(0) {
76  // Tracked
77  i_token = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputObjects"));
78 
79  useExaminer = pset.getParameter<bool>("UseExaminer");
80  examinerMask = pset.getParameter<unsigned int>("ExaminerMask");
82  useSelectiveUnpacking = pset.getParameter<bool>("UseSelectiveUnpacking");
83  errorMask = pset.getParameter<unsigned int>("ErrorMask");
84  unpackStatusDigis = pset.getParameter<bool>("UnpackStatusDigis");
86  useFormatStatus = pset.getParameter<bool>("UseFormatStatus");
87 
88  // Untracked
89 
90  printEventNumber = pset.getUntrackedParameter<bool>("PrintEventNumber", true);
91  debug = pset.getUntrackedParameter<bool>("Debug", false);
92  instantiateDQM = pset.getUntrackedParameter<bool>("runDQM", false);
93 
95  visualFEDInspect = pset.getUntrackedParameter<bool>("VisualFEDInspect", false);
96  visualFEDShort = pset.getUntrackedParameter<bool>("VisualFEDShort", false);
97  formatedEventDump = pset.getUntrackedParameter<bool>("FormatedEventDump", false);
98 
100  SuppressZeroLCT = pset.getUntrackedParameter<bool>("SuppressZeroLCT", true);
101 
102  if (instantiateDQM) {
104  }
105 
106  produces<CSCWireDigiCollection>("MuonCSCWireDigi");
107  produces<CSCStripDigiCollection>("MuonCSCStripDigi");
108  produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
109  produces<CSCALCTDigiCollection>("MuonCSCALCTDigi");
110  produces<CSCCLCTDigiCollection>("MuonCSCCLCTDigi");
111  produces<CSCRPCDigiCollection>("MuonCSCRPCDigi");
112  produces<CSCCorrelatedLCTDigiCollection>("MuonCSCCorrelatedLCTDigi");
113 
114  if (unpackStatusDigis) {
115  produces<CSCCFEBStatusDigiCollection>("MuonCSCCFEBStatusDigi");
116  produces<CSCTMBStatusDigiCollection>("MuonCSCTMBStatusDigi");
117  produces<CSCDMBStatusDigiCollection>("MuonCSCDMBStatusDigi");
118  produces<CSCALCTStatusDigiCollection>("MuonCSCALCTStatusDigi");
119  produces<CSCDDUStatusDigiCollection>("MuonCSCDDUStatusDigi");
120  produces<CSCDCCStatusDigiCollection>("MuonCSCDCCStatusDigi");
121  }
122 
123  if (useFormatStatus) {
124  produces<CSCDCCFormatStatusDigiCollection>("MuonCSCDCCFormatStatusDigi");
125  }
126  //CSCAnodeData::setDebug(debug);
136 }

References debug, errorMask, examinerMask, formatedEventDump, i_token, instantiateDQM, monitor, printEventNumber, muonDTDigis_cfi::pset, CSCDCCEventData::setDebug(), CSCRPCData::setDebug(), CSCDDUEventData::setDebug(), CSCALCTHeader::setDebug(), CSCCLCTData::setDebug(), CSCTMBData::setDebug(), CSCEventData::setDebug(), CSCTMBHeader::setDebug(), CSCDDUEventData::setErrorMask(), SuppressZeroLCT, unpackStatusDigis, useExaminer, useFormatStatus, useSelectiveUnpacking, visualFEDInspect, and visualFEDShort.

◆ ~CSCDCCUnpacker()

CSCDCCUnpacker::~CSCDCCUnpacker ( )
override

Destructor.

Definition at line 138 of file CSCDCCUnpacker.cc.

138  {
139  //fill destructor here
140 }

Member Function Documentation

◆ fillDescriptions()

void CSCDCCUnpacker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 142 of file CSCDCCUnpacker.cc.

142  {
144  desc.add<edm::InputTag>("InputObjects", edm::InputTag("rawDataCollector"))
145  ->setComment("# Define input to the unpacker");
146  desc.add<bool>("UseExaminer", true)
147  ->setComment("# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes");
148  desc.add<unsigned int>("ExaminerMask", 535557110)->setComment("# This mask is needed by the examiner");
149  desc.add<bool>("UseSelectiveUnpacking", true)
150  ->setComment("# Use Examiner to unpack good chambers and skip only bad ones");
151  desc.add<unsigned int>("ErrorMask", 0)->setComment("# This mask simply reduces error reporting");
152  desc.add<bool>("UnpackStatusDigis", false)->setComment("# Unpack general status digis?");
153  desc.add<bool>("UseFormatStatus", true)->setComment("# Unpack FormatStatus digi?");
154  desc.addUntracked<bool>("Debug", false)->setComment("# Turn on lots of output");
155  desc.addUntracked<bool>("PrintEventNumber", false);
156  desc.addUntracked<bool>("runDQM", false);
157  desc.addUntracked<bool>("VisualFEDInspect", false)->setComment("# Visualization of raw data in corrupted events");
158  desc.addUntracked<bool>("VisualFEDShort", false)->setComment("# Visualization of raw data in corrupted events");
159  desc.addUntracked<bool>("FormatedEventDump", false);
160  desc.addUntracked<bool>("SuppressZeroLCT", true);
161  descriptions.add("muonCSCDCCUnpacker", desc);
162  descriptions.setComment(" This is the generic cfi file for CSC unpacking");
163 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), HLT_2018_cff::InputTag, and edm::ConfigurationDescriptions::setComment().

◆ produce()

void CSCDCCUnpacker::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Produce digis out of raw data.

access database for mapping

Get a handle to the FED data collection

create the collections of CSC digis

uncomment this for regional unpacking if (id!=SOME_ID) continue;

Take a reference to this FED's data

if fed has data then unpack it

examine event for integrity

If we have DCC or only DDU FED by checking FED ID set examiner to uswe DCC or DDU mode

Visualization of raw data

get a pointer to data and pass it to constructor for unpacking

set default detid to that for E=+z, S=1, R=1, C=1, L=1

get a reference to dduData

DCC Trailer 2 added to dcc status product (to access TTS from DCC)

skip the DDU if its data has serious errors define a mask for serious errors

DDU Trailer 0 added to ddu status product (to access TTS from DDU)

get a reference to chamber data

first process chamber-wide digis such as LCT

default value for all digis not related to cfebs

layer=0 flags entire chamber

For Post-LS1 readout only. Check Chamber->FED/DDU mapping consistency. Skip chambers (special case of data corruption), which report wrong ID and pose as different chamber

check alct data integrity

fill alct digi

check tmb data integrity

fill correlatedlct and clct digis

fill cscrpc digi

fill cfeb status digi

loop over status digis

fill dmb status digi

fill wire, strip and comparator digis...

set layer, dmb and vme are valid because already checked in line 240

Definition at line 165 of file CSCDCCUnpacker.cc.

165  {
167  // Do we really have to do this every event???
168  // ... Yes, because framework is more efficient than you are at caching :)
169  // (But if you want to actually DO something specific WHEN the mapping changes, check out ESWatcher)
171  c.get<CSCCrateMapRcd>().get(hcrate);
172  const CSCCrateMap* pcrate = hcrate.product();
173 
174  // Need access to CSCChamberMap for chamber<->FED/DDU mapping consistency checks
176  c.get<CSCChamberMapRcd>().get(cscmap);
177  const CSCChamberMap* cscmapping = cscmap.product();
178 
179  if (printEventNumber)
180  ++numOfEvents;
181 
184  e.getByToken(i_token, rawdata);
185 
187  auto wireProduct = std::make_unique<CSCWireDigiCollection>();
188  auto stripProduct = std::make_unique<CSCStripDigiCollection>();
189  auto alctProduct = std::make_unique<CSCALCTDigiCollection>();
190  auto clctProduct = std::make_unique<CSCCLCTDigiCollection>();
191  auto comparatorProduct = std::make_unique<CSCComparatorDigiCollection>();
192  auto rpcProduct = std::make_unique<CSCRPCDigiCollection>();
193  auto corrlctProduct = std::make_unique<CSCCorrelatedLCTDigiCollection>();
194  auto cfebStatusProduct = std::make_unique<CSCCFEBStatusDigiCollection>();
195  auto dmbStatusProduct = std::make_unique<CSCDMBStatusDigiCollection>();
196  auto tmbStatusProduct = std::make_unique<CSCTMBStatusDigiCollection>();
197  auto dduStatusProduct = std::make_unique<CSCDDUStatusDigiCollection>();
198  auto dccStatusProduct = std::make_unique<CSCDCCStatusDigiCollection>();
199  auto alctStatusProduct = std::make_unique<CSCALCTStatusDigiCollection>();
200 
201  auto formatStatusProduct = std::make_unique<CSCDCCFormatStatusDigiCollection>();
202 
203  // If set selective unpacking mode
204  // hardcoded examiner mask below to check for DCC and DDU level errors will be used first
205  // then examinerMask for CSC level errors will be used during unpacking of each CSC block
206  unsigned long dccBinCheckMask = 0x06080016;
207 
208  // Post-LS1 FED/DDU ID mapping fix
209  const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
210  834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
211  867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
212 
213  // 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
214  std::vector<unsigned int> cscFEDids;
215 
216  for (unsigned int id = FEDNumbering::MINCSCFEDID; id <= FEDNumbering::MAXCSCFEDID; ++id) // loop over DCCs
217  {
218  cscFEDids.push_back(id);
219  }
220 
221  for (unsigned int id = FEDNumbering::MINCSCDDUFEDID; id <= FEDNumbering::MAXCSCDDUFEDID; ++id) // loop over DDUs
222  {
223  cscFEDids.push_back(id);
224  }
225 
226  for (unsigned int i = 0; i < cscFEDids.size(); i++) // loop over all CSC FEDs (DCCs and DDUs)
227  {
228  unsigned int id = cscFEDids[i];
229  bool isDDU_FED = ((id >= FEDNumbering::MINCSCDDUFEDID) && (id <= FEDNumbering::MAXCSCDDUFEDID)) ? true : false;
230 
233 
235  const FEDRawData& fedData = rawdata->FEDData(id);
236  unsigned long length = fedData.size();
237 
238  if (length >= 32)
239  {
240  CSCDCCExaminer* examiner = nullptr;
241  goodEvent = true;
242  if (useExaminer)
243  {
244  // CSCDCCExaminer examiner;
245  examiner = new CSCDCCExaminer();
246  if (examinerMask & 0x40000)
247  examiner->crcCFEB(true);
248  if (examinerMask & 0x8000)
249  examiner->crcTMB(true);
250  if (examinerMask & 0x0400)
251  examiner->crcALCT(true);
252  examiner->setMask(examinerMask);
253 
255  if (isDDU_FED) {
256  if (examiner != nullptr)
257  examiner->modeDDU(true);
258  }
259 
260  const short unsigned int* data = (short unsigned int*)fedData.data();
261 
262  LogTrace("badData") << "Length: " << length / 2;
263  // Event data hex dump
264  /*
265  short unsigned * buf = (short unsigned int *)fedData.data();
266  std::cout <<std::endl<<length/2<<" words of data:"<<std::endl;
267  for (short unsigned int i=0;i<length/2;i++) {
268  printf("%04x %04x %04x %04x\n",buf[i+3],buf[i+2],buf[i+1],buf[i]);
269  i+=3;
270  }
271  */
272 
273  int res = examiner->check(data, long(fedData.size() / 2));
274  if (res < 0) {
275  goodEvent = false;
276  } else {
278  goodEvent = !(examiner->errors() & dccBinCheckMask);
279  else
280  goodEvent = !(examiner->errors() & examinerMask);
281  }
282 
283  /*
284  std::cout << "FED" << id << " " << fedData.size() << " " << goodEvent << " "
285  << std::hex << examiner->errors() << std::dec << " " << status << std::endl;
286  */
287 
288  // Fill Format status digis per FED
289  // Remove examiner->errors() != 0 check if we need to put status digis for every event
290  if (useFormatStatus && (examiner->errors() != 0))
291  // formatStatusProduct->insertDigi(CSCDetId(1,1,1,1,1), CSCDCCFormatStatusDigi(id,examiner,dccBinCheckMask));
292  formatStatusProduct->insertDigi(CSCDetId(1, 1, 1, 1, 1),
294  dccBinCheckMask,
295  examiner->getMask(),
296  examiner->errors(),
297  examiner->errorsDetailedDDU(),
298  examiner->errorsDetailed(),
299  examiner->payloadDetailed(),
300  examiner->statusDetailed()));
301  }
302 
305  if (!goodEvent || formatedEventDump) {
306  short unsigned* buf = (short unsigned int*)fedData.data();
307  visual_raw(length / 2, id, (int)e.id().run(), (int)e.id().event(), visualFEDShort, formatedEventDump, buf);
308  }
309  }
310 
311  if (goodEvent) {
313 
314  CSCDCCExaminer* ptrExaminer = examiner;
316  ptrExaminer = nullptr;
317 
318  std::vector<CSCDDUEventData> fed_Data;
319  std::vector<CSCDDUEventData>* ptr_fedData = &fed_Data;
320 
322  CSCDetId layer(1, 1, 1, 1, 1);
323 
324  if (isDDU_FED) // Use new DDU FED readout mode
325  {
326  CSCDDUEventData single_dduData((short unsigned int*)fedData.data(), ptrExaminer);
327  fed_Data.push_back(single_dduData);
328 
329  // if(instantiateDQM) monitor->process(examiner, &single_dduData);
330 
331  } else // Use old DCC FED readout mode
332  {
333  CSCDCCEventData dccData((short unsigned int*)fedData.data(), ptrExaminer);
334 
335  //std::cout << " DCC Size [UNPK] " << dccData.sizeInWords() << std::endl;
336 
337  if (instantiateDQM)
338  monitor->process(examiner, &dccData);
339 
341  // const std::vector<CSCDDUEventData> & dduData = dccData.dduData();
342  // ptr_fedData = &(dccData.dduData());
343  fed_Data = dccData.dduData();
344 
345  if (unpackStatusDigis) {
347  short unsigned* bufForDcc = (short unsigned int*)fedData.data();
348 
349  //std::cout << "FED Length: " << std::dec << length/2 <<
350  //" Trailer 2: " << std::hex << bufForDcc[length/2-4] << std::endl;
351 
352  dccStatusProduct->insertDigi(layer,
353  CSCDCCStatusDigi(dccData.dccHeader().data(),
354  dccData.dccTrailer().data(),
355  examiner->errors(),
356  bufForDcc[length / 2 - 4]));
357  }
358  }
359 
360  const std::vector<CSCDDUEventData>& dduData = *ptr_fedData;
361 
362  for (unsigned int iDDU = 0; iDDU < dduData.size(); ++iDDU) // loop over DDUs
363  {
366  if (dduData[iDDU].trailer().errorstat() & errorMask) {
367  LogTrace("CSCDCCUnpacker|CSCRawToDigi")
368  << "FED ID" << id << " DDU# " << iDDU << " has serious error - no digis unpacked! " << std::hex
369  << dduData[iDDU].trailer().errorstat();
370  continue; // to next iteration of DDU loop
371  }
372 
373  if (unpackStatusDigis)
374  dduStatusProduct->insertDigi(
375  layer,
376  CSCDDUStatusDigi(dduData[iDDU].header().data(),
377  dduData[iDDU].trailer().data(),
379  dduData[iDDU].trailer0()));
380 
382  const std::vector<CSCEventData>& cscData = dduData[iDDU].cscData();
383 
384  // 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;
385 
386  for (unsigned int iCSC = 0; iCSC < cscData.size(); ++iCSC) // loop over CSCs
387  {
389  int vmecrate = cscData[iCSC].dmbHeader()->crateID();
390  int dmb = cscData[iCSC].dmbHeader()->dmbID();
391 
392  int icfeb = 0;
393  int ilayer = 0;
394 
395  if (debug)
396  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "crate = " << vmecrate << "; dmb = " << dmb;
397 
398  if ((vmecrate >= 1) && (vmecrate <= 60) && (dmb >= 1) && (dmb <= 10) && (dmb != 6)) {
399  layer = pcrate->detId(vmecrate, dmb, icfeb, ilayer);
400  } else {
401  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << " detID input out of range!!! ";
402  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << " skipping chamber vme= " << vmecrate << " dmb= " << dmb;
403  continue; // to next iteration of iCSC loop
404  }
405 
408  if (isDDU_FED) {
409  unsigned int dduid = cscmapping->ddu(layer);
410  if ((dduid >= 1) && (dduid <= 36))
411  dduid = postLS1_map[dduid - 1]; // Fix for Post-LS1 FED/DDU IDs mappings
412  // std::cout << "CSC " << layer << " -> " << id << ":" << dduid << ":" << vmecrate << ":" << dmb ;
413  if (id != dduid) {
414  LogTrace("CSCDDUUnpacker|CSCRawToDigi") << " CSC->FED/DDU mapping inconsistency!!! ";
415  LogTrace("CSCDCCUnpacker|CSCRawToDigi")
416  << "readout FED/DDU ID=" << id << " expected ID=" << dduid << ", skipping chamber " << layer
417  << " vme= " << vmecrate << " dmb= " << dmb;
418  continue;
419  }
420  }
421 
423  int nalct = cscData[iCSC].dmbHeader()->nalct();
424  bool goodALCT = false;
425  //if (nalct&&(cscData[iCSC].dataPresent>>6&0x1)==1) {
426  if (nalct && cscData[iCSC].alctHeader()) {
427  if (cscData[iCSC].alctHeader()->check()) {
428  goodALCT = true;
429  } else {
430  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "not storing ALCT digis; alct is bad or not present";
431  }
432  } else {
433  if (debug)
434  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "nALCT==0 !!!";
435  }
436 
438  if (goodALCT) {
439  std::vector<CSCALCTDigi> alctDigis = cscData[iCSC].alctHeader()->ALCTDigis();
440  if (SuppressZeroLCT) {
441  std::vector<CSCALCTDigi> alctDigis_0;
442  for (int unsigned i = 0; i < alctDigis.size(); ++i) {
443  if (alctDigis[i].isValid())
444  alctDigis_0.push_back(alctDigis[i]);
445  }
446  alctProduct->move(std::make_pair(alctDigis_0.begin(), alctDigis_0.end()), layer);
447  } else
448  alctProduct->move(std::make_pair(alctDigis.begin(), alctDigis.end()), layer);
449  }
450 
452  int nclct = cscData[iCSC].dmbHeader()->nclct();
453  bool goodTMB = false;
454  // if (nclct&&(cscData[iCSC].dataPresent>>5&0x1)==1) {
455  if (nclct && cscData[iCSC].tmbData()) {
456  if (cscData[iCSC].tmbHeader()->check()) {
457  if (cscData[iCSC].clctData()->check())
458  goodTMB = true;
459  } else {
460  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "one of TMB checks failed! not storing TMB digis ";
461  }
462  } else {
463  if (debug)
464  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "nCLCT==0 !!!";
465  }
466 
468  if (goodTMB) {
469  std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis =
470  cscData[iCSC].tmbHeader()->CorrelatedLCTDigis(layer.rawId());
471  if (SuppressZeroLCT) {
472  std::vector<CSCCorrelatedLCTDigi> correlatedlctDigis_0;
473  for (int unsigned i = 0; i < correlatedlctDigis.size(); ++i) {
474  if (correlatedlctDigis[i].isValid())
475  correlatedlctDigis_0.push_back(correlatedlctDigis[i]);
476  }
477  corrlctProduct->move(std::make_pair(correlatedlctDigis_0.begin(), correlatedlctDigis_0.end()), layer);
478  } else
479  corrlctProduct->move(std::make_pair(correlatedlctDigis.begin(), correlatedlctDigis.end()), layer);
480 
481  std::vector<CSCCLCTDigi> clctDigis = cscData[iCSC].tmbHeader()->CLCTDigis(layer.rawId());
482  if (SuppressZeroLCT) {
483  std::vector<CSCCLCTDigi> clctDigis_0;
484  for (int unsigned i = 0; i < clctDigis.size(); ++i) {
485  if (clctDigis[i].isValid())
486  clctDigis_0.push_back(clctDigis[i]);
487  }
488  clctProduct->move(std::make_pair(clctDigis_0.begin(), clctDigis_0.end()), layer);
489  } else
490  clctProduct->move(std::make_pair(clctDigis.begin(), clctDigis.end()), layer);
491 
493  if (cscData[iCSC].tmbData()->checkSize()) {
494  if (cscData[iCSC].tmbData()->hasRPC()) {
495  std::vector<CSCRPCDigi> rpcDigis = cscData[iCSC].tmbData()->rpcData()->digis();
496  rpcProduct->move(std::make_pair(rpcDigis.begin(), rpcDigis.end()), layer);
497  }
498  } else
499  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << " TMBData check size failed!";
500  }
501 
503  if (unpackStatusDigis) {
504  for (icfeb = 0; icfeb < 7; ++icfeb)
505  {
506  if (cscData[iCSC].cfebData(icfeb) != nullptr)
507  cfebStatusProduct->insertDigi(layer, cscData[iCSC].cfebData(icfeb)->statusDigi());
508  }
510  dmbStatusProduct->insertDigi(
511  layer, CSCDMBStatusDigi(cscData[iCSC].dmbHeader()->data(), cscData[iCSC].dmbTrailer()->data()));
512  if (goodTMB)
513  tmbStatusProduct->insertDigi(
514  layer,
515  CSCTMBStatusDigi(cscData[iCSC].tmbHeader()->data(), cscData[iCSC].tmbData()->tmbTrailer()->data()));
516  if (goodALCT)
517  alctStatusProduct->insertDigi(
518  layer, CSCALCTStatusDigi(cscData[iCSC].alctHeader()->data(), cscData[iCSC].alctTrailer()->data()));
519  }
520 
522  for (int ilayer = 1; ilayer <= 6; ++ilayer) {
524  // (You have to be kidding. Line 240 in whose universe?)
525 
526  // Allocate all ME1/1 wire digis to ring 1
527  layer = pcrate->detId(vmecrate, dmb, 0, ilayer);
528  {
529  std::vector<CSCWireDigi> wireDigis = cscData[iCSC].wireDigis(ilayer);
530  wireProduct->move(std::make_pair(wireDigis.begin(), wireDigis.end()), layer);
531  }
532 
533  for (icfeb = 0; icfeb < 7; ++icfeb) {
534  layer = pcrate->detId(vmecrate, dmb, icfeb, ilayer);
535  if (cscData[iCSC].cfebData(icfeb) && cscData[iCSC].cfebData(icfeb)->check()) {
536  std::vector<CSCStripDigi> stripDigis;
537  cscData[iCSC].cfebData(icfeb)->digis(layer.rawId(), stripDigis);
538  stripProduct->move(std::make_pair(stripDigis.begin(), stripDigis.end()), layer);
539  }
540  }
541 
542  if (goodTMB && (cscData[iCSC].tmbHeader() != nullptr)) {
543  int nCFEBs = cscData[iCSC].tmbHeader()->NCFEBs();
544  for (icfeb = 0; icfeb < nCFEBs; ++icfeb) {
545  layer = pcrate->detId(vmecrate, dmb, icfeb, ilayer);
546  std::vector<CSCComparatorDigi> comparatorDigis =
547  cscData[iCSC].clctData()->comparatorDigis(layer.rawId(), icfeb);
548  // Set cfeb=0, so that ME1/a and ME1/b comparators go to
549  // ring 1.
550  layer = pcrate->detId(vmecrate, dmb, 0, ilayer);
551  comparatorProduct->move(std::make_pair(comparatorDigis.begin(), comparatorDigis.end()), layer);
552  }
553  } // end of loop over cfebs
554  } // end of loop over layers
555  } // end of loop over chambers
556  } // endof loop over DDUs
557  } // end of good event
558  else {
559  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "ERROR! Examiner rejected FED #" << id;
560  if (examiner) {
561  for (int i = 0; i < examiner->nERRORS; ++i) {
562  if (((examinerMask & examiner->errors()) >> i) & 0x1)
563  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << examiner->errName(i);
564  }
565  if (debug) {
566  LogTrace("CSCDCCUnpacker|CSCRawToDigi")
567  << " Examiner errors:0x" << std::hex << examiner->errors() << " & 0x" << examinerMask << " = "
568  << (examiner->errors() & examinerMask);
569  }
570  }
571 
572  // dccStatusProduct->insertDigi(CSCDetId(1,1,1,1,1), CSCDCCStatusDigi(examiner->errors()));
573  // if(instantiateDQM) monitor->process(examiner, NULL);
574  }
575  if (examiner != nullptr)
576  delete examiner;
577  } // end of if fed has data
578  } // end of loop over DCCs
579  // put into the event
580  e.put(std::move(wireProduct), "MuonCSCWireDigi");
581  e.put(std::move(stripProduct), "MuonCSCStripDigi");
582  e.put(std::move(alctProduct), "MuonCSCALCTDigi");
583  e.put(std::move(clctProduct), "MuonCSCCLCTDigi");
584  e.put(std::move(comparatorProduct), "MuonCSCComparatorDigi");
585  e.put(std::move(rpcProduct), "MuonCSCRPCDigi");
586  e.put(std::move(corrlctProduct), "MuonCSCCorrelatedLCTDigi");
587 
588  if (useFormatStatus)
589  e.put(std::move(formatStatusProduct), "MuonCSCDCCFormatStatusDigi");
590 
591  if (unpackStatusDigis) {
592  e.put(std::move(cfebStatusProduct), "MuonCSCCFEBStatusDigi");
593  e.put(std::move(dmbStatusProduct), "MuonCSCDMBStatusDigi");
594  e.put(std::move(tmbStatusProduct), "MuonCSCTMBStatusDigi");
595  e.put(std::move(dduStatusProduct), "MuonCSCDDUStatusDigi");
596  e.put(std::move(dccStatusProduct), "MuonCSCDCCStatusDigi");
597  e.put(std::move(alctStatusProduct), "MuonCSCALCTStatusDigi");
598  }
599  if (printEventNumber)
600  LogTrace("CSCDCCUnpacker|CSCRawToDigi") << "[CSCDCCUnpacker]: " << numOfEvents << " events processed ";
601 }

References visDQMUpload::buf, HltBtagPostValidation_cff::c, RPCNoise_example::check, CSCDCCExaminer::check(), CSCDCCExaminer::crcALCT(), CSCDCCExaminer::crcCFEB(), CSCDCCExaminer::crcTMB(), FEDRawData::data(), data, CSCChamberMap::ddu(), debug, CSCCrateMap::detId(), MillePedeFileConverter_cfg::e, CSCDCCExaminer::errName(), errorMask, CSCDCCExaminer::errors(), CSCDCCExaminer::errorsDetailed(), CSCDCCExaminer::errorsDetailedDDU(), examinerMask, FEDRawDataCollection::FEDData(), formatedEventDump, get, CSCDCCExaminer::getMask(), goodEvent, RecoTauValidation_cfi::header, mps_fire::i, i_token, triggerObjects_cff::id, instantiateDQM, createfilelist::int, LogTrace, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MAXCSCFEDID, FEDNumbering::MINCSCDDUFEDID, FEDNumbering::MINCSCFEDID, CSCDCCExaminer::modeDDU(), monitor, eostools::move(), CSCDCCExaminer::nERRORS, numOfEvents, CSCDCCExaminer::payloadDetailed(), printEventNumber, CSCMonitorInterface::process(), edm::ESHandle< T >::product(), DetId::rawId(), CSCDCCExaminer::setMask(), FEDRawData::size(), CSCDCCExaminer::statusDetailed(), SuppressZeroLCT, unpackStatusDigis, useExaminer, useFormatStatus, useSelectiveUnpacking, visual_raw(), visualFEDInspect, and visualFEDShort.

◆ visual_raw()

void CSCDCCUnpacker::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)

Visualization of raw data.

ALCT Header 1,2

Definition at line 605 of file CSCDCCUnpacker.cc.

606  {
607  std::cout << std::endl << std::endl << std::endl;
608  std::cout << "Run: " << run << " Event: " << event << std::endl;
609  std::cout << std::endl << std::endl;
610  if (formatedEventDump)
611  std::cout << "FED-" << id << " "
612  << "(scroll down to see summary)" << std::endl;
613  else
614  std::cout << "Problem seems in FED-" << id << " "
615  << "(scroll down to see summary)" << std::endl;
616  std::cout << "********************************************************************************" << std::endl;
617  std::cout << hl << " words of data:" << std::endl;
618 
619  //================================================
620  // FED codes in DCC
621  std::vector<int> dcc_id;
622  int dcc_h1_id = 0;
623  // Current codes
624  for (int i = 750; i < 758; i++)
625  dcc_id.push_back(i);
626  // Codes for upgrade
627  for (int i = 830; i < 838; i++)
628  dcc_id.push_back(i);
629 
630  char dcc_common[] = "DCC-";
631 
632  //================================================
633  // DDU codes per FED
634  std::vector<int> ddu_id;
635  int ddu_h1_12_13 = 0;
636  for (int i = 1; i < 37; i++)
637  ddu_id.push_back(i);
638  // For DDU Headers and tarailers
639  char ddu_common[] = "DDU-";
640  char ddu_header1[] = "Header 1";
641  char ddu_header2[] = "Header 2";
642  char ddu_header3[] = "Header 3";
643  char ddu_trail1[] = "Trailer 1", ddu_trail2[] = "Trailer 2", ddu_trail3[] = "Trailer 3";
644  // For Header 2
645  char ddu_trailer1_bit[] = {'8', '0', '0', '0', 'f', 'f', 'f', 'f', '8', '0', '0', '0', '8', '0', '0', '0'};
646  char ddu_trailer3_bit[] = {'a'};
647  // Corrupted Trailers
648  char ddu_tr1_err_common[] = "Incomplet";
649  //====================================================
650 
651  //DMB
652  char dmb_common[] = "DMB", dmb_header1[] = "Header 1", dmb_header2[] = "Header 2";
653  char dmb_common_crate[] = "crate:", dmb_common_slot[] = "slot:";
654  char dmb_common_l1a[] = "L1A:";
655  char dmb_header1_bit[] = {'9', '9', '9', '9'};
656  char dmb_header2_bit[] = {'a', 'a', 'a', 'a'};
657  char dmb_tr1[] = "Trailer 1", dmb_tr2[] = "Trailer 2";
658  char dmb_tr1_bit[] = {'f', 'f', 'f', 'f'}, dmb_tr2_bit[] = {'e', 'e', 'e', 'e'};
659 
660  //=====================================================
661 
662  // ALCT
663  char alct_common[] = "ALCT", alct_header1[] = "Header 1", alct_header2[] = "Header 2";
664  char alct_common_bxn[] = "BXN:";
665  char alct_common_wcnt2[] = "| Actual word count:";
666  char alct_common_wcnt1[] = "Expected word count:";
667  char alct_header1_bit[] = {'d', 'd', 'd', 'd', 'b', '0', 'a'};
668  char alct_header2_bit[] = {'0', '0', '0', '0'};
669  char alct_tr1[] = "Trailer 1";
670 
671  //======================================================
672 
673  //TMB
674  char tmb_common[] = "TMB", tmb_header1[] = "Header", tmb_tr1[] = "Trailer";
675  char tmb_header1_bit[] = {'d', 'd', 'd', 'd', 'b', '0', 'c'};
676  char tmb_tr1_bit[] = {'d', 'd', 'd', 'd', 'e', '0', 'f'};
677 
678  //======================================================
679 
680  //CFEB
681  char cfeb_common[] = "CFEB", cfeb_tr1[] = "Trailer", cfeb_b[] = "B-word";
682  char cfeb_common_sample[] = "sample:";
683 
684  //======================================================
685 
686  //Auxiliary variables
687 
688  // Bufers
689  int word_lines = hl / 4;
690  char tempbuf[80];
691  char tempbuf1[130];
692  char tempbuf_short[17];
693  char sign1[] = " --->| ";
694 
695  // Counters
696  int word_numbering = 0;
697  int ddu_inst_i = 0, ddu_inst_n = 0, ddu_inst_l1a = 0;
698  int ddu_inst_bxn = 0;
699  int dmb_inst_crate = 0, dmb_inst_slot = 0, dmb_inst_l1a = 0;
700  int cfeb_sample = 0;
701  int alct_inst_l1a = 0;
702  int alct_inst_bxn = 0;
703  int alct_inst_wcnt1 = 0;
704  int alct_inst_wcnt2 = 0;
705  int alct_start = 0;
706  int alct_stop = 0;
707  int tmb_inst_l1a = 0;
708  int tmb_inst_wcnt1 = 0;
709  int tmb_inst_wcnt2 = 0;
710  int tmb_start = 0;
711  int tmb_stop = 0;
712  int dcc_h1_check = 0;
713 
714  //Flags
715  int ddu_h2_found = 0; //DDU Header 2 found
716  int w = 0;
717 
718  //Logic variables
719  const int sz1 = 5;
720  bool dcc_check = false;
721  bool ddu_h2_check[sz1] = {false};
722  bool ddu_h1_check = false;
723  bool dmb_h1_check[sz1] = {false};
724  bool dmb_h2_check[sz1] = {false};
725  bool ddu_h2_h1 = false;
726  bool ddu_tr1_check[sz1] = {false};
727  bool alct_h1_check[sz1] = {false};
728  bool alct_h2_check[sz1] = {false};
729  bool alct_tr1_check[sz1] = {false};
730  bool dmb_tr1_check[sz1] = {false};
731  bool dmb_tr2_check[sz1] = {false};
732  bool tmb_h1_check[sz1] = {false};
733  bool tmb_tr1_check[sz1] = {false};
734  bool cfeb_tr1_check[sz1] = {false};
735  bool cfeb_b_check[sz1] = {false};
736  bool ddu_tr1_bad_check[sz1] = {false};
737  bool extraction = fedshort;
738 
739  //Summary vectors
740  //DDU
741  std::vector<int> ddu_h1_coll;
742  std::vector<int> ddu_h1_n_coll;
743  std::vector<int> ddu_h2_coll;
744  std::vector<int> ddu_h3_coll;
745  std::vector<int> ddu_t1_coll;
746  std::vector<int> ddu_t2_coll;
747  std::vector<int> ddu_t3_coll;
748  std::vector<int> ddu_l1a_coll;
749  std::vector<int> ddu_bxn_coll;
750  //DMB
751  std::vector<int> dmb_h1_coll;
752  std::vector<int> dmb_h2_coll;
753  std::vector<int> dmb_t1_coll;
754  std::vector<int> dmb_t2_coll;
755  std::vector<int> dmb_crate_coll;
756  std::vector<int> dmb_slot_coll;
757  std::vector<int> dmb_l1a_coll;
758  //ALCT
759  std::vector<int> alct_h1_coll;
760  std::vector<int> alct_h2_coll;
761  std::vector<int> alct_t1_coll;
762  std::vector<int> alct_l1a_coll;
763  std::vector<int> alct_bxn_coll;
764  std::vector<int> alct_wcnt1_coll;
765  std::vector<int> alct_wcnt2_coll;
766  std::vector<int> alct_wcnt2_id_coll;
767  //TMB
768  std::vector<int> tmb_h1_coll;
769  std::vector<int> tmb_t1_coll;
770  std::vector<int> tmb_l1a_coll;
771  std::vector<int> tmb_wcnt1_coll;
772  std::vector<int> tmb_wcnt2_coll;
773  //CFEB
774  std::vector<int> cfeb_t1_coll;
775 
776  //========================================================
777 
778  // DCC Header and Ttrailer information
779  char dcc_header1[] = "DCC Header 1";
780  char dcc_header2[] = "DCC Header 2";
781  char dcc_trail1[] = "DCC Trailer 1", dcc_trail1_bit[] = {'e'};
782  char dcc_trail2[] = "DCC Trailer 2", dcc_trail2_bit[] = {'a'};
783  //=========================================================
784 
785  for (int i = 0; i < hl; i++) {
786  ++word_numbering;
787  for (int j = -1; j < 4; j++) {
788  sprintf(tempbuf_short,
789  "%04x%04x%04x%04x",
790  buf[i + 4 * (j - 1) + 3],
791  buf[i + 4 * (j - 1) + 2],
792  buf[i + 4 * (j - 1) + 1],
793  buf[i + 4 * (j - 1)]);
794 
795  // WARNING in 5_0_X for time being
796  ddu_h2_found++;
797  ddu_h2_found--;
798 
799  ddu_h2_check[j] = ((buf[i + 4 * (j - 1) + 1] == 0x8000) && (buf[i + 4 * (j - 1) + 2] == 0x0001) &&
800  (buf[i + 4 * (j - 1) + 3] == 0x8000));
801 
802  ddu_tr1_check[j] = ((tempbuf_short[0] == ddu_trailer1_bit[0]) && (tempbuf_short[1] == ddu_trailer1_bit[1]) &&
803  (tempbuf_short[2] == ddu_trailer1_bit[2]) && (tempbuf_short[3] == ddu_trailer1_bit[3]) &&
804  (tempbuf_short[4] == ddu_trailer1_bit[4]) && (tempbuf_short[5] == ddu_trailer1_bit[5]) &&
805  (tempbuf_short[6] == ddu_trailer1_bit[6]) && (tempbuf_short[7] == ddu_trailer1_bit[7]) &&
806  (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
807  (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
808  (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
809  (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
810 
811  dmb_h1_check[j] = ((tempbuf_short[0] == dmb_header1_bit[0]) && (tempbuf_short[4] == dmb_header1_bit[1]) &&
812  (tempbuf_short[8] == dmb_header1_bit[2]) && (tempbuf_short[12] == dmb_header1_bit[3]));
813 
814  dmb_h2_check[j] = ((tempbuf_short[0] == dmb_header2_bit[0]) && (tempbuf_short[4] == dmb_header2_bit[1]) &&
815  (tempbuf_short[8] == dmb_header2_bit[2]) && (tempbuf_short[12] == dmb_header2_bit[3]));
816  alct_h1_check[j] = ((tempbuf_short[0] == alct_header1_bit[0]) && (tempbuf_short[4] == alct_header1_bit[1]) &&
817  (tempbuf_short[8] == alct_header1_bit[2]) && (tempbuf_short[12] == alct_header1_bit[3]) &&
818  (tempbuf_short[13] == alct_header1_bit[4]) && (tempbuf_short[14] == alct_header1_bit[5]) &&
819  (tempbuf_short[15] == alct_header1_bit[6]));
820  alct_h2_check[j] = (((tempbuf_short[0] == alct_header2_bit[0]) && (tempbuf_short[1] == alct_header2_bit[1]) &&
821  (tempbuf_short[2] == alct_header2_bit[2]) && (tempbuf_short[3] == alct_header2_bit[3])) ||
822  ((tempbuf_short[4] == alct_header2_bit[0]) && (tempbuf_short[5] == alct_header2_bit[1]) &&
823  (tempbuf_short[6] == alct_header2_bit[2]) && (tempbuf_short[7] == alct_header2_bit[3])) ||
824  ((tempbuf_short[8] == alct_header2_bit[0]) && (tempbuf_short[9] == alct_header2_bit[1]) &&
825  (tempbuf_short[10] == alct_header2_bit[2]) && (tempbuf_short[11] == alct_header2_bit[3])) ||
826  ((tempbuf_short[12] == alct_header2_bit[0]) && (tempbuf_short[13] == alct_header2_bit[1]) &&
827  (tempbuf_short[14] == alct_header2_bit[2]) && (tempbuf_short[15] == alct_header2_bit[3]))
828  //(tempbuf_short[4]==alct_header2_bit[4])&&(tempbuf_short[5]==alct_header2_bit[5])
829  );
830  // ALCT Trailers
831  alct_tr1_check[j] =
832  (((buf[i + 4 * (j - 1)] & 0xFFFF) == 0xDE0D) && ((buf[i + 4 * (j - 1) + 1] & 0xF800) == 0xD000) &&
833  ((buf[i + 4 * (j - 1) + 2] & 0xF800) == 0xD000) && ((buf[i + 4 * (j - 1) + 3] & 0xF000) == 0xD000));
834  // DMB Trailers
835  dmb_tr1_check[j] = ((tempbuf_short[0] == dmb_tr1_bit[0]) && (tempbuf_short[4] == dmb_tr1_bit[1]) &&
836  (tempbuf_short[8] == dmb_tr1_bit[2]) && (tempbuf_short[12] == dmb_tr1_bit[3]));
837  dmb_tr2_check[j] = ((tempbuf_short[0] == dmb_tr2_bit[0]) && (tempbuf_short[4] == dmb_tr2_bit[1]) &&
838  (tempbuf_short[8] == dmb_tr2_bit[2]) && (tempbuf_short[12] == dmb_tr2_bit[3]));
839  // TMB
840  tmb_h1_check[j] = ((tempbuf_short[0] == tmb_header1_bit[0]) && (tempbuf_short[4] == tmb_header1_bit[1]) &&
841  (tempbuf_short[8] == tmb_header1_bit[2]) && (tempbuf_short[12] == tmb_header1_bit[3]) &&
842  (tempbuf_short[13] == tmb_header1_bit[4]) && (tempbuf_short[14] == tmb_header1_bit[5]) &&
843  (tempbuf_short[15] == tmb_header1_bit[6]));
844  tmb_tr1_check[j] = ((tempbuf_short[0] == tmb_tr1_bit[0]) && (tempbuf_short[4] == tmb_tr1_bit[1]) &&
845  (tempbuf_short[8] == tmb_tr1_bit[2]) && (tempbuf_short[12] == tmb_tr1_bit[3]) &&
846  (tempbuf_short[13] == tmb_tr1_bit[4]) && (tempbuf_short[14] == tmb_tr1_bit[5]) &&
847  (tempbuf_short[15] == tmb_tr1_bit[6]));
848  // CFEB
849  cfeb_tr1_check[j] =
850  (((buf[i + 4 * (j - 1) + 1] & 0xF000) == 0x7000) && ((buf[i + 4 * (j - 1) + 2] & 0xF000) == 0x7000) &&
851  ((buf[i + 4 * (j - 1) + 1] != 0x7FFF) || (buf[i + 4 * (j - 1) + 2] != 0x7FFF)) &&
852  ((buf[i + 4 * (j - 1) + 3] == 0x7FFF) || ((buf[i + 4 * (j - 1) + 3] & buf[i + 4 * (j - 1)]) == 0x0 &&
853  (buf[i + 4 * (j - 1) + 3] + buf[i + 4 * (j - 1)] == 0x7FFF))));
854  cfeb_b_check[j] =
855  (((buf[i + 4 * (j - 1) + 3] & 0xF000) == 0xB000) && ((buf[i + 4 * (j - 1) + 2] & 0xF000) == 0xB000) &&
856  ((buf[i + 4 * (j - 1) + 1] & 0xF000) == 0xB000) && ((buf[i + 4 * (j - 1)] = 3 & 0xF000) == 0xB000));
857  // DDU Trailers with errors
858  ddu_tr1_bad_check[j] =
859  ((tempbuf_short[0] != ddu_trailer1_bit[0]) &&
860  //(tempbuf_short[1]!=ddu_trailer1_bit[1])&&(tempbuf_short[2]!=ddu_trailer1_bit[2])&&
861  //(tempbuf_short[3]==ddu_trailer1_bit[3])&&
862  (tempbuf_short[4] != ddu_trailer1_bit[4]) &&
863  //(tempbuf_short[5]==ddu_trailer1_bit[5])&&
864  //(tempbuf_short[6]==ddu_trailer1_bit[6])&&(tempbuf_short[7]==ddu_trailer1_bit[7])&&
865  (tempbuf_short[8] == ddu_trailer1_bit[8]) && (tempbuf_short[9] == ddu_trailer1_bit[9]) &&
866  (tempbuf_short[10] == ddu_trailer1_bit[10]) && (tempbuf_short[11] == ddu_trailer1_bit[11]) &&
867  (tempbuf_short[12] == ddu_trailer1_bit[12]) && (tempbuf_short[13] == ddu_trailer1_bit[13]) &&
868  (tempbuf_short[14] == ddu_trailer1_bit[14]) && (tempbuf_short[15] == ddu_trailer1_bit[15]));
869  }
870 
871  // DDU Header 2 next to Header 1
872  ddu_h2_h1 = ddu_h2_check[2];
873 
874  sprintf(tempbuf_short, "%04x%04x%04x%04x", buf[i + 3], buf[i + 2], buf[i + 1], buf[i]);
875 
876  // Looking for DDU Header 1
877  ddu_h1_12_13 = (buf[i] >> 8);
878  for (int kk = 0; kk < 36; kk++) {
879  if (((buf[i + 3] & 0xF000) == 0x5000) && (ddu_h1_12_13 == ddu_id[kk]) && ddu_h2_h1) {
880  ddu_h1_coll.push_back(word_numbering);
881  ddu_h1_n_coll.push_back(ddu_id[kk]);
882  ddu_inst_l1a = ((buf[i + 2] & 0xFFFF) + ((buf[i + 3] & 0x00FF) << 16));
883  ddu_l1a_coll.push_back(ddu_inst_l1a);
884  ddu_inst_bxn = (buf[i + 1] & 0xFFF0) >> 4;
885  ddu_bxn_coll.push_back(ddu_inst_bxn);
886  sprintf(tempbuf1,
887  "%6i %04x %04x %04x %04x%s%s%i %s%s %s %i %s %i",
888  word_numbering,
889  buf[i + 3],
890  buf[i + 2],
891  buf[i + 1],
892  buf[i],
893  sign1,
894  ddu_common,
895  ddu_id[kk],
896  ddu_header1,
897  sign1,
898  dmb_common_l1a,
899  ddu_inst_l1a,
900  alct_common_bxn,
901  ddu_inst_bxn);
902  std::cout << tempbuf1 << std::endl;
903  w = 0;
904  ddu_h1_check = true;
905  cfeb_sample = 0;
906  }
907  }
908 
909  // Looking for DCC Header 1
910  dcc_h1_id = (((buf[i + 1] << 12) & 0xF000) >> 4) + (buf[i] >> 8);
911  for (int dcci = 0; dcci < 16; dcci++) {
912  if ((dcc_id[dcci] == dcc_h1_id) && (((buf[i + 3] & 0xF000) == 0x5000) && (!ddu_h1_check))) {
913  sprintf(tempbuf1,
914  "%6i %04x %04x %04x %04x%s%s%i %s",
915  word_numbering,
916  buf[i + 3],
917  buf[i + 2],
918  buf[i + 1],
919  buf[i],
920  sign1,
921  dcc_common,
922  dcc_h1_id,
923  dcc_header1);
924  dcc_h1_check = word_numbering;
925  w = 0;
926  dcc_check = true;
927  std::cout << tempbuf1 << std::endl;
928  }
929  }
930 
931  // Looking for DCC Header 2 and trailers
932  if (((word_numbering - 1) == dcc_h1_check) && ((buf[i + 3] & 0xFF00) == 0xD900)) {
933  sprintf(tempbuf1,
934  "%6i %04x %04x %04x %04x%s%s",
935  word_numbering,
936  buf[i + 3],
937  buf[i + 2],
938  buf[i + 1],
939  buf[i],
940  sign1,
941  dcc_header2);
942  std::cout << tempbuf1 << std::endl;
943  w = 0;
944  } else if ((word_numbering == word_lines - 1) && (tempbuf_short[0] == dcc_trail1_bit[0])) {
945  sprintf(tempbuf1,
946  "%6i %04x %04x %04x %04x%s%s",
947  word_numbering,
948  buf[i + 3],
949  buf[i + 2],
950  buf[i + 1],
951  buf[i],
952  sign1,
953  dcc_trail1);
954  std::cout << tempbuf1 << std::endl;
955  w = 0;
956  } else if ((word_numbering == word_lines) && (tempbuf_short[0] == dcc_trail2_bit[0])) {
957  sprintf(tempbuf1,
958  "%6i %04x %04x %04x %04x%s%s",
959  word_numbering,
960  buf[i + 3],
961  buf[i + 2],
962  buf[i + 1],
963  buf[i],
964  sign1,
965  dcc_trail2);
966  std::cout << tempbuf1 << std::endl;
967  w = 0;
968  }
969 
970  // DDU Header 2
971  else if (ddu_h2_check[1]) {
972  ddu_inst_i = ddu_h1_n_coll.size(); //ddu_inst_n=ddu_h1_n_coll[0];
973  if (ddu_inst_i > 0) {
974  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
975  }
976  sprintf(tempbuf1,
977  "%6i %04x %04x %04x %04x%s%s%i %s",
978  word_numbering,
979  buf[i + 3],
980  buf[i + 2],
981  buf[i + 1],
982  buf[i],
983  sign1,
984  ddu_common,
985  ddu_inst_n,
986  ddu_header2);
987  ddu_h2_coll.push_back(word_numbering);
988  std::cout << tempbuf1 << std::endl;
989  w = 0;
990  ddu_h2_found = 1;
991  }
992 
993  // DDU Header 3 (either between DDU Header 2 DMB Header or DDU Header 2 DDU Trailer1)
994  else if ((ddu_h2_check[0] && dmb_h1_check[2]) || (ddu_h2_check[0] && ddu_tr1_check[2])) {
995  ddu_inst_i = ddu_h1_n_coll.size();
996  if (ddu_inst_i > 0) {
997  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
998  }
999  sprintf(tempbuf1,
1000  "%6i %04x %04x %04x %04x%s%s%i %s",
1001  word_numbering,
1002  buf[i + 3],
1003  buf[i + 2],
1004  buf[i + 1],
1005  buf[i],
1006  sign1,
1007  ddu_common,
1008  ddu_inst_n,
1009  ddu_header3);
1010  ddu_h3_coll.push_back(word_numbering);
1011  std::cout << tempbuf1 << std::endl;
1012  w = 0;
1013  ddu_h2_found = 0;
1014  }
1015 
1016  // DMB Header 1,2
1017 
1018  else if (dmb_h1_check[1]) {
1019  dmb_inst_crate = 0;
1020  dmb_inst_slot = 0;
1021  dmb_inst_l1a = ((buf[i] & 0x0FFF) + ((buf[i + 1] & 0xFFF) << 12));
1022  dmb_l1a_coll.push_back(dmb_inst_l1a);
1023  if (dmb_h2_check[2]) {
1024  dmb_inst_crate = ((buf[i + 4 + 1] >> 4) & 0xFF);
1025  dmb_inst_slot = (buf[i + 4 + 1] & 0xF);
1026  dmb_crate_coll.push_back(dmb_inst_crate);
1027  dmb_slot_coll.push_back(dmb_inst_slot);
1028  }
1029  sprintf(tempbuf1,
1030  "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1031  word_numbering,
1032  buf[i + 3],
1033  buf[i + 2],
1034  buf[i + 1],
1035  buf[i],
1036  sign1,
1037  dmb_common,
1038  dmb_header1,
1039  sign1,
1040  dmb_common_crate,
1041  dmb_inst_crate,
1042  dmb_common_slot,
1043  dmb_inst_slot,
1044  dmb_common_l1a,
1045  dmb_inst_l1a);
1046  dmb_h1_coll.push_back(word_numbering);
1047  std::cout << tempbuf1 << std::endl;
1048  w = 0;
1049  ddu_h2_found = 1;
1050  }
1051 
1052  else if (dmb_h2_check[1]) {
1053  dmb_inst_crate = ((buf[i + 1] >> 4) & 0xFF);
1054  dmb_inst_slot = (buf[i + 1] & 0xF);
1055  dmb_h2_coll.push_back(word_numbering);
1056  if (dmb_h1_check[0])
1057  dmb_inst_l1a = ((buf[i - 4] & 0x0FFF) + ((buf[i - 4 + 1] & 0xFFF) << 12));
1058  sprintf(tempbuf1,
1059  "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i %s %i",
1060  word_numbering,
1061  buf[i + 3],
1062  buf[i + 2],
1063  buf[i + 1],
1064  buf[i],
1065  sign1,
1066  dmb_common,
1067  dmb_header2,
1068  sign1,
1069  dmb_common_crate,
1070  dmb_inst_crate,
1071  dmb_common_slot,
1072  dmb_inst_slot,
1073  dmb_common_l1a,
1074  dmb_inst_l1a);
1075  std::cout << tempbuf1 << std::endl;
1076  w = 0;
1077  ddu_h2_found = 1;
1078  }
1079 
1080  //DDU Trailer 1
1081 
1082  else if (ddu_tr1_check[1]) {
1083  ddu_inst_i = ddu_h1_n_coll.size();
1084  if (ddu_inst_i > 0) {
1085  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1086  }
1087  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1088  sprintf(tempbuf1,
1089  "%6i %04x %04x %04x %04x%s%s%i %s",
1090  word_numbering,
1091  buf[i + 3],
1092  buf[i + 2],
1093  buf[i + 1],
1094  buf[i],
1095  sign1,
1096  ddu_common,
1097  ddu_inst_n,
1098  ddu_trail1);
1099  ddu_t1_coll.push_back(word_numbering);
1100  std::cout << tempbuf1 << std::endl;
1101  w = 0;
1102  }
1103 
1105  else if (alct_h1_check[1]) {
1106  alct_start = word_numbering;
1107  alct_inst_l1a = (buf[i + 2] & 0x0FFF);
1108  alct_l1a_coll.push_back(alct_inst_l1a);
1109  sprintf(tempbuf1,
1110  "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1111  word_numbering,
1112  buf[i + 3],
1113  buf[i + 2],
1114  buf[i + 1],
1115  buf[i],
1116  sign1,
1117  alct_common,
1118  alct_header1,
1119  sign1,
1120  dmb_common_l1a,
1121  alct_inst_l1a);
1122  alct_h1_coll.push_back(word_numbering);
1123  std::cout << tempbuf1 << std::endl;
1124  w = 0;
1125  }
1126 
1127  else if ((alct_h1_check[0]) && (alct_h2_check[2])) {
1128  alct_inst_bxn = (buf[i] & 0x0FFF);
1129  alct_bxn_coll.push_back(alct_inst_bxn);
1130  sprintf(tempbuf1,
1131  "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1132  word_numbering,
1133  buf[i + 3],
1134  buf[i + 2],
1135  buf[i + 1],
1136  buf[i],
1137  sign1,
1138  alct_common,
1139  alct_header2,
1140  sign1,
1141  alct_common_bxn,
1142  alct_inst_bxn);
1143  alct_h2_coll.push_back(word_numbering);
1144  std::cout << tempbuf1 << std::endl;
1145  w = 0;
1146  }
1147 
1148  //ALCT Trailer 1
1149  else if (alct_tr1_check[1]) {
1150  alct_stop = word_numbering;
1151  if ((alct_start != 0) && (alct_stop != 0) && (alct_stop > alct_start)) {
1152  alct_inst_wcnt2 = 4 * (alct_stop - alct_start + 1);
1153  alct_wcnt2_coll.push_back(alct_inst_wcnt2);
1154  alct_wcnt2_id_coll.push_back(alct_start);
1155  }
1156  alct_inst_wcnt1 = (buf[i + 3] & 0x7FF);
1157  alct_wcnt1_coll.push_back(alct_inst_wcnt1);
1158  sprintf(tempbuf1,
1159  "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1160  word_numbering,
1161  buf[i + 3],
1162  buf[i + 2],
1163  buf[i + 1],
1164  buf[i],
1165  sign1,
1166  alct_common,
1167  alct_tr1,
1168  sign1,
1169  alct_common_wcnt1,
1170  alct_inst_wcnt1,
1171  alct_common_wcnt2,
1172  alct_inst_wcnt2);
1173  alct_t1_coll.push_back(word_numbering);
1174  std::cout << tempbuf1 << std::endl;
1175  w = 0;
1176  alct_inst_wcnt2 = 0;
1177  }
1178 
1179  //DDU Trailer 3
1180 
1181  // else if ((ddu_tr1_check[-1])&&(tempbuf_short[0]==ddu_trailer3_bit[0])) { // !!! TO FIX: negative index
1182  else if ((ddu_h2_h1) && (tempbuf_short[0] == ddu_trailer3_bit[0])) {
1183  //&&(tempbuf_short[0]==ddu_trailer3_bit[0])){
1184  ddu_inst_i = ddu_h1_n_coll.size();
1185  if (ddu_inst_i > 0) {
1186  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1187  }
1188  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1189  sprintf(tempbuf1,
1190  "%6i %04x %04x %04x %04x%s%s%i %s",
1191  word_numbering,
1192  buf[i + 3],
1193  buf[i + 2],
1194  buf[i + 1],
1195  buf[i],
1196  sign1,
1197  ddu_common,
1198  ddu_inst_n,
1199  ddu_trail3);
1200  ddu_t3_coll.push_back(word_numbering);
1201  std::cout << tempbuf1 << std::endl;
1202  w = 0;
1203  }
1204  //DDU Trailer 2
1205  else if ((ddu_tr1_check[0]) && (tempbuf_short[0] != ddu_trailer3_bit[0])) {
1206  //&&(tempbuf_short[0]==ddu_trailer3_bit[0])){
1207  ddu_inst_i = ddu_h1_n_coll.size();
1208  if (ddu_inst_i > 0) {
1209  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1210  }
1211  //ddu_inst_n=ddu_h1_n_coll[ddu_inst_i-1];
1212  sprintf(tempbuf1,
1213  "%6i %04x %04x %04x %04x%s%s%i %s",
1214  word_numbering,
1215  buf[i + 3],
1216  buf[i + 2],
1217  buf[i + 1],
1218  buf[i],
1219  sign1,
1220  ddu_common,
1221  ddu_inst_n,
1222  ddu_trail2);
1223  ddu_t2_coll.push_back(word_numbering);
1224  std::cout << tempbuf1 << std::endl;
1225  w = 0;
1226  }
1227 
1228  //DMB Trailer 1,2
1229  else if (dmb_tr1_check[1]) {
1230  sprintf(tempbuf1,
1231  "%6i %04x %04x %04x %04x%s%s %s",
1232  word_numbering,
1233  buf[i + 3],
1234  buf[i + 2],
1235  buf[i + 1],
1236  buf[i],
1237  sign1,
1238  dmb_common,
1239  dmb_tr1);
1240  dmb_t1_coll.push_back(word_numbering);
1241  std::cout << tempbuf1 << std::endl;
1242  w = 0;
1243  cfeb_sample = 0;
1244  }
1245 
1246  else if (dmb_tr2_check[1]) {
1247  sprintf(tempbuf1,
1248  "%6i %04x %04x %04x %04x%s%s %s",
1249  word_numbering,
1250  buf[i + 3],
1251  buf[i + 2],
1252  buf[i + 1],
1253  buf[i],
1254  sign1,
1255  dmb_common,
1256  dmb_tr2);
1257  dmb_t2_coll.push_back(word_numbering);
1258  std::cout << tempbuf1 << std::endl;
1259  w = 0;
1260  }
1261  // TMB
1262  else if (tmb_h1_check[1]) {
1263  tmb_start = word_numbering;
1264  tmb_inst_l1a = (buf[i + 2] & 0x000F);
1265  tmb_l1a_coll.push_back(tmb_inst_l1a);
1266  sprintf(tempbuf1,
1267  "%6i %04x %04x %04x %04x%s%s %s%s%s %i",
1268  word_numbering,
1269  buf[i + 3],
1270  buf[i + 2],
1271  buf[i + 1],
1272  buf[i],
1273  sign1,
1274  tmb_common,
1275  tmb_header1,
1276  sign1,
1277  dmb_common_l1a,
1278  tmb_inst_l1a);
1279  tmb_h1_coll.push_back(word_numbering);
1280  std::cout << tempbuf1 << std::endl;
1281  w = 0;
1282  } else if (tmb_tr1_check[1]) {
1283  tmb_stop = word_numbering;
1284  if ((tmb_start != 0) && (tmb_stop != 0) && (tmb_stop > tmb_start)) {
1285  tmb_inst_wcnt2 = 4 * (tmb_stop - tmb_start + 1);
1286  tmb_wcnt2_coll.push_back(tmb_inst_wcnt2);
1287  }
1288  tmb_inst_wcnt1 = (buf[i + 3] & 0x7FF);
1289  tmb_wcnt1_coll.push_back(tmb_inst_wcnt1);
1290  sprintf(tempbuf1,
1291  "%6i %04x %04x %04x %04x%s%s %s%s%s %i %s %i",
1292  word_numbering,
1293  buf[i + 3],
1294  buf[i + 2],
1295  buf[i + 1],
1296  buf[i],
1297  sign1,
1298  tmb_common,
1299  tmb_tr1,
1300  sign1,
1301  alct_common_wcnt1,
1302  tmb_inst_wcnt1,
1303  alct_common_wcnt2,
1304  tmb_inst_wcnt2);
1305  tmb_t1_coll.push_back(word_numbering);
1306  std::cout << tempbuf1 << std::endl;
1307  w = 0;
1308  tmb_inst_wcnt2 = 0;
1309  }
1310  // CFEB
1311  else if (cfeb_tr1_check[1]) {
1312  ++cfeb_sample;
1313  sprintf(tempbuf1,
1314  "%6i %04x %04x %04x %04x%s%s %s%s %s %i",
1315  word_numbering,
1316  buf[i + 3],
1317  buf[i + 2],
1318  buf[i + 1],
1319  buf[i],
1320  sign1,
1321  cfeb_common,
1322  cfeb_tr1,
1323  sign1,
1324  cfeb_common_sample,
1325  cfeb_sample);
1326  cfeb_t1_coll.push_back(word_numbering);
1327  std::cout << tempbuf1 << std::endl;
1328  w = 0;
1329  } else if (cfeb_b_check[1]) {
1330  sprintf(tempbuf1,
1331  "%6i %04x %04x %04x %04x%s%s %s",
1332  word_numbering,
1333  buf[i + 3],
1334  buf[i + 2],
1335  buf[i + 1],
1336  buf[i],
1337  sign1,
1338  cfeb_common,
1339  cfeb_b);
1340  std::cout << tempbuf1 << std::endl;
1341  w = 0;
1342  }
1343 
1344  //ERRORS ddu_tr1_bad_check
1345 
1346  else if (ddu_tr1_bad_check[1]) {
1347  ddu_inst_i = ddu_h1_n_coll.size();
1348  ddu_inst_n = ddu_h1_n_coll[ddu_inst_i - 1];
1349  sprintf(tempbuf1,
1350  "%6i %04x %04x %04x %04x%s%s%i %s %s",
1351  word_numbering,
1352  buf[i + 3],
1353  buf[i + 2],
1354  buf[i + 1],
1355  buf[i],
1356  sign1,
1357  ddu_common,
1358  ddu_inst_n,
1359  ddu_trail1,
1360  ddu_tr1_err_common);
1361  std::cout << tempbuf1 << std::endl;
1362  w = 0;
1363  }
1364 
1365  else if (extraction && (!ddu_h1_check) && (!dcc_check)) {
1366  if (w < 3) {
1367  sprintf(tempbuf, "%6i %04x %04x %04x %04x", word_numbering, buf[i + 3], buf[i + 2], buf[i + 1], buf[i]);
1368  std::cout << tempbuf << std::endl;
1369  w++;
1370  }
1371  if (w == 3) {
1372  std::cout << "..................................................." << std::endl;
1373  w++;
1374  }
1375  }
1376 
1377  else if ((!ddu_h1_check) && (!dcc_check)) {
1378  sprintf(tempbuf, "%6i %04x %04x %04x %04x", word_numbering, buf[i + 3], buf[i + 2], buf[i + 1], buf[i]);
1379  std::cout << tempbuf << std::endl;
1380  }
1381 
1382  i += 3;
1383  ddu_h1_check = false;
1384  dcc_check = false;
1385  }
1386  //char sign[30]; //WARNING 5_0_X
1387  std::cout << "********************************************************************************" << std::endl
1388  << std::endl;
1389  if (fedshort)
1390  std::cout << "For complete output turn off VisualFEDShort in muonCSCDigis configuration file." << std::endl;
1391  std::cout << "********************************************************************************" << std::endl
1392  << std::endl;
1393  std::cout << std::endl << std::endl;
1394  std::cout << " Summary " << std::endl;
1395  std::cout << std::endl << std::endl;
1396  std::cout << ddu_h1_coll.size() << " " << ddu_common << " " << ddu_header1 << " "
1397  << "found" << std::endl;
1398  /*
1399  std::cout << ddu_h1_coll.size() << " " << ddu_h1_n_coll.size() << " " << ddu_l1a_coll.size() <<
1400  " " << ddu_bxn_coll.size() << std::endl;
1401  */
1402  for (unsigned int k = 0; k < ddu_h1_coll.size(); ++k) {
1403  /*
1404  sprintf(sign,"%s%6i%5s %s%i %s %i %s %i","Line: ",
1405  ddu_h1_coll[k],sign1,ddu_common,ddu_h1_n_coll[k],dmb_common_l1a,ddu_l1a_coll[k],
1406  alct_common_bxn,ddu_bxn_coll[k]);
1407  */
1408  std::cout << "Line: "
1409  << " " << ddu_h1_coll[k] << " " << sign1 << " " << ddu_common << " " << ddu_h1_n_coll[k] << " "
1410  << dmb_common_l1a << " " << ddu_l1a_coll[k] << " " << alct_common_bxn << " " << ddu_bxn_coll[k]
1411  << std::endl;
1412  }
1413 
1414  std::cout << std::endl << std::endl;
1415  std::cout << "||||||||||||||||||||" << std::endl;
1416  std::cout << std::endl << std::endl;
1417  std::cout << ddu_h2_coll.size() << " " << ddu_common << " " << ddu_header2 << " "
1418  << "found" << std::endl;
1419  for (unsigned int k = 0; k < ddu_h2_coll.size(); ++k)
1420  std::cout << "Line: " << ddu_h2_coll[k] << std::endl;
1421  std::cout << std::endl << std::endl;
1422  std::cout << "||||||||||||||||||||" << std::endl;
1423  std::cout << std::endl << std::endl;
1424  std::cout << ddu_h3_coll.size() << " " << ddu_common << " " << ddu_header3 << " "
1425  << "found" << std::endl;
1426  for (unsigned int k = 0; k < ddu_h3_coll.size(); ++k)
1427  std::cout << "Line: " << ddu_h3_coll[k] << std::endl;
1428  std::cout << std::endl << std::endl;
1429  std::cout << "||||||||||||||||||||" << std::endl;
1430  std::cout << std::endl << std::endl;
1431  std::cout << ddu_t1_coll.size() << " " << ddu_common << " " << ddu_trail1 << " "
1432  << "found" << std::endl;
1433  for (unsigned int k = 0; k < ddu_t1_coll.size(); ++k)
1434  std::cout << "Line: " << ddu_t1_coll[k] << std::endl;
1435  std::cout << std::endl << std::endl;
1436  std::cout << "||||||||||||||||||||" << std::endl;
1437  std::cout << std::endl << std::endl;
1438  std::cout << ddu_t2_coll.size() << " " << ddu_common << " " << ddu_trail2 << " "
1439  << "found" << std::endl;
1440  for (unsigned int k = 0; k < ddu_t2_coll.size(); ++k)
1441  std::cout << "Line: " << ddu_t2_coll[k] << std::endl;
1442  std::cout << std::endl << std::endl;
1443  std::cout << "||||||||||||||||||||" << std::endl;
1444  std::cout << std::endl << std::endl;
1445  std::cout << ddu_t3_coll.size() << " " << ddu_common << " " << ddu_trail3 << " "
1446  << "found" << std::endl;
1447  for (unsigned int k = 0; k < ddu_t3_coll.size(); ++k)
1448  std::cout << "Line: " << ddu_t3_coll[k] << std::endl;
1449  std::cout << std::endl << std::endl;
1450  std::cout << "||||||||||||||||||||" << std::endl;
1451  std::cout << std::endl << std::endl;
1452  std::cout << dmb_h1_coll.size() << " " << dmb_common << " " << dmb_header1 << " "
1453  << "found" << std::endl;
1454 
1455  for (unsigned int k = 0; k < dmb_h1_coll.size(); ++k) {
1456  /*
1457  sprintf(sign,"%s%6i%5s %s %s %i %s %i %s %i","Line: ",
1458  dmb_h1_coll[k],sign1,dmb_common,dmb_common_crate,dmb_crate_coll[k],dmb_common_slot,
1459  dmb_slot_coll[k],dmb_common_l1a,dmb_l1a_coll[k]);
1460  */
1461  std::cout << "Line: "
1462  << " " << dmb_h1_coll[k] << " " << sign1 << dmb_common << " " << dmb_common_crate << " "
1463  << dmb_crate_coll[k] << " " << dmb_common_slot << " " << dmb_slot_coll[k] << " " << dmb_common_l1a << " "
1464  << dmb_l1a_coll[k] << std::endl;
1465  }
1466  std::cout << std::endl << std::endl;
1467  std::cout << "||||||||||||||||||||" << std::endl;
1468  std::cout << std::endl << std::endl;
1469  std::cout << dmb_h2_coll.size() << " " << dmb_common << " " << dmb_header2 << " "
1470  << "found" << std::endl;
1471  for (unsigned int k = 0; k < dmb_h2_coll.size(); ++k)
1472  std::cout << "Line: " << dmb_h2_coll[k] << std::endl;
1473  std::cout << std::endl << std::endl;
1474  std::cout << "||||||||||||||||||||" << std::endl;
1475  std::cout << std::endl << std::endl;
1476  std::cout << dmb_t1_coll.size() << " " << dmb_common << " " << dmb_tr1 << " "
1477  << "found" << std::endl;
1478  for (unsigned int k = 0; k < dmb_t1_coll.size(); ++k)
1479  std::cout << "Line: " << dmb_t1_coll[k] << std::endl;
1480  std::cout << std::endl << std::endl;
1481  std::cout << "||||||||||||||||||||" << std::endl;
1482  std::cout << std::endl << std::endl;
1483  std::cout << dmb_t2_coll.size() << " " << dmb_common << " " << dmb_tr2 << " "
1484  << "found" << std::endl;
1485  for (unsigned int k = 0; k < dmb_t2_coll.size(); ++k)
1486  std::cout << "Line: " << dmb_t2_coll[k] << std::endl;
1487  std::cout << std::endl << std::endl;
1488  std::cout << "||||||||||||||||||||" << std::endl;
1489  std::cout << std::endl << std::endl;
1490  std::cout << alct_h1_coll.size() << " " << alct_common << " " << alct_header1 << " "
1491  << "found" << std::endl;
1492  for (unsigned int k = 0; k < alct_h1_coll.size(); ++k) {
1493  /*
1494  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1495  alct_h1_coll[k],sign1,alct_common,
1496  dmb_common_l1a,alct_l1a_coll[k]);
1497  std::cout << sign << std::endl;
1498  */
1499  std::cout << "Line: "
1500  << " " << alct_h1_coll[k] << " " << sign1 << " " << alct_common << " " << dmb_common_l1a << " "
1501  << alct_l1a_coll[k] << std::endl;
1502  }
1503 
1504  std::cout << std::endl << std::endl;
1505  std::cout << "||||||||||||||||||||" << std::endl;
1506  std::cout << std::endl << std::endl;
1507  std::cout << alct_h2_coll.size() << " " << alct_common << " " << alct_header2 << " "
1508  << "found" << std::endl;
1509  for (unsigned int k = 0; k < alct_h2_coll.size(); ++k) {
1510  /*
1511  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1512  alct_h1_coll[k],sign1,alct_common,
1513  alct_common_bxn,alct_bxn_coll[k]);
1514  std::cout << sign << std::endl;
1515  */
1516  std::cout << "Line: "
1517  << " " << alct_h1_coll[k] << " " << sign1 << " " << alct_common << " " << alct_common_bxn << " "
1518  << alct_bxn_coll[k] << std::endl;
1519  }
1520 
1521  std::cout << std::endl << std::endl;
1522  std::cout << "||||||||||||||||||||" << std::endl;
1523  std::cout << std::endl << std::endl;
1524  std::cout << alct_t1_coll.size() << " " << alct_common << " " << alct_tr1 << " "
1525  << "found" << std::endl;
1526  for (unsigned int k = 0; k < alct_t1_coll.size(); ++k) {
1527  /*
1528  sprintf(sign,"%s%6i%5s %s %s %i %s %i","Line: ",
1529  alct_t1_coll[k],sign1,alct_common,
1530  alct_common_wcnt1,alct_wcnt1_coll[k],alct_common_wcnt2,alct_wcnt2_coll[k]);
1531  std::cout << sign << std::endl;
1532  */
1533  std::cout << "Line: "
1534  << " " << alct_t1_coll[k] << " " << sign1 << " " << alct_common << " " << alct_common_wcnt1 << " "
1535  << alct_wcnt1_coll[k] << " " << alct_common_wcnt2 << " ";
1536  if (!alct_wcnt2_coll.empty()) {
1537  std::cout << alct_wcnt2_coll[k] << std::endl;
1538  } else {
1539  std::cout << "Undefined (ALCT Header is not found) " << std::endl;
1540  }
1541  }
1542 
1543  std::cout << std::endl << std::endl;
1544  std::cout << "||||||||||||||||||||" << std::endl;
1545  std::cout << std::endl << std::endl;
1546  std::cout << tmb_h1_coll.size() << " " << tmb_common << " " << tmb_header1 << " "
1547  << "found" << std::endl;
1548  for (unsigned int k = 0; k < tmb_h1_coll.size(); ++k) {
1549  /*
1550  sprintf(sign,"%s%6i%5s %s %s %i","Line: ",
1551  tmb_h1_coll[k],sign1,tmb_common,
1552  dmb_common_l1a,tmb_l1a_coll[k]);
1553  std::cout << sign << std::endl;
1554  */
1555  std::cout << "Line: "
1556  << " " << tmb_h1_coll[k] << " " << sign1 << " " << tmb_common << " " << dmb_common_l1a << " "
1557  << tmb_l1a_coll[k] << std::endl;
1558  }
1559 
1560  std::cout << std::endl << std::endl;
1561  std::cout << "||||||||||||||||||||" << std::endl;
1562  std::cout << std::endl << std::endl;
1563  std::cout << tmb_t1_coll.size() << " " << tmb_common << " " << tmb_tr1 << " "
1564  << "found" << std::endl;
1565  for (unsigned int k = 0; k < tmb_t1_coll.size(); ++k) {
1566  /*
1567  sprintf(sign,"%s%6i%5s %s %s %i %s %i","Line: ",
1568  tmb_t1_coll[k],sign1,tmb_common,
1569  alct_common_wcnt1,tmb_wcnt1_coll[k],alct_common_wcnt2,tmb_wcnt2_coll[k]);
1570  std::cout << sign << std::endl;
1571  */
1572  std::cout << "Line: "
1573  << " " << tmb_t1_coll[k] << " " << sign1 << " " << tmb_common << " " << alct_common_wcnt1 << " "
1574  << tmb_wcnt1_coll[k] << " " << alct_common_wcnt2 << " " << tmb_wcnt2_coll[k] << std::endl;
1575  }
1576 
1577  std::cout << std::endl << std::endl;
1578  std::cout << "||||||||||||||||||||" << std::endl;
1579  std::cout << std::endl << std::endl;
1580  std::cout << cfeb_t1_coll.size() << " " << cfeb_common << " " << cfeb_tr1 << " "
1581  << "found" << std::endl;
1582  for (unsigned int k = 0; k < cfeb_t1_coll.size(); ++k)
1583  std::cout << "Line: " << cfeb_t1_coll[k] << std::endl;
1584  std::cout << "********************************************************************************" << std::endl;
1585 }

References visDQMUpload::buf, gather_cfg::cout, formatedEventDump, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, GetRecoTauVFromDQM_MC_cff::kk, writedatasetfile::run, and w.

Referenced by produce().

Member Data Documentation

◆ debug

bool CSCDCCUnpacker::debug
private

◆ errorMask

unsigned int CSCDCCUnpacker::errorMask
private

Definition at line 43 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ examinerMask

unsigned int CSCDCCUnpacker::examinerMask
private

Definition at line 43 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ formatedEventDump

bool CSCDCCUnpacker::formatedEventDump
private

Definition at line 38 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), produce(), and visual_raw().

◆ goodEvent

bool CSCDCCUnpacker::goodEvent
private

Definition at line 34 of file CSCDCCUnpacker.h.

Referenced by produce().

◆ i_token

edm::EDGetTokenT<FEDRawDataCollection> CSCDCCUnpacker::i_token
private

Token for consumes interface & access to data.

Definition at line 48 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ instantiateDQM

bool CSCDCCUnpacker::instantiateDQM
private

Definition at line 44 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ monitor

CSCMonitorInterface* CSCDCCUnpacker::monitor
private

Definition at line 45 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), produce(), and production_tasks.MonitorJobs::run().

◆ numOfEvents

int CSCDCCUnpacker::numOfEvents
private

Definition at line 42 of file CSCDCCUnpacker.h.

Referenced by produce().

◆ printEventNumber

bool CSCDCCUnpacker::printEventNumber
private

Definition at line 34 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ SuppressZeroLCT

bool CSCDCCUnpacker::SuppressZeroLCT
private

Suppress zeros LCTs.

Definition at line 40 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ unpackStatusDigis

bool CSCDCCUnpacker::unpackStatusDigis
private

Definition at line 34 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ useExaminer

bool CSCDCCUnpacker::useExaminer
private

Definition at line 34 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ useFormatStatus

bool CSCDCCUnpacker::useFormatStatus
private

Definition at line 35 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ useSelectiveUnpacking

bool CSCDCCUnpacker::useSelectiveUnpacking
private

Definition at line 35 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ visualFEDInspect

bool CSCDCCUnpacker::visualFEDInspect
private

Visualization of raw data.

Definition at line 38 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

◆ visualFEDShort

bool CSCDCCUnpacker::visualFEDShort
private

Definition at line 38 of file CSCDCCUnpacker.h.

Referenced by CSCDCCUnpacker(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:355
CSCDCCUnpacker::useExaminer
bool useExaminer
Definition: CSCDCCUnpacker.h:34
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CSCDCCUnpacker::instantiateDQM
bool instantiateDQM
Definition: CSCDCCUnpacker.h:44
CSCRPCData::setDebug
static void setDebug(bool debugValue)
Definition: CSCRPCData.h:26
CSCDDUEventData::setErrorMask
static void setErrorMask(unsigned int value)
Definition: CSCDDUEventData.h:30
CSCDCCExaminer::errors
ExaminerStatusType errors(void) const
Definition: CSCDCCExaminer.h:169
CSCEventData::setDebug
static void setDebug(const bool value)
Definition: CSCEventData.h:44
CSCTMBStatusDigi
Definition: CSCTMBStatusDigi.h:15
CSCDCCExaminer::nERRORS
const uint16_t nERRORS
Definition: CSCDCCExaminer.h:17
CSCDCCEventData
01/20/05 A.Tumanov
Definition: CSCDCCEventData.h:13
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CSCTMBData::setDebug
static void setDebug(const bool value)
Definition: CSCTMBData.h:34
CSCDCCUnpacker::formatedEventDump
bool formatedEventDump
Definition: CSCDCCUnpacker.h:38
CSCDCCUnpacker::unpackStatusDigis
bool unpackStatusDigis
Definition: CSCDCCUnpacker.h:34
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CSCALCTHeader::setDebug
static void setDebug(bool value)
to access data by via status digis
Definition: CSCALCTHeader.h:30
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
cscmap
Definition: CSCMap.h:8
CSCChamberMap::ddu
int ddu(const CSCDetId &) const
ddu id for given DetId
Definition: CSCChamberMap.cc:36
CSCMonitorInterface::process
virtual void process(CSCDCCExaminer *examiner, CSCDCCEventData *dccData)=0
CSCDCCUnpacker::visualFEDInspect
bool visualFEDInspect
Visualization of raw data.
Definition: CSCDCCUnpacker.h:38
CSCDDUEventData::setDebug
static void setDebug(bool value)
Definition: CSCDDUEventData.h:29
CSCDCCExaminer::modeDDU
void modeDDU(bool enable)
Definition: CSCDCCExaminer.cc:53
FEDNumbering::MAXCSCDDUFEDID
Definition: FEDNumbering.h:90
edm::Handle
Definition: AssociativeIterator.h:50
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
CSCDCCFormatStatusDigi
CSC Format Status Object.
Definition: CSCDCCFormatStatusDigi.h:160
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CSCDCCUnpacker::visual_raw
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)
Definition: CSCDCCUnpacker.cc:605
w
const double w
Definition: UKUtility.cc:23
CSCDCCExaminer::errorsDetailed
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
Definition: CSCDCCExaminer.h:301
edm::ESHandle
Definition: DTSurvey.h:22
CSCDCCUnpacker::examinerMask
unsigned int examinerMask
Definition: CSCDCCUnpacker.h:43
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CSCDCCStatusDigi
Definition: CSCDCCStatusDigi.h:15
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
CSCDCCExaminer::getMask
ExaminerMaskType getMask() const
Definition: CSCDCCExaminer.h:167
CSCALCTStatusDigi
Definition: CSCALCTStatusDigi.h:15
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
CSCDCCExaminer::setMask
void setMask(ExaminerMaskType mask)
Definition: CSCDCCExaminer.h:166
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
CSCDetId
Definition: CSCDetId.h:26
CSCDDUStatusDigi
Definition: CSCDDUStatusDigi.h:15
CSCDCCExaminer::check
int32_t check(const uint16_t *&buffer, int32_t length)
Definition: CSCDCCExaminer.cc:263
CSCChamberMap
Definition: CSCChamberMap.h:11
CSCDCCExaminer
Definition: CSCDCCExaminer.h:15
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
CSCDCCUnpacker::debug
bool debug
Definition: CSCDCCUnpacker.h:34
CSCDCCUnpacker::numOfEvents
int numOfEvents
Definition: CSCDCCUnpacker.h:42
CSCDCCUnpacker::visualFEDShort
bool visualFEDShort
Definition: CSCDCCUnpacker.h:38
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
res
Definition: Electron.h:6
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
eostools.move
def move(src, dest)
Definition: eostools.py:511
CSCDCCUnpacker::goodEvent
bool goodEvent
Definition: CSCDCCUnpacker.h:34
writedatasetfile.run
run
Definition: writedatasetfile.py:27
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDCCExaminer::payloadDetailed
std::map< CSCIdType, ExaminerStatusType > payloadDetailed(void) const
Definition: CSCDCCExaminer.h:303
CSCDCCUnpacker::i_token
edm::EDGetTokenT< FEDRawDataCollection > i_token
Token for consumes interface & access to data.
Definition: CSCDCCUnpacker.h:48
CSCDCCExaminer::crcTMB
void crcTMB(bool enable)
Definition: CSCDCCExaminer.cc:37
CSCCLCTData::setDebug
static void setDebug(const bool value)
Definition: CSCCLCTData.h:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCChamberMapRcd
Definition: CSCChamberMapRcd.h:5
CSCDCCExaminer::crcALCT
void crcALCT(bool enable)
Definition: CSCDCCExaminer.cc:29
CSCDCCUnpacker::monitor
CSCMonitorInterface * monitor
Definition: CSCDCCUnpacker.h:45
CSCCrateMap::detId
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
Definition: CSCCrateMap.cc:9
CSCCrateMapRcd
Definition: CSCCrateMapRcd.h:5
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
CSCDCCUnpacker::useFormatStatus
bool useFormatStatus
Definition: CSCDCCUnpacker.h:35
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CSCCrateMap
Definition: CSCCrateMap.h:11
CSCDCCUnpacker::SuppressZeroLCT
bool SuppressZeroLCT
Suppress zeros LCTs.
Definition: CSCDCCUnpacker.h:40
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
CSCDCCExaminer::statusDetailed
std::map< CSCIdType, ExaminerStatusType > statusDetailed(void) const
Definition: CSCDCCExaminer.h:304
CSCDCCExaminer::crcCFEB
void crcCFEB(bool enable)
Definition: CSCDCCExaminer.cc:45
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCDMBStatusDigi
Definition: CSCDMBStatusDigi.h:15
CSCDCCExaminer::errorsDetailedDDU
std::map< DDUIdType, ExaminerStatusType > errorsDetailedDDU(void) const
Definition: CSCDCCExaminer.h:299
CSCDCCEventData::setDebug
static void setDebug(bool value)
Definition: CSCDCCEventData.h:22
CSCDCCExaminer::errName
const char * errName(int num) const
Definition: CSCDCCExaminer.h:172
edm::InputTag
Definition: InputTag.h:15
CSCDCCUnpacker::errorMask
unsigned int errorMask
Definition: CSCDCCUnpacker.h:43
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCTMBHeader::setDebug
static void setDebug(const bool value)
Definition: CSCTMBHeader.h:83
CSCDCCUnpacker::printEventNumber
bool printEventNumber
Definition: CSCDCCUnpacker.h:34
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCDCCUnpacker::useSelectiveUnpacking
bool useSelectiveUnpacking
Definition: CSCDCCUnpacker.h:35