CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CSCDCCUnpacker Class Reference
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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ESGetToken< CSCCrateMap, CSCCrateMapRcdcrateToken
 
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcdcscmapToken
 
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 useGEMs_
 option to unpack GEM cluster data More...
 
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 63 of file CSCDCCUnpacker.cc.

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 102 of file CSCDCCUnpacker.cc.

102  : numOfEvents(0) {
103  // Tracked
104  i_token = consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputObjects"));
105  crateToken = esConsumes<CSCCrateMap, CSCCrateMapRcd>();
106  cscmapToken = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
107 
108  useExaminer = pset.getParameter<bool>("UseExaminer");
109  examinerMask = pset.getParameter<unsigned int>("ExaminerMask");
111  useSelectiveUnpacking = pset.getParameter<bool>("UseSelectiveUnpacking");
112  errorMask = pset.getParameter<unsigned int>("ErrorMask");
113  unpackStatusDigis = pset.getParameter<bool>("UnpackStatusDigis");
115  useFormatStatus = pset.getParameter<bool>("UseFormatStatus");
116 
117  useGEMs_ = pset.getParameter<bool>("useGEMs");
118  // Untracked
119 
120  printEventNumber = pset.getUntrackedParameter<bool>("PrintEventNumber", true);
121  debug = pset.getUntrackedParameter<bool>("Debug", false);
122  instantiateDQM = pset.getUntrackedParameter<bool>("runDQM", false);
123 
125  visualFEDInspect = pset.getUntrackedParameter<bool>("VisualFEDInspect", false);
126  visualFEDShort = pset.getUntrackedParameter<bool>("VisualFEDShort", false);
127  formatedEventDump = pset.getUntrackedParameter<bool>("FormatedEventDump", false);
128 
130  SuppressZeroLCT = pset.getUntrackedParameter<bool>("SuppressZeroLCT", true);
131 
132  if (instantiateDQM) {
134  }
135 
136  produces<CSCWireDigiCollection>("MuonCSCWireDigi");
137  produces<CSCStripDigiCollection>("MuonCSCStripDigi");
138  produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
139  produces<CSCALCTDigiCollection>("MuonCSCALCTDigi");
140  produces<CSCCLCTDigiCollection>("MuonCSCCLCTDigi");
141  produces<CSCRPCDigiCollection>("MuonCSCRPCDigi");
142  produces<CSCCorrelatedLCTDigiCollection>("MuonCSCCorrelatedLCTDigi");
143 
144  if (unpackStatusDigis) {
145  produces<CSCCFEBStatusDigiCollection>("MuonCSCCFEBStatusDigi");
146  produces<CSCTMBStatusDigiCollection>("MuonCSCTMBStatusDigi");
147  produces<CSCDMBStatusDigiCollection>("MuonCSCDMBStatusDigi");
148  produces<CSCALCTStatusDigiCollection>("MuonCSCALCTStatusDigi");
149  produces<CSCDDUStatusDigiCollection>("MuonCSCDDUStatusDigi");
150  produces<CSCDCCStatusDigiCollection>("MuonCSCDCCStatusDigi");
151  }
152 
153  if (useFormatStatus) {
154  produces<CSCDCCFormatStatusDigiCollection>("MuonCSCDCCFormatStatusDigi");
155  }
156 
157  if (useGEMs_) {
158  produces<GEMPadDigiClusterCollection>("MuonGEMPadDigiCluster");
159  }
160  //CSCAnodeData::setDebug(debug);
170 }

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

◆ ~CSCDCCUnpacker()

CSCDCCUnpacker::~CSCDCCUnpacker ( )
override

Destructor.

Definition at line 172 of file CSCDCCUnpacker.cc.

