CbmRoot
|
Functions to encode or decode the address field of FSD data. More...
Namespaces | |
namespace | Detail |
Enumerations | |
enum class | Level { System , Unit , Module , PhotoDet , NumLevels } |
Functions | |
int32_t | GetAddress (uint32_t Unit=0, uint32_t Module=0, uint32_t PhotoDet=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::kFsd) | |
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 |
Functions to encode or decode the address field of FSD data.
Namespace CbmFsdAddress
Inspired by the structure used by STS. The current definition (version 0) of the address bit field for the FSD is:
Level Bits Max. Elements Bit Position System (kFSD) 4 16 0 - 3 Unit 4 16 4 - 7 Module 15 32768 8 - 22 PhotoDetector 2 4 23 - 24 Unused 3 25 - 27 Version 4 16 28 - 31
|
strong |
Enumerator for the hierarchy levels of the FSD setup
Enumerator | |
---|---|
System | |
Unit | |
Module | |
PhotoDet | |
NumLevels |
Definition at line 40 of file CbmFsdAddress.h.
int32_t CbmFsdAddress::GetAddress | ( | uint32_t | Unit = 0, |
uint32_t | Module = 0, | ||
uint32_t | PhotoDet = 0, | ||
uint32_t | Version = kCurrentVersion ) |
Construct address.
unit | Unit index |
module | Module index in unit |
photodet | PhotoDetector index in module |
Definition at line 23 of file CbmFsdAddress.cxx.
References kCurrentVersion, kFsd, kVersionShift, Module, PhotoDet, System, ToIntegralType(), and Unit.
Referenced by CbmFsdDigitize::Exec(), CbmFsdGeoHandler::GetAddress(), CbmFsdGeoHandler::GetCurrentAddress(), CbmFsdGeoHandler::GetCurrentAddress(), and CbmFsdDigi::SetAddress().
uint32_t CbmFsdAddress::GetElementId | ( | int32_t | address, |
int32_t | level ) |
Get the index of an element.
address | Unique element address |
level | Hierarchy level |
Definition at line 73 of file CbmFsdAddress.cxx.
References GetVersion(), NumLevels, and System.
Referenced by CbmFsdHit::CbmFsdHit(), CbmFsdDigitize::Exec(), CbmFsdDigi::GetModuleID(), CbmFsdDigi::GetPhotoDetID(), GetSystemId(), CbmFsdDigi::GetUnitID(), CbmFsdHitProducer::ProcessData(), CbmFsdDigitize::ReleaseBuffer(), and ToString().
int32_t CbmFsdAddress::GetMotherAddress | ( | int32_t | address, |
int32_t | level ) |
Construct the address of an element from the address of a descendant element.
address | Address of descendant element |
level | Desired hierarchy level |
This strips of the address information of all hierarchy levels below the desired one.
Definition at line 55 of file CbmFsdAddress.cxx.
References GetVersion(), kVersionShift, NumLevels, and System.
uint32_t CbmFsdAddress::GetSystemId | ( | int32_t | address | ) |
Get system Id (should be integer value of ECbmModuleId::kFsd)
address | Unique element address |
Definition at line 88 of file CbmFsdAddress.cxx.
References GetElementId(), and System.
uint32_t CbmFsdAddress::GetVersion | ( | int32_t | address | ) |
Extract version number.
address | Unique element address @value Version number |
The version is encoded in the last 4 bits (28 to 31). The maximal number of versions is 16.
Definition at line 96 of file CbmFsdAddress.cxx.
References kVersionMask, and kVersionShift.
Referenced by GetElementId(), GetMotherAddress(), SetElementId(), and ToString().
int32_t CbmFsdAddress::SetElementId | ( | int32_t | address, |
int32_t | level, | ||
uint32_t | newId ) |
Set the index of an element, leaving the other element levels untouched.
address | Unique element address |
level | Hierarchy level |
newId | New element index |
Definition at line 104 of file CbmFsdAddress.cxx.
References GetVersion(), NumLevels, and System.
std::string CbmFsdAddress::ToString | ( | int32_t | address | ) |
String output.
address | Unique element address |
Definition at line 123 of file CbmFsdAddress.cxx.
References GetElementId(), GetVersion(), Module, PhotoDet, System, and Unit.
|
inlineconstexpr |
Definition at line 49 of file CbmFsdAddress.h.
Referenced by GetAddress().
|
inlineconstexpr |
Definition at line 55 of file CbmFsdAddress.h.
Referenced by GetVersion().
|
inlineconstexpr |
Definition at line 54 of file CbmFsdAddress.h.
Referenced by GetAddress(), GetMotherAddress(), and GetVersion().
|
inlineconstexpr |
Definition at line 53 of file CbmFsdAddress.h.