23#ifndef ALICEO2_ITSMFT_CLUSTERPATTERN_H
24#define ALICEO2_ITSMFT_CLUSTERPATTERN_H
36class TopologyDictionary;
37class BuildTopologyDictionary;
54 template <
class iterator>
57 mBitmap[0] = *pattIt++;
58 mBitmap[1] = *pattIt++;
59 int nbits = mBitmap[0] * mBitmap[1];
60 int nBytes = nbits / 8;
61 if (((nbits) % 8) != 0) {
64 memcpy(&mBitmap[2], &(*pattIt), nBytes);
68 template <
class iterator>
71 unsigned char b0 = *pattIt++,
b1 = *pattIt++;
73 pattIt += nbits / 8 + (((nbits) % 8) != 0);
77 template <
class iterator>
86 const std::array<unsigned char, kExtendedPatternBytes>&
getPattern()
const {
return mBitmap; }
105 static int getCOG(
int rowSpan,
int colSpan,
const unsigned char patt[
MaxPatternBytes],
float& xCOG,
float& zCOG);
111 const auto bmap = mBitmap.data() + 2;
118 const auto bmap = mBitmap.data() + 2;
121 bmap[
pos >> 3] &= 0xff & ~(0x1 << (7 - (
pos % 8)));
127 const auto bmap = mBitmap.data() + 2;
130 bmap[
pos >> 3] |= 0x1 << (7 - (
pos % 8));
134 template <
typename Processor>
135 void process(Processor procRowCol);
150 std::array<unsigned char, kExtendedPatternBytes> mBitmap;
155template <
typename Processor>
159 uint32_t nBits = cspan * rspan;
160 uint32_t nBytes = (nBits >> 3) + (nBits % 8 != 0);
161 const auto bmap = mBitmap.data() + 2;
162 uint16_t ic = 0,
ir = 0;
163 for (
unsigned int i = 0;
i < nBytes;
i++) {
166 if ((bmap[
i] & s) != 0) {
171 if (uint32_t(
ir + 1) * ic == nBits) {
179 if (uint32_t(
ir + 1) * ic == nBits) {
Definition of the ITSMFT compact cluster.
const GPUTPCGMMerger::trackCluster & b1
ClusterPattern(iterator &pattIt)
Constructor from cluster patterns.
int getRowSpan() const
Returns the number of rows.
void acquirePattern(iterator &pattIt)
static constexpr int MaxPatternBytes
int getColumnSpan() const
Returns the number of columns.
static int getCOG(int rowSpan, int colSpan, const unsigned char patt[MaxPatternBytes], float &xCOG, float &zCOG)
Static: Compute pattern's COG position. Returns the number of fired pixels.
void setPattern(int nRow, int nCol, const unsigned char patt[MaxPatternBytes])
Sets the pattern.
void resetPixel(int row, int col)
ClusterPattern()
Default constructor.
static constexpr int kExtendedPatternBytes
Maximum number of bytes for the cluster puttern + 2 bytes respectively for the number of rows and col...
static constexpr int SpanMask
unsigned char getByte(int n) const
Returns a specific byte of the pattern.
void process(Processor procRowCol)
static constexpr uint8_t MaxRowSpan
void setPattern(const unsigned char bitmask[kExtendedPatternBytes])
Sets the whole bitmask: the number of rows, the number of columns and the pattern.
int getNPixels() const
Returns the number of fired pixels.
friend TopologyDictionary
int getCOG(float &xCOG, float &zCOG) const
Compute pattern's COG position. Returns the number of fired pixels.
bool isSet(int row, int col) const
static void skipPattern(iterator &pattIt)
friend std::ostream & operator<<(std::ostream &os, const ClusterPattern &top)
Prints the pattern.
const std::array< unsigned char, kExtendedPatternBytes > & getPattern() const
Returns the pattern.
static constexpr int MaxPatternBits
static constexpr uint8_t MaxColSpan
void setPixel(int row, int col)
friend BuildTopologyDictionary
int getUsedBytes() const
Returns the number of bytes used for the pattern.
static constexpr int TruncateMask
GLdouble GLdouble GLdouble GLdouble top
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)