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

Functions to encode or decode the address field of MVD data. More...

#include <CbmMvdAddress.h>

Inheritance diagram for CbmMvdAddress:
[legend]
Collaboration diagram for CbmMvdAddress:
[legend]

Static Public Member Functions

static uint32_t GetAddress (int32_t station=0, int32_t sideUD=0, int32_t sideLR=0, int32_t sideTB=0, int32_t ladder=0, int32_t sensor=0, int32_t sensorY=0, int32_t sensorX=0)
 
static uint32_t GetAddress (int32_t *elementIds)
 
static int32_t GetNofLevels ()
 
static int32_t GetNofBits (int32_t level)
 
static int32_t GetElementId (uint32_t address, int32_t level)
 
static int32_t GetSystemIndex (uint32_t address)
 
static int32_t GetStationIndex (uint32_t address)
 
static int32_t GetSideUDIndex (uint32_t address)
 
static int32_t GetSideLRIndex (uint32_t address)
 
static int32_t GetSideTBIndex (uint32_t address)
 
static int32_t GetLadderIndex (uint32_t address)
 
static int32_t GetSensorIndex (uint32_t address)
 
static int32_t GetSensorYIndex (uint32_t address)
 
static int32_t GetSensorXIndex (uint32_t address)
 
static uint32_t GetDetectorId (uint32_t address)
 Provides a unit sensor address, masking information on the pixels (bits 13-31)
 
static uint32_t GetAddressFromSensorNrAndPixelXY (int32_t sensorNr, int32_t sensorY, int32_t sensorX)
 
static int32_t GetSensorNrFromAddress (uint32_t address)
 
static int32_t GetElementAddress (int32_t address, int32_t level)
 
static void Print ()
 
static uint32_t SetElementId (uint32_t address, int32_t level, int32_t newId)
 
static int32_t GetNofSystemBits ()
 
static int32_t GetSystemId (uint32_t address)
 

Static Protected Attributes

static const int32_t fgkSystemBits = 4
 

Private Member Functions

 ClassDef (CbmMvdAddress, 1)
 

Static Private Attributes

static constexpr int32_t fgkBits [kMvdNofLevels]
 
static const int32_t fgkShift [kMvdNofLevels]
 
static const int32_t fgkMask [kMvdNofLevels]
 
static constexpr int32_t fgkBitsSensorNr
 
static const int32_t fgkShiftSensorNr = fgkShift[kMvdStation]
 
static const int32_t fgkMaskSensorNr = (1 << fgkBitsSensorNr) - 1
 

Detailed Description

Functions to encode or decode the address field of MVD data.

Namespace CbmMvdAddress

The current definition (version 1) of the address bit field for the MVD is:

Level Bits Max. Elements Bit Position System (kMVD) 4 16 0 - 3 // for system id Station 2 4 4 - 5 // for station id SideUD 1 2 6 // for upstream/downstream SideLR 1 2 7 // for left right SideTB 1 2 8 // for top bottom Ladder 2 4 9 - 10 // Ladder no Sensor 2 4 11 - 12 // sensor id SensorY 9 512 13 - 21 // Sensor Y (column) SensorX 10 1024 22 - 31 // sensor X (row)

07/2025: As a way to support legacy conventions in simulation code using CbmMvdDigi, an MVD-system wide consecutive SensorNr can be used instead of the combination of Station + SideUD + SideLR + SideTB + Ladder + Sensor => This has exactly the same bit-width of 9 bits! Level Bits Max. Elements Bit Position System (kMVD) 4 16 0 - 3 // for system id SensorNr 9 512 4 - 12 // for sensor nr (wrongly named in some places station id) SensorY 9 512 13 - 21 // Sensor Y (column) SensorX 10 1024 22 - 31 // sensor X (row)

Interface class to unique address for the MVD

Definition at line 68 of file CbmMvdAddress.h.

Member Function Documentation

◆ ClassDef()

CbmMvdAddress::ClassDef ( CbmMvdAddress ,
1  )
private

◆ GetAddress() [1/2]

uint32_t CbmMvdAddress::GetAddress ( int32_t * elementIds)
static

Definition at line 86 of file CbmMvdAddress.cxx.

References fgkBits, fgkShift, kMvd, kMvdNofLevels, kMvdSystem, and ToIntegralType().

◆ GetAddress() [2/2]

uint32_t CbmMvdAddress::GetAddress ( int32_t station = 0,
int32_t sideUD = 0,
int32_t sideLR = 0,
int32_t sideTB = 0,
int32_t ladder = 0,
int32_t sensor = 0,
int32_t sensorY = 0,
int32_t sensorX = 0 )
static

