CbmRoot
Loading...
Searching...
No Matches
CbmStsDigi Class Reference

Data class for a single-channel message in the STS. More...

#include <CbmStsDigi.h>

Public Member Functions

 CbmStsDigi ()=default
 
XPU_D CbmStsDigi (int32_t address, int32_t channel, uint32_t time, uint16_t charge)
 
 ~CbmStsDigi ()=default
 
XPU_D int32_t GetAddress () const
 
XPU_D int32_t GetAddressPacked () const
 
XPU_D uint16_t GetChannel () const
 Channel number in module @value Channel number.
 
XPU_D uint16_t GetChargeU16 () const
 
XPU_D uint32_t GetTimeU32 () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
XPU_D void SetTime (uint32_t dNewTime)
 
XPU_D void SetChannel (uint16_t channel)
 
XPU_D void SetCharge (uint16_t charge)
 
XPU_D void SetAddress (int32_t address)
 
XPU_D void SetChannelAndCharge (uint16_t channel, uint16_t charge)
 
XPU_D void SetAddressAndTime (int32_t address, uint32_t time)
 
std::string ToString () const
 

Static Public Member Functions

static const char * GetBranchName ()
 Get the desired name of the branch for this obj in the cbm output tree (static)
 
static const char * GetClassName ()
 Class name (static)
 
static ECbmModuleId GetSystem ()
 

Static Public Attributes

static constexpr int kNumAdcBits = 5
 
static constexpr uint32_t kAdcMask = (1u << kNumAdcBits) - 1u
 
static constexpr int kNumLowerAddrBits = 16
 
static constexpr int kNumTimestampBits = 31
 
static constexpr uint32_t kTimestampMask = (1u << kNumTimestampBits) - 1u
 
static constexpr uint32_t kMaxTimestamp = kTimestampMask
 
static constexpr uint32_t kTimeAddressBitMask = ~kTimestampMask
 

Private Member Functions

XPU_D void PackTime (uint32_t newTime)
 
XPU_D uint32_t UnpackTime () const
 
XPU_D void PackChannelAndCharge (uint16_t channel, uint16_t charge)
 
XPU_D uint16_t UnpackChannel () const
 
XPU_D uint16_t UnpackCharge () const
 
XPU_D void PackAddressAndTime (int32_t newAddress, uint32_t newTime)
 
XPU_D int32_t UnpackAddress () const
 
XPU_D uint32_t ClampTime (uint32_t time) const
 
 ClassDefNV (CbmStsDigi, 8)
 

Private Attributes

uint32_t fTime
 Time [ns] in lower 31 bits, highest bit is the 17th address bit.
 
uint16_t fChannelAndCharge
 Channel number (lower 11 bits) and charge [ADC Units] in upper 5 bits.
 
uint16_t fAddress
 Unique element address (lower 16 bits of 17)
 

Friends

class boost::serialization::access
 

Detailed Description

Data class for a single-channel message in the STS.

The CbmStsDigi is the ROOT representation of the smallest information unit delivered by the CBM-STS by a single readout channel. It carries the channel address, the measurement time and the digitised charge as information.

Definition at line 40 of file CbmStsDigi.h.

Constructor & Destructor Documentation

◆ CbmStsDigi() [1/2]

CbmStsDigi::CbmStsDigi ( )
default

Default constructor

◆ CbmStsDigi() [2/2]

XPU_D CbmStsDigi::CbmStsDigi ( int32_t address,
int32_t channel,
uint32_t time,
uint16_t charge )
inline

Standard constructor

Parameters
addressUnique element address
channelChannel number
timeMeasurement time [ns]
chargeCharge [ADC units]

Definition at line 61 of file CbmStsDigi.h.

References ClampTime(), PackAddressAndTime(), and PackChannelAndCharge().

◆ ~CbmStsDigi()

CbmStsDigi::~CbmStsDigi ( )
default

Destructor

Member Function Documentation

◆ ClampTime()

XPU_D uint32_t CbmStsDigi::ClampTime ( uint32_t time) const
inlineprivate

Definition at line 209 of file CbmStsDigi.h.

