Skip to content
Snippets Groups Projects
Commit d1d1c4db authored by Sergei Zharko's avatar Sergei Zharko
Browse files

Tracking interfaces: module-to-station map is introduced

parent 51878292
No related branches found
No related tags found
1 merge request!1413Tracking interfaces: module-to-station map is introduced
Pipeline #24884 passed
......@@ -20,6 +20,7 @@
#include <array>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
......@@ -108,6 +109,10 @@ public:
/// @return Flag: true - station provides time measurements, false - station does not provide time measurements
virtual bool IsTimeInfoProvided(int stationId) const = 0;
/// @brief Returns the map of address to station index
/// @return std::unordered_map<int32_t - address, int - station index>
const std::unordered_map<int32_t, int>& GetAddressToStationMap() const { return fmAddressToStation; }
/// @brief Gets x,y,t ranges of a CbmPixelHit
/// @param hit A hit
/// @return range X, Y, T
......@@ -124,6 +129,9 @@ public:
/// @brief Prints all the parameters into table and saves the table as a string
std::string ToString() const;
/// @brief Map of the address to station index
std::unordered_map<int32_t, int> fmAddressToStation {};
};
#endif // CbmTrackingDetectorInterfaceBase_h
......@@ -69,12 +69,13 @@ InitStatus CbmTofTrackingInterface::Init()
fTofStationZMin.resize(nStations, std::numeric_limits<double>::max());
fTofStationZMax.resize(nStations, std::numeric_limits<double>::lowest());
fmAddressToStation.clear();
for (int iSmType = 0; iSmType < fDigiBdfPar->GetNbSmTypes(); ++iSmType) {
for (int iSm = 0; iSm < fDigiBdfPar->GetNbSm(iSmType); ++iSm) {
for (int iRpc = 0; iRpc < fDigiBdfPar->GetNbRpc(iSmType); ++iRpc) {
auto address = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType);
int iStation = fDigiBdfPar->GetTrackingStation(iSmType, iSm, iRpc); // Local index of tracking station
fmAddressToStation[address] = iStation;
auto* pChannelInfo = dynamic_cast<CbmTofCell*>(fDigiPar->GetCell(address));
if (nullptr == pChannelInfo) {
......
......@@ -429,6 +429,13 @@ InitStatus CbmL1::Init()
auto trdInterface = CbmTrdTrackingInterface::Instance();
auto tofInterface = CbmTofTrackingInterface::Instance();
if (fUseTOF) {
LOG(info) << "TOF module map";
for (auto [addr, iSt] : tofInterface->GetAddressToStationMap()) {
LOG(info) << Form("%#010x %2d", addr, iSt);
}
}
fNMvdStationsGeom = (fUseMVD) ? mvdInterface->GetNtrackingStations() : 0;
fNStsStationsGeom = (fUseSTS) ? stsInterface->GetNtrackingStations() : 0;
fNMuchStationsGeom = (fUseMUCH) ? muchInterface->GetNtrackingStations() : 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment