Project
Loading...
Searching...
No Matches
o2::emcal::Channel Class Reference

ALTRO channel representation. More...

#include <Channel.h>

Classes

class  HardwareAddressError
 Handling of uninitialized hardware addresses. More...
 

Public Member Functions

 Channel ()=default
 Dummy constructor.
 
 Channel (int32_t hardwareAddress, uint8_t payloadSize)
 Constructor initializing hardware address and payload size.
 
 ~Channel ()=default
 Destructor.
 
bool isBadChannel () const
 Check whether the channel is bad.
 
uint16_t getHardwareAddress () const
 Get the full hardware address.
 
uint16_t getPayloadSize () const
 Get the size of the payload.
 
const std::vector< Bunch > & getBunches () const
 Get list of bunches in the channel.
 
int getBranchIndex () const
 Provide the branch index for the current hardware address.
 
int getFECIndex () const
 Provide the front-end card index (0-9) in branch for the current hardware address.
 
int getAltroIndex () const
 Provide the altro chip index for the current hardware address.
 
int getChannelIndex () const
 Provide the channel index for the current hardware address.
 
void addBunch (const Bunch &bunch)
 Add bunch to the channel.
 
void setHardwareAddress (uint16_t hardwareAddress)
 Set the hardware address.
 
void setPayloadSize (uint8_t payloadSize)
 Set the size of the payload in number of 10-bit words.
 
void setBadChannel (bool badchannel)
 Mark the channel status.
 
BunchcreateBunch (uint8_t bunchlength, uint8_t starttime)
 Create and initialize a new bunch and return reference to it.
 

Static Public Member Functions

static int getHardwareAddressFromChannelHeader (int channelheader)
 Extrcting hardware address from the channel header word.
 
static int getPayloadSizeFromChannelHeader (int channelheader)
 Extrcting payload size from the channel header word.
 
static int getBranchIndexFromHwAddress (int hwaddress)
 Extracting branch index from the hardware address.
 
static int getFecIndexFromHwAddress (int hwaddress)
 Extracting FEC index in branch from the hardware address.
 
static int getAltroIndexFromHwAddress (int hwaddress)
 Extracting ALTRO index from the hardware address.
 
static int getChannelIndexFromHwAddress (int hwaddress)
 Extracting Channel index in FEC from the hardware address.
 

Detailed Description

ALTRO channel representation.

The channel contains information about a hardware channel in the raw stream. Those information are:

  • Hardware address
  • Size of the payload of all bunches in the channel as total number of 10-bit words
  • Channel status (good or bad) In addition it contains the data of all bunches in the raw stream.

The hardware address itself encods

  • Branch ID (bit 12)
  • FEC ID (bits 7-10)
  • ALTRO ID (bits 4-6)
  • Channel ID (bits 0-3)

Definition at line 45 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel() [1/2]

o2::emcal::Channel::Channel ( )
default

Dummy constructor.

◆ Channel() [2/2]

o2::emcal::Channel::Channel ( int32_t  hardwareAddress,
uint8_t  payloadSize 
)
inline

Constructor initializing hardware address and payload size.

Parameters
hardwareAddressHarware address
payloadSizeSize of the payload

Definition at line 73 of file Channel.h.

◆ ~Channel()

o2::emcal::Channel::~Channel ( )
default

Destructor.

Member Function Documentation

◆ addBunch()

void o2::emcal::Channel::addBunch ( const Bunch bunch)
inline

Add bunch to the channel.

Parameters
bunchBunch to be added

This function will copy the bunch information to the object, which might be expensive. Better use the function createBunch.

Definition at line 130 of file Channel.h.

◆ createBunch()

Bunch & Channel::createBunch ( uint8_t  bunchlength,
uint8_t  starttime 
)

Create and initialize a new bunch and return reference to it.

Parameters
bunchlengthLength of the bunch
starttimeStart time of the bunch

Definition at line 47 of file Channel.cxx.

◆ getAltroIndex()

Int_t Channel::getAltroIndex ( ) const

Provide the altro chip index for the current hardware address.

Returns
Altro chip index for the current hardware address
Exceptions
HadrwareAddressErrorin case the hardware address is not initialized

Definition at line 31 of file Channel.cxx.

◆ getAltroIndexFromHwAddress()

