32 badPixelInfo_(nullptr),
33 modulesToUnpack_(nullptr),
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";
89 bool moreHeaders =
true;
94 moreHeaders = headerStatus;
98 bool moreTrailers =
true;
100 while (moreTrailers) {
104 moreTrailers = trailerStatus;
115 bool skipROC =
false;
120 if (*(ew - 1) == 0) {
135 if ((nlink !=
link) | (nroc !=
roc)) {
145 errorsInEvent =
true;
150 auto rawId = rocp->
rawId();
153 layer = PixelROC::bpixLayerPhase1(rawId);
168 if ((*detDigis).empty())
169 (*detDigis).
data.reserve(32);
177 std::unique_ptr<LocalPixel>
local;
186 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
187 errorsInEvent =
true;
191 local = std::make_unique<LocalPixel>(localCR);
199 LogDebug(
"PixelDataFormatter::interpretRawData") <<
"status #3";
200 errorsInEvent =
true;
204 local = std::make_unique<LocalPixel>(localDP);
208 (*detDigis).data.emplace_back(global.
row, global.
col,
adc);
209 LogTrace(
"") << (*detDigis).data.back();
217 std::map<int, vector<Word32> > words;
220 for (Digis::const_iterator im = digis.begin(); im != digis.end(); im++) {
226 layer = PixelROC::bpixLayerPhase1(rawId);
228 BadChannels::const_iterator detBadChannels = badChannels.find(rawId);
231 const DetDigis& detDigis = im->second;
232 for (DetDigis::const_iterator it = detDigis.begin(); it != detDigis.end(); it++) {
245 <<
" detector: " << rawId << endl
246 <<
print(digi) << endl;
247 }
else if (detBadChannels != badChannels.end()) {
249 std::find_if(detBadChannels->second.begin(), detBadChannels->second.end(), [&](
const PixelFEDChannel& ch) {
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;
263 for (
const auto& detBadChannels : badChannels) {
264 for (
const auto& badChannel : detBadChannels.second) {
265 unsigned int FEDError25 = 25;
267 words[badChannel.fed].push_back(
word);
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;
277 if (words.find(
fedId)->second.size() % 2 != 0)
281 int dataSize = words.find(
fedId)->second.size() *
sizeof(
Word32);
284 dataSize += (nHeaders + nTrailers) *
sizeof(
Word64);
295 unsigned int nWord32InFed = words.find(
fedId)->second.size();
296 for (
unsigned int i = 0;
i < nWord32InFed;
i += 2) {
307 if (
word != reinterpret_cast<Word64*>(
rawData->data() + dataSize)) {
308 string s =
"** PROBLEM in PixelDataFormatter !!!";
318 std::map<
int, vector<Word32> >& words)
const {
336 std::map<
int, vector<Word32> >& words)
const {
345 int col = ((cabling.
dcol) * 2) + ((cabling.
pxid) % 2);
358 str <<
" DIGI: row: " << digi.
row() <<
", col: " << digi.
column() <<
", adc: " << digi.
adc();
364 str <<
"word64: " <<
reinterpret_cast<const bitset<64>&
>(
word);
369 std::vector<int>
const& tkerrorlist,
370 std::vector<int>
const& usererrorlist,
379 nodeterrors.insert(nodeterrors.end(), rawErrorsVec.begin(), rawErrorsVec.end());
382 errorDetSet.
data.insert(errorDetSet.
data.end(), rawErrorsVec.begin(), rawErrorsVec.end());
388 std::vector<PixelFEDChannel> disabledChannelsDetSet;
390 for (
auto const& aPixelError : errorDetSet) {
393 if (
phase1_ && aPixelError.getType() == 25) {
394 int fedId = aPixelError.getFedId();
403 for (
unsigned int iRoc = 1; iRoc <=
link->numberOfROCs(); iRoc++) {
410 disabledChannelsDetSet.push_back(ch);
415 if (!tkerrorlist.empty()) {
416 auto it_find =
std::find(tkerrorlist.begin(), tkerrorlist.end(), aPixelError.getType());
417 if (it_find != tkerrorlist.end()) {
424 if (!usererrorlist.empty()) {
425 auto it_find =
std::find(usererrorlist.begin(), usererrorlist.end(), aPixelError.getType());
426 if (it_find != usererrorlist.end()) {
433 if (!disabledChannelsDetSet.empty()) {
434 disabled_channelcollection.
insert(
errorDetId, disabledChannelsDetSet.data(), disabledChannelsDetSet.size());