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
15
#include "
ITSMFTReconstruction/PixelData.h
"
16
#include "
ITSMFTBase/SegmentationAlpide.h
"
17
#include "
Framework/Logger.h
"
18
#include <cassert>
19
#include <bitset>
20
21
using namespace
o2::itsmft
;
22
23
void
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
30
void
ChipPixelData::print
()
const
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
42
std::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
}
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
Logger.h
PixelData.h
Transient data classes for single pixel and set of pixels from current chip.
pos
uint16_t pos
Definition
RawData.h:3
SegmentationAlpide.h
Definition of the SegmentationAlpide class.
o2::itsmft::ChipPixelData::getNBytesInRawBuff
auto getNBytesInRawBuff() const
Definition
PixelData.h:133
o2::itsmft::ChipPixelData::getRawErrBuff
auto & getRawErrBuff()
Definition
PixelData.h:135
o2::itsmft::ChipPixelData::print
void print() const
Definition
PixelData.cxx:30
o2::itsmft::ChipPixelData::getErrorDetails
std::string getErrorDetails(int pos) const
Definition
PixelData.cxx:42
o2::itsmft::SegmentationAlpide::NRows
static constexpr int NRows
Definition
SegmentationAlpide.h:36
o2::itsmft
Definition
SimTraits.h:123
o2::InteractionRecord::orbit
uint32_t orbit
LHC orbit.
Definition
InteractionRecord.h:35
o2::InteractionRecord::bc
uint16_t bc
bunch crossing ID of interaction
Definition
InteractionRecord.h:34
o2::itsmft::ChipStat::WrongAlpideChipID
@ WrongAlpideChipID
Definition
DecodingStat.h:70
o2::itsmft::ChipStat::RepeatingPixel
@ RepeatingPixel
Definition
DecodingStat.h:49
o2::itsmft::ChipStat::NErrorsDefined
@ NErrorsDefined
Definition
DecodingStat.h:72
o2::itsmft::ChipStat::UnknownWord
@ UnknownWord
Definition
DecodingStat.h:48
Detectors
ITSMFT
common
reconstruction
src
PixelData.cxx
Generated on Tue Feb 25 2025 23:16:19 for Project by
1.9.8