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;
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) {
192 if ((nlink !=
link) | (nroc !=
roc)) {
203 errorsInEvent =
true;
208 auto rawId = rocp->
rawId();
211 layer = PixelROC::bpixLayerPhase1(rawId);
229 if ((*detDigis).empty())
230 (*detDigis).
data.reserve(32);
235 UNLIKELY(skipROC || !rocp)
continue;
238 std::unique_ptr<LocalPixel>
local;
240 if (
phase1 && layer == 1) {
251 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
252 errorsInEvent =
true;
256 local = std::make_unique<LocalPixel>(localCR);
270 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
271 errorsInEvent =
true;
275 local = std::make_unique<LocalPixel>(localDP);
280 (*detDigis).data.emplace_back(global.
row, global.
col,
adc);
282 LogTrace(
"") << (*detDigis).data.back();
305 std::map<int, vector<Word32> > words;
308 for (Digis::const_iterator im = digis.begin(); im != digis.end(); im++) {
314 layer = PixelROC::bpixLayerPhase1(rawId);
317 BadChannels::const_iterator detBadChannels = badChannels.find(rawId);
320 const DetDigis& detDigis = im->second;
321 for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
334 <<
" detector: " << rawId << endl
335 <<
print(digi) << endl;
336 }
else if (detBadChannels != badChannels.end()) {
338 std::find_if(detBadChannels->second.begin(), detBadChannels->second.end(), [&](
const PixelFEDChannel& ch) {
341 if (badChannel != detBadChannels->second.end()) {
342 LogError(
"FormatDataException") <<
" while marked bad, found digi for FED " <<
fedId <<
" Link "
343 <<
linkId(words[
fedId].back()) <<
" on module " << rawId << endl
344 <<
print(digi) << endl;
352 for (
const auto& detBadChannels : badChannels) {
353 for (
const auto& badChannel : detBadChannels.second) {
354 unsigned int FEDError25 = 25;
356 words[badChannel.fed].push_back(
word);
361 typedef std::map<int, vector<Word32> >::const_iterator RI;
362 for (RI feddata = words.begin(); feddata != words.end(); feddata++) {
363 int fedId = feddata->first;
366 if (words.find(
fedId)->second.size() % 2 != 0)
370 int dataSize = words.find(
fedId)->second.size() *
sizeof(
Word32);
373 dataSize += (nHeaders + nTrailers) *
sizeof(
Word64);
384 unsigned int nWord32InFed = words.find(
fedId)->second.size();
385 for (
unsigned int i = 0;
i < nWord32InFed;
i += 2) {
396 if (
word != reinterpret_cast<Word64*>(
rawData->data() + dataSize)) {
397 string s =
"** PROBLEM in PixelDataFormatter !!!";
407 std::map<
int, vector<Word32> >& words)
const {
430 std::map<
int, vector<Word32> >& words)
const {
441 int col = ((cabling.
dcol) * 2) + ((cabling.
pxid) % 2);
462 Digis& digis)
const {
477 LogTrace(
"") <<
" link: " << cabling.
link <<
", roc: " << cabling.
roc <<
" rocRow: " <<
local.rocRow()
478 <<
", rocCol:" <<
local.rocCol() <<
" (dcol: " << cabling.
dcol <<
", pxid:" << cabling.
pxid
495 static_cast<unsigned int>(cabling.
link),
496 static_cast<unsigned int>(cabling.
roc)};
498 short rocInDet = (short)
roc->idInDetUnit();
518 str <<
" DIGI: row: " << digi.
row() <<
", col: " << digi.
column() <<
", adc: " << digi.
adc();
524 str <<
"word64: " <<
reinterpret_cast<const bitset<64>&
>(
word);