11#ifndef ALICEO2_EMCAL_CHANNEL_H
12#define ALICEO2_EMCAL_CHANNEL_H
61 const
char*
what() const noexcept
override
63 return "Hardware address not initialized";
73 Channel(int32_t hardwareAddress, uint8_t payloadSize) : mHardwareAddress(hardwareAddress),
74 mPayloadSize(payloadSize),
102 const std::vector<Bunch>&
getBunches()
const {
return mBunches; }
174 int32_t mHardwareAddress = -1;
175 uint16_t mPayloadSize = 0;
177 std::vector<Bunch> mBunches;
Handling of uninitialized hardware addresses.
const char * what() const noexcept override
Access to error message.
~HardwareAddressError() noexcept override=default
Destructor.
HardwareAddressError()=default
Constructor.
ALTRO channel representation.
void setPayloadSize(uint8_t payloadSize)
Set the size of the payload in number of 10-bit words.
static int getAltroIndexFromHwAddress(int hwaddress)
Extracting ALTRO index from the hardware address.
int getBranchIndex() const
Provide the branch index for the current hardware address.
static int getChannelIndexFromHwAddress(int hwaddress)
Extracting Channel index in FEC from the hardware address.
void addBunch(const Bunch &bunch)
Add bunch to the channel.
int getChannelIndex() const
Provide the channel index for the current hardware address.
static int getFecIndexFromHwAddress(int hwaddress)
Extracting FEC index in branch from the hardware address.
void setBadChannel(bool badchannel)
Mark the channel status.
bool isBadChannel() const
Check whether the channel is bad.
uint16_t getPayloadSize() const
Get the size of the payload.
static int getHardwareAddressFromChannelHeader(int channelheader)
Extrcting hardware address from the channel header word.
uint16_t getHardwareAddress() const
Get the full hardware address.
Channel(int32_t hardwareAddress, uint8_t payloadSize)
Constructor initializing hardware address and payload size.
int getFECIndex() const
Provide the front-end card index (0-9) in branch for the current hardware address.
static int getPayloadSizeFromChannelHeader(int channelheader)
Extrcting payload size from the channel header word.
int getAltroIndex() const
Provide the altro chip index for the current hardware address.
Channel()=default
Dummy constructor.
static int getBranchIndexFromHwAddress(int hwaddress)
Extracting branch index from the hardware address.
~Channel()=default
Destructor.
const std::vector< Bunch > & getBunches() const
Get list of bunches in the channel.
Bunch & createBunch(uint8_t bunchlength, uint8_t starttime)
Create and initialize a new bunch and return reference to it.
void setHardwareAddress(uint16_t hardwareAddress)
Set the hardware address.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...