CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PixelDataFormatter Class Reference

#include <PixelDataFormatter.h>

Public Types

using BadChannels = std::map< cms_uint32_t, DetBadChannels >
 
using Collection = edm::DetSetVector< PixelDigi >
 
using DetBadChannels = std::vector< PixelFEDChannel >
 
using DetDigis = std::vector< PixelDigi >
 
using DetErrors = std::vector< SiPixelRawDataError >
 
using Digis = std::map< cms_uint32_t, DetDigis >
 
using Errors = std::map< cms_uint32_t, DetErrors >
 
using FEDWordsMap = std::map< int, std::vector< Word32 > >
 
using ModuleIDSet = std::set< unsigned int >
 
using RawData = std::map< int, FEDRawData >
 

Public Member Functions

void formatRawData (unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, const BadChannels &badChannels)
 
void interpretRawData (bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
 
int nDigis () const
 
int nWords () const
 
void passFrameReverter (const SiPixelFrameReverter *reverter)
 
 PixelDataFormatter (const SiPixelFedCablingTree *map, bool phase1_=false)
 
void setErrorStatus (bool ErrorStatus)
 
void setModulesToUnpack (const ModuleIDSet *moduleIds)
 
void setQualityStatus (bool QualityStatus, const SiPixelQuality *QualityInfo)
 
void unpackFEDErrors (Errors const &errors, std::vector< int > const &tkerrorlist, std::vector< int > const &usererrorlist, edm::DetSetVector< SiPixelRawDataError > &errorcollection, DetIdCollection &tkerror_detidcollection, DetIdCollection &usererror_detidcollection, edmNew::DetSetVector< PixelFEDChannel > &disabled_channelcollection, DetErrors &nodeterrors)
 

Private Member Functions

int checkError (const Word32 &data) const
 
int digi2word (cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const
 
int digi2wordPhase1Layer1 (cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const
 
cms_uint32_t errorDetId (const SiPixelFrameConverter *converter, int fedId, int errorType, const Word32 &word) const
 
std::string print (const PixelDigi &digi) const
 
std::string print (const Word64 &word) const
 

Private Attributes

int allDetDigis_
 
const SiPixelQualitybadPixelInfo_
 
std::unique_ptr< ErrorCheckerBaseerrorcheck_
 
int hasDetDigis_
 
bool includeErrors_
 
int maxROCIndex_
 
const ModuleIDSetmodulesToUnpack_
 
bool phase1_
 
SiPixelFedCablingTree const * theCablingTree_
 
int theDigiCounter_
 
const SiPixelFrameRevertertheFrameReverter_
 
int theWordCounter_
 
bool useQualityInfo_
 

Detailed Description

Transforms Pixel raw data of a given FED to orca digi and vice versa.

FED OUTPUT DATA FORMAT 6/02, d.k. (11/02 updated for 100*150 pixels)

The output is transmitted through a 64 bit S-link connection. The packet format is defined by the CMS RU group to be : 1st packet header, 64 bits, includes a 6 bit FED id. 2nd packet header, 64 bits. .......................... (detector data) packet trailer, 64 bits. of the 64 bit pixel data records consists of 2 32 bit words. Each 32 bit word includes data from 1 pixel, the bit fields are the following:

6 bit link ID (max 36) - this defines the input link within 1 FED. 5 bit ROC ID (max 24) - this defines the readout chip within one link. 5 bit DCOL ID (max 26) - this defines the double column index with 1 chip. 8 bit pixel ID (max 180) - this defines the pixel address within 1 DCOL. 8 bit ADC vales - this has the charge amplitude.

So, 1 pixel occupies 4 bytes. If the number of pixels is odd, one extra 32 bit word is added (value 0) to fill all 64 bits.

The PixelDataFormatter interpret/format ONLY detector data words (not FED headers or trailer, which are treated elsewhere).

Definition at line 61 of file PixelDataFormatter.h.

Member Typedef Documentation

◆ BadChannels

Definition at line 70 of file PixelDataFormatter.h.

◆ Collection

Definition at line 65 of file PixelDataFormatter.h.

◆ DetBadChannels

Definition at line 69 of file PixelDataFormatter.h.

◆ DetDigis

Definition at line 67 of file PixelDataFormatter.h.

◆ DetErrors

Definition at line 63 of file PixelDataFormatter.h.

◆ Digis

Definition at line 68 of file PixelDataFormatter.h.

◆ Errors

Definition at line 64 of file PixelDataFormatter.h.

◆ FEDWordsMap

using PixelDataFormatter::FEDWordsMap = std::map<int, std::vector<Word32> >

Definition at line 71 of file PixelDataFormatter.h.

◆ ModuleIDSet

using PixelDataFormatter::ModuleIDSet = std::set<unsigned int>

Definition at line 72 of file PixelDataFormatter.h.

◆ RawData

using PixelDataFormatter::RawData = std::map<int, FEDRawData>

Definition at line 66 of file PixelDataFormatter.h.

Constructor & Destructor Documentation

◆ PixelDataFormatter()

PixelDataFormatter::PixelDataFormatter ( const SiPixelFedCablingTree map,
bool  phase1_ = false 
)

Definition at line 28 of file PixelDataFormatter.cc.

29  : theDigiCounter_(0),
30  theWordCounter_(0),
32  badPixelInfo_(nullptr),
33  modulesToUnpack_(nullptr),
34  phase1_(phase) {
35  int s32 = sizeof(Word32);
36  int s64 = sizeof(Word64);
37  int s8 = sizeof(char);
38  if (s8 != 1 || s32 != 4 * s8 || s64 != 2 * s32) {
39  LogError("UnexpectedSizes") << " unexpected sizes: "
40  << " size of char is: " << s8 << ", size of Word32 is: " << s32
41  << ", size of Word64 is: " << s64 << ", send exception";
42  }
43  includeErrors_ = false;
44  useQualityInfo_ = false;
45  allDetDigis_ = 0;
46  hasDetDigis_ = 0;
47 
48  if (phase1_) {
49  maxROCIndex_ = 8;
50  errorcheck_ = std::unique_ptr<ErrorCheckerBase>(new ErrorChecker());
51  } else {
52  maxROCIndex_ = 25;
53  errorcheck_ = std::unique_ptr<ErrorCheckerBase>(new ErrorCheckerPhase0());
54  }
55 }

References allDetDigis_, errorcheck_, hasDetDigis_, includeErrors_, maxROCIndex_, phase1_, and useQualityInfo_.

Member Function Documentation

◆ checkError()

int PixelDataFormatter::checkError ( const Word32 data) const
private

◆ digi2word()

int PixelDataFormatter::digi2word ( cms_uint32_t  detId,
const PixelDigi digi,
FEDWordsMap words 
) const
private

◆ digi2wordPhase1Layer1()

int PixelDataFormatter::digi2wordPhase1Layer1 ( cms_uint32_t  detId,
const PixelDigi digi,
FEDWordsMap words 
) const
private

◆ errorDetId()

cms_uint32_t PixelDataFormatter::errorDetId ( const SiPixelFrameConverter converter,
int  fedId,
int  errorType,
const Word32 word 
) const
private

Referenced by unpackFEDErrors().

◆ formatRawData()

void PixelDataFormatter::formatRawData ( unsigned int  lvl1_ID,
RawData fedRawData,
const Digis digis,
const BadChannels badChannels 
)

Definition at line 213 of file PixelDataFormatter.cc.

216  {
217  std::map<int, vector<Word32> > words;
218 
219  // translate digis into 32-bit raw words and store in map indexed by Fed
220  for (Digis::const_iterator im = digis.begin(); im != digis.end(); im++) {
221  allDetDigis_++;
222  cms_uint32_t rawId = im->first;
223  int layer = 0;
224  bool barrel = PixelModuleName::isBarrel(rawId);
225  if (barrel)
226  layer = PixelROC::bpixLayerPhase1(rawId);
227 
228  BadChannels::const_iterator detBadChannels = badChannels.find(rawId);
229 
230  hasDetDigis_++;
231  const DetDigis& detDigis = im->second;
232  for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
233  theDigiCounter_++;
234  const PixelDigi& digi = (*it);
235  int fedId = 0;
236 
237  if (layer == 1 && phase1_)
238  fedId = digi2wordPhase1Layer1(rawId, digi, words);
239  else
240  fedId = digi2word(rawId, digi, words);
241 
242  if (fedId < 0) {
243  LogError("FormatDataException") << " digi2word returns error #" << fedId << " Ndigis: " << theDigiCounter_
244  << endl
245  << " detector: " << rawId << endl
246  << print(digi) << endl;
247  } else if (detBadChannels != badChannels.end()) {
248  auto badChannel =
249  std::find_if(detBadChannels->second.begin(), detBadChannels->second.end(), [&](const PixelFEDChannel& ch) {
250  return (int(ch.fed) == fedId && ch.link == getLink(words[fedId].back()));
251  });
252  if (badChannel != detBadChannels->second.end()) {
253  LogError("FormatDataException") << " while marked bad, found digi for FED " << fedId << " Link "
254  << getLink(words[fedId].back()) << " on module " << rawId << endl
255  << print(digi) << endl;
256  }
257  } // if (fedId)
258  } // for (DetDigis
259  } // for (Digis
260  LogTrace(" allDetDigis_/hasDetDigis_ : ") << allDetDigis_ << "/" << hasDetDigis_;
261 
262  // fill FED error 25 words
263  for (const auto& detBadChannels : badChannels) {
264  for (const auto& badChannel : detBadChannels.second) {
265  unsigned int FEDError25 = 25;
266  Word32 word = (badChannel.link << LINK_shift) | (FEDError25 << ROC_shift);
267  words[badChannel.fed].push_back(word);
268  theWordCounter_++;
269  }
270  }
271 
272  typedef std::map<int, vector<Word32> >::const_iterator RI;
273  for (RI feddata = words.begin(); feddata != words.end(); feddata++) {
274  int fedId = feddata->first;
275  // since raw words are written in the form of 64-bit packets
276  // add extra 32-bit word to make number of words even if necessary
277  if (words.find(fedId)->second.size() % 2 != 0)
278  words[fedId].push_back(Word32(0));
279 
280  // size in Bytes; create output structure
281  int dataSize = words.find(fedId)->second.size() * sizeof(Word32);
282  int nHeaders = 1;
283  int nTrailers = 1;
284  dataSize += (nHeaders + nTrailers) * sizeof(Word64);
285  FEDRawData* rawData = new FEDRawData(dataSize);
286 
287  // get begining of data;
288  Word64* word = reinterpret_cast<Word64*>(rawData->data());
289 
290  // write one header
291  FEDHeader::set(reinterpret_cast<unsigned char*>(word), 0, lvl1_ID, 0, fedId);
292  word++;
293 
294  // write data
295  unsigned int nWord32InFed = words.find(fedId)->second.size();
296  for (unsigned int i = 0; i < nWord32InFed; i += 2) {
297  *word = (Word64(words.find(fedId)->second[i + 1]) << 32) | words.find(fedId)->second[i];
298  LogDebug("PixelDataFormatter") << print(*word);
299  word++;
300  }
301 
302  // write one trailer
303  FEDTrailer::set(reinterpret_cast<unsigned char*>(word), dataSize / sizeof(Word64), 0, 0, 0);
304  word++;
305 
306  // check memory
307  if (word != reinterpret_cast<Word64*>(rawData->data() + dataSize)) {
308  string s = "** PROBLEM in PixelDataFormatter !!!";
309  throw cms::Exception(s);
310  } // if (word !=
312  delete rawData;
313  } // for (RI feddata
314 }

References allDetDigis_, Reference_intrackfit_cff::barrel, digi2word(), digi2wordPhase1Layer1(), Exception, l1tstage2_dqm_sourceclient-live_cfg::fedId, l1t_dqm_sourceclient-live_cfg::fedRawData, sipixelconstants::functions::getLink(), hasDetDigis_, mps_fire::i, PixelModuleName::isBarrel(), phase1PixelTopology::layer, sipixelconstants::LINK_shift, LogDebug, LogTrace, phase1_, print(), l1tstage2_dqm_sourceclient-live_cfg::rawData, sipixelconstants::ROC_shift, alignCSCRings::s, FEDHeader::set(), FEDTrailer::set(), theDigiCounter_, and theWordCounter_.

◆ interpretRawData()

void PixelDataFormatter::interpretRawData ( bool &  errorsInEvent,
int  fedId,
const FEDRawData data,
Collection digis,
Errors errors 
)

Definition at line 71 of file PixelDataFormatter.cc.

72  {
73  using namespace sipixelobjects;
74 
75  int nWords = rawData.size() / sizeof(Word64);
76  if (nWords == 0)
77  return;
78 
80 
81  // check CRC bit
82  const Word64* trailer = reinterpret_cast<const Word64*>(rawData.data()) + (nWords - 1);
83  if (!errorcheck_->checkCRC(errorsInEvent, fedId, trailer, errors))
84  return;
85 
86  // check headers
87  const Word64* header = reinterpret_cast<const Word64*>(rawData.data());
88  header--;
89  bool moreHeaders = true;
90  while (moreHeaders) {
91  header++;
92  LogTrace("") << "HEADER: " << print(*header);
93  bool headerStatus = errorcheck_->checkHeader(errorsInEvent, fedId, header, errors);
94  moreHeaders = headerStatus;
95  }
96 
97  // check trailers
98  bool moreTrailers = true;
99  trailer++;
100  while (moreTrailers) {
101  trailer--;
102  LogTrace("") << "TRAILER: " << print(*trailer);
103  bool trailerStatus = errorcheck_->checkTrailer(errorsInEvent, fedId, nWords, trailer, errors);
104  moreTrailers = trailerStatus;
105  }
106 
107  // data words
108  theWordCounter_ += 2 * (nWords - 2);
109  LogTrace("") << "data words: " << (trailer - header - 1);
110 
111  int link = -1;
112  int roc = -1;
113  int layer = 0;
114  PixelROC const* rocp = nullptr;
115  bool skipROC = false;
116  edm::DetSet<PixelDigi>* detDigis = nullptr;
117 
118  const Word32* bw = (const Word32*)(header + 1);
119  const Word32* ew = (const Word32*)(trailer);
120  if (*(ew - 1) == 0) {
121  ew--;
122  theWordCounter_--;
123  }
124  for (auto word = bw; word < ew; ++word) {
125  LogTrace("") << "DATA: " << print(*word);
126 
127  auto ww = *word;
128  if UNLIKELY (ww == 0) {
129  theWordCounter_--;
130  continue;
131  }
132  int nlink = getLink(ww);
133  int nroc = getROC(ww);
134 
135  if ((nlink != link) | (nroc != roc)) { // new roc
136  link = nlink;
137  roc = nroc;
138  skipROC = LIKELY(roc < maxROCIndex_)
139  ? false
140  : !errorcheck_->checkROC(errorsInEvent, fedId, &converter, theCablingTree_, ww, errors);
141  if (skipROC)
142  continue;
143  rocp = converter.toRoc(link, roc);
144  if UNLIKELY (!rocp) {
145  errorsInEvent = true;
146  errorcheck_->conversionError(fedId, &converter, 2, ww, errors);
147  skipROC = true;
148  continue;
149  }
150  auto rawId = rocp->rawId();
151  bool barrel = PixelModuleName::isBarrel(rawId);
152  if (barrel)
153  layer = PixelROC::bpixLayerPhase1(rawId);
154  else
155  layer = 0;
156 
157  if (useQualityInfo_ & (nullptr != badPixelInfo_)) {
158  short rocInDet = (short)rocp->idInDetUnit();
159  skipROC = badPixelInfo_->IsRocBad(rawId, rocInDet);
160  if (skipROC)
161  continue;
162  }
163  skipROC = modulesToUnpack_ && (modulesToUnpack_->find(rawId) == modulesToUnpack_->end());
164  if (skipROC)
165  continue;
166 
167  detDigis = &digis.find_or_insert(rawId);
168  if ((*detDigis).empty())
169  (*detDigis).data.reserve(32); // avoid the first relocations
170  }
171 
172  // skip is roc to be skipped ot invalid
173  if UNLIKELY (skipROC || !rocp)
174  continue;
175 
176  int adc = getADC(ww);
177  std::unique_ptr<LocalPixel> local;
178 
179  if (phase1_ && layer == 1) { // special case for layer 1ROC
180  // for l1 roc use the roc column and row index instead of dcol and pixel index.
181  int col = getCol(ww);
182  int row = getRow(ww);
183 
184  LocalPixel::RocRowCol localCR = {row, col}; // build pixel
185  if UNLIKELY (!localCR.valid()) {
186  LogDebug("PixelDataFormatter::interpretRawData") << "status #3";
187  errorsInEvent = true;
188  errorcheck_->conversionError(fedId, &converter, 3, ww, errors);
189  continue;
190  }
191  local = std::make_unique<LocalPixel>(localCR); // local pixel coordinate
192 
193  } else { // phase0 and phase1 except bpix layer 1
194  int dcol = getDCol(ww);
195  int pxid = getPxId(ww);
196  LocalPixel::DcolPxid localDP = {dcol, pxid};
197 
198  if UNLIKELY (!localDP.valid()) {
199  LogDebug("PixelDataFormatter::interpretRawData") << "status #3";
200  errorsInEvent = true;
201  errorcheck_->conversionError(fedId, &converter, 3, ww, errors);
202  continue;
203  }
204  local = std::make_unique<LocalPixel>(localDP); // local pixel coordinate
205  }
206 
207  GlobalPixel global = rocp->toGlobal(*local); // global pixel coordinate (in module)
208  (*detDigis).data.emplace_back(global.row, global.col, adc);
209  LogTrace("") << (*detDigis).data.back();
210  }
211 }

References gpuClustering::adc, badPixelInfo_, Reference_intrackfit_cff::barrel, sipixelobjects::GlobalPixel::col, cuy::col, edm::DetSet< T >::data, errorcheck_, funct::false, l1tstage2_dqm_sourceclient-live_cfg::fedId, edm::DetSetVector< T >::find_or_insert(), sipixelconstants::functions::getADC(), sipixelconstants::functions::getCol(), sipixelconstants::functions::getDCol(), sipixelconstants::functions::getLink(), sipixelconstants::functions::getPxId(), sipixelconstants::functions::getROC(), sipixelconstants::functions::getRow(), RecoTauValidation_cfi::header, sipixelobjects::PixelROC::idInDetUnit(), PixelModuleName::isBarrel(), SiPixelQuality::IsRocBad(), phase1PixelTopology::layer, LIKELY, MainPageGenerator::link, DTRecHitClients_cfi::local, LogDebug, LogTrace, maxROCIndex_, modulesToUnpack_, nWords(), phase1_, print(), l1tstage2_dqm_sourceclient-live_cfg::rawData, sipixelobjects::PixelROC::rawId(), PixelMapPlotter::roc, sipixelobjects::GlobalPixel::row, theCablingTree_, theWordCounter_, sipixelobjects::PixelROC::toGlobal(), UNLIKELY, useQualityInfo_, sipixelobjects::LocalPixel::RocRowCol::valid(), and sipixelobjects::LocalPixel::DcolPxid::valid().

◆ nDigis()

int PixelDataFormatter::nDigis ( ) const
inline

Definition at line 81 of file PixelDataFormatter.h.

81 { return theDigiCounter_; }

References theDigiCounter_.

◆ nWords()

int PixelDataFormatter::nWords ( ) const
inline

Definition at line 82 of file PixelDataFormatter.h.

82 { return theWordCounter_; }

References theWordCounter_.

Referenced by interpretRawData().

◆ passFrameReverter()

void PixelDataFormatter::passFrameReverter ( const SiPixelFrameReverter reverter)

Definition at line 69 of file PixelDataFormatter.cc.

69 { theFrameReverter_ = reverter; }

References theFrameReverter_.

◆ print() [1/2]

std::string PixelDataFormatter::print ( const PixelDigi digi) const
private

Definition at line 356 of file PixelDataFormatter.cc.

356  {
357  ostringstream str;
358  str << " DIGI: row: " << digi.row() << ", col: " << digi.column() << ", adc: " << digi.adc();
359  return str.str();
360 }

References PixelDigi::adc(), PixelDigi::column(), PixelDigi::row(), and str.

Referenced by digi2word(), digi2wordPhase1Layer1(), formatRawData(), and interpretRawData().

◆ print() [2/2]

std::string PixelDataFormatter::print ( const Word64 word) const
private

Definition at line 362 of file PixelDataFormatter.cc.

362  {
363  ostringstream str;
364  str << "word64: " << reinterpret_cast<const bitset<64>&>(word);
365  return str.str();
366 }

References str.

◆ setErrorStatus()

void PixelDataFormatter::setErrorStatus ( bool  ErrorStatus)

Definition at line 57 of file PixelDataFormatter.cc.

57  {
58  includeErrors_ = ErrorStatus;
59  errorcheck_->setErrorStatus(includeErrors_);
60 }

References errorcheck_, and includeErrors_.

◆ setModulesToUnpack()

void PixelDataFormatter::setModulesToUnpack ( const ModuleIDSet moduleIds)

Definition at line 67 of file PixelDataFormatter.cc.

67 { modulesToUnpack_ = moduleIds; }

References modulesToUnpack_.

◆ setQualityStatus()

void PixelDataFormatter::setQualityStatus ( bool  QualityStatus,
const SiPixelQuality QualityInfo 
)

Definition at line 62 of file PixelDataFormatter.cc.

62  {
63  useQualityInfo_ = QualityStatus;
64  badPixelInfo_ = QualityInfo;
65 }

References badPixelInfo_, and useQualityInfo_.

◆ unpackFEDErrors()

void PixelDataFormatter::unpackFEDErrors ( PixelDataFormatter::Errors const &  errors,
std::vector< int > const &  tkerrorlist,
std::vector< int > const &  usererrorlist,
edm::DetSetVector< SiPixelRawDataError > &  errorcollection,
DetIdCollection tkerror_detidcollection,
DetIdCollection usererror_detidcollection,
edmNew::DetSetVector< PixelFEDChannel > &  disabled_channelcollection,
DetErrors nodeterrors 
)

Definition at line 368 of file PixelDataFormatter.cc.

375  {
376  const uint32_t dummyDetId = 0xffffffff;
377  for (const auto& [errorDetId, rawErrorsVec] : errors) {
378  if (errorDetId == dummyDetId) { // errors given dummy detId must be sorted by Fed
379  nodeterrors.insert(nodeterrors.end(), rawErrorsVec.begin(), rawErrorsVec.end());
380  } else {
381  edm::DetSet<SiPixelRawDataError>& errorDetSet = errorcollection.find_or_insert(errorDetId);
382  errorDetSet.data.insert(errorDetSet.data.end(), rawErrorsVec.begin(), rawErrorsVec.end());
383  // Fill detid of the detectors where there is error AND the error number is listed
384  // in the configurable error list in the job option cfi.
385  // Code needs to be here, because there can be a set of errors for each
386  // entry in the for loop over PixelDataFormatter::Errors
387 
388  std::vector<PixelFEDChannel> disabledChannelsDetSet;
389 
390  for (auto const& aPixelError : errorDetSet) {
391  // For the time being, we extend the error handling functionality with ErrorType 25
392  // In the future, we should sort out how the usage of tkerrorlist can be generalized
393  if (phase1_ && aPixelError.getType() == 25) {
394  int fedId = aPixelError.getFedId();
396  if (fed) {
397  cms_uint32_t linkId = getLink(aPixelError.getWord32());
398  const sipixelobjects::PixelFEDLink* link = fed->link(linkId);
399  if (link) {
400  // The "offline" 0..15 numbering is fixed by definition, also, the FrameConversion depends on it
401  // in contrast, the ROC-in-channel numbering is determined by hardware --> better to use the "offline" scheme
402  PixelFEDChannel ch = {fed->id(), linkId, 25, 0};
403  for (unsigned int iRoc = 1; iRoc <= link->numberOfROCs(); iRoc++) {
404  const sipixelobjects::PixelROC* roc = link->roc(iRoc);
405  if (roc->idInDetUnit() < ch.roc_first)
406  ch.roc_first = roc->idInDetUnit();
407  if (roc->idInDetUnit() > ch.roc_last)
408  ch.roc_last = roc->idInDetUnit();
409  }
410  disabledChannelsDetSet.push_back(ch);
411  }
412  }
413  } else {
414  // fill list of detIds to be turned off by tracking
415  if (!tkerrorlist.empty()) {
416  auto it_find = std::find(tkerrorlist.begin(), tkerrorlist.end(), aPixelError.getType());
417  if (it_find != tkerrorlist.end()) {
418  tkerror_detidcollection.push_back(errorDetId);
419  }
420  }
421  }
422 
423  // fill list of detIds with errors to be studied
424  if (!usererrorlist.empty()) {
425  auto it_find = std::find(usererrorlist.begin(), usererrorlist.end(), aPixelError.getType());
426  if (it_find != usererrorlist.end()) {
427  usererror_detidcollection.push_back(errorDetId);
428  }
429  }
430 
431  } // loop on DetSet of errors
432 
433  if (!disabledChannelsDetSet.empty()) {
434  disabled_channelcollection.insert(errorDetId, disabledChannelsDetSet.data(), disabledChannelsDetSet.size());
435  }
436 
437  } // if error assigned to a real DetId
438  } // loop on errors in event for this FED
439 }

References edm::DetSet< T >::data, sipixelconstants::dummyDetId, errorDetId(), SiPixelFedCablingTree::fed(), l1tstage2_dqm_sourceclient-live_cfg::fedId, spr::find(), edm::DetSetVector< T >::find_or_insert(), sipixelconstants::functions::getLink(), sipixelobjects::PixelFEDCabling::id(), edmNew::DetSetVector< T >::insert(), sipixelobjects::PixelFEDCabling::link(), MainPageGenerator::link, phase1_, edm::EDCollection< T >::push_back(), PixelMapPlotter::roc, PixelFEDChannel::roc_first, PixelFEDChannel::roc_last, and theCablingTree_.

Member Data Documentation

◆ allDetDigis_

int PixelDataFormatter::allDetDigis_
private

Definition at line 108 of file PixelDataFormatter.h.

Referenced by formatRawData(), and PixelDataFormatter().

◆ badPixelInfo_

const SiPixelQuality* PixelDataFormatter::badPixelInfo_
private

Definition at line 103 of file PixelDataFormatter.h.

Referenced by interpretRawData(), and setQualityStatus().

◆ errorcheck_

std::unique_ptr<ErrorCheckerBase> PixelDataFormatter::errorcheck_
private

Definition at line 110 of file PixelDataFormatter.h.

Referenced by interpretRawData(), PixelDataFormatter(), and setErrorStatus().

◆ hasDetDigis_

int PixelDataFormatter::hasDetDigis_
private

Definition at line 109 of file PixelDataFormatter.h.

Referenced by formatRawData(), and PixelDataFormatter().

◆ includeErrors_

bool PixelDataFormatter::includeErrors_
private

Definition at line 106 of file PixelDataFormatter.h.

Referenced by PixelDataFormatter(), and setErrorStatus().

◆ maxROCIndex_

int PixelDataFormatter::maxROCIndex_
private

Definition at line 112 of file PixelDataFormatter.h.

Referenced by interpretRawData(), and PixelDataFormatter().

◆ modulesToUnpack_

const ModuleIDSet* PixelDataFormatter::modulesToUnpack_
private

Definition at line 104 of file PixelDataFormatter.h.

Referenced by interpretRawData(), and setModulesToUnpack().

◆ phase1_

bool PixelDataFormatter::phase1_
private

◆ theCablingTree_

SiPixelFedCablingTree const* PixelDataFormatter::theCablingTree_
private

Definition at line 101 of file PixelDataFormatter.h.

Referenced by interpretRawData(), and unpackFEDErrors().

◆ theDigiCounter_

int PixelDataFormatter::theDigiCounter_
mutableprivate

Definition at line 98 of file PixelDataFormatter.h.

Referenced by formatRawData(), and nDigis().

◆ theFrameReverter_

const SiPixelFrameReverter* PixelDataFormatter::theFrameReverter_
private

Definition at line 102 of file PixelDataFormatter.h.

Referenced by digi2word(), digi2wordPhase1Layer1(), and passFrameReverter().

◆ theWordCounter_

int PixelDataFormatter::theWordCounter_
mutableprivate

◆ useQualityInfo_

bool PixelDataFormatter::useQualityInfo_
private

Definition at line 107 of file PixelDataFormatter.h.

Referenced by interpretRawData(), PixelDataFormatter(), and setQualityStatus().

sipixelobjects::PixelFEDCabling::id
unsigned int id() const
Definition: PixelFEDCabling.h:34
edm::EDCollection::push_back
void push_back(T const &t)
Definition: EDCollection.h:60
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
sipixelobjects::PixelFEDCabling::link
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id's are ranged [1, numberOfLinks]
Definition: PixelFEDCabling.h:27
PixelDataFormatter::nWords
int nWords() const
Definition: PixelDataFormatter.h:82
ErrorCheckerPhase0
Definition: ErrorCheckerPhase0.h:12
mps_fire.i
i
Definition: mps_fire.py:428
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
funct::false
false
Definition: Factorize.h:29
PixelFEDChannel
Definition: PixelFEDChannel.h:6
PixelDataFormatter::theCablingTree_
SiPixelFedCablingTree const * theCablingTree_
Definition: PixelDataFormatter.h:101
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
edm::DetSet
Definition: DetSet.h:23
sipixelconstants::functions::getRow
constexpr uint32_t getRow(uint32_t ww)
Definition: SiPixelDigiConstants.h:55
converter
Definition: CandidateProducer.h:25
sipixelconstants::functions::getADC
constexpr uint32_t getADC(uint32_t ww)
Definition: SiPixelDigiConstants.h:53
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
sipixelconstants::dummyDetId
constexpr cms_uint32_t dummyDetId
Definition: SiPixelDigiConstants.h:11
sipixelconstants::LINK_shift
constexpr uint32_t LINK_shift
Definition: SiPixelDigiConstants.h:27
edmNew::DetSetVector::insert
DetSet insert(id_type iid, data_type const *idata, size_type isize)
Definition: DetSetVectorNew.h:466
phase1PixelTopology::numRowsInRoc
constexpr uint16_t numRowsInRoc
Definition: phase1PixelTopology.h:9
cuy.col
col
Definition: cuy.py:1009
sipixelobjects::PixelFEDCabling
Definition: PixelFEDCabling.h:16
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:163
sipixelconstants::functions::getROC
constexpr uint32_t getROC(uint32_t ww)
Definition: SiPixelDigiConstants.h:52
PixelDigi
Definition: PixelDigi.h:14
omtf::Word64
uint64_t Word64
Definition: OmtfDataWord64.h:11
PixelDataFormatter::badPixelInfo_
const SiPixelQuality * badPixelInfo_
Definition: PixelDataFormatter.h:103
sipixelobjects::LocalPixel::DcolPxid::valid
bool valid() const
Definition: LocalPixel.h:21
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
PixelDataFormatter::includeErrors_
bool includeErrors_
Definition: PixelDataFormatter.h:106
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
SiPixelFedCablingTree::fed
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
Definition: SiPixelFedCablingTree.cc:95
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
FEDRawData
Definition: FEDRawData.h:19
sipixelconstants::ROC_shift
constexpr uint32_t ROC_shift
Definition: SiPixelDigiConstants.h:26
PixelDataFormatter::hasDetDigis_
int hasDetDigis_
Definition: PixelDataFormatter.h:109
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
sipixelconstants::phase1layer1::COL_shift
constexpr uint32_t COL_shift
Definition: SiPixelDigiConstants.h:44
PixelDataFormatter::theDigiCounter_
int theDigiCounter_
Definition: PixelDataFormatter.h:98
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
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::phase1_
bool phase1_
Definition: PixelDataFormatter.h:113
sipixelconstants::phase1layer1::ROW_shift
constexpr uint32_t ROW_shift
Definition: SiPixelDigiConstants.h:43
sipixelobjects
Definition: CablingPathToDetUnit.h:4
PixelDataFormatter::maxROCIndex_
int maxROCIndex_
Definition: PixelDataFormatter.h:112
Word64
cms_uint64_t Word64
Definition: SiPixelDigiConstants.h:7
str
#define str(s)
Definition: TestProcessor.cc:53
sipixelobjects::ElectronicIndex::pxid
int pxid
Definition: ElectronicIndex.h:9
PixelDataFormatter::errorDetId
cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int fedId, int errorType, const Word32 &word) const
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
PixelDataFormatter::DetDigis
std::vector< PixelDigi > DetDigis
Definition: PixelDataFormatter.h:67
sipixelobjects::ElectronicIndex::link
int link
Definition: ElectronicIndex.h:6
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
SiPixelPI::phase
phase
Definition: SiPixelPayloadInspectorHelper.h:39
PixelDigi::column
int column() const
Definition: PixelDigi.h:57
SiPixelFrameReverter::toCabling
int toCabling(sipixelobjects::ElectronicIndex &cabling, const sipixelobjects::DetectorIndex &detector) const
Definition: SiPixelFrameReverter.cc:34
PixelDataFormatter::errorcheck_
std::unique_ptr< ErrorCheckerBase > errorcheck_
Definition: PixelDataFormatter.h:110
sipixelconstants::functions::getDCol
constexpr uint32_t getDCol(uint32_t ww)
Definition: SiPixelDigiConstants.h:56
PixelDataFormatter::modulesToUnpack_
const ModuleIDSet * modulesToUnpack_
Definition: PixelDataFormatter.h:104
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
sipixelconstants::ADC_shift
constexpr uint32_t ADC_shift
Definition: SiPixelDigiConstants.h:23
sipixelobjects::LocalPixel::DcolPxid
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
sipixelconstants::functions::getCol
constexpr uint32_t getCol(uint32_t ww)
Definition: SiPixelDigiConstants.h:54
PixelDataFormatter::print
std::string print(const PixelDigi &digi) const
Definition: PixelDataFormatter.cc:356
sipixelconstants::functions::getLink
constexpr uint32_t getLink(uint32_t ww)
Definition: SiPixelDigiConstants.h:51
PixelDataFormatter::theFrameReverter_
const SiPixelFrameReverter * theFrameReverter_
Definition: PixelDataFormatter.h:102
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
sipixelconstants::DCOL_shift
constexpr uint32_t DCOL_shift
Definition: SiPixelDigiConstants.h:25
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:89
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::digi2wordPhase1Layer1
int digi2wordPhase1Layer1(cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const
Definition: PixelDataFormatter.cc:334
PixelDataFormatter::digi2word
int digi2word(cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const
Definition: PixelDataFormatter.cc:316
ErrorChecker
Definition: ErrorChecker.h:12
PixelDataFormatter::useQualityInfo_
bool useQualityInfo_
Definition: PixelDataFormatter.h:107
PixelDataFormatter::theWordCounter_
int theWordCounter_
Definition: PixelDataFormatter.h:99
PixelModuleName::isBarrel
virtual bool isBarrel() const
true for barrel modules
Definition: PixelModuleName.h:20
sipixelobjects::PixelROC
Definition: PixelROC.h:23
Word32
cms_uint32_t Word32
Definition: SiPixelDigiConstants.h:8
sipixelconstants::functions::getPxId
constexpr uint32_t getPxId(uint32_t ww)
Definition: SiPixelDigiConstants.h:57
PixelDigi::row
int row() const
Definition: PixelDigi.h:54
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
PixelFEDChannel::roc_last
unsigned int roc_last
Definition: PixelFEDChannel.h:7
Exception
Definition: hltDiff.cc:245
PixelDigi::adc
unsigned short adc() const
Definition: PixelDigi.h:64
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
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
edm::DetSetVector::find_or_insert
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
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
SiPixelQuality::IsRocBad
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
Definition: SiPixelQuality.cc:107
sipixelobjects::LocalPixel::RocRowCol::valid
bool valid() const
Definition: LocalPixel.h:15
PixelDataFormatter::allDetDigis_
int allDetDigis_
Definition: PixelDataFormatter.h:108
sipixelconstants::PXID_shift
constexpr uint32_t PXID_shift
Definition: SiPixelDigiConstants.h:24
PixelFEDChannel::roc_first
unsigned int roc_first
Definition: PixelFEDChannel.h:7
sipixelobjects::PixelROC::idInDetUnit
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
sipixelobjects::DetectorIndex
Definition: DetectorIndex.h:6
sipixelobjects::ElectronicIndex::roc
int roc
Definition: ElectronicIndex.h:7