References kMaxTimestamp.

Referenced by CbmStsDigi(), SetAddressAndTime(), and SetTime().

◆ ClassDefNV()

CbmStsDigi::ClassDefNV ( CbmStsDigi ,
8  )
private

◆ GetAddress()

◆ GetAddressPacked()

XPU_D int32_t CbmStsDigi::GetAddressPacked ( ) const
inline

◆ GetBranchName()

static const char * CbmStsDigi::GetBranchName ( )
inlinestatic

Get the desired name of the branch for this obj in the cbm output tree (static)

Returns
"StsDigi"

Definition at line 87 of file CbmStsDigi.h.

Referenced by CbmDeviceDigiEventSink::InitTask().

◆ GetChannel()

◆ GetChargeU16()

◆ GetClassName()

static const char * CbmStsDigi::GetClassName ( )
inlinestatic

Class name (static)

Returns
CbmStsDigi

Definition at line 99 of file CbmStsDigi.h.

Referenced by TEST().

◆ GetSystem()

static ECbmModuleId CbmStsDigi::GetSystem ( )
inlinestatic

System ID (static)

Returns
System identifier (EcbmModuleId)

Definition at line 114 of file CbmStsDigi.h.

References kSts.

Referenced by compareStsDigiDataMembers().

◆ GetTimeU32()

◆ PackAddressAndTime()

XPU_D void CbmStsDigi::PackAddressAndTime ( int32_t newAddress,
uint32_t newTime )
inlineprivate

◆ PackChannelAndCharge()

XPU_D void CbmStsDigi::PackChannelAndCharge ( uint16_t channel,
uint16_t charge )
inlineprivate

Definition at line 185 of file CbmStsDigi.h.

References fChannelAndCharge, and kNumAdcBits.

Referenced by CbmStsDigi(), SetChannel(), SetChannelAndCharge(), and SetCharge().

◆ PackTime()

XPU_D void CbmStsDigi::PackTime ( uint32_t newTime)
inlineprivate

Definition at line 181 of file CbmStsDigi.h.

References fTime, kTimeAddressBitMask, and kTimestampMask.

Referenced by SetTime().

◆ serialize()

template<class Archive >
void CbmStsDigi::serialize ( Archive & ar,
const unsigned int  )
inline

Definition at line 127 of file CbmStsDigi.h.

References fAddress, fChannelAndCharge, and fTime.

◆ SetAddress()

XPU_D void CbmStsDigi::SetAddress ( int32_t address)
inline

Definition at line 148 of file CbmStsDigi.h.

References PackAddressAndTime(), and UnpackTime().

◆ SetAddressAndTime()

XPU_D void CbmStsDigi::SetAddressAndTime ( int32_t address,
uint32_t time )
inline

Set new address and time at once.

Slightly more efficient than calling both individual setters.

Definition at line 161 of file CbmStsDigi.h.

References ClampTime(), and PackAddressAndTime().

◆ SetChannel()

XPU_D void CbmStsDigi::SetChannel ( uint16_t channel)
inline

Definition at line 144 of file CbmStsDigi.h.

References PackChannelAndCharge(), and UnpackCharge().

◆ SetChannelAndCharge()

XPU_D void CbmStsDigi::SetChannelAndCharge ( uint16_t channel,
uint16_t charge )
inline

Set new channel and charge.

Slightly more efficient than calling both individual setters.

Definition at line 155 of file CbmStsDigi.h.

References PackChannelAndCharge().

◆ SetCharge()

XPU_D void CbmStsDigi::SetCharge ( uint16_t charge)
inline

Definition at line 146 of file CbmStsDigi.h.

References PackChannelAndCharge(), and UnpackChannel().

◆ SetTime()

XPU_D void CbmStsDigi::SetTime ( uint32_t dNewTime)
inline

Update Time of measurement

Parameters
NewTime [ns]

Definition at line 138 of file CbmStsDigi.h.

References ClampTime(), and PackTime().

Referenced by TEST().

◆ ToString()

string CbmStsDigi::ToString ( ) const

String output

