Project
Loading...
Searching...
No Matches
PixelData.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
17#include "Framework/Logger.h"
18#include <cassert>
19#include <bitset>
20
21using namespace o2::itsmft;
22
23void PixelData::sanityCheck() const
24{
25 // make sure the mask used in this class are compatible with Alpide segmenations
26 static_assert(RowMask + 1 >= o2::itsmft::SegmentationAlpide::NRows,
27 "incompatible mask, does not match Alpide segmentations");
28}
29
31{
32 // print chip data
33 static_assert(ChipStat::DecErrors::NErrorsDefined > sizeof(mErrors), "too many DecErrors defined");
34 std::bitset<4> flg(mROFlags);
35 printf("Chip %d in Orbit %6d BC:%4d (ROFrame %d) ROFlags: 4b'%4s | %4lu hits\n", mChipID,
36 mInteractionRecord.orbit, mInteractionRecord.bc, mROFrame, flg.to_string().c_str(), mPixels.size());
37 for (int i = 0; i < mPixels.size(); i++) {
38 printf("#%4d C:%4d R: %3d %s\n", i, mPixels[i].getCol(), mPixels[i].getRow(), mPixels[i].isMasked() ? "*" : "");
39 }
40}
41
42std::string ChipPixelData::getErrorDetails(int pos) const
43{
44 // if possible, extract more detailed info about the error
45 if (pos == int(ChipStat::RepeatingPixel)) {
46 return fmt::format(": row{}/col{}", mErrorInfo & 0xffff, (mErrorInfo >> 16) & 0xffff);
47 }
48 if (pos == int(ChipStat::UnknownWord)) {
49 std::string rbuf = ": 0x<";
50 int nc = getNBytesInRawBuff();
51 for (int i = 0; i < nc; i++) {
52 rbuf += fmt::format(fmt::runtime(i ? " {:02x}" : "{:02x}"), (int)getRawErrBuff()[i]);
53 }
54 rbuf += '>';
55 return rbuf;
56 }
57 if (pos == int(ChipStat::WrongAlpideChipID)) {
58 std::string rbuf = fmt::format(" {} for this link", mErrorInfo & 0xffff);
59 return rbuf;
60 }
61 return {};
62}
int32_t i
Transient data classes for single pixel and set of pixels from current chip.
uint16_t pos
Definition RawData.h:3
Definition of the SegmentationAlpide class.
auto getNBytesInRawBuff() const
Definition PixelData.h:133
std::string getErrorDetails(int pos) const
Definition PixelData.cxx:42
uint32_t orbit
LHC orbit.
uint16_t bc
bunch crossing ID of interaction