12#ifndef ALICEO2_TRD_TRDCOMPRESSEDDIGIT_H
13#define ALICEO2_TRD_TRDCOMPRESSEDDIGIT_H
19#include "fairlogger/Logger.h"
36 CompressedDigit(
const int det,
const int rob,
const int mcm,
const int channel,
const std::array<uint16_t, constants::TIMEBINS>&
adc);
47 mHeader |= (channel)&0x003f;
52 mHeader |= (
mcm)&0x3c0;
57 mHeader |= (
rob)&0x1c00;
61 mHeader &= ~(0x7fe000);
62 mHeader |= (det << 12) & 0x7fe000;
64 void setADC(std::array<uint16_t, constants::TIMEBINS>
const& adcs)
67 int rem = adcindex % 3;
69 mADC[adcindex / 3] &= ~((0x3ff) << (rem * 10));
71 mADC[adcindex / 3] |= (adcs[adcindex] << (rem * 10));
78 mADC[
index / 3] &= ~((0x3ff) << (rem * 10));
79 mADC[
index / 3] |= (adcvalue << (rem * 10));
83 int getMCM()
const {
return (mHeader & 0x3c0) >> 6; }
84 int getROB()
const {
return (mHeader & 0x1c00) >> 10; }
85 int getDetector()
const {
return (mHeader & 0x7fe000) >> 12; }
93 sum += (mADC[
i / 3] >> ((
i % 3) * 10));
104 std::array<uint32_t, 10> mADC;
void setADCi(int index, uint16_t adcvalue)
uint16_t operator[](const int index)
~CompressedDigit()=default
uint32_t getADCsum() const
void setDetector(int det)
bool isSharedCompressedDigit() const
CompressedDigit & operator=(const CompressedDigit &)=default
void setADC(std::array< uint16_t, constants::TIMEBINS > const &adcs)
CompressedDigit()=default
void setChannel(int channel)
CompressedDigit(const CompressedDigit &)=default
float sum(float s, o2::dcs::DataPointValue v)
constexpr int TIMEBINS
the number of time bins
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...