diff --git a/algo/detectors/trd2d/ReadoutConfig.cxx b/algo/detectors/trd2d/ReadoutConfig.cxx index 692988991454bed4ae6193b430d0a3707c45d94d..675b8084ac96dc690a5e6fac2b9d3c26e5dbfacc 100644 --- a/algo/detectors/trd2d/ReadoutConfig.cxx +++ b/algo/detectors/trd2d/ReadoutConfig.cxx @@ -98,20 +98,22 @@ namespace cbm::algo::trd2d // --- Initialise the mapping structure -------------------------------------------- void ReadoutConfig::InitChannelMap( - const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap) + const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>>& + channelMap) { // Constructing the map (equipId, asicId, chanId) -> (pad address, mask flag, daq offset) for (auto compMap : channelMap) { uint16_t equipmentId = compMap.first; - uint16_t numAsics = compMap.second.size(); + // uint16_t numAsics = compMap.second.size(); for (auto asicMap : compMap.second) { uint16_t asicId = asicMap.first; - uint16_t numChans = asicMap.second.size(); + // uint16_t numChans = asicMap.second.size(); fChannelMap[equipmentId][asicId].resize(16); for (auto chanMap : asicMap.second) { uint16_t chanId = chanMap.first; - std::tuple<int32_t, bool, uint64_t> chanPars = chanMap.second; - ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars)}; + std::tuple<int32_t, bool, uint8_t, uint16_t> chanPars = chanMap.second; + const ChanMapping entry = {std::get<0>(chanPars), std::get<1>(chanPars), std::get<2>(chanPars), + std::get<3>(chanPars)}; fChannelMap[equipmentId][asicId][chanId] = entry; } } @@ -123,7 +125,7 @@ namespace cbm::algo::trd2d // --- Mapping (equimentId, asicId, channel) -> (pad address, mask flag, daq offset) ----- ReadoutConfig::ChanMapping ReadoutConfig::ChanMap(uint16_t equipId, uint16_t asicId, uint16_t chanId) { - ChanMapping result = {-1, false, 0}; + ChanMapping result = {-1, false, 0, 0}; auto it = fChannelMap.find(equipId); if (it != fChannelMap.end()) { auto fiberMap = fChannelMap[equipId]; diff --git a/algo/detectors/trd2d/ReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h index a4b189c8f9d35a6f12ea07b3737e02bad9f102c6..ebd29530d0303cb60df43d4a1026f766b140354a 100644 --- a/algo/detectors/trd2d/ReadoutConfig.h +++ b/algo/detectors/trd2d/ReadoutConfig.h @@ -116,7 +116,8 @@ namespace cbm::algo::trd2d /** @brief Initialisation of channel map **/ void InitChannelMap( - const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap); + const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>>& + channelMap); /** @brief Get system time offset **/ int64_t GetSystemTimeOffset() { return fSystemTimeOffset; }; diff --git a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx index 6a19ff16bf719e0b89908d6efdb28eb89535fd6d..aa85f8906c28250b3a10060be1e3be97e272b307 100644 --- a/reco/tasks/CbmTaskTrdUnpackParWrite.cxx +++ b/reco/tasks/CbmTaskTrdUnpackParWrite.cxx @@ -39,7 +39,7 @@ InitStatus CbmTaskTrdUnpackParWrite::Init() // Map (moduleId) -> (array of crobId) std::map<uint32_t, std::vector<uint16_t>> crobMap; // Map (equipId, asicId, chanId) -> (pad address, mask flag, daq offset [FASP clk]) - std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>> channelMap; + std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint8_t, uint16_t>>>> channelMap; // Loop through a list of module IDs from the .digi file (can in principle contradict crob_map). for (auto entry : digiparset.GetModuleMap()) { @@ -77,9 +77,10 @@ InitStatus CbmTaskTrdUnpackParWrite::Init() const CbmTrdParFaspChannel* faspch = fasppar->GetChannel(chan); const int32_t pad = fasppar->GetPadAddress(chan) * (faspch->HasPairingR() ? 1 : -1); const bool isMasked = faspch->IsMasked(); - uint64_t daq_offset = 0; + uint8_t daq_offset = 0; + uint8_t thres = 0; if (((CbmTrdParModDigi*) digipar)->GetPadRow(pad) % 2 == 0) daq_offset = 3; - channelMap[eq_id][fasp_in_eq][chan] = std::make_tuple(pad, isMasked, daq_offset); + channelMap[eq_id][fasp_in_eq][chan] = std::make_tuple(pad, isMasked, daq_offset, thres); } } }