CMS 3D CMS Logo

PixelDataFormatter.cc
Go to the documentation of this file.
2 
6 
8 
12 
15 
18 
19 #include <bitset>
20 #include <sstream>
21 #include <iostream>
22 
23 using namespace std;
24 using namespace edm;
25 using namespace sipixelobjects;
26 namespace {
27  constexpr int LINK_bits = 6;
28  constexpr int ROC_bits = 5;
29  constexpr int DCOL_bits = 5;
30  constexpr int PXID_bits = 8;
31  constexpr int ADC_bits = 8;
32 
33  // Add phase1 constants
34  // For phase1
35  //GO BACK TO OLD VALUES. THE 48-CHAN FED DOES NOT NEED A NEW FORMAT
36  // 28/9/16 d.k.
37  constexpr int LINK_bits1 = 6; // 7;
38  constexpr int ROC_bits1 = 5; // 4;
39  // Special for layer 1 bpix rocs 6/9/16 d.k. THIS STAYS.
40  constexpr int COL_bits1_l1 = 6;
41  constexpr int ROW_bits1_l1 = 7;
42 
43  // Moved to the header file, keep commented out unti the final version is done/
44  // constexpr int ADC_shift = 0;
45  // constexpr int PXID_shift = ADC_shift + ADC_bits;
46  // constexpr int DCOL_shift = PXID_shift + PXID_bits;
47  // constexpr int ROC_shift = DCOL_shift + DCOL_bits;
48  // constexpr int LINK_shift = ROC_shift + ROC_bits;
49  // constexpr PixelDataFormatter::Word32 LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits);
50  // constexpr PixelDataFormatter::Word32 ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits);
51  // constexpr PixelDataFormatter::Word32 DCOL_mask = ~(~PixelDataFormatter::Word32(0) << DCOL_bits);
52  // constexpr PixelDataFormatter::Word32 PXID_mask = ~(~PixelDataFormatter::Word32(0) << PXID_bits);
53  // constexpr PixelDataFormatter::Word32 ADC_mask = ~(~PixelDataFormatter::Word32(0) << ADC_bits);
54  //const bool DANEK = false;
55 } // namespace
56 
58  : theDigiCounter(0),
59  theWordCounter(0),
60  theCablingTree(map),
61  badPixelInfo(nullptr),
62  modulesToUnpack(nullptr),
63  phase1(phase) {
64  int s32 = sizeof(Word32);
65  int s64 = sizeof(Word64);
66  int s8 = sizeof(char);
67  if (s8 != 1 || s32 != 4 * s8 || s64 != 2 * s32) {
68  LogError("UnexpectedSizes") << " unexpected sizes: "
69  << " size of char is: " << s8 << ", size of Word32 is: " << s32
70  << ", size of Word64 is: " << s64 << ", send exception";
71  }
72  includeErrors = false;
73  useQualityInfo = false;
74  allDetDigis = 0;
75  hasDetDigis = 0;
76 
77  ADC_shift = 0;
81 
82  if (phase1) { // for phase 1
83  LINK_shift = ROC_shift + ROC_bits1;
84  LINK_mask = ~(~PixelDataFormatter::Word32(0) << LINK_bits1);
85  ROC_mask = ~(~PixelDataFormatter::Word32(0) << ROC_bits1);
86  // special for layer 1 ROC
88  COL_shift = ROW_shift + ROW_bits1_l1;
89  COL_mask = ~(~PixelDataFormatter::Word32(0) << COL_bits1_l1);
90  ROW_mask = ~(~PixelDataFormatter::Word32(0) << ROW_bits1_l1);
91  maxROCIndex = 8;
92 
93  } else { // for phase 0
97  maxROCIndex = 25;
98  }
99 
103 
104  if (phase1) {
105  errorcheck = std::unique_ptr<ErrorCheckerBase>(new ErrorChecker());
106  } else {
107  errorcheck = std::unique_ptr<ErrorCheckerBase>(new ErrorCheckerPhase0());
108  }
109 }
110 
111 void PixelDataFormatter::setErrorStatus(bool ErrorStatus) {
112  includeErrors = ErrorStatus;
113  errorcheck->setErrorStatus(includeErrors);
114 }
115 
116 void PixelDataFormatter::setQualityStatus(bool QualityStatus, const SiPixelQuality* QualityInfo) {
117  useQualityInfo = QualityStatus;
118  badPixelInfo = QualityInfo;
119 }
120 
121 void PixelDataFormatter::setModulesToUnpack(const std::set<unsigned int>* moduleIds) { modulesToUnpack = moduleIds; }
122 
124 
126  bool& errorsInEvent, int fedId, const FEDRawData& rawData, Collection& digis, Errors& errors) {
127  using namespace sipixelobjects;
128 
129  int nWords = rawData.size() / sizeof(Word64);
130  if (nWords == 0)
131  return;
132 
134 
135  // check CRC bit
136  const Word64* trailer = reinterpret_cast<const Word64*>(rawData.data()) + (nWords - 1);
137  if (!errorcheck->checkCRC(errorsInEvent, fedId, trailer, errors))
138  return;
139 
140  // check headers
141  const Word64* header = reinterpret_cast<const Word64*>(rawData.data());
142  header--;
143  bool moreHeaders = true;
144  while (moreHeaders) {
145  header++;
146  LogTrace("") << "HEADER: " << print(*header);
147  bool headerStatus = errorcheck->checkHeader(errorsInEvent, fedId, header, errors);
148  moreHeaders = headerStatus;
149  }
150 
151  // check trailers
152  bool moreTrailers = true;
153  trailer++;
154  while (moreTrailers) {
155  trailer--;
156  LogTrace("") << "TRAILER: " << print(*trailer);
157  bool trailerStatus = errorcheck->checkTrailer(errorsInEvent, fedId, nWords, trailer, errors);
158  moreTrailers = trailerStatus;
159  }
160 
161  // data words
162  theWordCounter += 2 * (nWords - 2);
163  LogTrace("") << "data words: " << (trailer - header - 1);
164 
165  int link = -1;
166  int roc = -1;
167  int layer = 0;
168  PixelROC const* rocp = nullptr;
169  bool skipROC = false;
170  edm::DetSet<PixelDigi>* detDigis = nullptr;
171 
172  const Word32* bw = (const Word32*)(header + 1);
173  const Word32* ew = (const Word32*)(trailer);
174  if (*(ew - 1) == 0) {
175  ew--;
176  theWordCounter--;
177  }
178  for (auto word = bw; word < ew; ++word) {
179  LogTrace("") << "DATA: " << print(*word);
180 
181  auto ww = *word;
182  if UNLIKELY (ww == 0) {
183  theWordCounter--;
184  continue;
185  }
186  int nlink = (ww >> LINK_shift) & LINK_mask;
187  int nroc = (ww >> ROC_shift) & ROC_mask;
188 
189  //if(DANEK) cout<<" fed, link, roc "<<fedId<<" "<<nlink<<" "<<nroc<<endl;
190 
191  if ((nlink != link) | (nroc != roc)) { // new roc
192  link = nlink;
193  roc = nroc;
194  skipROC = LIKELY(roc < maxROCIndex)
195  ? false
196  : !errorcheck->checkROC(errorsInEvent, fedId, &converter, theCablingTree, ww, errors);
197  if (skipROC)
198  continue;
199  rocp = converter.toRoc(link, roc);
200  if UNLIKELY (!rocp) {
201  errorsInEvent = true;
202  errorcheck->conversionError(fedId, &converter, 2, ww, errors);
203  skipROC = true;
204  continue;
205  }
206  auto rawId = rocp->rawId();
207  bool barrel = PixelModuleName::isBarrel(rawId);
208  if (barrel)
209  layer = PixelROC::bpixLayerPhase1(rawId);
210  else
211  layer = 0;
212 
213  //if(DANEK) cout<<" rocp "<<rocp->print()<<" layer "<<rocp->bpixLayerPhase1(rawId)<<" "
214  // <<layer<<" phase1 "<<phase1<<" rawid "<<rawId<<endl;
215 
216  if (useQualityInfo & (nullptr != badPixelInfo)) {
217  short rocInDet = (short)rocp->idInDetUnit();
218  skipROC = badPixelInfo->IsRocBad(rawId, rocInDet);
219  if (skipROC)
220  continue;
221  }
222  skipROC = modulesToUnpack && (modulesToUnpack->find(rawId) == modulesToUnpack->end());
223  if (skipROC)
224  continue;
225 
226  detDigis = &digis.find_or_insert(rawId);
227  if ((*detDigis).empty())
228  (*detDigis).data.reserve(32); // avoid the first relocations
229  }
230 
231  // skip is roc to be skipped ot invalid
232  if UNLIKELY (skipROC || !rocp)
233  continue;
234 
235  int adc = (ww >> ADC_shift) & ADC_mask;
236  std::unique_ptr<LocalPixel> local;
237 
238  if (phase1 && layer == 1) { // special case for layer 1ROC
239  // for l1 roc use the roc column and row index instead of dcol and pixel index.
240  int col = (ww >> COL_shift) & COL_mask;
241  int row = (ww >> ROW_shift) & ROW_mask;
242  //if(DANEK) cout<<" layer 1: raw2digi "<<link<<" "<<roc<<" "
243  // <<col<<" "<<row<<" "<<adc<<endl;
244 
245  LocalPixel::RocRowCol localCR = {row, col}; // build pixel
246  //if(DANEK)cout<<localCR.rocCol<<" "<<localCR.rocRow<<endl;
247  if UNLIKELY (!localCR.valid()) {
248  LogDebug("PixelDataFormatter::interpretRawData") << "status #3";
249  errorsInEvent = true;
250  errorcheck->conversionError(fedId, &converter, 3, ww, errors);
251  continue;
252  }
253  local = std::make_unique<LocalPixel>(localCR); // local pixel coordinate
254  //if(DANEK) cout<<local->dcol()<<" "<<local->pxid()<<" "<<local->rocCol()<<" "<<local->rocRow()<<endl;
255 
256  } else { // phase0 and phase1 except bpix layer 1
257  int dcol = (ww >> DCOL_shift) & DCOL_mask;
258  int pxid = (ww >> PXID_shift) & PXID_mask;
259  //if(DANEK) cout<<" raw2digi "<<link<<" "<<roc<<" "
260  //<<dcol<<" "<<pxid<<" "<<adc<<" "<<layer<<endl;
261 
262  LocalPixel::DcolPxid localDP = {dcol, pxid};
263  //if(DANEK) cout<<localDP.dcol<<" "<<localDP.pxid<<endl;
264 
265  if UNLIKELY (!localDP.valid()) {
266  LogDebug("PixelDataFormatter::interpretRawData") << "status #3";
267  errorsInEvent = true;
268  errorcheck->conversionError(fedId, &converter, 3, ww, errors);
269  continue;
270  }
271  local = std::make_unique<LocalPixel>(localDP); // local pixel coordinate
272  //if(DANEK) cout<<local->dcol()<<" "<<local->pxid()<<" "<<local->rocCol()<<" "<<local->rocRow()<<endl;
273  }
274 
275  GlobalPixel global = rocp->toGlobal(*local); // global pixel coordinate (in module)
276  (*detDigis).data.emplace_back(global.row, global.col, adc);
277  //if(DANEK) cout<<global.row<<" "<<global.col<<" "<<adc<<endl;
278  LogTrace("") << (*detDigis).data.back();
279  }
280 }
281 
282 // I do not know what this was for or if it is needed? d.k. 10.14
283 // Keep it commented out until we are sure that it is not needed.
284 // void doVectorize(int const * __restrict__ w, int * __restrict__ row, int * __restrict__ col, int * __restrict__ valid, int N, PixelROC const * rocp) {
285 // for (int i=0; i<N; ++i) {
286 // auto ww = w[i];
287 // int dcol = (ww >> DCOL_shift) & DCOL_mask;
288 // int pxid = (ww >> PXID_shift) & PXID_mask;
289 // // int adc = (ww >> ADC_shift) & ADC_mask;
290 // LocalPixel::DcolPxid local = { dcol, pxid };
291 // valid[i] = local.valid();
292 // GlobalPixel global = rocp->toGlobal( LocalPixel(local) );
293 // row[i]=global.row; col[i]=global.col;
294 // }
295 // }
296 
297 void PixelDataFormatter::formatRawData(unsigned int lvl1_ID,
299  const Digis& digis,
300  const BadChannels& badChannels) {
301  std::map<int, vector<Word32> > words;
302 
303  // translate digis into 32-bit raw words and store in map indexed by Fed
304  for (Digis::const_iterator im = digis.begin(); im != digis.end(); im++) {
305  allDetDigis++;
306  cms_uint32_t rawId = im->first;
307  int layer = 0;
308  bool barrel = PixelModuleName::isBarrel(rawId);
309  if (barrel)
310  layer = PixelROC::bpixLayerPhase1(rawId);
311  //if(DANEK) cout<<" layer "<<layer<<" "<<phase1<<endl;
312 
313  BadChannels::const_iterator detBadChannels = badChannels.find(rawId);
314 
315  hasDetDigis++;
316  const DetDigis& detDigis = im->second;
317  for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
318  theDigiCounter++;
319  const PixelDigi& digi = (*it);
320  int fedId = 0;
321 
322  if (layer == 1 && phase1)
323  fedId = digi2wordPhase1Layer1(rawId, digi, words);
324  else
325  fedId = digi2word(rawId, digi, words);
326 
327  if (fedId < 0) {
328  LogError("FormatDataException") << " digi2word returns error #" << fedId << " Ndigis: " << theDigiCounter
329  << endl
330  << " detector: " << rawId << endl
331  << print(digi) << endl;
332  } else if (detBadChannels != badChannels.end()) {
333  auto badChannel =
334  std::find_if(detBadChannels->second.begin(), detBadChannels->second.end(), [&](const PixelFEDChannel& ch) {
335  return (int(ch.fed) == fedId && ch.link == linkId(words[fedId].back()));
336  });
337  if (badChannel != detBadChannels->second.end()) {
338  LogError("FormatDataException") << " while marked bad, found digi for FED " << fedId << " Link "
339  << linkId(words[fedId].back()) << " on module " << rawId << endl
340  << print(digi) << endl;
341  }
342  } // if (fedId)
343  } // for (DetDigis
344  } // for (Digis
345  LogTrace(" allDetDigis/hasDetDigis : ") << allDetDigis << "/" << hasDetDigis;
346 
347  // fill FED error 25 words
348  for (const auto& detBadChannels : badChannels) {
349  for (const auto& badChannel : detBadChannels.second) {
350  unsigned int FEDError25 = 25;
351  Word32 word = (badChannel.link << LINK_shift) | (FEDError25 << ROC_shift);
352  words[badChannel.fed].push_back(word);
353  theWordCounter++;
354  }
355  }
356 
357  typedef std::map<int, vector<Word32> >::const_iterator RI;
358  for (RI feddata = words.begin(); feddata != words.end(); feddata++) {
359  int fedId = feddata->first;
360  // since raw words are written in the form of 64-bit packets
361  // add extra 32-bit word to make number of words even if necessary
362  if (words.find(fedId)->second.size() % 2 != 0)
363  words[fedId].push_back(Word32(0));
364 
365  // size in Bytes; create output structure
366  int dataSize = words.find(fedId)->second.size() * sizeof(Word32);
367  int nHeaders = 1;
368  int nTrailers = 1;
369  dataSize += (nHeaders + nTrailers) * sizeof(Word64);
370  FEDRawData* rawData = new FEDRawData(dataSize);
371 
372  // get begining of data;
373  Word64* word = reinterpret_cast<Word64*>(rawData->data());
374 
375  // write one header
376  FEDHeader::set(reinterpret_cast<unsigned char*>(word), 0, lvl1_ID, 0, fedId);
377  word++;
378 
379  // write data
380  unsigned int nWord32InFed = words.find(fedId)->second.size();
381  for (unsigned int i = 0; i < nWord32InFed; i += 2) {
382  *word = (Word64(words.find(fedId)->second[i + 1]) << 32) | words.find(fedId)->second[i];
383  LogDebug("PixelDataFormatter") << print(*word);
384  word++;
385  }
386 
387  // write one trailer
388  FEDTrailer::set(reinterpret_cast<unsigned char*>(word), dataSize / sizeof(Word64), 0, 0, 0);
389  word++;
390 
391  // check memory
392  if (word != reinterpret_cast<Word64*>(rawData->data() + dataSize)) {
393  string s = "** PROBLEM in PixelDataFormatter !!!";
394  throw cms::Exception(s);
395  } // if (word !=
397  delete rawData;
398  } // for (RI feddata
399 }
400 
402  const PixelDigi& digi,
403  std::map<int, vector<Word32> >& words) const {
404  LogDebug("PixelDataFormatter")
405  // <<" detId: " << detId
406  << print(digi);
407 
408  DetectorIndex detector = {detId, digi.row(), digi.column()};
409  ElectronicIndex cabling;
410  int fedId = theFrameReverter->toCabling(cabling, detector);
411  if (fedId < 0)
412  return fedId;
413 
414  //if(DANEK) cout<<" digi2raw "<<detId<<" "<<digi.column()<<" "<<digi.row()<<" "<<digi.adc()<<" "
415  // <<cabling.link<<" "<<cabling.roc<<" "<<cabling.dcol<<" "<<cabling.pxid<<endl;
416 
417  Word32 word = (cabling.link << LINK_shift) | (cabling.roc << ROC_shift) | (cabling.dcol << DCOL_shift) |
418  (cabling.pxid << PXID_shift) | (digi.adc() << ADC_shift);
419  words[fedId].push_back(word);
420  theWordCounter++;
421 
422  return fedId;
423 }
425  const PixelDigi& digi,
426  std::map<int, vector<Word32> >& words) const {
427  LogDebug("PixelDataFormatter")
428  // <<" detId: " << detId
429  << print(digi);
430 
431  DetectorIndex detector = {detId, digi.row(), digi.column()};
432  ElectronicIndex cabling;
433  int fedId = theFrameReverter->toCabling(cabling, detector);
434  if (fedId < 0)
435  return fedId;
436 
437  int col = ((cabling.dcol) * 2) + ((cabling.pxid) % 2);
438  int row = LocalPixel::numRowsInRoc - ((cabling.pxid) / 2);
439 
440  //if(DANEK) cout<<" layer 1: digi2raw "<<detId<<" "<<digi.column()<<" "<<digi.row()<<" "<<digi.adc()<<" "
441  // <<cabling.link<<" "<<cabling.roc<<" "<<cabling.dcol<<" "<<cabling.pxid<<" "
442  // <<col<<" "<<row<<endl;
443 
444  Word32 word = (cabling.link << LINK_shift) | (cabling.roc << ROC_shift) | (col << COL_shift) | (row << ROW_shift) |
445  (digi.adc() << ADC_shift);
446  words[fedId].push_back(word);
447  theWordCounter++;
448 
449  return fedId;
450 }
451 
452 // obsolete...
455  const bool includeErrors,
456  const bool useQuality,
457  const Word32& word,
458  Digis& digis) const {
459  // do not interpret false digis
460  if (word == 0)
461  return 0;
462 
463  ElectronicIndex cabling;
464  cabling.dcol = (word >> DCOL_shift) & DCOL_mask;
465  cabling.pxid = (word >> PXID_shift) & PXID_mask;
466  cabling.link = (word >> LINK_shift) & LINK_mask;
467  cabling.roc = (word >> ROC_shift) & ROC_mask;
468  int adc = (word >> ADC_shift) & ADC_mask;
469 
470  if (debug) {
471  LocalPixel::DcolPxid pixel = {cabling.dcol, cabling.pxid};
473  LogTrace("") << " link: " << cabling.link << ", roc: " << cabling.roc << " rocRow: " << local.rocRow()
474  << ", rocCol:" << local.rocCol() << " (dcol: " << cabling.dcol << ", pxid:" << cabling.pxid
475  << "), adc:" << adc;
476  }
477 
478  if (!converter)
479  return 0;
480 
481  DetectorIndex detIdx;
482  int status = converter->toDetector(cabling, detIdx);
483  if (status)
484  return status;
485 
486  // exclude ROC(raw) based on bad ROC list bad in SiPixelQuality
487  // enable: process.siPixelDigis.UseQualityInfo = True
488  // 20-10-2010 A.Y.
489  if (useQuality && badPixelInfo) {
490  CablingPathToDetUnit path = {static_cast<unsigned int>(fedId),
491  static_cast<unsigned int>(cabling.link),
492  static_cast<unsigned int>(cabling.roc)};
494  short rocInDet = (short)roc->idInDetUnit();
495  bool badROC = badPixelInfo->IsRocBad(detIdx.rawId, rocInDet);
496  if (badROC)
497  return 0;
498  }
499 
500  if (modulesToUnpack && modulesToUnpack->find(detIdx.rawId) == modulesToUnpack->end())
501  return 0;
502 
503  digis[detIdx.rawId].emplace_back(detIdx.row, detIdx.col, adc);
504 
505  theDigiCounter++;
506 
507  if (debug)
508  LogTrace("") << digis[detIdx.rawId].back();
509  return 0;
510 }
511 
513  ostringstream str;
514  str << " DIGI: row: " << digi.row() << ", col: " << digi.column() << ", adc: " << digi.adc();
515  return str.str();
516 }
517 
519  ostringstream str;
520  str << "word64: " << reinterpret_cast<const bitset<64>&>(word);
521  return str.str();
522 }
edm::DetSetVector
Definition: DetSetVector.h:61
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
SiPixelFrameReverter
Definition: SiPixelFrameReverter.h:17
PixelDataFormatter::nWords
int nWords() const
Definition: PixelDataFormatter.h:81
ErrorCheckerPhase0
Definition: ErrorCheckerPhase0.h:11
mps_fire.i
i
Definition: mps_fire.py:428
PixelBarrelName.h
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
MessageLogger.h
PixelDataFormatter::ADC_mask
Word32 ADC_mask
Definition: PixelDataFormatter.h:108
funct::false
false
Definition: Factorize.h:29
PixelFEDChannel
Definition: PixelFEDChannel.h:6
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
PixelDataFormatter::digi2word
int digi2word(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
Definition: PixelDataFormatter.cc:401
edm::DetSet
Definition: DetSet.h:23
mps_update.status
status
Definition: mps_update.py:69
converter
Definition: CandidateProducer.h:25
SiPixelFedCabling::findItem
virtual const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &) const =0
PixelDataFormatter::setModulesToUnpack
void setModulesToUnpack(const std::set< unsigned int > *moduleIds)
Definition: PixelDataFormatter.cc:121
edm
HLT enums.
Definition: AlignableModifier.h:19
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
pixelgpudetails::LINK_bits
const uint32_t LINK_bits
Definition: SiPixelRawToClusterGPUKernel.h:41
PixelDataFormatter::DCOL_shift
int DCOL_shift
Definition: PixelDataFormatter.h:107
phase1PixelTopology::numRowsInRoc
constexpr uint16_t numRowsInRoc
Definition: phase1PixelTopology.h:9
PixelDataFormatter::theDigiCounter
int theDigiCounter
Definition: PixelDataFormatter.h:90
cuy.col
col
Definition: cuy.py:1010
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
PixelDataFormatter::interpretRawData
void interpretRawData(bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
Definition: PixelDataFormatter.cc:125
PixelDigi
Definition: PixelDigi.h:14
sipixelobjects::LocalPixel::DcolPxid::valid
bool valid() const
Definition: LocalPixel.h:21
PixelDataFormatter::Digis
std::map< cms_uint32_t, DetDigis > Digis
Definition: PixelDataFormatter.h:63
muonClassificationByHits_cfi.pixel
pixel
Definition: muonClassificationByHits_cfi.py:9
PixelDataFormatter::theFrameReverter
const SiPixelFrameReverter * theFrameReverter
Definition: PixelDataFormatter.h:94
SiPixelFedCablingMap.h
PixelDataFormatter::RawData
std::map< int, FEDRawData > RawData
Definition: PixelDataFormatter.h:61
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
PixelDataFormatter::DetDigis
std::vector< PixelDigi > DetDigis
Definition: PixelDataFormatter.h:62
sipixelobjects::DetectorIndex::row
int row
Definition: DetectorIndex.h:8
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
SiPixelFedCablingTree.h
SiPixelFedCabling
Definition: SiPixelFedCabling.h:10
pixelgpudetails::DCOL_bits
const uint32_t DCOL_bits
Definition: SiPixelRawToClusterGPUKernel.h:43
FEDRawData.h
PixelDataFormatter::hasDetDigis
int hasDetDigis
Definition: PixelDataFormatter.h:102
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
PixelDataFormatter::ADC_shift
int ADC_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::phase1
bool phase1
Definition: PixelDataFormatter.h:110
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
FEDRawData
Definition: FEDRawData.h:19
PixelDataFormatter
Definition: PixelDataFormatter.h:57
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
PixelDataFormatter::errorcheck
std::unique_ptr< ErrorCheckerBase > errorcheck
Definition: PixelDataFormatter.h:103
PVValHelper::phase1
Definition: PVValidationHelpers.h:80
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
bysipixelclustmulteventfilter_cfi.useQuality
useQuality
Definition: bysipixelclustmulteventfilter_cfi.py:7
PixelDataFormatter::DCOL_mask
Word32 DCOL_mask
Definition: PixelDataFormatter.h:108
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
errors
Definition: errors.py:1
PixelDataFormatter::ROW_shift
int ROW_shift
Definition: PixelDataFormatter.h:107
sipixelobjects
Definition: CablingPathToDetUnit.h:4
sipixelobjects::CablingPathToDetUnit
Definition: CablingPathToDetUnit.h:5
PixelDataFormatter::useQualityInfo
bool useQualityInfo
Definition: PixelDataFormatter.h:99
pixelgpudetails::PXID_bits
const uint32_t PXID_bits
Definition: SiPixelRawToClusterGPUKernel.h:44
str
#define str(s)
Definition: TestProcessor.cc:52
PixelDataFormatter::ROC_mask
Word32 ROC_mask
Definition: PixelDataFormatter.h:108
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
PixelDataFormatter::badPixelInfo
const SiPixelQuality * badPixelInfo
Definition: PixelDataFormatter.h:95
PixelDataFormatter::LINK_mask
Word32 LINK_mask
Definition: PixelDataFormatter.h:108
sipixelobjects::PixelROC::rawId
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:34
sipixelobjects::ElectronicIndex
Definition: ElectronicIndex.h:5
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelPI::phase
phase
Definition: SiPixelPayloadInspectorHelper.h:39
PixelDigi::column
int column() const
Definition: PixelDigi.h:55
SiPixelFrameReverter::toCabling
int toCabling(sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const
Definition: SiPixelFrameReverter.cc:34
SiPixelFrameConverter.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
SiPixelQuality
Definition: SiPixelQuality.h:27
PixelROC.h
sipixelobjects::LocalPixel::DcolPxid
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
PixelDataFormatter::ROW_mask
Word32 ROW_mask
Definition: PixelDataFormatter.h:108
PixelDataFormatter::maxROCIndex
int maxROCIndex
Definition: PixelDataFormatter.h:109
PixelDataFormatter::theWordCounter
int theWordCounter
Definition: PixelDataFormatter.h:91
PixelDataFormatter::print
std::string print(const PixelDigi &digi) const
Definition: PixelDataFormatter.cc:512
sipixelobjects::DetectorIndex::col
int col
Definition: DetectorIndex.h:9
PixelDataFormatter::PXID_mask
Word32 PXID_mask
Definition: PixelDataFormatter.h:108
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
PixelDataFormatter::PixelDataFormatter
PixelDataFormatter(const SiPixelFedCabling *map, bool phase1=false)
Definition: PixelDataFormatter.cc:57
pixelgpudetails::ROC_bits
const uint32_t ROC_bits
Definition: SiPixelRawToClusterGPUKernel.h:42
sipixelobjects::PixelROC::toGlobal
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
FEDTrailer::set
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
Definition: FEDTrailer.cc:31
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PixelDataFormatter::linkId
cms_uint32_t linkId(cms_uint32_t word32)
Definition: PixelDataFormatter.h:87
PixelDataFormatter::LINK_shift
int LINK_shift
Definition: PixelDataFormatter.h:107
ErrorChecker
Definition: ErrorChecker.h:11
PixelDataFormatter::theCablingTree
SiPixelFedCabling const * theCablingTree
Definition: PixelDataFormatter.h:93
PixelDataFormatter::digi2wordPhase1Layer1
int digi2wordPhase1Layer1(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
Definition: PixelDataFormatter.cc:424
PixelModuleName::isBarrel
virtual bool isBarrel() const
true for barrel modules
Definition: PixelModuleName.h:20
PixelDataFormatter::debug
bool debug
Definition: PixelDataFormatter.h:100
sipixelobjects::PixelROC
Definition: PixelROC.h:23
PixelDataFormatter.h
PixelDataFormatter::passFrameReverter
void passFrameReverter(const SiPixelFrameReverter *reverter)
Definition: PixelDataFormatter.cc:123
std
Definition: JetResolutionObject.h:76
PixelDataFormatter::formatRawData
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, const BadChannels &badChannels)
Definition: PixelDataFormatter.cc:297
PixelDigi::row
int row() const
Definition: PixelDigi.h:52
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
PixelDataFormatter::COL_mask
Word32 COL_mask
Definition: PixelDataFormatter.h:108
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
pixelgpudetails::ADC_bits
const uint32_t ADC_bits
Definition: SiPixelRawToClusterGPUKernel.h:45
PixelDataFormatter::setErrorStatus
void setErrorStatus(bool ErrorStatus)
Definition: PixelDataFormatter.cc:111
Exception
Definition: hltDiff.cc:245
PixelDigi::adc
unsigned short adc() const
Definition: PixelDigi.h:60
FEDHeader::set
static void set(unsigned char *header, uint8_t triggerType, uint32_t lvl1ID, uint16_t bxID, uint16_t sourceID, uint8_t version=0, bool moreHeaders=false)
Set all fields in the header.
Definition: FEDHeader.cc:25
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
Exception.h
SiPixelQuality.h
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
edm::DetSetVector::find_or_insert
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
genParticles_cff.map
map
Definition: genParticles_cff.py:11
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
PixelDataFormatter::BadChannels
std::map< cms_uint32_t, DetBadChannels > BadChannels
Definition: PixelDataFormatter.h:68
PixelDataFormatter::includeErrors
bool includeErrors
Definition: PixelDataFormatter.h:98
SiPixelQuality::IsRocBad
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
Definition: SiPixelQuality.cc:111
sipixelobjects::LocalPixel::RocRowCol::valid
bool valid() const
Definition: LocalPixel.h:15
PixelDataFormatter::PXID_shift
int PXID_shift
Definition: PixelDataFormatter.h:107
FEDHeader.h
PixelDataFormatter::setQualityStatus
void setQualityStatus(bool QualityStatus, const SiPixelQuality *QualityInfo)
Definition: PixelDataFormatter.cc:116
PixelDataFormatter::Word32
cms_uint32_t Word32
Definition: PixelDataFormatter.h:70
PixelDataFormatter::allDetDigis
int allDetDigis
Definition: PixelDataFormatter.h:101
PixelDataFormatter::COL_shift
int COL_shift
Definition: PixelDataFormatter.h:107
sipixelobjects::PixelROC::idInDetUnit
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
sipixelobjects::DetectorIndex::rawId
uint32_t rawId
Definition: DetectorIndex.h:7
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
PixelDataFormatter::Word64
cms_uint64_t Word64
Definition: PixelDataFormatter.h:71
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7
PixelDataFormatter::Errors
std::map< cms_uint32_t, DetErrors > Errors
Definition: PixelDataFormatter.h:66
PixelDataFormatter::modulesToUnpack
const std::set< unsigned int > * modulesToUnpack
Definition: PixelDataFormatter.h:96
PixelDataFormatter::ROC_shift
int ROC_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::word2digi
int word2digi(const int fedId, const SiPixelFrameConverter *converter, const bool includeError, const bool useQuality, const Word32 &word, Digis &digis) const
Definition: PixelDataFormatter.cc:453
FEDTrailer.h