static int o2::emcal::Channel::getAltroIndexFromHwAddress ( int  hwaddress)
inlinestatic

Extracting ALTRO index from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 167 of file Channel.h.

◆ getBranchIndex()

int Channel::getBranchIndex ( ) const

Provide the branch index for the current hardware address.

Returns
RCU branch index (0 or 1)
Exceptions
HadrwareAddressErrorin case the hardware address is not initialized

Definition at line 15 of file Channel.cxx.

◆ getBranchIndexFromHwAddress()

static int o2::emcal::Channel::getBranchIndexFromHwAddress ( int  hwaddress)
inlinestatic

Extracting branch index from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 159 of file Channel.h.

◆ getBunches()

const std::vector< Bunch > & o2::emcal::Channel::getBunches ( ) const
inline

Get list of bunches in the channel.

Returns
List of bunches

Definition at line 102 of file Channel.h.

◆ getChannelIndex()

Int_t Channel::getChannelIndex ( ) const

Provide the channel index for the current hardware address.

Returns
Channel index for the current hardware address
Exceptions
HadrwareAddressErrorin case the hardware address is not initialized

Definition at line 39 of file Channel.cxx.

◆ getChannelIndexFromHwAddress()

static int o2::emcal::Channel::getChannelIndexFromHwAddress ( int  hwaddress)
inlinestatic

Extracting Channel index in FEC from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 171 of file Channel.h.

◆ getFECIndex()

int Channel::getFECIndex ( ) const

Provide the front-end card index (0-9) in branch for the current hardware address.

Returns
Front-end card index for the current hardware address
Exceptions
HadrwareAddressErrorin case the hardware address is not initialized

Definition at line 23 of file Channel.cxx.

◆ getFecIndexFromHwAddress()

static int o2::emcal::Channel::getFecIndexFromHwAddress ( int  hwaddress)
inlinestatic

Extracting FEC index in branch from the hardware address.

Parameters
hwaddressHardware address of the channel

Definition at line 163 of file Channel.h.

◆ getHardwareAddress()

uint16_t o2::emcal::Channel::getHardwareAddress ( ) const
inline

Get the full hardware address.

Returns
Hardware address

The hardware address contains:

  • Branch ID (bit 12)
  • FEC ID (bits 7-10)
  • ALTRO ID (bits 4-6)
  • Channel ID (bits 0-3)

Definition at line 94 of file Channel.h.

◆ getHardwareAddressFromChannelHeader()

static int o2::emcal::Channel::getHardwareAddressFromChannelHeader ( int  channelheader)
inlinestatic

Extrcting hardware address from the channel header word.

Parameters
channelheaderChannel header word

Definition at line 151 of file Channel.h.

◆ getPayloadSize()

uint16_t o2::emcal::Channel::getPayloadSize ( ) const
inline

Get the size of the payload.

Returns
Size of the payload as number of 10-bit samples (1/3rd words)

Definition at line 98 of file Channel.h.

◆ getPayloadSizeFromChannelHeader()

static int o2::emcal::Channel::getPayloadSizeFromChannelHeader ( int  channelheader)
inlinestatic

Extrcting payload size from the channel header word.

Parameters
channelheaderChannel header word

Definition at line 155 of file Channel.h.

◆ isBadChannel()

bool o2::emcal::Channel::isBadChannel ( ) const
inline

Check whether the channel is bad.

Returns
true if the channel is bad, false otherwise

Definition at line 84 of file Channel.h.

◆ setBadChannel()

void o2::emcal::Channel::setBadChannel ( bool  badchannel)
inline

Mark the channel status.

Parameters
badchannelBad channel status (true if bad)

Definition at line 142 of file Channel.h.

◆ setHardwareAddress()

void o2::emcal::Channel::setHardwareAddress ( uint16_t  hardwareAddress)
inline

Set the hardware address.

Parameters
hardwareAddressHardware address

Definition at line 134 of file Channel.h.

◆ setPayloadSize()

void o2::emcal::Channel::setPayloadSize ( uint8_t  payloadSize)
inline

Set the size of the payload in number of 10-bit words.

Parameters
payloadSizeSize of the payload

Definition at line 138 of file Channel.h.


The documentation for this class was generated from the following files: