diff --git a/core/base/CbmTrackingDetectorInterfaceBase.h b/core/base/CbmTrackingDetectorInterfaceBase.h index 4c8fd2f19dc796348c2d8fd08f7e01773569f439..c08a6498fb2384a6aacb963c1f97539e0fd4dbbd 100644 --- a/core/base/CbmTrackingDetectorInterfaceBase.h +++ b/core/base/CbmTrackingDetectorInterfaceBase.h @@ -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 diff --git a/core/detectors/tof/CbmTofTrackingInterface.cxx b/core/detectors/tof/CbmTofTrackingInterface.cxx index 5d2e2b26e0bbf87c85cd0378362c0bd71421cd9b..e74eba5d36079dcfba0198c0b687c63de2f89d14 100644 --- a/core/detectors/tof/CbmTofTrackingInterface.cxx +++ b/core/detectors/tof/CbmTofTrackingInterface.cxx @@ -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) { diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 58631f430501cdf5fc9ef0a5a41d41d3feadb5f2..f3f7cffbab3c1b0429c556af06af5c76ec918f2e 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -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;