◆ GetAddressFromSensorNrAndPixelXY()

uint32_t CbmMvdAddress::GetAddressFromSensorNrAndPixelXY ( int32_t sensorNr,
int32_t sensorY,
int32_t sensorX )
static

◆ GetDetectorId()

static uint32_t CbmMvdAddress::GetDetectorId ( uint32_t address)
inlinestatic

Provides a unit sensor address, masking information on the pixels (bits 13-31)

Parameters
addressAn MVD address

Definition at line 107 of file CbmMvdAddress.h.

References fgkBits, fgkBitsSensorNr, and kMvdSystem.

Referenced by CbmMvdCluster::GetDetectorId(), and CbmMvdDigi::GetDetectorId().

◆ GetElementAddress()

static int32_t CbmMvdAddress::GetElementAddress ( int32_t address,
int32_t level )
inlinestatic

Returns the raw sub-address up to (and including) the given level

Definition at line 121 of file CbmMvdAddress.h.

References fgkBits, and fgkShift.

◆ GetElementId()

static int32_t CbmMvdAddress::GetElementId ( uint32_t address,
int32_t level )
inlinestatic

◆ GetLadderIndex()

static int32_t CbmMvdAddress::GetLadderIndex ( uint32_t address)
inlinestatic

Definition at line 97 of file CbmMvdAddress.h.

References GetElementId(), and kMvdLadder.

Referenced by CbmMvdRawDigi::GetLadder().

◆ GetNofBits()

static int32_t CbmMvdAddress::GetNofBits ( int32_t level)
inlinestatic

Definition at line 79 of file CbmMvdAddress.h.

References fgkBits, and kMvdNofLevels.

◆ GetNofLevels()

static int32_t CbmMvdAddress::GetNofLevels ( )
inlinestatic

Definition at line 77 of file CbmMvdAddress.h.

References kMvdNofLevels.

◆ GetNofSystemBits()

static int32_t CbmAddress::GetNofSystemBits ( )
inlinestaticinherited

Number of bits for system Id in the address field

Returns
Number of bits

Definition at line 40 of file CbmAddress.h.

References fgkSystemBits.

Referenced by TEST().

◆ GetSensorIndex()

static int32_t CbmMvdAddress::GetSensorIndex ( uint32_t address)
inlinestatic

Definition at line 98 of file CbmMvdAddress.h.

References GetElementId(), and kMvdSensor.

Referenced by CbmMvdRawDigi::GetSensor().

◆ GetSensorNrFromAddress()

static int32_t CbmMvdAddress::GetSensorNrFromAddress ( uint32_t address)
inlinestatic

◆ GetSensorXIndex()

static int32_t CbmMvdAddress::GetSensorXIndex ( uint32_t address)
inlinestatic

◆ GetSensorYIndex()

static int32_t CbmMvdAddress::GetSensorYIndex ( uint32_t address)
inlinestatic

◆ GetSideLRIndex()

static int32_t CbmMvdAddress::GetSideLRIndex ( uint32_t address)
inlinestatic

Definition at line 95 of file CbmMvdAddress.h.

References GetElementId(), and kMvdSideLR.

Referenced by CbmMvdRawDigi::GetSideLR().

◆ GetSideTBIndex()

static int32_t CbmMvdAddress::GetSideTBIndex ( uint32_t address)
inlinestatic

Definition at line 96 of file CbmMvdAddress.h.

References GetElementId(), and kMvdSideTB.

Referenced by CbmMvdRawDigi::GetSideTB().

◆ GetSideUDIndex()

static int32_t CbmMvdAddress::GetSideUDIndex ( uint32_t address)
inlinestatic

Definition at line 94 of file CbmMvdAddress.h.

References GetElementId(), and kMvdSideUD.

Referenced by CbmMvdRawDigi::GetSideUD().

◆ GetStationIndex()

static int32_t CbmMvdAddress::GetStationIndex ( uint32_t address)
inlinestatic

Definition at line 93 of file CbmMvdAddress.h.

References GetElementId(), and kMvdStation.

Referenced by CbmMvdRawDigi::GetStation().

◆ GetSystemId()

static int32_t CbmAddress::GetSystemId ( uint32_t address)
inlinestaticinherited

Get the system Id from the address

Parameters
addressUnique address
Returns
systemId

Definition at line 47 of file CbmAddress.h.

References fgkSystemBits.

Referenced by cbm::GeoNodeMap::ApplyMask(), cbm::GeoNodeMap::GetVolumeProperties(), CbmRecoSts::ProcessData(), CbmRecoStsPixel::ProcessData(), cbm::GeoNodeMap::ReadGeoVolume(), and TEST().

◆ GetSystemIndex()

static int32_t CbmMvdAddress::GetSystemIndex ( uint32_t address)
inlinestatic

Definition at line 92 of file CbmMvdAddress.h.

References GetElementId(), and kMvdSystem.

Referenced by CbmMvdPoint::GetSystemId().

◆ Print()

void CbmMvdAddress::Print ( )
static

Definition at line 119 of file CbmMvdAddress.cxx.

References fgkBits, fgkMask, and kMvdNofLevels.

◆ SetElementId()

uint32_t CbmMvdAddress::SetElementId ( uint32_t address,
int32_t level,
int32_t newId )
static

Definition at line 128 of file CbmMvdAddress.cxx.

References fgkBits, fgkMask, fgkShift, and kMvdNofLevels.

Member Data Documentation

◆ fgkBits

int32_t CbmMvdAddress::fgkBits[kMvdNofLevels]
staticconstexprprivate
Initial value:
= {
4,
2,
1,
1,
1,
2,
2,
9,
10,
}

Definition at line 132 of file CbmMvdAddress.h.

Referenced by GetAddress(), GetAddress(), GetAddressFromSensorNrAndPixelXY(), GetDetectorId(), GetElementAddress(), GetNofBits(), Print(), and SetElementId().

◆ fgkBitsSensorNr

int32_t CbmMvdAddress::fgkBitsSensorNr
staticconstexprprivate
Initial value:
@ kMvdSensor
Sensor.
@ kMvdSideLR
Left/Right.
@ kMvdStation
Station.
@ kMvdSideTB
Top/Bottom.
@ kMvdSideUD
Upstream/Downstream.
@ kMvdLadder
Ladder.
static constexpr int32_t fgkBits[kMvdNofLevels]

Definition at line 149 of file CbmMvdAddress.h.

Referenced by GetAddressFromSensorNrAndPixelXY(), and GetDetectorId().

◆ fgkMask

const int32_t CbmMvdAddress::fgkMask
staticprivate
Initial value:
= {
(1 << fgkBits[0]) - 1,
(1 << fgkBits[1]) - 1,
(1 << fgkBits[2]) - 1,
(1 << fgkBits[3]) - 1,
(1 << fgkBits[4]) - 1,
(1 << fgkBits[5]) - 1,
(1 << fgkBits[6]) - 1,
(1 << fgkBits[7]) - 1,
(1 << fgkBits[8]) - 1,
}
static const int32_t fgkBits[kMuchNofLevels]

Definition at line 28 of file CbmMvdAddress.h.

Referenced by GetElementId(), Print(), and SetElementId().

◆ fgkMaskSensorNr

const int32_t CbmMvdAddress::fgkMaskSensorNr = (1 << fgkBitsSensorNr) - 1
staticprivate

Definition at line 152 of file CbmMvdAddress.h.

Referenced by GetSensorNrFromAddress().

◆ fgkShift

const int32_t CbmMvdAddress::fgkShift
staticprivate
Initial value:
= {
0,
fgkShift[0] + fgkBits[0],
fgkShift[1] + fgkBits[1],
fgkShift[2] + fgkBits[2],
fgkShift[3] + fgkBits[3],
fgkShift[4] + fgkBits[4],
fgkShift[5] + fgkBits[5],
fgkShift[6] + fgkBits[6],
fgkShift[7] + fgkBits[7],
}
static const int32_t fgkShift[kMvdNofLevels]

Definition at line 14 of file CbmMvdAddress.h.

Referenced by GetAddress(), GetAddress(), GetAddressFromSensorNrAndPixelXY(), GetElementAddress(), GetElementId(), and SetElementId().

◆ fgkShiftSensorNr

const int32_t CbmMvdAddress::fgkShiftSensorNr = fgkShift[kMvdStation]
staticprivate

Definition at line 151 of file CbmMvdAddress.h.

Referenced by GetAddressFromSensorNrAndPixelXY(), and GetSensorNrFromAddress().

◆ fgkSystemBits

const int32_t CbmAddress::fgkSystemBits = 4
staticprotectedinherited

Number of bits for system Id in the address field

Definition at line 52 of file CbmAddress.h.

Referenced by GetNofSystemBits(), GetSystemId(), and CbmTofAddress::GetUniqueAddress().


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