CbmRoot
Loading...
Searching...
No Matches
CbmRichAddress Namespace Reference

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

Namespaces

namespace  Detail
 

Enumerations

enum class  RichElementLevel {
  kSystem , kCamera , kStrip , kBackplane ,
  kPmt , kPixel , kNumLevels
}
 

Functions

int32_t GetAddress (uint32_t camera=0, uint32_t strip=0, uint32_t backplane=0, uint32_t pmt=0, uint32_t pixel=0, uint32_t version=kCurrentVersion)
 Construct address.
 
int32_t GetMotherAddress (int32_t address, int32_t level)
 Construct the address of an element from the address of a descendant element.
 
uint32_t GetElementId (int32_t address, int32_t level)
 Get the index of an element.
 
uint32_t GetSystemId (int32_t address)
 Get system Id (should be integer value of ECbmModuleId::kRich)
 
uint32_t GetVersion (int32_t address)
 Extract version number.
 
int32_t SetElementId (int32_t address, int32_t level, uint32_t newId)
 Set the index of an element, leaving the other element levels untouched.
 
std::string ToString (int32_t address)
 String output.
 

Variables

constexpr uint32_t kCurrentVersion = 0
 
constexpr int32_t kVersionSize = 4
 
constexpr int32_t kVersionShift = 28
 
constexpr int32_t kVersionMask = (1 << kVersionSize) - 1
 

Detailed Description

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

Author
Martin Beyer ma.be.nosp@m.yer@.nosp@m.gsi.d.nosp@m.e

Based on the structure used by STS & FSD. The current definition (version 0) of the address bit field for the RICH is:

Level Bits Max. Elements Bit Position System (kRICH) 4 16 0 - 3 Camera 1 2 4 Strip 4 16 5 - 8 Backplane 3 8 9 - 11 PMT 3 8 12 - 14 Pixel 6 64 15 - 20 Unused 7 21 - 27 Version 4 16 28 - 31

Enumeration Type Documentation

◆ RichElementLevel

Enumerator for the hierarchy levels of the RICH setup

Enumerator
kSystem 
kCamera 
kStrip 
kBackplane 
kPmt 
kPixel 
kNumLevels 

Definition at line 37 of file CbmRichAddress.h.

Function Documentation

◆ GetAddress()

int32_t CbmRichAddress::GetAddress ( uint32_t camera = 0,
uint32_t strip = 0,
uint32_t backplane = 0,
uint32_t pmt = 0,
uint32_t pixel = 0,
uint32_t version = kCurrentVersion )

Construct address.

Parameters
cameraCamera index (0: upper, 1: lower camera)
stripStrip index in camera
backplaneBackplane index in strip
pmtPMT index in backplane
pixelPixel index in pmt
Returns
Unique element address

Definition at line 19 of file CbmRichAddress.cxx.

References kBackplane, kCamera, kCurrentVersion, kPixel, kPmt, kRich, kStrip, kSystem, kVersionShift, and ToIntegralType().

Referenced by CbmRichGeoHandler::CreateAddressRich().

◆ GetElementId()

uint32_t CbmRichAddress::GetElementId ( int32_t address,
int32_t level )

Get the index of an element.

Parameters
addressUnique element address
levelHierarchy level
Returns
Element index

Definition at line 77 of file CbmRichAddress.cxx.

References GetVersion(), kNumLevels, and kSystem.

Referenced by GetSystemId(), and ToString().

◆ GetMotherAddress()

int32_t CbmRichAddress::GetMotherAddress ( int32_t address,
int32_t level )

Construct the address of an element from the address of a descendant element.

Parameters
addressAddress of descendant element
levelDesired hierarchy level
Returns
Address of element at desired hierarchy level

This strips of the address information of all hierarchy levels below the desired one.

Definition at line 61 of file CbmRichAddress.cxx.

References GetVersion(), kNumLevels, kSystem, and kVersionShift.

Referenced by CbmRichGeoHandler::CreateAddressRich().

◆ GetSystemId()

uint32_t CbmRichAddress::GetSystemId ( int32_t address)

Get system Id (should be integer value of ECbmModuleId::kRich)

Parameters
addressUnique element address

Definition at line 90 of file CbmRichAddress.cxx.

References GetElementId(), and kSystem.

◆ GetVersion()

uint32_t CbmRichAddress::GetVersion ( int32_t address)

Extract version number.

Parameters
addressUnique element address
Returns
Version number

The version is encoded in the last 4 bits (28 to 31). The maximal number of versions is 16.

Definition at line 95 of file CbmRichAddress.cxx.

References kVersionMask, and kVersionShift.

Referenced by GetElementId(), GetMotherAddress(), SetElementId(), and ToString().

◆ SetElementId()

int32_t CbmRichAddress::SetElementId ( int32_t address,
int32_t level,
uint32_t newId )

Set the index of an element, leaving the other element levels untouched.

Parameters
addressUnique element address
levelHierarchy level
newIdNew element index
Returns
New address

Definition at line 100 of file CbmRichAddress.cxx.

References GetVersion(), kNumLevels, and kSystem.

◆ ToString()

std::string CbmRichAddress::ToString ( int32_t address)

String output.

Parameters
addressUnique element address

Definition at line 119 of file CbmRichAddress.cxx.

References GetElementId(), GetVersion(), kBackplane, kCamera, kPixel, kPmt, kStrip, and kSystem.

Variable Documentation

◆ kCurrentVersion

uint32_t CbmRichAddress::kCurrentVersion = 0
inlineconstexpr

Definition at line 48 of file CbmRichAddress.h.

Referenced by GetAddress().

◆ kVersionMask

int32_t CbmRichAddress::kVersionMask = (1 << kVersionSize) - 1
inlineconstexpr

Definition at line 54 of file CbmRichAddress.h.

Referenced by GetVersion().

◆ kVersionShift

int32_t CbmRichAddress::kVersionShift = 28
inlineconstexpr

Definition at line 53 of file CbmRichAddress.h.

Referenced by GetAddress(), GetMotherAddress(), and GetVersion().

◆ kVersionSize

int32_t CbmRichAddress::kVersionSize = 4
inlineconstexpr

Definition at line 52 of file CbmRichAddress.h.