14#ifndef ALICEO2_ITSMFT_PIXELDATA_H
15#define ALICEO2_ITSMFT_PIXELDATA_H
38 uint16_t
getRow()
const {
return mRow & RowMask; }
39 uint16_t
getCol()
const {
return mCol; }
40 bool isMasked()
const {
return mRow & MaskBit; }
74 return (std::abs(
static_cast<int>(
getCol()) -
static_cast<int>(dt.
getCol())) <= maxDist &&
75 std::abs(
static_cast<int>(
getRow()) -
static_cast<int>(dt.
getRow())) <= maxDist);
84 static constexpr uint32_t
DummyROF = 0xffffffff;
88 void sanityCheck()
const;
89 static constexpr int RowMask = 0x7FFF;
90 static constexpr int MaskBit = 0x8000;
115 const std::vector<PixelData>&
getData()
const {
return mPixels; }
116 std::vector<PixelData>&
getData() {
return (std::vector<PixelData>&)mPixels; }
153 mPixelsOrder.clear();
159 std::swap(mROFlags,
other.mROFlags);
160 std::swap(mChipID,
other.mChipID);
161 std::swap(mROFrame,
other.mROFrame);
162 std::swap(mFirstUnmasked,
other.mFirstUnmasked);
163 std::swap(mStartID,
other.mStartID);
164 std::swap(mTrigger,
other.mTrigger);
165 std::swap(mErrors,
other.mErrors);
166 std::swap(mInteractionRecord,
other.mInteractionRecord);
167 mPixels.swap(
other.mPixels);
173 const auto& pixelsS = sample.
getData();
174 uint32_t nC = mPixels.size();
178 uint32_t nS = pixelsS.size();
182 uint32_t itC = 0, itS = 0;
183 while (itC < nC && itS < nS) {
184 auto& pix0 = mPixels[itC];
185 const auto& pixC = pixelsS[itS];
188 if (mFirstUnmasked == itC++) {
189 mFirstUnmasked = itC;
192 }
else if (pix0 < pixC) {
203 const auto& pixelsS = sample.
getData();
204 int nC = mPixels.size();
208 int nS = pixelsS.size();
212 for (
int itC = 0, itS = 0; itC < nC; itC++) {
213 auto& pix0 = mPixels[itC];
216 auto mincol = pix0.getCol() > maxDist ? pix0.getCol() - maxDist : 0;
217 auto minrow = pix0.getRowDirect() > maxDist ? pix0.getRowDirect() - maxDist : 0;
221 while ((pixelsS[itS].getCol() > mincol || pixelsS[itS].getRow() > minrow) && itS > 0) {
224 for (; itS < nS; itS++) {
225 const auto& pixC = pixelsS[itS];
227 auto drow =
static_cast<int>(pixC.getRow()) -
static_cast<int>(pix0.getRowDirect());
228 auto dcol =
static_cast<int>(pixC.getCol()) -
static_cast<int>(pix0.getCol());
230 if (dcol > maxDist || (dcol == maxDist && drow > maxDist)) {
233 if (dcol < -maxDist || (drow > maxDist || drow < -maxDist)) {
237 if (
int(mFirstUnmasked) == itC) {
238 mFirstUnmasked = itC + 1;
246 template <
typename Func>
249 auto outer = [&](
int errIdx) {
261 auto inner = [&](
int errIdx) {
278 uint8_t mROFlags = 0;
279 uint16_t mChipID = 0;
280 uint32_t mROFrame = 0;
281 uint32_t mFirstUnmasked = 0;
282 uint32_t mStartID = 0;
283 uint32_t mTrigger = 0;
284 uint64_t mErrors = 0;
285 uint64_t mErrorInfo = 0;
286 std::array<uint8_t, MAXDATAERRBYTES> mRawBuff{};
288 std::vector<PixelData> mPixels;
289 std::vector<uint32_t> mPixIds;
290 std::vector<int> mPixelsOrder;
Alpide Chip and GBT link decoding statistics.
o2::mid::ColumnData & getColumn(std::vector< o2::mid::ColumnData > &patterns, uint8_t icolumn, uint8_t deId)
uint32_t getOrderedPixId(int pos) const
std::string reportErrors() const
auto getNBytesInRawBuff() const
uint32_t getStartID() const
static constexpr size_t MAXDATAERRBYTES
uint8_t getROFlags() const
void setError(ChipStat::DecErrors i)
void setErrorFlags(uint64_t f)
void setInteractionRecord(const o2::InteractionRecord &r)
uint32_t getFirstUnmasked() const
std::vector< uint32_t > & getPixIds()
void setErrorInfo(uint64_t b)
void setROFrame(uint32_t r)
void setStartID(uint32_t id)
void setNBytesInRawBuff(int n)
std::vector< int > & getPixelsOrder()
auto & getRawErrBuff() const
auto getErrorInfo() const
void setChipID(uint16_t id)
void swap(ChipPixelData &other)
void setROFlags(uint8_t f=0)
void setFirstUnmasked(uint32_t n)
uint32_t getROFrame() const
bool isErrorSet(ChipStat::DecErrors i) const
const o2::InteractionRecord & getInteractionRecord() const
void addErrorInfo(uint64_t b)
void setTrigger(uint32_t t)
static constexpr size_t MAXDATAERRBYTES_AFTER
auto getErrorFlags() const
uint32_t getTrigger() const
std::vector< PixelData > & getData()
std::string getErrorDetails(int pos) const
uint16_t getChipID() const
const std::vector< PixelData > & getData() const
void forEachSetError(Func f) const
void maskFiredInSample(const ChipPixelData &sample)
void maskFiredInSample(const ChipPixelData &sample, int maxDist)
< single pixel datum, with possibility to set a flag of pixel being masked out
uint16_t getRowDirect() const
for faster access when the pixel is guaranteed to not be masked
PixelData(const Digit *dig)
static constexpr uint32_t DummyChipID
static constexpr uint32_t DummyROF
int compare(const PixelData &dt) const
bool operator>(const PixelData &dt) const
bool operator==(const PixelData &dt) const
bool isNeighbour(const PixelData &dt, int maxDist) const
PixelData(uint16_t r=0, uint16_t c=0)
bool operator<(const PixelData &dt) const
GLboolean GLboolean GLboolean b
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static constexpr std::array< std::string_view, NErrorsDefined > ErrNames
static void forEachError(Func f)
VectorOfTObjectPtrs other