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