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 using namespace sipixelconstants;
27 
29  : theDigiCounter_(0),
30  theWordCounter_(0),
31  theCablingTree_(map),
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 }
56 
57 void PixelDataFormatter::setErrorStatus(bool ErrorStatus) {
58  includeErrors_ = ErrorStatus;
59  errorcheck_->setErrorStatus(includeErrors_);
60 }
61 
62 void PixelDataFormatter::setQualityStatus(bool QualityStatus, const SiPixelQuality* QualityInfo) {
63  useQualityInfo_ = QualityStatus;
64  badPixelInfo_ = QualityInfo;
65 }
66 
67 void PixelDataFormatter::setModulesToUnpack(const std::set<unsigned int>* moduleIds) { modulesToUnpack_ = moduleIds; }
68 
70 
72  bool& errorsInEvent, int fedId, const FEDRawData& rawData, Collection& digis, Errors& errors) {
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 }
212 
213 void PixelDataFormatter::formatRawData(unsigned int lvl1_ID,
215  const Digis& digis,
216  const BadChannels& badChannels) {
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 }
315 
317  const PixelDigi& digi,
318  std::map<int, vector<Word32> >& words) const {
319  LogDebug("PixelDataFormatter") << print(digi);
320 
321  DetectorIndex detector = {detId, digi.row(), digi.column()};
322  ElectronicIndex cabling;
323  int fedId = theFrameReverter_->toCabling(cabling, detector);
324  if (fedId < 0)
325  return fedId;
326 
327  Word32 word = (cabling.link << LINK_shift) | (cabling.roc << ROC_shift) | (cabling.dcol << DCOL_shift) |
328  (cabling.pxid << PXID_shift) | (digi.adc() << ADC_shift);
329  words[fedId].push_back(word);
330  theWordCounter_++;
331 
332  return fedId;
333 }
335  const PixelDigi& digi,
336  std::map<int, vector<Word32> >& words) const {
337  LogDebug("PixelDataFormatter") << print(digi);
338 
339  DetectorIndex detector = {detId, digi.row(), digi.column()};
340  ElectronicIndex cabling;
341  int fedId = theFrameReverter_->toCabling(cabling, detector);
342  if (fedId < 0)
343  return fedId;
344 
345  int col = ((cabling.dcol) * 2) + ((cabling.pxid) % 2);
346  int row = LocalPixel::numRowsInRoc - ((cabling.pxid) / 2);
347 
348  Word32 word = (cabling.link << LINK_shift) | (cabling.roc << ROC_shift) | (col << COL_shift) | (row << ROW_shift) |
349  (digi.adc() << ADC_shift);
350  words[fedId].push_back(word);
351  theWordCounter_++;
352 
353  return fedId;
354 }
355 
357  ostringstream str;
358  str << " DIGI: row: " << digi.row() << ", col: " << digi.column() << ", adc: " << digi.adc();
359  return str.str();
360 }
361 
363  ostringstream str;
364  str << "word64: " << reinterpret_cast<const bitset<64>&>(word);
365  return str.str();
366 }
367 
369  std::vector<int> const& tkerrorlist,
370  std::vector<int> const& usererrorlist,
372  DetIdCollection& tkerror_detidcollection,
373  DetIdCollection& usererror_detidcollection,
374  edmNew::DetSetVector<PixelFEDChannel>& disabled_channelcollection,
375  DetErrors& nodeterrors) {
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 }
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
edm::DetSetVector< PixelDigi >
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
SiPixelFrameReverter
Definition: SiPixelFrameReverter.h:17
PixelDataFormatter::nWords
int nWords() const
Definition: PixelDataFormatter.h:82
ErrorCheckerPhase0
Definition: ErrorCheckerPhase0.h:12
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
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
PixelDataFormatter::RawData
std::map< int, FEDRawData > RawData
Definition: PixelDataFormatter.h:66
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
PixelDataFormatter::Errors
std::map< cms_uint32_t, DetErrors > Errors
Definition: PixelDataFormatter.h:64
sipixelconstants::functions::getADC
constexpr uint32_t getADC(uint32_t ww)
Definition: SiPixelDigiConstants.h:53
edm
HLT enums.
Definition: AlignableModifier.h:19
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
PixelDataFormatter::DetErrors
std::vector< SiPixelRawDataError > DetErrors
Definition: PixelDataFormatter.h:63
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
PixelDataFormatter::interpretRawData
void interpretRawData(bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
Definition: PixelDataFormatter.cc:71
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
SiPixelFedCablingMap.h
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
sipixelobjects::ElectronicIndex::dcol
int dcol
Definition: ElectronicIndex.h:8
SiPixelFedCablingTree.h
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
FEDRawData.h
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
sipixelconstants
Definition: SiPixelDigiConstants.h:10
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
SiPixelFrameConverter.h
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
SiPixelQuality
Definition: SiPixelQuality.h:27
PixelROC.h
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::setModulesToUnpack
void setModulesToUnpack(const ModuleIDSet *moduleIds)
Definition: PixelDataFormatter.cc:67
PixelDataFormatter::PixelDataFormatter
PixelDataFormatter(const SiPixelFedCablingTree *map, bool phase1_=false)
Definition: PixelDataFormatter.cc:28
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::Digis
std::map< cms_uint32_t, DetDigis > Digis
Definition: PixelDataFormatter.h:68
PixelDataFormatter::digi2word
int digi2word(cms_uint32_t detId, const PixelDigi &digi, FEDWordsMap &words) const
Definition: PixelDataFormatter.cc:316
edm::EDCollection< DetId >
ErrorChecker
Definition: ErrorChecker.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
edmNew::DetSetVector
Definition: DetSetNew.h:13
sipixelobjects::PixelROC
Definition: PixelROC.h:23
Word32
cms_uint32_t Word32
Definition: SiPixelDigiConstants.h:8
PixelDataFormatter::unpackFEDErrors
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)
Definition: PixelDataFormatter.cc:368
PixelDataFormatter.h
PixelDataFormatter::passFrameReverter
void passFrameReverter(const SiPixelFrameReverter *reverter)
Definition: PixelDataFormatter.cc:69
std
Definition: JetResolutionObject.h:76
sipixelconstants::functions::getPxId
constexpr uint32_t getPxId(uint32_t ww)
Definition: SiPixelDigiConstants.h:57
PixelDataFormatter::formatRawData
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, const BadChannels &badChannels)
Definition: PixelDataFormatter.cc:213
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
PixelDataFormatter::setErrorStatus
void setErrorStatus(bool ErrorStatus)
Definition: PixelDataFormatter.cc:57
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
PixelDataFormatter::BadChannels
std::map< cms_uint32_t, DetBadChannels > BadChannels
Definition: PixelDataFormatter.h:70
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: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
FEDHeader.h
SiPixelFedCablingTree
Definition: SiPixelFedCablingTree.h:13
PixelDataFormatter::setQualityStatus
void setQualityStatus(bool QualityStatus, const SiPixelQuality *QualityInfo)
Definition: PixelDataFormatter.cc:62
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
FEDTrailer.h