CbmRoot
|
Functions to encode or decode the address field of STS data. More...
Functions | |
Int_t | GetAddress (UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion) |
Construct address. More... | |
Int_t | GetAddress (UInt_t *elementId, UInt_t version) |
Construct address. More... | |
Int_t | GetMotherAddress (Int_t address, Int_t level) |
Construct the address of an element from the address of a descendant element. More... | |
UInt_t | GetElementId (Int_t address, Int_t level) |
Get the index of an element. More... | |
ECbmModuleId | GetSystemId (Int_t address) |
Get system Id (should be ECbmModuleId::kSts) More... | |
UInt_t | GetVersion (Int_t address) |
Extract version number. More... | |
Int_t | SetElementId (Int_t address, Int_t level, UInt_t newId) |
Set the index of an element, leaving the other element levels untouched. More... | |
std::string | ToString (Int_t address) |
String output. More... | |
Variables | |
const UShort_t | kBits [kCurrentVersion+1][kStsNofLevels] |
const Int_t | kShift [kCurrentVersion+1][kStsNofLevels] |
const Int_t | kMask [kCurrentVersion+1][kStsNofLevels] |
const UInt_t | kCurrentVersion = 1 |
const Int_t | kVersionSize = 4 |
const Int_t | kVersionShift = 28 |
const Int_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
Int_t CbmStsAddress::GetAddress | ( | UInt_t * | elementId, |
UInt_t | version | ||
) |
Construct address.
elementIds | Array of element indices in their mother volumes |
Definition at line 145 of file CbmStsAddress.cxx.
References kBits, kCurrentVersion, kShift, kSts, kStsNofLevels, kStsSystem, kVersionShift, and ToIntegralType().
Int_t CbmStsAddress::GetAddress | ( | UInt_t | unit = 0 , |
UInt_t | ladder = 0 , |
||
UInt_t | halfladder = 0 , |
||
UInt_t | module = 0 , |
||
UInt_t | sensor = 0 , |
||
UInt_t | side = 0 , |
||
UInt_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 90 of file CbmStsAddress.cxx.
References kBits, kCurrentVersion, kShift, kSts, kStsHalfLadder, kStsLadder, kStsModule, kStsSensor, kStsSide, kStsSystem, kStsUnit, kVersionShift, and ToIntegralType().
Referenced by CbmDeviceHitBuilderTof::CheckLHMemory(), CbmTofCosmicClusterizer::CheckLHMemory(), CbmTofTestBeamClusterizer::CheckLHMemory(), CbmTofEventClusterizer::CheckLHMemory(), CbmDeviceHitBuilderTof::CleanLHMemory(), CbmTofCosmicClusterizer::CleanLHMemory(), CbmTofTestBeamClusterizer::CleanLHMemory(), CbmTofEventClusterizer::CleanLHMemory(), CbmDeviceHitBuilderTof::FillHistos(), CbmTofCosmicClusterizer::FillHistos(), CbmTofTestBeamClusterizer::FillHistos(), CbmTofEventClusterizer::FillHistos(), CbmTofAnaTestbeam::FillHistos(), CbmTestDigi::GetAddress(), CbmStsModule::GetAddressFromName(), CbmStsSimSensor::GetAddressFromName(), CbmStsSensor::GetAddressFromName(), CbmStsSimModule::GetAddressFromName(), CbmKFTrErrMCPoints::GetNConsHitStations(), CbmKFTrErrMCPoints::GetNHitStations(), CbmTofTracklet::HitIndexOfAddr(), CbmTofTracklet::HitPointerOfAddr(), CbmStsSetup::Init(), CbmStsFitPerformanceTask::IsLong(), CbmDeviceHitBuilderTof::MonitorPulser(), and CbmTofTracklet::PrintInfo().
UInt_t CbmStsAddress::GetElementId | ( | Int_t | address, |
Int_t | level | ||
) |
Get the index of an element.
address | Unique element address |
level | Hierarchy level |
Definition at line 180 of file CbmStsAddress.cxx.
References GetVersion(), kMask, kShift, kStsNofLevels, and kStsSystem.
Referenced by CbmStsElement::ConstructName(), CbmBuildEventsSimple::Exec(), LxFinderTriplet::Exec(), LxTrackAna::Exec(), LxTrackAnaTriplet::Exec(), LxFinder::Exec(), CbmStsSetup::GetElement(), CbmStsElement::GetIndex(), CbmStsSensor::GetSensorId(), CbmStsSimSensor::GetSensorId(), CbmStsSetup::GetStationNumber(), GetSystemId(), CbmEvBuildSource::ReadEvent(), and ToString().
Int_t CbmStsAddress::GetMotherAddress | ( | Int_t | address, |
Int_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 168 of file CbmStsAddress.cxx.
References GetVersion(), kShift, kStsNofLevels, kStsSystem, and kVersionShift.
Referenced by CbmStsRecoModule::AddDigiToQueue(), and CbmRecoSts::ProcessData().
ECbmModuleId CbmStsAddress::GetSystemId | ( | Int_t | address | ) |
Get system Id (should be ECbmModuleId::kSts)
address | Unique element address |
Definition at line 190 of file CbmStsAddress.cxx.
References GetElementId(), and kStsSystem.
Referenced by CbmStsSetup::GetElement(), CbmTestDigi::GetSystemId(), CbmMatchRecoToMC::MatchStsTracks(), and CbmMatchRecoToMC::MatchTracks().
UInt_t CbmStsAddress::GetVersion | ( | Int_t | address | ) |
Extract version number.
address | Unique element address @value Version number |
The version is encoded in the last 6 bits (58 to 63). The maximal number of versions is 64.
Definition at line 198 of file CbmStsAddress.cxx.
References kVersionMask, and kVersionShift.
Referenced by GetElementId(), GetMotherAddress(), SetElementId(), and ToString().
Int_t CbmStsAddress::SetElementId | ( | Int_t | address, |
Int_t | level, | ||
UInt_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 205 of file CbmStsAddress.cxx.
References GetVersion(), kBits, kMask, kShift, kStsNofLevels, and kStsSystem.
Referenced by CbmStsModule::InitDaughters(), and CbmStsElement::InitDaughters().
std::string CbmStsAddress::ToString | ( | Int_t | address | ) |
String output.
address | Unique element address |
Definition at line 221 of file CbmStsAddress.cxx.
References GetElementId(), GetVersion(), kStsHalfLadder, kStsLadder, kStsModule, kStsSensor, kStsSide, kStsSystem, and kStsUnit.
Referenced by CbmRecoSts::ProcessData(), CbmStsModule::ToString(), and CbmStsSensor::ToString().
const UShort_t CbmStsAddress::kBits[kCurrentVersion+1][kStsNofLevels] |
Definition at line 18 of file CbmStsAddress.cxx.
Referenced by GetAddress(), and SetElementId().
const UInt_t CbmStsAddress::kCurrentVersion = 1 |
Definition at line 47 of file CbmStsAddress.h.
Referenced by GetAddress().
const Int_t CbmStsAddress::kMask[kCurrentVersion+1][kStsNofLevels] |
Definition at line 67 of file CbmStsAddress.cxx.
Referenced by GetElementId(), and SetElementId().
const Int_t CbmStsAddress::kShift[kCurrentVersion+1][kStsNofLevels] |
Definition at line 47 of file CbmStsAddress.cxx.
Referenced by GetAddress(), GetElementId(), GetMotherAddress(), and SetElementId().
const Int_t CbmStsAddress::kVersionMask = (1 << kVersionSize) - 1 |
Definition at line 53 of file CbmStsAddress.h.
Referenced by GetVersion().
const Int_t CbmStsAddress::kVersionShift = 28 |
Definition at line 52 of file CbmStsAddress.h.
Referenced by GetAddress(), GetMotherAddress(), and GetVersion().
const Int_t CbmStsAddress::kVersionSize = 4 |
Definition at line 51 of file CbmStsAddress.h.