CbmRoot
|
Functions to encode or decode the address field of STS data. More...
Namespaces | |
namespace | Detail |
Functions | |
int32_t | GetAddress (uint32_t unit=0, uint32_t ladder=0, uint32_t halfladder=0, uint32_t module=0, uint32_t sensor=0, uint32_t side=0, uint32_t version=kCurrentVersion) |
Construct address. | |
int32_t | GetAddress (uint32_t *elementId, uint32_t version) |
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. | |
ECbmModuleId | GetSystemId (int32_t address) |
Get system Id (should be ECbmModuleId::kSts) | |
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. | |
XPU_D int32_t | UnpackDigiAddress (int32_t digiAddress) |
Add version and system to compressed address that's stored in a digi. | |
XPU_D int32_t | PackDigiAddress (int32_t address) |
Strip address to contain only unit, (half)ladder and module. | |
std::string | ToString (int32_t address) |
String output. | |
Variables | |
constexpr uint32_t | kCurrentVersion = 1 |
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 STS data.
Namespace CbmStsAddress
The current definition (version 1) of the address bit field for the STS is:
Level Bits Max. Elements Bit Position System (kSTS) 4 16 0 - 3 Unit 6 64 4 - 9 Ladder 5 32 10 - 14 HalfLadder 1 2 15 Module 5 32 16 - 20 Sensor 4 16 21 - 24 Side 1 2 25 Unused 2 26 - 27 Version 4 16 28 - 31
int32_t CbmStsAddress::GetAddress | ( | uint32_t * | elementId, |
uint32_t | version ) |
Construct address.
elementIds | Array of element indices in their mother volumes |
Definition at line 68 of file CbmStsAddress.cxx.
References kSts, kStsNofLevels, kStsSystem, and ToIntegralType().
int32_t CbmStsAddress::GetAddress | ( | uint32_t | unit = 0, |
uint32_t | ladder = 0, | ||
uint32_t | halfladder = 0, | ||
uint32_t | module = 0, | ||
uint32_t | sensor = 0, | ||
uint32_t | side = 0, | ||
uint32_t | version = kCurrentVersion ) |
Construct address.
unit | Unit index |
ladder | Ladder index in station |
halfladder | Halfladder index in ladder |
module | Module index within halfladder |
sensor | Sensor index within module |
side | Side (0=front, 1=back) of sensor |
channel | Channel number |
Definition at line 20 of file CbmStsAddress.cxx.
References kSts, kStsHalfLadder, kStsLadder, kStsModule, kStsSensor, kStsSide, kStsSystem, kStsUnit, and ToIntegralType().
Referenced by CbmOnlineParWrite::AddSts(), CbmStsModule::GetAddressFromName(), CbmStsSensor::GetAddressFromName(), CbmStsSimModule::GetAddressFromName(), CbmStsSimSensor::GetAddressFromName(), CbmStsSetup::Init(), TEST(), TEST(), and TEST().
uint32_t CbmStsAddress::GetElementId | ( | int32_t | address, |
int32_t | level ) |
Get the index of an element.
address | Unique element address |
level | Hierarchy level |
Definition at line 105 of file CbmStsAddress.cxx.
References kStsNofLevels, and kStsSystem.
Referenced by cbm::algo::evbuild::DigiEventSelector::CheckStsStations(), CbmAlgoBuildRawEvents::CheckTriggerConditions(), CbmStsElement::ConstructName(), CbmStsElement::ConstructName(), CbmBuildEventsSimple::Exec(), CbmMcbmCheckTimingAlgo::GetDigiInfo(), CbmStsSetup::GetElement(), CbmStsElement::GetIndex(), CbmStsSensor::GetSensorId(), CbmStsSimSensor::GetSensorId(), CbmStsSetup::GetStationNumber(), cbm::algo::sts::TrackingInterface::GetTrackingStation(), CbmRecoQaTask::View::HasAddress(), cbm::algo::sts::DigiQa::Init(), cbm::algo::sts::ReadoutConfig::PrintReadoutMap(), and CbmEvBuildSource::ReadEvent().
int32_t CbmStsAddress::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 91 of file CbmStsAddress.cxx.
References kStsNofLevels, and kStsSystem.
Referenced by CbmStsRecoModule::AddDigiToQueue(), CbmAlgoBuildRawEvents::CheckTriggerConditions(), and CbmRecoSts::ProcessData().
ECbmModuleId CbmStsAddress::GetSystemId | ( | int32_t | address | ) |
Get system Id (should be ECbmModuleId::kSts)
address | Unique element address |
Definition at line 116 of file CbmStsAddress.cxx.
References kStsSystem.
Referenced by CbmStsSetup::GetElement(), CbmMatchRecoToMC::MatchStsTracks(), and CbmMatchRecoToMC::MatchTracks().
uint32_t CbmStsAddress::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 125 of file CbmStsAddress.cxx.
|
inline |
Strip address to contain only unit, (half)ladder and module.
address | Full address |
Definition at line 197 of file CbmStsAddress.h.
References kStsHalfLadder, kStsLadder, kStsModule, kStsUnit, and UnpackDigiAddress().
Referenced by cbm::algo::sts::HitfinderChain::CountDigisPerModules(), and CbmStsDigi::PackAddressAndTime().
int32_t CbmStsAddress::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 133 of file CbmStsAddress.cxx.
References kStsNofLevels, and kStsSystem.
Referenced by CbmStsElement::InitDaughters(), and CbmStsModule::InitDaughters().
std::string CbmStsAddress::ToString | ( | int32_t | address | ) |
String output.
address | Unique element address |
Definition at line 148 of file CbmStsAddress.cxx.
References kStsHalfLadder, kStsLadder, kStsModule, kStsSensor, kStsSide, kStsSystem, and kStsUnit.
Referenced by CbmOnlineParWrite::AddSts(), CbmRecoSts::ProcessData(), CbmStsModule::ToString(), and CbmStsSensor::ToString().
|
inline |
Add version and system to compressed address that's stored in a digi.
digiAddress | Compressed address from digi |
Definition at line 186 of file CbmStsAddress.h.
References kSts, kStsSystem, kStsUnit, kVersionShift, and ToIntegralType().
Referenced by PackDigiAddress(), and CbmStsDigi::UnpackAddress().
|
inlineconstexpr |
Definition at line 56 of file CbmStsAddress.h.
|
inlineconstexpr |
Definition at line 62 of file CbmStsAddress.h.
|
inlineconstexpr |
Definition at line 61 of file CbmStsAddress.h.
Referenced by UnpackDigiAddress().
|
inlineconstexpr |
Definition at line 60 of file CbmStsAddress.h.