37 constexpr
int LINK_bits1 = 6;
38 constexpr
int ROC_bits1 = 5;
40 constexpr
int COL_bits1_l1 = 6;
41 constexpr
int ROW_bits1_l1 = 7;
61 badPixelInfo(nullptr),
62 modulesToUnpack(nullptr),
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";
143 bool moreHeaders =
true;
144 while (moreHeaders) {
148 moreHeaders = headerStatus;
152 bool moreTrailers =
true;
154 while (moreTrailers) {
158 moreTrailers = trailerStatus;
169 bool skipROC =
false;
174 if (*(ew - 1) == 0) {
191 if ((nlink !=
link) | (nroc !=
roc)) {
201 errorsInEvent =
true;
206 auto rawId = rocp->
rawId();
209 layer = PixelROC::bpixLayerPhase1(rawId);
227 if ((*detDigis).empty())
228 (*detDigis).
data.reserve(32);
236 std::unique_ptr<LocalPixel>
local;
248 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
249 errorsInEvent =
true;
253 local = std::make_unique<LocalPixel>(localCR);
266 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
267 errorsInEvent =
true;
271 local = std::make_unique<LocalPixel>(localDP);
276 (*detDigis).data.emplace_back(global.
row, global.
col,
adc);
278 LogTrace(
"") << (*detDigis).data.back();
301 std::map<int, vector<Word32> > words;
304 for (Digis::const_iterator im = digis.begin(); im != digis.end(); im++) {
310 layer = PixelROC::bpixLayerPhase1(rawId);
313 BadChannels::const_iterator detBadChannels = badChannels.find(rawId);
316 const DetDigis& detDigis = im->second;
317 for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
330 <<
" detector: " << rawId << endl
331 <<
print(digi) << endl;
332 }
else if (detBadChannels != badChannels.end()) {
334 std::find_if(detBadChannels->second.begin(), detBadChannels->second.end(), [&](
const PixelFEDChannel& ch) {
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;
348 for (
const auto& detBadChannels : badChannels) {
349 for (
const auto& badChannel : detBadChannels.second) {
350 unsigned int FEDError25 = 25;
352 words[badChannel.fed].push_back(
word);
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;
362 if (words.find(
fedId)->second.size() % 2 != 0)
366 int dataSize = words.find(
fedId)->second.size() *
sizeof(
Word32);
369 dataSize += (nHeaders + nTrailers) *
sizeof(
Word64);
380 unsigned int nWord32InFed = words.find(
fedId)->second.size();
381 for (
unsigned int i = 0;
i < nWord32InFed;
i += 2) {
392 if (
word != reinterpret_cast<Word64*>(
rawData->data() + dataSize)) {
393 string s =
"** PROBLEM in PixelDataFormatter !!!";
403 std::map<
int, vector<Word32> >& words)
const {
426 std::map<
int, vector<Word32> >& words)
const {
437 int col = ((cabling.
dcol) * 2) + ((cabling.
pxid) % 2);
458 Digis& digis)
const {
473 LogTrace(
"") <<
" link: " << cabling.
link <<
", roc: " << cabling.
roc <<
" rocRow: " <<
local.rocRow()
474 <<
", rocCol:" <<
local.rocCol() <<
" (dcol: " << cabling.
dcol <<
", pxid:" << cabling.
pxid
491 static_cast<unsigned int>(cabling.
link),
492 static_cast<unsigned int>(cabling.
roc)};
494 short rocInDet = (short)
roc->idInDetUnit();
514 str <<
" DIGI: row: " << digi.
row() <<
", col: " << digi.
column() <<
", adc: " << digi.
adc();
520 str <<
"word64: " <<
reinterpret_cast<const bitset<64>&
>(
word);