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>
160 uint32_t nBytes = (nBits >> 3) + (nBits % 8 != 0);
161 const auto bmap = mBitmap.data() + 2;
163 for (
unsigned int i = 0;
i < nBytes;
i++) {
166 if ((bmap[
i] &
s) != 0) {
Definition of the ITSMFT compact cluster.
unsigned short int uint16_t
std::bitset< 80 > bitmask
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to process
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)