172  {
173  //fill destructor here
174 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 176 of file CSCDCCUnpacker.cc.

176  {
178  desc.add<edm::InputTag>("InputObjects", edm::InputTag("rawDataCollector"))
179  ->setComment("# Define input to the unpacker");
180  desc.add<bool>("UseExaminer", true)
181  ->setComment("# Use CSC examiner to check for corrupt or semi-corrupt data & avoid unpacker crashes");
182  desc.add<unsigned int>("ExaminerMask", 535557110)->setComment("# This mask is needed by the examiner");
183  desc.add<bool>("UseSelectiveUnpacking", true)
184  ->setComment("# Use Examiner to unpack good chambers and skip only bad ones");
185  desc.add<unsigned int>("ErrorMask", 0)->setComment("# This mask simply reduces error reporting");
186  desc.add<bool>("UnpackStatusDigis", false)->setComment("# Unpack general status digis?");
187  desc.add<bool>("UseFormatStatus", true)->setComment("# Unpack FormatStatus digi?");
188  desc.add<bool>("useGEMs", false)->setComment("Unpack GEM trigger data");
189  desc.addUntracked<bool>("Debug", false)->setComment("# Turn on lots of output");
190  desc.addUntracked<bool>("PrintEventNumber", false);
191  desc.addUntracked<bool>("runDQM", false);
192  desc.addUntracked<bool>("VisualFEDInspect", false)->setComment("# Visualization of raw data in corrupted events");
193  desc.addUntracked<bool>("VisualFEDShort", false)->setComment("# Visualization of raw data in corrupted events");
194  desc.addUntracked<bool>("FormatedEventDump", false);
195  desc.addUntracked<bool>("SuppressZeroLCT", true);
196  descriptions.add("muonCSCDCCUnpacker", desc);
197  descriptions.setComment(" This is the generic cfi file for CSC unpacking");
198 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_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 200 of file CSCDCCUnpacker.cc.

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

References visDQMUpload::buf, HltBtagPostValidation_cff::c, RPCNoise_example::check, CSCDCCExaminer::check(), crateToken, CSCDCCExaminer::crcALCT(), CSCDCCExaminer::crcCFEB(), CSCDCCExaminer::crcTMB(), cscmapToken, FEDRawData::data(), data, CSCChamberMap::ddu(), debug, CSCCrateMap::detId(), MillePedeFileConverter_cfg::e, CSCDCCExaminer::errName(), errorMask, CSCDCCExaminer::errors(), CSCDCCExaminer::errorsDetailed(), CSCDCCExaminer::errorsDetailedDDU(), examinerMask, FEDRawDataCollection::FEDData(), formatedEventDump, 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, useGEMs_, 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 643 of file CSCDCCUnpacker.cc.

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

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

◆ crateToken

edm::ESGetToken<CSCCrateMap, CSCCrateMapRcd> CSCDCCUnpacker::crateToken
private

Definition at line 98 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ cscmapToken

edm::ESGetToken<CSCChamberMap, CSCChamberMapRcd> CSCDCCUnpacker::cscmapToken
private

Definition at line 99 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ debug

bool CSCDCCUnpacker::debug
private

◆ errorMask

unsigned int CSCDCCUnpacker::errorMask
private

Definition at line 92 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ examinerMask

unsigned int CSCDCCUnpacker::examinerMask
private

Definition at line 92 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ formatedEventDump

bool CSCDCCUnpacker::formatedEventDump
private

Definition at line 87 of file CSCDCCUnpacker.cc.

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

◆ goodEvent

bool CSCDCCUnpacker::goodEvent
private

Definition at line 80 of file CSCDCCUnpacker.cc.

Referenced by produce().

◆ i_token

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

Token for consumes interface & access to data.

Definition at line 97 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ instantiateDQM

bool CSCDCCUnpacker::instantiateDQM
private

Definition at line 93 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ monitor

CSCMonitorInterface* CSCDCCUnpacker::monitor
private

Definition at line 94 of file CSCDCCUnpacker.cc.

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

◆ numOfEvents

int CSCDCCUnpacker::numOfEvents
private

Definition at line 91 of file CSCDCCUnpacker.cc.

Referenced by produce().

◆ printEventNumber

bool CSCDCCUnpacker::printEventNumber
private

Definition at line 80 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ SuppressZeroLCT

bool CSCDCCUnpacker::SuppressZeroLCT
private

Suppress zeros LCTs.

Definition at line 89 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ unpackStatusDigis

bool CSCDCCUnpacker::unpackStatusDigis
private

Definition at line 80 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ useExaminer

bool CSCDCCUnpacker::useExaminer
private

Definition at line 80 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ useFormatStatus

bool CSCDCCUnpacker::useFormatStatus
private

Definition at line 81 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ useGEMs_

bool CSCDCCUnpacker::useGEMs_
private

option to unpack GEM cluster data

Definition at line 84 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ useSelectiveUnpacking

bool CSCDCCUnpacker::useSelectiveUnpacking
private

Definition at line 81 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ visualFEDInspect

bool CSCDCCUnpacker::visualFEDInspect
private

Visualization of raw data.

Definition at line 87 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

◆ visualFEDShort

bool CSCDCCUnpacker::visualFEDShort
private

Definition at line 87 of file CSCDCCUnpacker.cc.

Referenced by CSCDCCUnpacker(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:428
CSCDCCUnpacker::useExaminer
bool useExaminer
Definition: CSCDCCUnpacker.cc:80
CSCDCCUnpacker::instantiateDQM
bool instantiateDQM
Definition: CSCDCCUnpacker.cc:93
CSCDCCUnpacker::crateToken
edm::ESGetToken< CSCCrateMap, CSCCrateMapRcd > crateToken
Definition: CSCDCCUnpacker.cc:98
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:45
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.cc:87
CSCDCCUnpacker::unpackStatusDigis
bool unpackStatusDigis
Definition: CSCDCCUnpacker.cc:80
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
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.cc:87
CSCDCCUnpacker::cscmapToken
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cscmapToken
Definition: CSCDCCUnpacker.cc:99
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:643
w
const double w
Definition: UKUtility.cc:23
CSCDCCExaminer::errorsDetailed
std::map< CSCIdType, ExaminerStatusType > errorsDetailed(void) const
Definition: CSCDCCExaminer.h:301
CSCComparatorData::setDebug
static void setDebug(const bool value)
Definition: CSCComparatorData.h:31
edm::ESHandle
Definition: DTSurvey.h:22
CSCDCCUnpacker::examinerMask
unsigned int examinerMask
Definition: CSCDCCUnpacker.cc:92
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
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.cc:80
CSCDCCUnpacker::numOfEvents
int numOfEvents
Definition: CSCDCCUnpacker.cc:91
CSCDCCUnpacker::visualFEDShort
bool visualFEDShort
Definition: CSCDCCUnpacker.cc:87
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
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
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CSCDCCUnpacker::useGEMs_
bool useGEMs_
option to unpack GEM cluster data
Definition: CSCDCCUnpacker.cc:84
eostools.move
def move(src, dest)
Definition: eostools.py:511
CSCDCCUnpacker::goodEvent
bool goodEvent
Definition: CSCDCCUnpacker.cc:80
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.cc:97
CSCDCCExaminer::crcTMB
void crcTMB(bool enable)
Definition: CSCDCCExaminer.cc:37
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCDCCExaminer::crcALCT
void crcALCT(bool enable)
Definition: CSCDCCExaminer.cc:29
CSCDCCUnpacker::monitor
CSCMonitorInterface * monitor
Definition: CSCDCCUnpacker.cc:94
CSCCrateMap::detId
CSCDetId detId(int vme, int dmb, int cfeb, int layer=0) const
Definition: CSCCrateMap.cc:9
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
CSCDCCUnpacker::useFormatStatus
bool useFormatStatus
Definition: CSCDCCUnpacker.cc:81
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.cc:89
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:224
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.cc:92
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCTMBHeader::setDebug
static void setDebug(const bool value)
Definition: CSCTMBHeader.h:84
CSCDCCUnpacker::printEventNumber
bool printEventNumber
Definition: CSCDCCUnpacker.cc:80
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCDCCUnpacker::useSelectiveUnpacking
bool useSelectiveUnpacking
Definition: CSCDCCUnpacker.cc:81