Definition at line 24 of file CbmStsDigi.cxx.

References UnpackAddress(), UnpackChannel(), UnpackCharge(), and UnpackTime().

Referenced by CbmStsDigiSource::PrintStsDigi(), and TEST().

◆ UnpackAddress()

XPU_D int32_t CbmStsDigi::UnpackAddress ( ) const
inlineprivate

Definition at line 203 of file CbmStsDigi.h.

References GetAddressPacked(), and CbmStsAddress::UnpackDigiAddress().

Referenced by GetAddress(), and ToString().

◆ UnpackChannel()

XPU_D uint16_t CbmStsDigi::UnpackChannel ( ) const
inlineprivate

Definition at line 189 of file CbmStsDigi.h.

References fChannelAndCharge, and kNumAdcBits.

Referenced by GetChannel(), SetCharge(), and ToString().

◆ UnpackCharge()

XPU_D uint16_t CbmStsDigi::UnpackCharge ( ) const
inlineprivate

Definition at line 190 of file CbmStsDigi.h.

References fChannelAndCharge, and kAdcMask.

Referenced by GetChargeU16(), SetChannel(), and ToString().

◆ UnpackTime()

XPU_D uint32_t CbmStsDigi::UnpackTime ( ) const
inlineprivate

Definition at line 182 of file CbmStsDigi.h.

References fTime, and kTimestampMask.

Referenced by GetTimeU32(), SetAddress(), and ToString().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 173 of file CbmStsDigi.h.

Member Data Documentation

◆ fAddress

uint16_t CbmStsDigi::fAddress
private

Unique element address (lower 16 bits of 17)

Definition at line 178 of file CbmStsDigi.h.

Referenced by GetAddressPacked(), PackAddressAndTime(), and serialize().

◆ fChannelAndCharge

uint16_t CbmStsDigi::fChannelAndCharge
private

Channel number (lower 11 bits) and charge [ADC Units] in upper 5 bits.

Definition at line 177 of file CbmStsDigi.h.

Referenced by PackChannelAndCharge(), serialize(), UnpackChannel(), and UnpackCharge().

◆ fTime

uint32_t CbmStsDigi::fTime
private

Time [ns] in lower 31 bits, highest bit is the 17th address bit.

Definition at line 176 of file CbmStsDigi.h.

Referenced by GetAddressPacked(), PackAddressAndTime(), PackTime(), serialize(), and UnpackTime().

◆ kAdcMask

uint32_t CbmStsDigi::kAdcMask = (1u << kNumAdcBits) - 1u
staticconstexpr

Definition at line 44 of file CbmStsDigi.h.

Referenced by UnpackCharge().

◆ kMaxTimestamp

uint32_t CbmStsDigi::kMaxTimestamp = kTimestampMask
staticconstexpr

Definition at line 48 of file CbmStsDigi.h.

Referenced by ClampTime().

◆ kNumAdcBits

int CbmStsDigi::kNumAdcBits = 5
staticconstexpr

Definition at line 43 of file CbmStsDigi.h.

Referenced by PackChannelAndCharge(), and UnpackChannel().

◆ kNumLowerAddrBits

int CbmStsDigi::kNumLowerAddrBits = 16
staticconstexpr

Definition at line 45 of file CbmStsDigi.h.

Referenced by GetAddressPacked(), and PackAddressAndTime().

◆ kNumTimestampBits

int CbmStsDigi::kNumTimestampBits = 31
staticconstexpr

Definition at line 46 of file CbmStsDigi.h.

Referenced by GetAddressPacked(), and PackAddressAndTime().

◆ kTimeAddressBitMask

uint32_t CbmStsDigi::kTimeAddressBitMask = ~kTimestampMask
staticconstexpr

Definition at line 49 of file CbmStsDigi.h.

Referenced by PackTime().

◆ kTimestampMask

uint32_t CbmStsDigi::kTimestampMask = (1u << kNumTimestampBits) - 1u
staticconstexpr

Definition at line 47 of file CbmStsDigi.h.

Referenced by PackAddressAndTime(), PackTime(), and UnpackTime().


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