|
CbmRoot
|
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 |
Functions to encode or decode the address field of RICH data.
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
|
strong |
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.
| 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.
| camera | Camera index (0: upper, 1: lower camera) |
| strip | Strip index in camera |
| backplane | Backplane index in strip |
| pmt | PMT index in backplane |
| pixel | Pixel index in pmt |
Definition at line 19 of file CbmRichAddress.cxx.
References kBackplane, kCamera, kCurrentVersion, kPixel, kPmt, kRich, kStrip, kSystem, kVersionShift, and ToIntegralType().
Referenced by CbmRichGeoHandler::CreateAddressRich().
| uint32_t CbmRichAddress::GetElementId | ( | int32_t | address, |
| int32_t | level ) |
Get the index of an element.
| address | Unique element address |
| level | Hierarchy level |
Definition at line 77 of file CbmRichAddress.cxx.
References GetVersion(), kNumLevels, and kSystem.
Referenced by GetSystemId(), and ToString().
| int32_t CbmRichAddress::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 61 of file CbmRichAddress.cxx.
References GetVersion(), kNumLevels, kSystem, and kVersionShift.
Referenced by CbmRichGeoHandler::CreateAddressRich().
| uint32_t CbmRichAddress::GetSystemId | ( | int32_t | address | ) |
Get system Id (should be integer value of ECbmModuleId::kRich)
| address | Unique element address |
Definition at line 90 of file CbmRichAddress.cxx.
References GetElementId(), and kSystem.
| uint32_t CbmRichAddress::GetVersion | ( | int32_t | address | ) |
Extract version number.
| address | Unique element address |
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().
| 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.
| address | Unique element address |
| level | Hierarchy level |
| newId | New element index |
Definition at line 100 of file CbmRichAddress.cxx.
References GetVersion(), kNumLevels, and kSystem.
| std::string CbmRichAddress::ToString | ( | int32_t | address | ) |
String output.
| address | Unique element address |
Definition at line 119 of file CbmRichAddress.cxx.
References GetElementId(), GetVersion(), kBackplane, kCamera, kPixel, kPmt, kStrip, and kSystem.
|
inlineconstexpr |
Definition at line 48 of file CbmRichAddress.h.
Referenced by GetAddress().
|
inlineconstexpr |
Definition at line 54 of file CbmRichAddress.h.
Referenced by GetVersion().
|
inlineconstexpr |
Definition at line 53 of file CbmRichAddress.h.
Referenced by GetAddress(), GetMotherAddress(), and GetVersion().
|
inlineconstexpr |
Definition at line 52 of file CbmRichAddress.h.