diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index 60fe4c1d66aec22cbb0ef35de26f3c337153616c..1deebb47baa2274bfe606dc9847c0c60fba5eb9f 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -6,7 +6,7 @@ set(DEVICE_SRCS base/gpu/DeviceImage.cxx base/gpu/Params.cxx detectors/sts/UnpackStsXpu.cxx - detectors/sts/StsHitfinder.cxx + detectors/sts/Hitfinder.cxx ) set(SRCS @@ -27,22 +27,22 @@ set(SRCS unpack/Unpack.cxx unpack/UnpackChain.cxx detectors/sts/ReadoutConfig.cxx - detectors/sts/StsHitfinderChain.cxx - detectors/sts/StsReadoutConfigLegacy.cxx - detectors/sts/UnpackSts.cxx - detectors/much/MuchReadoutConfig.cxx - detectors/much/UnpackMuch.cxx - detectors/tof/HitFinderTof.cxx - detectors/tof/TofReadoutConfig.cxx - detectors/tof/UnpackTof.cxx - detectors/bmon/BmonReadoutConfig.cxx - detectors/bmon/UnpackBmon.cxx - detectors/trd/TrdReadoutConfig.cxx - detectors/trd/UnpackTrd.cxx - detectors/trd2d/Trd2dReadoutConfig.cxx - detectors/trd2d/UnpackTrd2d.cxx - detectors/rich/RichReadoutConfig.cxx - detectors/rich/UnpackRich.cxx + detectors/sts/HitfinderChain.cxx + detectors/sts/ReadoutConfigLegacy.cxx + detectors/sts/Unpack.cxx + detectors/much/ReadoutConfig.cxx + detectors/much/Unpack.cxx + detectors/tof/HitFinder.cxx + detectors/tof/ReadoutConfig.cxx + detectors/tof/Unpack.cxx + detectors/bmon/ReadoutConfig.cxx + detectors/bmon/Unpack.cxx + detectors/trd/ReadoutConfig.cxx + detectors/trd/Unpack.cxx + detectors/trd2d/ReadoutConfig.cxx + detectors/trd2d/Unpack.cxx + detectors/rich/ReadoutConfig.cxx + detectors/rich/Unpack.cxx global/Archive.cxx global/RecoResults.cxx global/Reco.cxx @@ -139,8 +139,6 @@ install( ca/simd/CaSimd.h ca/simd/CaSimdVc.h ca/simd/CaSimdPseudo.h - detectors/sts/StsHitfinder.h - detectors/sts/StsHitfinderChain.h global/Reco.h DESTINATION include/ diff --git a/algo/detectors/bmon/BmonReadoutConfig.cxx b/algo/detectors/bmon/ReadoutConfig.cxx similarity index 91% rename from algo/detectors/bmon/BmonReadoutConfig.cxx rename to algo/detectors/bmon/ReadoutConfig.cxx index 1edee46e7d21c13e79b83aac6ba67fee1785c5f0..b04ac70f8b1ae7a587f7acb5518180e8647c9ff2 100644 --- a/algo/detectors/bmon/BmonReadoutConfig.cxx +++ b/algo/detectors/bmon/ReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "BmonReadoutConfig.h" +#include "ReadoutConfig.h" #include "CbmTofAddress.h" @@ -16,18 +16,18 @@ using namespace std; -namespace cbm::algo +namespace cbm::algo::bmon { // --- Constructor ------------------------------------------------------------------ - BmonReadoutConfig::BmonReadoutConfig() { Init(); } + ReadoutConfig::ReadoutConfig() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - BmonReadoutConfig::~BmonReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> BmonReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -37,7 +37,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Number of elinks for a component / equipment ------------------------------- - size_t BmonReadoutConfig::GetNumElinks(uint16_t equipmentId) + size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -48,7 +48,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> address[channel] ------------------------------ - std::vector<uint32_t> BmonReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) + std::vector<uint32_t> ReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) { std::vector<uint32_t> result; auto equipIter = fReadoutMap.find(equipmentId); @@ -59,7 +59,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------------------ - void BmonReadoutConfig::Init() + void ReadoutConfig::Init() { // This here refers to the mCBM 2022 setup. // Taken from CbmMcbm2018TofPar in combination with macro/beamtime/mcbm2022/mBmonCriPar.par @@ -99,7 +99,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void BmonReadoutConfig::BuildChannelsUidMap() + void ReadoutConfig::BuildChannelsUidMap() { const uint32_t numAsics = numComp * numFebsPerComp * numAsicsPerFeb; const uint32_t numChan = numAsics * numChanPerAsic; @@ -135,7 +135,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void BmonReadoutConfig::BuildChannelsUidMapT0(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapT0(uint32_t& uCh, uint32_t uGbtx) { L_(debug) << " Map diamond " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; for (uint32_t uGet4 = 0; uGet4 < numElinksPerCrob; ++uGet4) { @@ -157,7 +157,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void BmonReadoutConfig::BuildChannelsUidMapT0_2022(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapT0_2022(uint32_t& uCh, uint32_t uGbtx) { L_(debug) << " Map 2022 diamond " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; for (uint32_t uGet4 = 0; uGet4 < numElinksPerCrob; ++uGet4) { @@ -179,4 +179,4 @@ namespace cbm::algo } } } -} /* namespace cbm::algo */ +} // namespace cbm::algo::bmon diff --git a/algo/detectors/bmon/BmonReadoutConfig.h b/algo/detectors/bmon/ReadoutConfig.h similarity index 90% rename from algo/detectors/bmon/BmonReadoutConfig.h rename to algo/detectors/bmon/ReadoutConfig.h index 7bad27cf71b33c09e382cc53679e87bc319f023c..189bf9ab666aad6b8a6a8650264e00652a823323 100644 --- a/algo/detectors/bmon/BmonReadoutConfig.h +++ b/algo/detectors/bmon/ReadoutConfig.h @@ -2,24 +2,24 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H -#define ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_BMON_READOUTCONFIG_H +#define ALGO_DETECTORS_BMON_READOUTCONFIG_H #include <cstddef> #include <cstdint> #include <map> #include <vector> -namespace cbm::algo +namespace cbm::algo::bmon { - class BmonReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - BmonReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~BmonReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration ** @return Vector of equipment IDs @@ -75,6 +75,6 @@ namespace cbm::algo void BuildChannelsUidMapT0_2022(uint32_t& uCh, uint32_t uGbtx); }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::bmon -#endif //ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H +#endif //ALGO_DETECTORS_BMON_READOUTCONFIG_H diff --git a/algo/detectors/bmon/UnpackBmon.cxx b/algo/detectors/bmon/Unpack.cxx similarity index 87% rename from algo/detectors/bmon/UnpackBmon.cxx rename to algo/detectors/bmon/Unpack.cxx index 4809362b636a7eb3a4ec1c178c03f161b970f2b2..dee3b83b2d419747afe5b7074dcd6a83fc5eab86 100644 --- a/algo/detectors/bmon/UnpackBmon.cxx +++ b/algo/detectors/bmon/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "UnpackBmon.h" +#include "Unpack.h" #include <cassert> #include <sstream> @@ -14,12 +14,12 @@ using std::unique_ptr; using std::vector; -namespace cbm::algo +namespace cbm::algo::bmon { // ---- Algorithm execution --------------------------------------------- - UnpackBmon::resultType UnpackBmon::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -105,8 +105,8 @@ namespace cbm::algo // ----- Process hit message -------------------------------------------- - inline void UnpackBmon::ProcessHitMessage(const critof001::Message& message, const TimeSpec& time, - vector<CbmBmonDigi>& digiVec, UnpackBmonMonitorData& monitor) const + inline void Unpack::ProcessHitMessage(const critof001::Message& message, const TimeSpec& time, + vector<CbmBmonDigi>& digiVec, UnpackMonitorData& monitor) const { // IGNORES: // - Duplicate messages @@ -122,7 +122,7 @@ namespace cbm::algo monitor.fNumErrElinkOutOfRange++; return; } - const UnpackBmonElinkPar& elinkPar = fParams.fElinkParams.at(elink); + const UnpackElinkPar& elinkPar = fParams.fElinkParams.at(elink); const uint32_t channel = message.getGdpbHitChanId(); const uint32_t channelUId = (elinkPar.fChannelUId)[channel]; @@ -137,7 +137,7 @@ namespace cbm::algo // ----- Process an epoch message --------------------------------------- - inline void UnpackBmon::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const + inline void Unpack::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const { const uint64_t epoch = message.getGdpbEpEpochNb(); @@ -151,4 +151,4 @@ namespace cbm::algo // -------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::bmon diff --git a/algo/detectors/bmon/UnpackBmon.h b/algo/detectors/bmon/Unpack.h similarity index 82% rename from algo/detectors/bmon/UnpackBmon.h rename to algo/detectors/bmon/Unpack.h index 681e368387c541948e58e48df011441889222aa3..06d4ec5affa4272fd5114b1dc1f8844e0a0e5a70 100644 --- a/algo/detectors/bmon/UnpackBmon.h +++ b/algo/detectors/bmon/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACKBMON_H -#define CBM_ALGO_UNPACKBMON_H 1 +#ifndef CBM_ALGO_BMON_UNPACK_H +#define CBM_ALGO_BMON_UNPACK_H 1 #include "CbmBmonDigi.h" @@ -20,37 +20,37 @@ #include "CriGet4Mess001.h" -namespace cbm::algo +namespace cbm::algo::bmon { - /** @struct UnpackBmonElinkPar + /** @struct UnpackElinkPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Bmon Unpacking parameters for one eLink / ASIC **/ - struct UnpackBmonElinkPar { + struct UnpackElinkPar { std::vector<uint32_t> fChannelUId; ///< CbmBmonAddress for different channels uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackBmonPar + /** @struct UnpackPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Parameters required for the STS unpacking (specific to one component) **/ - struct UnpackBmonPar { - std::vector<UnpackBmonElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackPar { + std::vector<UnpackElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; - /** @struct UnpackBmonMoni + /** @struct UnpackMoni ** @author Volker Friese <v.friese@gsi.de> ** @since 2 December 2021 ** @brief Monitoring data for STS unpacking **/ - struct UnpackBmonMonitorData { + struct UnpackMonitorData { uint32_t fNumNonHitOrTsbMessage = 0; uint32_t fNumErrElinkOutOfRange = 0; ///< Elink not contained in parameters uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not EPOCH @@ -76,25 +76,25 @@ namespace cbm::algo }; - /** @class UnpackBmon + /** @class Unpack ** @author Pierre-Alain Loizeau <p.-a.loizeau@gsi.de> ** @author Volker Friese <v.friese@gsi.de> ** @author Dominik Smith <d.smith@gsi.de> ** @since 25 November 2021 ** @brief Unpack algorithm for STS **/ - class UnpackBmon { + class Unpack { public: - typedef std::pair<std::vector<CbmBmonDigi>, UnpackBmonMonitorData> resultType; + typedef std::pair<std::vector<CbmBmonDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackBmon() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackBmon() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -109,7 +109,7 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackBmonPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } private: // datatypes struct TimeSpec { @@ -124,7 +124,7 @@ namespace cbm::algo ** @param monitor Reference to monitor object **/ void ProcessHitMessage(const critof001::Message& message, const TimeSpec& time, std::vector<CbmBmonDigi>& digiVec, - UnpackBmonMonitorData& monitor) const; + UnpackMonitorData& monitor) const; /** @brief Process an epoch message (TS_MSB) ** @param message SMX message (32-bit word) @@ -132,11 +132,11 @@ namespace cbm::algo void ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const; - private: // members - UnpackBmonPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::bmon -#endif /* CBM_ALGO_UNPACKBMON_H */ +#endif /* CBM_ALGO_BMON_UNPACK_H */ diff --git a/algo/detectors/much/MuchReadoutConfig.cxx b/algo/detectors/much/ReadoutConfig.cxx similarity index 97% rename from algo/detectors/much/MuchReadoutConfig.cxx rename to algo/detectors/much/ReadoutConfig.cxx index 813d1d4c7251e4524b258bef86f9d38dace75ae0..94bee8e4b79d2d8b16cccfe7edd57183f113eda6 100644 --- a/algo/detectors/much/MuchReadoutConfig.cxx +++ b/algo/detectors/much/ReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Ajit Kumar, Florian Uhlig [committer] */ -#include "MuchReadoutConfig.h" +#include "ReadoutConfig.h" #include "CbmMuchAddress.h" @@ -13,18 +13,18 @@ using namespace std; -namespace cbm::algo +namespace cbm::algo::much { // --- Constructor ------------------------------------------------------------------ - MuchReadoutConfig::MuchReadoutConfig() { Init(); } + ReadoutConfig::ReadoutConfig() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - MuchReadoutConfig::~MuchReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> MuchReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -34,7 +34,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Number of elinks for a component / equipment ------------------------------- - size_t MuchReadoutConfig::GetNumElinks(uint16_t equipmentId) + size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -44,7 +44,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Mapping (equimentId, elink) -> address[channel] ------------------------------ - std::vector<uint32_t> MuchReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) + std::vector<uint32_t> ReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) { std::vector<uint32_t> result; auto equipIter = fReadoutMap.find(equipmentId); @@ -56,7 +56,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Mapping (equimentId, elink) -> (vector of mask flags) ------------------------ - std::vector<bool> MuchReadoutConfig::MaskMap(uint16_t equipmentId, uint16_t elinkId) + std::vector<bool> ReadoutConfig::MaskMap(uint16_t equipmentId, uint16_t elinkId) { std::vector<bool> result; auto equipIter = fMaskMap.find(equipmentId); @@ -70,7 +70,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ - void MuchReadoutConfig::Init() + void ReadoutConfig::Init() { // This here refers to the mCBM 2022 setup. // Taken from CbmMuchUnpackPar in combination with macro/beamtime/mcbm2022/mMuchParUpto26052022.par @@ -156,7 +156,7 @@ namespace cbm::algo } //To do address need to be checked carefully - uint32_t MuchReadoutConfig::CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan) + uint32_t ReadoutConfig::CreateMuchAddress(uint32_t dpbidx, int32_t iFebId, uint32_t usChan) { // For generating Station number (GEM1 station = 0, GEM2 station = 1 and RPC station = 2) /// Below FebID is according to FEB Position in Module GEM A or Module GEM B (Carefully write MUCH Par file) @@ -270,47 +270,47 @@ namespace cbm::algo return address; } - int8_t MuchReadoutConfig::GetPadXA(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadXA(uint8_t febid, uint8_t channelid) { if (fChannelsToPadXA.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { - LOG(debug) << "MuchReadoutConfig::GetPadXA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) + LOG(debug) << "ReadoutConfig::GetPadXA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) << " VS " << fChannelsToPadXA.size() << " (" << febid << " and " << channelid << ")"; return -2; } return fChannelsToPadXA[(febid * numChanPerAsic) + channelid]; } - int8_t MuchReadoutConfig::GetPadYA(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadYA(uint8_t febid, uint8_t channelid) { if (fChannelsToPadYA.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { - LOG(debug) << "MuchReadoutConfig::GetPadYA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) + LOG(debug) << "ReadoutConfig::GetPadYA => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) << " VS " << fChannelsToPadYA.size() << " (" << febid << " and " << channelid << ")"; return -2; } return fChannelsToPadYA[(febid * numChanPerAsic) + channelid]; } - int8_t MuchReadoutConfig::GetPadXB(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadXB(uint8_t febid, uint8_t channelid) { if (fChannelsToPadXB.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { - LOG(debug) << "MuchReadoutConfig::GetPadXB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) + LOG(debug) << "ReadoutConfig::GetPadXB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) << " VS " << fChannelsToPadXB.size() << " (" << febid << " and " << channelid << ")"; return -2; } return fChannelsToPadXB[(febid * numChanPerAsic) + channelid]; } - int8_t MuchReadoutConfig::GetPadYB(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadYB(uint8_t febid, uint8_t channelid) { if (fChannelsToPadYB.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { - LOG(debug) << "MuchReadoutConfig::GetPadYB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) + LOG(debug) << "ReadoutConfig::GetPadYB => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) << " VS " << fChannelsToPadYB.size() << " (" << febid << " and " << channelid << ")"; return -2; } return fChannelsToPadYB[(febid * numChanPerAsic) + channelid]; } - int8_t MuchReadoutConfig::GetPadXRpc(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadXRpc(uint8_t febid, uint8_t channelid) { if (fChannelsToPadXRpc.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { LOG(debug) << "CbmMcbm2018MuchPar::GetPadXRpc => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) @@ -320,7 +320,7 @@ namespace cbm::algo return fChannelsToPadXRpc[(febid * numChanPerAsic) + channelid]; } - int8_t MuchReadoutConfig::GetPadYRpc(uint8_t febid, uint8_t channelid) + int8_t ReadoutConfig::GetPadYRpc(uint8_t febid, uint8_t channelid) { if (fChannelsToPadYRpc.size() <= (static_cast<uint32_t>(febid) * numChanPerAsic) + channelid) { LOG(debug) << "CbmMcbm2018MuchPar::GetPadYRpc => Index out of bounds: " << ((febid * numChanPerAsic) + channelid) @@ -330,7 +330,7 @@ namespace cbm::algo return fChannelsToPadYRpc[(febid * numChanPerAsic) + channelid]; } - int32_t MuchReadoutConfig::GetFebId(uint16_t uAsicIdx) + int32_t ReadoutConfig::GetFebId(uint16_t uAsicIdx) { if (uAsicIdx >= numFebsInGemA && uAsicIdx < (numFebsInGemA + numFebsInRpc)) //Check return fnFebsIdsArrayRpc[uAsicIdx - numFebsInGemA]; //Check Vikas @@ -340,14 +340,14 @@ namespace cbm::algo else if (uAsicIdx < numFebsInGemA) return fnFebsIdsArrayGemA[uAsicIdx]; else { - LOG(warning) << "MuchReadoutConfig::GetFebId => provided uAsicIdx : " << uAsicIdx + LOG(warning) << "ReadoutConfig::GetFebId => provided uAsicIdx : " << uAsicIdx << " not in the range of :" << (numFebsInGemA + numFebsInRpc + numFebsInGemB) << "Returning large value -2"; return -2; } } - void MuchReadoutConfig::InitChannelToPadMaps() + void ReadoutConfig::InitChannelToPadMaps() { // Array which stores the corresponding x position of PAD of RPC module @@ -1076,4 +1076,4 @@ namespace cbm::algo 95, 94, 96, 90, 95, 91, 96, 92, 95, 90, 96, 91, 95, 95, 96, 96, // 95, 96, 95, 93, 96, 92, -1, 91, -1, 90, -1, 90, -1, 91, 79, 92}; } -} /* namespace cbm::algo */ +} // namespace cbm::algo::much diff --git a/algo/detectors/much/MuchReadoutConfig.h b/algo/detectors/much/ReadoutConfig.h similarity index 92% rename from algo/detectors/much/MuchReadoutConfig.h rename to algo/detectors/much/ReadoutConfig.h index 8c496856c39abff5a1db578b8a54cb2f30ff8c53..56f80e5693c4d665d32d5095f42456a207fb4111 100644 --- a/algo/detectors/much/MuchReadoutConfig.h +++ b/algo/detectors/much/ReadoutConfig.h @@ -2,24 +2,24 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef ALGO_DETECTORS_MUCH_MUCHREADOUTCONFIG_H -#define ALGO_DETECTORS_MUCH_MUCHREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_MUCH_READOUTCONFIG_H +#define ALGO_DETECTORS_MUCH_READOUTCONFIG_H #include <cstddef> #include <cstdint> #include <map> #include <vector> -namespace cbm::algo +namespace cbm::algo::much { - class MuchReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - MuchReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~MuchReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration ** @return Vector of equipment IDs @@ -42,7 +42,7 @@ namespace cbm::algo /** @brief API: Mapping from component and elink to channel mask flags ** @param equipId Equipment identifier (component) ** @param elink Elink number within component - ** @return (vector of mask flags for channels per asic) + ** @return (vector of mask flags for channels per asic) */ std::vector<bool> MaskMap(uint16_t equipId, uint16_t elink); @@ -100,6 +100,6 @@ namespace cbm::algo int8_t GetPadYRpc(uint8_t febid, uint8_t channelid); }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::much -#endif // ALGO_DETECTORS_MUCH_MUCHREADOUTCONFIG_H +#endif // ALGO_DETECTORS_MUCH_READOUTCONFIG_H diff --git a/algo/detectors/much/UnpackMuch.cxx b/algo/detectors/much/Unpack.cxx similarity index 88% rename from algo/detectors/much/UnpackMuch.cxx rename to algo/detectors/much/Unpack.cxx index ccd98924fe4c61ecef1bf883a41faa1ff111ede2..0c9c4f7bb5ab60340e18ee833bd90c0ce463222f 100644 --- a/algo/detectors/much/UnpackMuch.cxx +++ b/algo/detectors/much/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Volker Friese [committer] */ -#include "UnpackMuch.h" +#include "Unpack.h" #include <cassert> #include <utility> @@ -15,12 +15,12 @@ using std::unique_ptr; using std::vector; -namespace cbm::algo +namespace cbm::algo::much { // ---- Algorithm execution --------------------------------------------- - UnpackMuch::resultType UnpackMuch::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -100,8 +100,8 @@ namespace cbm::algo // ----- Process hit message -------------------------------------------- - inline void UnpackMuch::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, - vector<CbmMuchDigi>& digiVec, UnpackMuchMonitorData& monitor) const + inline void Unpack::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, + vector<CbmMuchDigi>& digiVec, UnpackMonitorData& monitor) const { // --- Check eLink and get parameters uint16_t elink = message.GetLinkIndexHitBinning(); @@ -109,8 +109,8 @@ namespace cbm::algo monitor.fNumErrElinkOutOfRange++; return; } - const UnpackMuchElinkPar& elinkPar = fParams.fElinkParams.at(elink); - uint16_t channel = message.GetHitChannel(); + const UnpackElinkPar& elinkPar = fParams.fElinkParams.at(elink); + uint16_t channel = message.GetHitChannel(); // --- Check for masked channel if (!elinkPar.fChanMask.empty() && elinkPar.fChanMask[channel] == true) { return; } @@ -136,7 +136,7 @@ namespace cbm::algo // ----- Process an epoch (TS_MSB) message ------------------------------ - inline void UnpackMuch::ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const + inline void Unpack::ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const { // The compression of time is based on the hierarchy epoch cycle - epoch - message time. // Cycles are counted from the start of Unix time and are multiples of an epoch (ts_msb). @@ -160,4 +160,4 @@ namespace cbm::algo // -------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::much diff --git a/algo/detectors/much/UnpackMuch.h b/algo/detectors/much/Unpack.h similarity index 83% rename from algo/detectors/much/UnpackMuch.h rename to algo/detectors/much/Unpack.h index 477396b691d263b63c7c7447bb494bc93299f41b..57db012db431fa32bc662301a616e482d9181560 100644 --- a/algo/detectors/much/UnpackMuch.h +++ b/algo/detectors/much/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Volker Friese [committer] */ -#ifndef CBM_ALGO_UNPACKMUCH_H -#define CBM_ALGO_UNPACKMUCH_H 1 +#ifndef CBM_ALGO_MUCH_UNPACK_H +#define CBM_ALGO_MUCH_UNPACK_H 1 #include "CbmMuchDigi.h" @@ -20,38 +20,38 @@ #include "StsXyterMessage.h" -namespace cbm::algo +namespace cbm::algo::much { - /** @struct UnpackMuchElinkPar + /** @struct UnpackElinkPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief STS Unpacking parameters for one eLink / ASIC **/ - struct UnpackMuchElinkPar { + struct UnpackElinkPar { std::vector<uint32_t> fAddress; ///< CbmMuchAddress for different channels std::vector<bool> fChanMask; ///< Channel masking flags uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackMuchPar + /** @struct UnpackPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Parameters required for the STS unpacking (specific to one component) **/ - struct UnpackMuchPar { - std::vector<UnpackMuchElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackPar { + std::vector<UnpackElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; - /** @struct UnpackMuchMoni + /** @struct UnpackMoni ** @author Volker Friese <v.friese@gsi.de> ** @since 2 December 2021 ** @brief Monitoring data for STS unpacking **/ - struct UnpackMuchMonitorData { + struct UnpackMonitorData { uint32_t fNumNonHitOrTsbMessage = 0; uint32_t fNumErrElinkOutOfRange = 0; ///< Elink not contained in parameters uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not TS_MSB or second is not EPOCH @@ -73,24 +73,24 @@ namespace cbm::algo }; - /** @class UnpackMuch + /** @class Unpack ** @author Pierre-Alain Loizeau <p.-a.loizeau@gsi.de> ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Unpack algorithm for STS **/ - class UnpackMuch { + class Unpack { public: - typedef std::pair<std::vector<CbmMuchDigi>, UnpackMuchMonitorData> resultType; + typedef std::pair<std::vector<CbmMuchDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackMuch() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackMuch() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -105,7 +105,7 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackMuchPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } private: // datatypes struct TimeSpec { @@ -123,7 +123,7 @@ namespace cbm::algo ** @param monitor Reference to monitor object **/ void ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, std::vector<CbmMuchDigi>& digiVec, - UnpackMuchMonitorData& monitor) const; + UnpackMonitorData& monitor) const; /** @brief Process an epoch message (TS_MSB) ** @param message SMX message (32-bit word) @@ -131,8 +131,8 @@ namespace cbm::algo void ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const; - private: // members - UnpackMuchPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container /** Number of TS_MSB epochs per cycle **/ static constexpr uint64_t fkEpochsPerCycle = stsxyter::kuTsMsbNbTsBinsBinning; @@ -149,6 +149,6 @@ namespace cbm::algo }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::much -#endif /* CBM_ALGO_UNPACKSTS_H */ +#endif /* CBM_ALGO_UNPACKMUCH_H */ diff --git a/algo/detectors/rich/RichReadoutConfig.cxx b/algo/detectors/rich/ReadoutConfig.cxx similarity index 97% rename from algo/detectors/rich/RichReadoutConfig.cxx rename to algo/detectors/rich/ReadoutConfig.cxx index 9267f192f726fe1ff13b7054e9712051d4be6c99..493e40e94637964ab127f45342d46135cd67e800 100644 --- a/algo/detectors/rich/RichReadoutConfig.cxx +++ b/algo/detectors/rich/ReadoutConfig.cxx @@ -2,29 +2,29 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese, Dominik Smith [committer] */ -#include "RichReadoutConfig.h" +#include "ReadoutConfig.h" #include <cassert> #include <iomanip> using std::setw; -namespace cbm::algo +namespace cbm::algo::rich { // --- Constructor ------------------------------------------------------------------ - RichReadoutConfig::RichReadoutConfig() { Init(); } + ReadoutConfig::ReadoutConfig() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - RichReadoutConfig::~RichReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> RichReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -35,7 +35,7 @@ namespace cbm::algo // --- Number of elinks for a component / equipment ------------------------------- - size_t RichReadoutConfig::GetNumElinks(uint16_t equipmentId) + size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -46,7 +46,7 @@ namespace cbm::algo // --- Total number of elinks for STS --------------------------------------------- - size_t RichReadoutConfig::GetNumElinks() + size_t ReadoutConfig::GetNumElinks() { size_t result = 0; for (auto& entry : fReadoutMap) { @@ -58,7 +58,7 @@ namespace cbm::algo // --- Initialise the mapping structure -------------------------------------------- - void RichReadoutConfig::Init() + void ReadoutConfig::Init() { // This here refers to the mCBM 2021 setup. // Taken from CbmMcbm2018RichPar in combination with macro/beamtime/mcbm2021/mRich.par @@ -318,7 +318,7 @@ namespace cbm::algo // --- Mapping (equimentId, trb address, channel) -> (tot shift) -------------------- - double RichReadoutConfig::Map(uint16_t equipmentId, uint32_t address, uint16_t chan) + double ReadoutConfig::Map(uint16_t equipmentId, uint32_t address, uint16_t chan) { double result = -1.; auto equipIter = fReadoutMap.find(equipmentId); @@ -334,7 +334,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Returns map (trb address, channel) -> (tot shift) ---------------------------- - std::map<uint32_t, std::vector<double>> RichReadoutConfig::Map(uint16_t equipmentId) + std::map<uint32_t, std::vector<double>> ReadoutConfig::Map(uint16_t equipmentId) { std::map<uint32_t, std::vector<double>> result; auto equipIter = fReadoutMap.find(equipmentId); @@ -345,7 +345,7 @@ namespace cbm::algo // ----- Print readout map ------------------------------------------------ - std::string RichReadoutConfig::PrintReadoutMap() + std::string ReadoutConfig::PrintReadoutMap() { std::stringstream ss; for (auto& equipment : fReadoutMap) { @@ -363,4 +363,4 @@ namespace cbm::algo } // ---------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::rich diff --git a/algo/detectors/rich/RichReadoutConfig.h b/algo/detectors/rich/ReadoutConfig.h similarity index 82% rename from algo/detectors/rich/RichReadoutConfig.h rename to algo/detectors/rich/ReadoutConfig.h index ea811d82a72c178d32ceb94c991a0b45e5f6bf7b..a18e0d469e0cba6314bb4511130a63799337f8fe 100644 --- a/algo/detectors/rich/RichReadoutConfig.h +++ b/algo/detectors/rich/ReadoutConfig.h @@ -2,38 +2,38 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese, Dominik Smith [committer] */ -#ifndef ALGO_DETECTORS_RICH_RICHREADOUTCONFIG_H -#define ALGO_DETECTORS_RICH_RICHREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_RICH_READOUTCONFIG_H +#define ALGO_DETECTORS_RICH_READOUTCONFIG_H #include <map> #include <sstream> #include <utility> #include <vector> -namespace cbm::algo +namespace cbm::algo::rich { - /** @class RichReadoutConfig + /** @class ReadoutConfig ** @author Dominik Smith <d.smith@gsi.de> ** @since 3 March 2022 ** @brief Provides the hardware-to-software address mapping for the CBM-RICH ** ** The hardware address as provided in the raw data stream is specified in terms of the ** equipment identifier (specific to one FLES component) and the trb address within - ** component. This is to be translated to a tot shift value. + ** component. This is to be translated to a tot shift value. ** The mapping of the address spaces is hard-coded in this class. **/ - class RichReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - RichReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~RichReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration @@ -58,7 +58,7 @@ namespace cbm::algo /** @brief API: Mapping from component, address and channel to tot shift ** @param equipId Equipment identifier (component) ** @param address trb address within component - ** @param chan channel within trb address + ** @param chan channel within trb address ** @return tot shift */ double Map(uint16_t equipmentId, uint32_t address, uint16_t chan); @@ -84,6 +84,6 @@ namespace cbm::algo void Init(); }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::rich -#endif /* ALGO_DETECTORS_RICH_RICHREADOUTCONFIG_H_ */ +#endif /* ALGO_DETECTORS_RICH_READOUTCONFIG_H_ */ diff --git a/algo/detectors/rich/UnpackRich.cxx b/algo/detectors/rich/Unpack.cxx similarity index 77% rename from algo/detectors/rich/UnpackRich.cxx rename to algo/detectors/rich/Unpack.cxx index 7958be3dc62755ab84819d18af7f0696aadf2c42..9f9db43ce10118b4143b322d0daf4bb989f4dc77 100644 --- a/algo/detectors/rich/UnpackRich.cxx +++ b/algo/detectors/rich/Unpack.cxx @@ -2,28 +2,28 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#include "UnpackRich.h" +#include "Unpack.h" #include <cstdint> #include "AlgoFairloggerCompat.h" -namespace cbm::algo +namespace cbm::algo::rich { // ---- Algorithm execution --------------------------------------------- - UnpackRich::resultType UnpackRich::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) { // --- Output data resultType result = {}; - fMonitor = UnpackRichMonitorData(); + fMonitor = UnpackMonitorData(); fOutputVec.clear(); // Clear CbmTime of MS. Used to get time offset of subtriggers to MS start fCbmTimeMS = 0; - RichMicrosliceReader reader; + rich::MicrosliceReader reader; reader.SetData(msContent, msDescr.size); const auto mstime = msDescr.idx; @@ -51,7 +51,7 @@ namespace cbm::algo } - void UnpackRich::ProcessTrbPacket(RichMicrosliceReader& reader) + void Unpack::ProcessTrbPacket(rich::MicrosliceReader& reader) { //process CBM time const uint32_t word_MSB = reader.NextWord(); // CBM 63:32 @@ -69,7 +69,7 @@ namespace cbm::algo const uint32_t wordEpoch = reader.NextWord(); const uint32_t epoch = ProcessEpoch(wordEpoch); const uint32_t wordTime = reader.NextWord(); - const RichTdcTimeData td = ProcessTimeData(wordTime); + const TdcTimeData td = ProcessTimeData(wordTime); const double fullTime = CalculateTime(epoch, td.fCoarse, td.fFine); if (l == 0) fPrevLastCh0ReTime[12] = fullTime; @@ -82,7 +82,7 @@ namespace cbm::algo } - void UnpackRich::ProcessHubBlock(RichMicrosliceReader& reader) + void Unpack::ProcessHubBlock(rich::MicrosliceReader& reader) { uint32_t word = reader.NextWord(); const uint32_t hubId = word & 0xffff; // 16 bits @@ -130,7 +130,7 @@ namespace cbm::algo } } - int UnpackRich::ProcessCtsHeader(RichMicrosliceReader& reader, uint32_t subSubEventSize, uint32_t subSubEventId) + int Unpack::ProcessCtsHeader(rich::MicrosliceReader& reader, uint32_t subSubEventSize, uint32_t subSubEventId) { const uint32_t word = reader.NextWord(); const uint32_t ctsState = word & 0xffff; // 16 bits @@ -154,7 +154,7 @@ namespace cbm::algo return nofTimeWords; } - void UnpackRich::ProcessSubSubEvent(RichMicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId) + void Unpack::ProcessSubSubEvent(rich::MicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId) { uint32_t epoch = 0; // store last epoch obtained in sub-sub-event @@ -171,11 +171,11 @@ namespace cbm::algo } // First word is expected to be of type "header" - if (GetTdcWordType(reader.NextWord()) != RichTdcWordType::Header) { fMonitor.fNumErrInvalidFirstMessage++; } + if (GetTdcWordType(reader.NextWord()) != TdcWordType::Header) { fMonitor.fNumErrInvalidFirstMessage++; } // Second word is expected to be of type "epoch" uint32_t word = reader.NextWord(); - if (GetTdcWordType(word) != RichTdcWordType::Epoch) { fMonitor.fNumErrInvalidSecondMessage++; } + if (GetTdcWordType(word) != TdcWordType::Epoch) { fMonitor.fNumErrInvalidSecondMessage++; } else { epoch = ProcessEpoch(word); } @@ -184,29 +184,29 @@ namespace cbm::algo for (int i = 2; i < nofTimeWords - 1; i++) { word = reader.NextWord(); switch (GetTdcWordType(word)) { - case RichTdcWordType::TimeData: { + case TdcWordType::TimeData: { ProcessTimeDataWord(epoch, word, subSubEventId, raisingTime); break; } - case RichTdcWordType::Epoch: { + case TdcWordType::Epoch: { epoch = ProcessEpoch(word); break; } - case RichTdcWordType::Header: { + case TdcWordType::Header: { fMonitor.fNumErrWildHeaderMessage++; break; } - case RichTdcWordType::Trailer: { + case TdcWordType::Trailer: { fMonitor.fNumErrWildTrailerMessage++; break; } - case RichTdcWordType::Debug: { + case TdcWordType::Debug: { break; // for the moment do nothing fMonitor.fNumDebugMessage++; break; } - case RichTdcWordType::Error: { + case TdcWordType::Error: { fMonitor.fNumErrTdcErrorWord++; break; } @@ -214,15 +214,15 @@ namespace cbm::algo } // Last word is expected to be of type "trailer" - if (GetTdcWordType(reader.NextWord()) != RichTdcWordType::Trailer) { fMonitor.fNumErrInvalidLastMessage++; } + if (GetTdcWordType(reader.NextWord()) != TdcWordType::Trailer) { fMonitor.fNumErrInvalidLastMessage++; } } // ---- ProcessTimeDataWord ---- - void UnpackRich::ProcessTimeDataWord(uint32_t epoch, uint32_t tdcWord, uint32_t subSubEventId, - std::vector<double>& raisingTime) + void Unpack::ProcessTimeDataWord(uint32_t epoch, uint32_t tdcWord, uint32_t subSubEventId, + std::vector<double>& raisingTime) { - const RichTdcTimeData td = ProcessTimeData(tdcWord); - const double fullTime = CalculateTime(epoch, td.fCoarse, td.fFine); + const TdcTimeData td = ProcessTimeData(tdcWord); + const double fullTime = CalculateTime(epoch, td.fCoarse, td.fFine); if (td.fChannel != 0) { const double dT = fullTime - fPrevLastCh0ReTime[fCurrentSubSubEvent]; @@ -248,12 +248,12 @@ namespace cbm::algo } } - double UnpackRich::CalculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine) + double Unpack::CalculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine) { return ((double) epoch) * 2048. * 5. + ((double) coarse) * 5. - ((double) fine) * 0.005; } - void UnpackRich::WriteOutputDigi(int32_t fpgaID, int32_t channel, double time, double tot) + void Unpack::WriteOutputDigi(int32_t fpgaID, int32_t channel, double time, double tot) { double ToTcorr = fbDoToTCorr ? fParams.fElinkParams[fpgaID].fToTshift[channel] : 0.; int32_t pixelUID = GetPixelUID(fpgaID, channel); @@ -266,7 +266,7 @@ namespace cbm::algo fOutputVec.emplace_back(pixelUID, finalTime, tot - ToTcorr); } - bool UnpackRich::CheckMaskedDiRICH(int32_t subSubEventId) + bool Unpack::CheckMaskedDiRICH(int32_t subSubEventId) { for (unsigned int i = 0; i < fMaskedDiRICHes.size(); ++i) { if (fMaskedDiRICHes.at(i) == subSubEventId) return true; @@ -274,35 +274,35 @@ namespace cbm::algo return false; } - RichTdcWordType UnpackRich::GetTdcWordType(uint32_t tdcWord) + TdcWordType Unpack::GetTdcWordType(uint32_t tdcWord) { uint32_t tdcTimeDataMarker = (tdcWord >> 31) & 0x1; // 1 bit uint32_t tdcMarker = (tdcWord >> 29) & 0x7; // 3 bits if (tdcTimeDataMarker == 0x1) { // TODO: I also include tdcMarker == 0x5, some tdc time data words have this marker. Is it correct? - if (tdcMarker == 0x4 || tdcMarker == 0x5) { return RichTdcWordType::TimeData; } + if (tdcMarker == 0x4 || tdcMarker == 0x5) { return TdcWordType::TimeData; } else { - return RichTdcWordType::Error; + return TdcWordType::Error; } } - if (tdcMarker == 0x0) return RichTdcWordType::Trailer; - if (tdcMarker == 0x1) return RichTdcWordType::Header; - if (tdcMarker == 0x2) return RichTdcWordType::Debug; - if (tdcMarker == 0x3) return RichTdcWordType::Epoch; - return RichTdcWordType::Error; + if (tdcMarker == 0x0) return TdcWordType::Trailer; + if (tdcMarker == 0x1) return TdcWordType::Header; + if (tdcMarker == 0x2) return TdcWordType::Debug; + if (tdcMarker == 0x3) return TdcWordType::Epoch; + return TdcWordType::Error; } - int32_t UnpackRich::GetPixelUID(int32_t fpgaID, int32_t ch) + int32_t Unpack::GetPixelUID(int32_t fpgaID, int32_t ch) { // First 16 bits are used for the FPGA ID, then // 8 bits unused and then 8 bits are used for the channel return ((fpgaID << 16) | (ch & 0x00FF)); } - RichTdcTimeData UnpackRich::ProcessTimeData(uint32_t tdcWord) + TdcTimeData Unpack::ProcessTimeData(uint32_t tdcWord) { - RichTdcTimeData out; + TdcTimeData out; out.fCoarse = static_cast<uint32_t>(tdcWord & 0x7ff); // 11 bits out.fIsRisingEdge = static_cast<uint32_t>((tdcWord >> 11) & 0x1); // 1 bit out.fFine = static_cast<uint32_t>((tdcWord >> 12) & 0x3ff); // 10 bits @@ -310,13 +310,13 @@ namespace cbm::algo return out; } - uint32_t UnpackRich::ProcessEpoch(uint32_t tdcWord) { return static_cast<uint32_t>(tdcWord & 0xfffffff); } + uint32_t Unpack::ProcessEpoch(uint32_t tdcWord) { return static_cast<uint32_t>(tdcWord & 0xfffffff); } - uint16_t UnpackRich::ProcessHeader(uint32_t tdcWord) + uint16_t Unpack::ProcessHeader(uint32_t tdcWord) { return static_cast<uint16_t>(tdcWord & 0xff); //8 bits } - uint16_t UnpackRich::ProcessTrailer(uint32_t tdcWord) { return static_cast<uint16_t>(tdcWord & 0xffff); } + uint16_t Unpack::ProcessTrailer(uint32_t tdcWord) { return static_cast<uint16_t>(tdcWord & 0xffff); } -} /* namespace cbm::algo */ +} // namespace cbm::algo::rich diff --git a/algo/detectors/rich/UnpackRich.h b/algo/detectors/rich/Unpack.h similarity index 83% rename from algo/detectors/rich/UnpackRich.h rename to algo/detectors/rich/Unpack.h index 944660d68780964ec2c4d58f3dd877605937df4d..e668c2b1ffa995b8fb1afe6822f92a623ad0f13f 100644 --- a/algo/detectors/rich/UnpackRich.h +++ b/algo/detectors/rich/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#ifndef UnpackRich_H -#define UnpackRich_H +#ifndef CBM_ALGO_RICH_UNPACK_H +#define CBM_ALGO_RICH_UNPACK_H #include "CbmRichDigi.h" @@ -16,11 +16,11 @@ #include <sstream> #include <utility> -namespace cbm::algo +namespace cbm::algo::rich { - class RichMicrosliceReader; + class MicrosliceReader; - enum class RichTdcWordType + enum class TdcWordType { TimeData, Header, @@ -31,7 +31,7 @@ namespace cbm::algo }; - struct RichTdcTimeData { + struct TdcTimeData { uint32_t fCoarse = 0; // 11 bits uint32_t fIsRisingEdge = 0; // 1 bit uint32_t fFine = 0; // 10 bits @@ -39,33 +39,33 @@ namespace cbm::algo }; - /** @struct UnpackRichElinkPar + /** @struct UnpackElinkPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 26 May 2023 ** @brief RICH Unpacking parameters for one eLink / ASIC **/ - struct UnpackRichElinkPar { + struct UnpackElinkPar { std::vector<double> fToTshift; ///< TOT shift for different channels uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackRichPar + /** @struct UnpackPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 26 May 2023 ** @brief Parameters required for the RICH unpacking (specific to one component) **/ - struct UnpackRichPar { - std::map<uint32_t, UnpackRichElinkPar> fElinkParams = {}; ///< Map TRB address to elink params + struct UnpackPar { + std::map<uint32_t, UnpackElinkPar> fElinkParams = {}; ///< Map TRB address to elink params }; - /** @struct UnpackRichMoni + /** @struct UnpackMonitorData ** @author Dominik Smith <d.smith@gsi.de> ** @since 26 May 2023 ** @brief Monitoring data for RICH unpacking **/ - struct UnpackRichMonitorData { + struct UnpackMonitorData { uint32_t fNumDebugMessage = 0; ///< Received debug messages uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not HEADER uint32_t fNumErrInvalidSecondMessage = 0; ///< Second message is not EPOCH @@ -98,17 +98,17 @@ namespace cbm::algo }; - class UnpackRich { + class Unpack { public: - typedef std::pair<std::vector<CbmRichDigi>, UnpackRichMonitorData> resultType; + typedef std::pair<std::vector<CbmRichDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackRich() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackRich() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -123,23 +123,23 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackRichPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } private: - void ProcessTrbPacket(RichMicrosliceReader& reader); + void ProcessTrbPacket(MicrosliceReader& reader); - void ProcessHubBlock(RichMicrosliceReader& reader); + void ProcessHubBlock(MicrosliceReader& reader); - int ProcessCtsHeader(RichMicrosliceReader& reader, uint32_t subSubEventSize, uint32_t subSubEventId); + int ProcessCtsHeader(MicrosliceReader& reader, uint32_t subSubEventSize, uint32_t subSubEventId); - void ProcessSubSubEvent(RichMicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId); + void ProcessSubSubEvent(MicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId); void ProcessTimeDataWord(uint32_t epoch, uint32_t tdcWord, uint32_t subSubEventId, std::vector<double>& raisingTime); - RichTdcWordType GetTdcWordType(uint32_t tdcWord); + TdcWordType GetTdcWordType(uint32_t tdcWord); - RichTdcTimeData ProcessTimeData(uint32_t tdcWord); + TdcTimeData ProcessTimeData(uint32_t tdcWord); uint32_t ProcessEpoch(uint32_t tdcWord); @@ -156,7 +156,7 @@ namespace cbm::algo bool CheckMaskedDiRICH(int32_t subSubEventId); private: - UnpackRichPar fParams = {}; ///< Parameter container + UnpackPar fParams = {}; ///< Parameter container std::vector<int32_t> fMaskedDiRICHes; @@ -178,11 +178,11 @@ namespace cbm::algo std::vector<CbmRichDigi> fOutputVec = {}; /** @brief Storage of monitoring data. */ - UnpackRichMonitorData fMonitor; + UnpackMonitorData fMonitor; }; - class RichMicrosliceReader { + class MicrosliceReader { private: const uint8_t* fData = nullptr; size_t fSize = 0; @@ -240,6 +240,6 @@ namespace cbm::algo } }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::rich -#endif // UnpackRich_H +#endif // CBM_ALGO_RICH_UNPACK_H diff --git a/algo/detectors/sts/StsHitfinder.cxx b/algo/detectors/sts/Hitfinder.cxx similarity index 99% rename from algo/detectors/sts/StsHitfinder.cxx rename to algo/detectors/sts/Hitfinder.cxx index 05d848a4d2bf779667ec2087c9ea2fdcd69ca270..0ecb4b2154ca9ad260658a60c06348c4ec330043 100644 --- a/algo/detectors/sts/StsHitfinder.cxx +++ b/algo/detectors/sts/Hitfinder.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Felix Weiglhofer [committer], Kilian Hunold */ -#include "StsHitfinder.h" +#include "Hitfinder.h" using namespace cbm::algo; @@ -575,6 +575,9 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const startB = start; #endif + // Temporarily disable clang-format because it indents this block wrongly for some reason. + // TODO: Code above needs cleanup. Then clang-format can be re-enabled too. + // clang-format off GpuClusterIdx clsIdxF = clusterIdxF[iClusterF]; sts::Cluster clsDataF = clusterDataF[clsIdxF.fIdx]; @@ -597,7 +600,7 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const break; } - float timeCut = -1.f; + float timeCut = -1.f; const RecoParams::STS& params = ctx.cmem<Params>().sts; if (params.timeCutClusterAbs > 0.f) timeCut = params.timeCutClusterAbs; else if (params.timeCutClusterSig > 0.f) { @@ -611,6 +614,7 @@ XPU_D void sts::Hitfinder::FindHits(FindHits::context& ctx) const IntersectClusters(iModule, pars, clsIdxF.fTime, clsDataF, clsIdxB.fTime, clsDataB); } } +// clang-format on } XPU_D void sts::Hitfinder::IntersectClusters(int iBlock, const HitfinderCache& pars, uint32_t timeF, diff --git a/algo/detectors/sts/StsHitfinder.h b/algo/detectors/sts/Hitfinder.h similarity index 100% rename from algo/detectors/sts/StsHitfinder.h rename to algo/detectors/sts/Hitfinder.h diff --git a/algo/detectors/sts/StsHitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx similarity index 98% rename from algo/detectors/sts/StsHitfinderChain.cxx rename to algo/detectors/sts/HitfinderChain.cxx index 5fe1579989238a0aacd0c04d2bc26c8aa4c95a26..d49866ef87a72a2fae6797b2e584c5206258b349 100644 --- a/algo/detectors/sts/StsHitfinderChain.cxx +++ b/algo/detectors/sts/HitfinderChain.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Felix Weiglhofer [committer], Kilian Hunold */ -#include "StsHitfinderChain.h" +#include "HitfinderChain.h" #include <log.hpp> #include <numeric> @@ -139,8 +139,8 @@ sts::HitfinderMonitor sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi // Currently we use method one for CPU and GPU. // See sts::Hitfinder::FindHits() for details. // bool isCpu = xpu::device::active().backend() == xpu::cpu; - bool isCpu = false; - xpu::grid findHitsG = isCpu ? xpu::n_blocks(nModules) : xpu::n_threads(nClustersFront); + bool isCpu = false; + xpu::grid findHitsG = isCpu ? xpu::n_blocks(nModules) : xpu::n_threads(nClustersFront); queue.launch<FindHits>(findHitsG); // Transfer Hits / Cluster back to host @@ -216,8 +216,8 @@ void sts::HitfinderChain::AllocateStatic() EnsureParameters(); // Shorthands for common constants - const int nChannels = fPars->nChannels / 2; // Only count channels on one side of the module - const int nModules = fPars->modules.size(); + const int nChannels = fPars->nChannels / 2; // Only count channels on one side of the module + const int nModules = fPars->modules.size(); const int nModuleSides = 2 * nModules; // Number of module front + backsides xpu::queue q; @@ -387,7 +387,7 @@ void sts::HitfinderChain::FlattenDigisSide(DigiMapSide& digis, bool isFront) { EnsureParameters(); - int nModules = fPars->modules.size(); + int nModules = fPars->modules.size(); xpu::h_view pMdigiOffset {fHitfinder.digiOffsetPerModule}; xpu::h_view pDigisFlat {fHitfinder.digisPerModule}; diff --git a/algo/detectors/sts/StsHitfinderChain.h b/algo/detectors/sts/HitfinderChain.h similarity index 99% rename from algo/detectors/sts/StsHitfinderChain.h rename to algo/detectors/sts/HitfinderChain.h index c811a19ab9c91a2c0981e8932b99fb989374465d..dcd0265e9a2eaf313ad593c51e19c6b8e427fd4c 100644 --- a/algo/detectors/sts/StsHitfinderChain.h +++ b/algo/detectors/sts/HitfinderChain.h @@ -14,9 +14,9 @@ #include <optional> #include <vector> -#include "StsHitfinder.h" #include "SubChain.h" #include "gpu/xpu_legacy.h" +#include "sts/Hitfinder.h" #include "sts/HitfinderPars.h" #include "sts/LandauTable.h" diff --git a/algo/detectors/sts/StsReadoutConfigLegacy.cxx b/algo/detectors/sts/ReadoutConfigLegacy.cxx similarity index 98% rename from algo/detectors/sts/StsReadoutConfigLegacy.cxx rename to algo/detectors/sts/ReadoutConfigLegacy.cxx index 3f16d49dbc4e3e3539639d94136b366a5fccb93b..23eab32e2c484bca26134ea1c02dedf5d202c694 100644 --- a/algo/detectors/sts/StsReadoutConfigLegacy.cxx +++ b/algo/detectors/sts/ReadoutConfigLegacy.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese [committer] */ -#include "StsReadoutConfigLegacy.h" +#include "ReadoutConfigLegacy.h" #include "CbmStsAddress.h" @@ -12,22 +12,22 @@ using std::pair; using std::setw; -namespace cbm::algo +namespace cbm::algo::sts { // --- Constructor ------------------------------------------------------------------ - StsReadoutConfigLegacy::StsReadoutConfigLegacy() { Init(); } + ReadoutConfigLegacy::ReadoutConfigLegacy() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - StsReadoutConfigLegacy::~StsReadoutConfigLegacy() {} + ReadoutConfigLegacy::~ReadoutConfigLegacy() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> StsReadoutConfigLegacy::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfigLegacy::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -38,7 +38,7 @@ namespace cbm::algo // --- Number of elinks for a component / equipment ------------------------------- - size_t StsReadoutConfigLegacy::GetNumElinks(uint16_t equipmentId) + size_t ReadoutConfigLegacy::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -49,7 +49,7 @@ namespace cbm::algo // --- Total number of elinks for STS --------------------------------------------- - size_t StsReadoutConfigLegacy::GetNumElinks() + size_t ReadoutConfigLegacy::GetNumElinks() { size_t result = 0; for (auto& entry : fReadoutMap) { @@ -61,7 +61,7 @@ namespace cbm::algo // --- Initialise the mapping structure -------------------------------------------- - void StsReadoutConfigLegacy::Init() + void ReadoutConfigLegacy::Init() { // This here refers to the mCBM 2022 setup. @@ -211,7 +211,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> (address, ASIC) -------------------------------- - pair<int32_t, uint16_t> StsReadoutConfigLegacy::Map(uint16_t equipmentId, uint16_t elinkId) + pair<int32_t, uint16_t> ReadoutConfigLegacy::Map(uint16_t equipmentId, uint16_t elinkId) { std::pair<int32_t, uint16_t> result(-1, 0); auto equipIter = fReadoutMap.find(equipmentId); @@ -224,7 +224,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> vector of walk coefficients ------------------- - std::vector<double> StsReadoutConfigLegacy::WalkMap(int32_t modAddress, uint16_t asic) + std::vector<double> ReadoutConfigLegacy::WalkMap(int32_t modAddress, uint16_t asic) { std::vector<double> result; auto modIter = fWalkMap.find(modAddress); @@ -237,7 +237,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> (vector of mask flags) ------------------------ - std::vector<bool> StsReadoutConfigLegacy::MaskMap(uint16_t equipmentId, uint16_t elinkId) + std::vector<bool> ReadoutConfigLegacy::MaskMap(uint16_t equipmentId, uint16_t elinkId) { std::vector<bool> result; auto equipIter = fMaskMap.find(equipmentId); @@ -252,7 +252,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> adc cut --------------------------------------- - uint32_t StsReadoutConfigLegacy::AdcCutMap(uint16_t equipmentId, uint16_t elinkId) + uint32_t ReadoutConfigLegacy::AdcCutMap(uint16_t equipmentId, uint16_t elinkId) { uint32_t result = 0; auto equipIter = fAdcCutMap.find(equipmentId); @@ -267,7 +267,7 @@ namespace cbm::algo // ----- Print readout map ------------------------------------------------ - std::string StsReadoutConfigLegacy::PrintReadoutMap() + std::string ReadoutConfigLegacy::PrintReadoutMap() { std::stringstream ss; @@ -294,7 +294,7 @@ namespace cbm::algo // --- Init map of masked channels --------------------------------------------- - std::map<size_t, std::unordered_set<uint16_t>> StsReadoutConfigLegacy::BuildMaskSet() + std::map<size_t, std::unordered_set<uint16_t>> ReadoutConfigLegacy::BuildMaskSet() { // Taken from /macro/beamtime/mcbm2022/sts_mask_channels.par std::map<size_t, std::unordered_set<uint16_t>> maskedchans; @@ -338,7 +338,7 @@ namespace cbm::algo // --- Initialise the walk map --------------------------------------------- - void StsReadoutConfigLegacy::InitWalkCoeffs() + void ReadoutConfigLegacy::InitWalkCoeffs() { // Taken from macro/beamtime/mcbm2022/mStsAsicTimeWalk.par fWalkMap[0x10008002].resize(16); @@ -1039,4 +1039,4 @@ namespace cbm::algo -10.714, -11.535, -11.360, -9.831, -9.665, -10.627, -9.878}; } -} /* namespace cbm::algo */ +} // namespace cbm::algo::sts diff --git a/algo/detectors/sts/StsReadoutConfigLegacy.h b/algo/detectors/sts/ReadoutConfigLegacy.h similarity index 89% rename from algo/detectors/sts/StsReadoutConfigLegacy.h rename to algo/detectors/sts/ReadoutConfigLegacy.h index 6691ff01fbb0061df24416d2b213abea0917370b..df7e0bb8878b3a8518f3e53b5a3a54c337f56533 100644 --- a/algo/detectors/sts/StsReadoutConfigLegacy.h +++ b/algo/detectors/sts/ReadoutConfigLegacy.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese [committer] */ -#ifndef ALGO_DETECTORS_STS_StsReadoutConfigLegacy_H -#define ALGO_DETECTORS_STS_StsReadoutConfigLegacy_H +#ifndef ALGO_DETECTORS_STS_ReadoutConfigLegacy_H +#define ALGO_DETECTORS_STS_ReadoutConfigLegacy_H #include <map> #include <sstream> @@ -11,11 +11,11 @@ #include <utility> #include <vector> -namespace cbm::algo +namespace cbm::algo::sts { - /** @class StsReadoutConfigLegacy + /** @class ReadoutConfigLegacy ** @author Volker Friese <v.friese@gsi.de> ** @since 3 March 2022 ** @brief Provides the hardware-to-software address mapping for the CBM-STS @@ -29,15 +29,15 @@ namespace cbm::algo ** NOTE: This class is deprecated. It's replaced by ReadoutConfig in detector/sts. The new class no longer hardcodes the mapping. It can be read from a configuration file instead. **/ - class StsReadoutConfigLegacy { + class ReadoutConfigLegacy { public: /** @brief Constructor **/ - StsReadoutConfigLegacy(); + ReadoutConfigLegacy(); /** @brief Destructor **/ - virtual ~StsReadoutConfigLegacy(); + virtual ~ReadoutConfigLegacy(); /** @brief Equipment in the configuration @@ -62,12 +62,12 @@ namespace cbm::algo /** @brief API: Mapping from component and elink to channel mask flags ** @param equipId Equipment identifier (component) ** @param elink Elink number within component - ** @return (vector of mask flags for channels per asic) + ** @return (vector of mask flags for channels per asic) */ std::vector<bool> MaskMap(uint16_t equipId, uint16_t elink); - /** @brief API: Mapping from module address and ASIC number to walk coefficients. + /** @brief API: Mapping from module address and ASIC number to walk coefficients. ** @param modAddress module address ** @param asic ASIC number within module ** @return std::vector<double> of walk coefficients @@ -122,6 +122,6 @@ namespace cbm::algo std::map<size_t, std::unordered_set<uint16_t>> BuildMaskSet(); }; -} /* namespace cbm::algo */ +} /* namespace cbm::algo::sts */ -#endif /* ALGO_DETECTORS_STS_StsReadoutConfigLegacy_H_ */ +#endif /* ALGO_DETECTORS_STS_ReadoutConfigLegacy_H_ */ diff --git a/algo/detectors/sts/StsUnpackChain.h b/algo/detectors/sts/StsUnpackChain.h deleted file mode 100644 index c004363b2b08b5a24cc2aeebbfb1c5af53865294..0000000000000000000000000000000000000000 --- a/algo/detectors/sts/StsUnpackChain.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2022 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main - SPDX-License-Identifier: GPL-3.0-only - Authors: Felix Weiglhofer [committer]*/ -#ifndef CBM_ALGO_DETECTORS_STS_UNPACKCHAIN_H -#define CBM_ALGO_DETECTORS_STS_UNPACKCHAIN_H - -#include <optional> -#include <unordered_map> -#include <vector> - -#include <xpu/defines.h> -#include <yaml-cpp/yaml.h> - -#include "Definitions.h" -#include "ReadoutConfig.h" -#include "SubChain.h" -#include "UnpackSts.h" - -class CbmStsDigi; -namespace fles -{ - class Timeslice; -} - -namespace cbm::algo::sts -{ - - class UnpackChain : public SubChain { - - public: - void Init(sts::ReadoutConfig config); - std::vector<CbmStsDigi> Run(const fles::Timeslice& ts); - - private: - std::unordered_map<u16, UnpackSts> fAlgoSts; - std::optional<sts::ReadoutConfig> fConfig; - }; - -} // namespace cbm::algo::sts - -#endif // CBM_ALGO_DETECTORS_STS_UNPACKCHAIN_H diff --git a/algo/detectors/sts/UnpackSts.cxx b/algo/detectors/sts/Unpack.cxx similarity index 89% rename from algo/detectors/sts/UnpackSts.cxx rename to algo/detectors/sts/Unpack.cxx index c340d932ca9bdce1fca04952b3226211b9e16848..825bdd1ee1b7aeec740fe330d7d9e5b3234fab21 100644 --- a/algo/detectors/sts/UnpackSts.cxx +++ b/algo/detectors/sts/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Volker Friese [committer] */ -#include "UnpackSts.h" +#include "Unpack.h" #include <cassert> #include <utility> @@ -15,12 +15,12 @@ using std::unique_ptr; using std::vector; -namespace cbm::algo +namespace cbm::algo::sts { // ---- Algorithm execution --------------------------------------------- - UnpackSts::resultType UnpackSts::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data resultType result = {}; @@ -95,8 +95,8 @@ namespace cbm::algo // ----- Process hit message -------------------------------------------- - inline void UnpackSts::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, - vector<CbmStsDigi>& digiVec, UnpackStsMonitorData& monitor) const + inline void Unpack::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, + vector<CbmStsDigi>& digiVec, UnpackMonitorData& monitor) const { // --- Check eLink and get parameters @@ -105,8 +105,8 @@ namespace cbm::algo monitor.fNumErrElinkOutOfRange++; return; } - const UnpackStsElinkPar& elinkPar = fParams.fElinkParams.at(elink); - uint32_t asicNr = elinkPar.fAsicNr; + const UnpackElinkPar& elinkPar = fParams.fElinkParams.at(elink); + uint32_t asicNr = elinkPar.fAsicNr; // --- Check minimum adc cut if (message.GetHitAdc() <= elinkPar.fAdcMinCut) { return; } @@ -153,7 +153,7 @@ namespace cbm::algo // ----- Process an epoch (TS_MSB) message ------------------------------ - inline void UnpackSts::ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const + inline void Unpack::ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const { // The compression of time is based on the hierarchy epoch cycle - epoch - message time. // Cycles are counted from the start of Unix time and are multiples of an epoch (ts_msb). @@ -177,4 +177,4 @@ namespace cbm::algo // -------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::sts diff --git a/algo/detectors/sts/UnpackSts.h b/algo/detectors/sts/Unpack.h similarity index 86% rename from algo/detectors/sts/UnpackSts.h rename to algo/detectors/sts/Unpack.h index 63183224071933c8c6e124a595b71a70d02fcc8c..a7578227ab8490927447d789de0a2b13cd262a8e 100644 --- a/algo/detectors/sts/UnpackSts.h +++ b/algo/detectors/sts/Unpack.h @@ -19,7 +19,7 @@ #include "Definitions.h" #include "StsXyterMessage.h" -namespace cbm::algo +namespace cbm::algo::sts { @@ -28,7 +28,7 @@ namespace cbm::algo ** @since 25 November 2021 ** @brief STS Unpacking parameters for one eLink / ASIC **/ - struct UnpackStsElinkPar { + struct UnpackElinkPar { int32_t fAddress = 0; ///< CbmStsAddress for the connected module uint32_t fAsicNr = 0; ///< Number of connected ASIC within the module uint64_t fTimeOffset = 0.; ///< Time calibration parameter @@ -45,10 +45,10 @@ namespace cbm::algo ** @since 25 November 2021 ** @brief Parameters required for the STS unpacking (specific to one component) **/ - struct UnpackStsPar { - uint32_t fNumChansPerAsic = 0; ///< Number of channels per ASIC - uint32_t fNumAsicsPerModule = 0; ///< Number of ASICS per module - std::vector<UnpackStsElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackPar { + uint32_t fNumChansPerAsic = 0; ///< Number of channels per ASIC + uint32_t fNumAsicsPerModule = 0; ///< Number of ASICS per module + std::vector<UnpackElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; @@ -57,7 +57,7 @@ namespace cbm::algo ** @since 2 December 2021 ** @brief Monitoring data for STS unpacking **/ - struct UnpackStsMonitorData { + struct UnpackMonitorData { uint32_t fNumNonHitOrTsbMessage = 0; uint32_t fNumErrElinkOutOfRange = 0; ///< Elink not contained in parameters uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not TS_MSB or second is not EPOCH @@ -84,18 +84,18 @@ namespace cbm::algo ** @since 25 November 2021 ** @brief Unpack algorithm for STS **/ - class UnpackSts { + class Unpack { public: - typedef std::pair<std::vector<CbmStsDigi>, UnpackStsMonitorData> resultType; + typedef std::pair<std::vector<CbmStsDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackSts() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackSts() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -110,7 +110,7 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackStsPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } private: // types /** @@ -130,7 +130,7 @@ namespace cbm::algo ** @param monitor Reference to monitor object **/ void ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, std::vector<CbmStsDigi>& digiVec, - UnpackStsMonitorData& monitor) const; + UnpackMonitorData& monitor) const; /** @brief Process an epoch message (TS_MSB) ** @param message SMX message (32-bit word) @@ -138,8 +138,8 @@ namespace cbm::algo void ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const; - private: // members - UnpackStsPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container /** Number of TS_MSB epochs per cycle **/ static constexpr uint64_t fkEpochsPerCycle = stsxyter::kuTsMsbNbTsBinsBinning; @@ -156,6 +156,6 @@ namespace cbm::algo }; -} /* namespace cbm::algo */ +} /* namespace cbm::algo::sts */ #endif /* CBM_ALGO_UNPACKSTS_H */ diff --git a/algo/detectors/sts/UnpackStsXpu.cxx b/algo/detectors/sts/UnpackStsXpu.cxx index 6c6b10b467db0d7af0cda2586ed19b54b91e4a4b..40fee8d82d40cacac71d060ec03a5812511d3787 100644 --- a/algo/detectors/sts/UnpackStsXpu.cxx +++ b/algo/detectors/sts/UnpackStsXpu.cxx @@ -95,7 +95,7 @@ XPU_KERNEL(cbm::algo::UnpackK, xpu::no_smem, UnpackStsXpuPar* params, UnpackStsX namespace cbm::algo { // ---- Algorithm execution --------------------------------------------- - UnpackStsXpu::resultType UnpackStsXpu::operator()(const fles::Timeslice* ts, StsReadoutConfigLegacy& config) + UnpackStsXpu::resultType UnpackStsXpu::operator()(const fles::Timeslice* ts, sts::ReadoutConfigLegacy& config) { // --- Output data resultType result = {}; diff --git a/algo/detectors/sts/UnpackStsXpu.h b/algo/detectors/sts/UnpackStsXpu.h index d021fbee866292309a4214b1342f7eb424bb36db..66ab4006a0876dc07a03b8926998334fb85dc5cb 100644 --- a/algo/detectors/sts/UnpackStsXpu.h +++ b/algo/detectors/sts/UnpackStsXpu.h @@ -20,7 +20,7 @@ #include <xpu/device.h> #include <xpu/host.h> -#include "StsReadoutConfigLegacy.h" +#include "ReadoutConfigLegacy.h" #include "StsXyterMessage.h" #include "gpu/DeviceImage.h" #include "gpu/xpu_legacy.h" @@ -104,7 +104,7 @@ namespace cbm::algo ** @param config Configuration data ** @return STS digi data **/ - resultType operator()(const fles::Timeslice* ts, StsReadoutConfigLegacy& config); + resultType operator()(const fles::Timeslice* ts, sts::ReadoutConfigLegacy& config); //Stores parameter structs for all elinks xpu::hd_buffer<UnpackStsXpuElinkPar> fElinkParams; diff --git a/algo/detectors/tof/TofConfig.h b/algo/detectors/tof/Config.h similarity index 80% rename from algo/detectors/tof/TofConfig.h rename to algo/detectors/tof/Config.h index 01d888152f1072902a9c8736c691573a567e0610..34e69400ab5c758f66fd1b752ef7d9281c8b7a4c 100644 --- a/algo/detectors/tof/TofConfig.h +++ b/algo/detectors/tof/Config.h @@ -2,21 +2,20 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef CBM_ALGO_TOFCONFIG -#define CBM_ALGO_TOFCONFIG 1 +#ifndef CBM_ALGO_TOF_CONFIG +#define CBM_ALGO_TOF_CONFIG 1 #include <cstdint> -namespace cbm::algo +namespace cbm::algo::tof { - /** @class TofConfig - ** @author Dominik Smith <d.smith@gsi.de> - -** @since 2022 - ** @brief - ** - **/ - class TofConfig { + /** @class Config + ** @author Dominik Smith <d.smith@gsi.de> + ** @since 2022 + ** @brief + ** + **/ + class Config { public: static uint32_t GetTofTrackingStation(const uint32_t smType, const uint32_t sm, const uint32_t rpc) @@ -45,6 +44,6 @@ namespace cbm::algo return 0; } }; -} // namespace cbm::algo +} // namespace cbm::algo::tof -#endif /* CBM_ALGO_TOFCONFIG */ +#endif /* CBM_ALGO_TOF_CONFIG */ diff --git a/algo/detectors/tof/HitFinderTof.cxx b/algo/detectors/tof/HitFinder.cxx similarity index 88% rename from algo/detectors/tof/HitFinderTof.cxx rename to algo/detectors/tof/HitFinder.cxx index 8ff2770ffc45dce093ccaac42dfae834477dc6f7..a784900be8e73dbfdbbe805e437c1fc0497c0ba7 100644 --- a/algo/detectors/tof/HitFinderTof.cxx +++ b/algo/detectors/tof/HitFinder.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer], Pierre-Alain Loizeau */ -#include "HitFinderTof.h" +#include "HitFinder.h" // TOF Classes and includes #include "CbmTofDigi.h" @@ -11,27 +11,26 @@ #include <iomanip> #include <iostream> -namespace cbm::algo +namespace cbm::algo::tof { - HitFinderTof::resultType HitFinderTof::operator()(std::vector<CbmTofDigi> digisIn, - const std::vector<int32_t>& digiIndexIn) + HitFinder::resultType HitFinder::operator()(std::vector<CbmTofDigi> digisIn, const std::vector<int32_t>& digiIndexIn) { inputType input = calibrateDigis(digisIn, digiIndexIn); return buildClusters(input); } - HitFinderTof::resultType HitFinderTof::buildClusters(inputType& input) + HitFinder::resultType HitFinder::buildClusters(inputType& input) { // Intermediate storage variables std::vector<std::vector<CbmTofDigi*>>& digisExp = input.first; //[nbCh][nDigis] std::vector<std::vector<int32_t>>& digisInd = input.second; //[nbCh][nDigis] // Hit variables - TofCluster cluster; - std::vector<TofCluster> clustersOut; + Cluster cluster; + std::vector<Cluster> clustersOut; // Reference cell of a cluster - TofCell* trafoCell = nullptr; + Cell* trafoCell = nullptr; int32_t iTrafoCell = -1; // Last Channel Temp variables @@ -46,7 +45,7 @@ namespace cbm::algo std::vector<CbmTofDigi*>& storDigiExp = digisExp[chan]; std::vector<int32_t>& storDigiInd = digisInd[chan]; - HitFinderTofChanPar& chanPar = fParams.fChanPar[chan]; + HitFinderChanPar& chanPar = fParams.fChanPar[chan]; auto digiExpIt = storDigiExp.begin(); auto digiIndIt = storDigiInd.begin(); @@ -61,9 +60,9 @@ namespace cbm::algo } if (2 > std::distance(digiExpIt, storDigiExp.end())) break; // 2 Digis = both sides present - TofCell* channelInfo = &chanPar.cell; - CbmTofDigi* xDigiA = *digiExpIt; - CbmTofDigi* xDigiB = *std::next(digiExpIt, 1); + Cell* channelInfo = &chanPar.cell; + CbmTofDigi* xDigiA = *digiExpIt; + CbmTofDigi* xDigiB = *std::next(digiExpIt, 1); // The "Strip" time is the mean time between each end const double time = 0.5 * (xDigiA->GetTime() + xDigiB->GetTime()); @@ -134,8 +133,8 @@ namespace cbm::algo return clustersOut; } - HitFinderTof::inputType HitFinderTof::calibrateDigis(std::vector<CbmTofDigi>& digisIn, - const std::vector<int32_t>& digiIndexIn) + HitFinder::inputType HitFinder::calibrateDigis(std::vector<CbmTofDigi>& digisIn, + const std::vector<int32_t>& digiIndexIn) { inputType result; std::vector<std::vector<CbmTofDigi*>>& digisExp = result.first; //[nbCh][nDigis] @@ -188,4 +187,4 @@ namespace cbm::algo } return result; } -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof diff --git a/algo/detectors/tof/HitFinderTof.h b/algo/detectors/tof/HitFinder.h similarity index 87% rename from algo/detectors/tof/HitFinderTof.h rename to algo/detectors/tof/HitFinder.h index 06975c7c422c297a044b15471857ef751ced8043..8a8fc9bdbbf728e5e48ab5cd740e5cc85e0e4000 100644 --- a/algo/detectors/tof/HitFinderTof.h +++ b/algo/detectors/tof/HitFinder.h @@ -4,15 +4,15 @@ /* This algo was based on CbmTofSimpClusterizer, which can be used only for simulation of the main setup and - is as the name implies a simplified solution. - A later step will be the replacement with a version based on CbmTofEventClusterizer, which is the version - currently maintained, based on what we learned from real data at mCBM. - This step will be required to apply the algo to real/online data and to prepare + is as the name implies a simplified solution. + A later step will be the replacement with a version based on CbmTofEventClusterizer, which is the version + currently maintained, based on what we learned from real data at mCBM. + This step will be required to apply the algo to real/online data and to prepare our simulations for first CBM beam */ -#ifndef HITFINDERTOF_H -#define HITFINDERTOF_H +#ifndef CBM_ALGO_TOF_HITFINDER_H +#define CBM_ALGO_TOF_HITFINDER_H // TOF Classes and includes class CbmTofDigi; @@ -27,23 +27,23 @@ class CbmTofDigi; #include <cmath> -namespace cbm::algo +namespace cbm::algo::tof { - struct TofCell { + struct Cell { double sizeX, sizeY; ROOT::Math::XYZVector pos; ROOT::Math::Rotation3D rotation; }; - struct HitFinderTofChanPar { + struct HitFinderChanPar { std::vector<double> fvCPTOff; //[nbSide] std::vector<double> fvCPTotGain; //[nbSide] std::vector<std::vector<double>> fvCPWalk; //[nbSide][nbWalkBins] int32_t address; //unique address - TofCell cell; + Cell cell; }; - struct HitFinderTofRpcPar { + struct HitFinderRpcPar { double FeeTimeRes; double SysTimeRes; double CPSigPropSpeed; @@ -55,10 +55,10 @@ namespace cbm::algo double gapSize; int32_t numGaps; int32_t numClWalkBinX; - std::vector<HitFinderTofChanPar> fChanPar = {}; + std::vector<HitFinderChanPar> fChanPar = {}; }; - struct TofCluster { + struct Cluster { //temporary values std::vector<int32_t> vDigiIndRef; ROOT::Math::XYZVector weightedPos = ROOT::Math::XYZVector(0.0, 0.0, 0.0); @@ -111,7 +111,7 @@ namespace cbm::algo weightedTimeErr = timeErr; } - void finalize(const TofCell& trafoCell, const int32_t iTrafoCell, const HitFinderTofRpcPar& par) + void finalize(const Cell& trafoCell, const int32_t iTrafoCell, const HitFinderRpcPar& par) { // prepare local->global trafo ROOT::Math::Rotation3D rotMatrix = trafoCell.rotation; @@ -139,20 +139,20 @@ namespace cbm::algo } }; - class HitFinderTof { + class HitFinder { public: - typedef std::vector<TofCluster> resultType; + typedef std::vector<Cluster> resultType; typedef std::pair<std::vector<std::vector<CbmTofDigi*>>, std::vector<std::vector<int32_t>>> inputType; /** ** @brief Constructor. **/ - HitFinderTof() {}; + HitFinder() {}; /** ** @brief Destructor. **/ - ~HitFinderTof() {}; + ~HitFinder() {}; /** ** @brief Build clusters out of ToF Digis and store the resulting info in a TofHit. @@ -162,10 +162,10 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Vectorer to parameter container **/ - void SetParams(std::unique_ptr<HitFinderTofRpcPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<HitFinderRpcPar> params) { fParams = *(std::move(params)); } private: - HitFinderTofRpcPar fParams = {}; ///< Parameter container + HitFinderRpcPar fParams = {}; ///< Parameter container inputType calibrateDigis(std::vector<CbmTofDigi>& digisIn, const std::vector<int32_t>& digiIndexIn); resultType buildClusters(inputType& input); @@ -173,6 +173,6 @@ namespace cbm::algo int32_t numSameSide; // Digis quality }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof -#endif // HITFINDERTOF_H +#endif // CBM_ALGO_TOF_HITFINDER_H diff --git a/algo/detectors/tof/TofReadoutConfig.cxx b/algo/detectors/tof/ReadoutConfig.cxx similarity index 93% rename from algo/detectors/tof/TofReadoutConfig.cxx rename to algo/detectors/tof/ReadoutConfig.cxx index 0682bc4252db7d7fc417e0f898dc9723f45904ad..d519b7d547ce1647a15921c3f461c3d343bffcae 100644 --- a/algo/detectors/tof/TofReadoutConfig.cxx +++ b/algo/detectors/tof/ReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "TofReadoutConfig.h" +#include "ReadoutConfig.h" #include "CbmTofAddress.h" @@ -14,18 +14,18 @@ using namespace std; -namespace cbm::algo +namespace cbm::algo::tof { // --- Constructor ------------------------------------------------------------------ - TofReadoutConfig::TofReadoutConfig() { Init(); } + ReadoutConfig::ReadoutConfig() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - TofReadoutConfig::~TofReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> TofReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -35,7 +35,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Number of elinks for a component / equipment ------------------------------- - size_t TofReadoutConfig::GetNumElinks(uint16_t equipmentId) + size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -46,7 +46,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> address[channel] ------------------------------ - std::vector<uint32_t> TofReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) + std::vector<uint32_t> ReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) { std::vector<uint32_t> result; auto equipIter = fReadoutMap.find(equipmentId); @@ -57,7 +57,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------------------ - void TofReadoutConfig::Init() + void ReadoutConfig::Init() { // This here refers to the mCBM 2022 setup. // Taken from CbmMcbm2018TofPar in combination with macro/beamtime/mcbm2022/mTofCriParNickel.par @@ -91,7 +91,7 @@ namespace cbm::algo } //# component } - int32_t TofReadoutConfig::ElinkIdxToGet4Idx(uint32_t elink) + int32_t ReadoutConfig::ElinkIdxToGet4Idx(uint32_t elink) { if (gdpbv100::kuChipIdMergedEpoch == elink) return elink; else if (elink < numElinksPerComp) @@ -106,7 +106,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- - int32_t TofReadoutConfig::Get4ChanToPadiChan(uint32_t channelInFee) + int32_t ReadoutConfig::Get4ChanToPadiChan(uint32_t channelInFee) { if (channelInFee < numChanPerFeb) return asic2PadI[channelInFee]; else { @@ -118,7 +118,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMap() + void ReadoutConfig::BuildChannelsUidMap() { uint32_t uNrOfGet4 = numComp * numFebsPerComp * numAsicsPerFeb; uint32_t uNrOfChannels = uNrOfGet4 * numChanPerAsic; @@ -190,7 +190,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapCbm(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapCbm(uint32_t& uCh, uint32_t uGbtx) { L_(debug) << " Map mTof box " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; if (rpcSide[uGbtx] < 2) { // mTof modules @@ -218,7 +218,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapStar(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapStar(uint32_t& uCh, uint32_t uGbtx) { if (rpcSide[uGbtx] < 2) { // mTof modules @@ -246,7 +246,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapCern(uint32_t& uCh, uint32_t) + void ReadoutConfig::BuildChannelsUidMapCern(uint32_t& uCh, uint32_t) { L_(debug) << " Map CERN 20 gap at GBTX - uCh = " << uCh; // clang-format off @@ -272,7 +272,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapCera(uint32_t& uCh, uint32_t) + void ReadoutConfig::BuildChannelsUidMapCera(uint32_t& uCh, uint32_t) { int32_t iModuleId = 0; int32_t iModuleType = 8; @@ -286,7 +286,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapStar2(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapStar2(uint32_t& uCh, uint32_t uGbtx) { L_(debug) << " Map Star2 box " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; const int32_t iRpc[5] = {1, -1, 1, 0, 0}; @@ -344,7 +344,7 @@ namespace cbm::algo // ------------------------------------------------------------------------- - void TofReadoutConfig::BuildChannelsUidMapBuc(uint32_t& uCh, uint32_t uGbtx) + void ReadoutConfig::BuildChannelsUidMapBuc(uint32_t& uCh, uint32_t uGbtx) { L_(debug) << " Map Buc box " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; @@ -462,4 +462,4 @@ namespace cbm::algo } // ------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof diff --git a/algo/detectors/tof/TofReadoutConfig.h b/algo/detectors/tof/ReadoutConfig.h similarity index 93% rename from algo/detectors/tof/TofReadoutConfig.h rename to algo/detectors/tof/ReadoutConfig.h index 2c648ad21638acedf8ba07ee135abeecbba3386b..3d9e85e9a5d8e9f6fb8dfbe0ac5522944ffeccd7 100644 --- a/algo/detectors/tof/TofReadoutConfig.h +++ b/algo/detectors/tof/ReadoutConfig.h @@ -2,24 +2,24 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef ALGO_DETECTORS_TOF_TOFREADOUTCONFIG_H -#define ALGO_DETECTORS_TOF_TOFREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_TOF_READOUTCONFIG_H +#define ALGO_DETECTORS_TOF_READOUTCONFIG_H #include <cstddef> #include <cstdint> #include <map> #include <vector> -namespace cbm::algo +namespace cbm::algo::tof { - class TofReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - TofReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~TofReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration ** @return Vector of equipment IDs @@ -99,6 +99,6 @@ namespace cbm::algo void BuildChannelsUidMapBuc(uint32_t& uCh, uint32_t uGbtx); }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof -#endif //ALGO_DETECTORS_TOF_TOFREADOUTCONFIG_H +#endif //ALGO_DETECTORS_TOF_READOUTCONFIG_H diff --git a/algo/detectors/tof/UnpackTof.cxx b/algo/detectors/tof/Unpack.cxx similarity index 87% rename from algo/detectors/tof/UnpackTof.cxx rename to algo/detectors/tof/Unpack.cxx index 7bd71d827e0d120655db0250f52e27a68beb421e..0add702750f3998d5ec50e9dcada478997d8500a 100644 --- a/algo/detectors/tof/UnpackTof.cxx +++ b/algo/detectors/tof/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "UnpackTof.h" +#include "Unpack.h" #include <cassert> #include <utility> @@ -13,12 +13,12 @@ using std::unique_ptr; using std::vector; -namespace cbm::algo +namespace cbm::algo::tof { // ---- Algorithm execution --------------------------------------------- - UnpackTof::resultType UnpackTof::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -104,8 +104,8 @@ namespace cbm::algo // ----- Process hit message -------------------------------------------- - inline void UnpackTof::ProcessHitMessage(const critof001::Message& message, vector<CbmTofDigi>& digiVec, - UnpackTofMonitorData& monitor, TimeSpec& time) const + inline void Unpack::ProcessHitMessage(const critof001::Message& message, vector<CbmTofDigi>& digiVec, + UnpackMonitorData& monitor, TimeSpec& time) const { // --- Check eLink and get parameters const uint32_t elink = message.getGet4Idx(); @@ -113,7 +113,7 @@ namespace cbm::algo monitor.fNumErrElinkOutOfRange++; return; } - const UnpackTofElinkPar& elinkPar = fParams.fElinkParams.at(elink); + const UnpackElinkPar& elinkPar = fParams.fElinkParams.at(elink); const uint32_t channel = message.getGdpbHitChanId(); const uint32_t channelUId = (elinkPar.fChannelUId)[channel]; @@ -128,7 +128,7 @@ namespace cbm::algo // ----- Process an epoch message --------------------------------------- - inline void UnpackTof::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const + inline void Unpack::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const { const uint64_t epoch = message.getGdpbEpEpochNb(); @@ -142,4 +142,4 @@ namespace cbm::algo // -------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof diff --git a/algo/detectors/tof/UnpackTof.h b/algo/detectors/tof/Unpack.h similarity index 81% rename from algo/detectors/tof/UnpackTof.h rename to algo/detectors/tof/Unpack.h index b6e9ff1a7f163d7a90a289738f31941db09e8d98..c39ba8d77dc33bdcd1d46d4c68134692d2040d26 100644 --- a/algo/detectors/tof/UnpackTof.h +++ b/algo/detectors/tof/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACKTOF_H -#define CBM_ALGO_UNPACKTOF_H 1 +#ifndef CBM_ALGO_TOF_UNPACK_H +#define CBM_ALGO_TOF_UNPACK_H 1 #include "CbmTofDigi.h" @@ -21,34 +21,34 @@ #include "CriGet4Mess001.h" #include "Definitions.h" -namespace cbm::algo +namespace cbm::algo::tof { - /** @struct UnpackTofElinkPar + /** @struct UnpackElinkPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief TOF Unpacking parameters for one eLink / ASIC **/ - struct UnpackTofElinkPar { + struct UnpackElinkPar { std::vector<uint32_t> fChannelUId; ///< CbmTofAddress for different channels uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackTofPar + /** @struct UnpackPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Parameters required for the STS unpacking (specific to one component) **/ - struct UnpackTofPar { - std::vector<UnpackTofElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackPar { + std::vector<UnpackElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; - /** @struct UnpackTofMoni + /** @struct UnpackMoni ** @author Volker Friese <v.friese@gsi.de> ** @since 2 December 2021 ** @brief Monitoring data for STS unpacking **/ - struct UnpackTofMonitorData { + struct UnpackMonitorData { uint32_t fNumNonHitOrTsbMessage = 0; uint32_t fNumErrElinkOutOfRange = 0; ///< Elink not contained in parameters uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not EPOCH @@ -73,22 +73,22 @@ namespace cbm::algo } }; - /** @class UnpackTof + /** @class Unpack ** @author Pierre-Alain Loizeau <p.-a.loizeau@gsi.de> ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Unpack algorithm for STS **/ - class UnpackTof { + class Unpack { public: - typedef std::pair<std::vector<CbmTofDigi>, UnpackTofMonitorData> resultType; + typedef std::pair<std::vector<CbmTofDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackTof() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackTof() {}; + ~Unpack() {}; /** @brief Algorithm execution ** @param msContent Microslice payload @@ -102,7 +102,7 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackTofPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } private: // types struct TimeSpec { @@ -117,17 +117,17 @@ namespace cbm::algo ** @param monitor Reference to monitor object **/ void ProcessHitMessage(const critof001::Message& message, std::vector<CbmTofDigi>& digiVec, - UnpackTofMonitorData& monitor, TimeSpec& time) const; + UnpackMonitorData& monitor, TimeSpec& time) const; /** @brief Process an epoch message ** @param message SMX message (32-bit word) **/ void ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const; - private: // members - UnpackTofPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::tof -#endif /* CBM_ALGO_UNPACKTOF_H */ +#endif /* CBM_ALGO_TOF_UNPACK_H */ diff --git a/algo/detectors/trd/TrdReadoutConfig.cxx b/algo/detectors/trd/ReadoutConfig.cxx similarity index 86% rename from algo/detectors/trd/TrdReadoutConfig.cxx rename to algo/detectors/trd/ReadoutConfig.cxx index f3d54987e8b6509f4ea96a9a5a4b876c3c71d7e9..1a462bbfa44859f309637b87e875a8b4bfc9747d 100644 --- a/algo/detectors/trd/TrdReadoutConfig.cxx +++ b/algo/detectors/trd/ReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese [committer] */ -#include "TrdReadoutConfig.h" +#include "ReadoutConfig.h" //#include "CbmTrdAddress.h" @@ -14,22 +14,22 @@ using std::pair; using std::setw; -namespace cbm::algo +namespace cbm::algo::trd { // --- Constructor ------------------------------------------------------------------ - TrdReadoutConfig::TrdReadoutConfig() {} + ReadoutConfig::ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - TrdReadoutConfig::~TrdReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> TrdReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -40,7 +40,7 @@ namespace cbm::algo // --- Number of Crobs for a component / equipment ------------------------------- - size_t TrdReadoutConfig::GetNumCrobs(uint16_t equipmentId) + size_t ReadoutConfig::GetNumCrobs(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -51,7 +51,7 @@ namespace cbm::algo // --- Number of Elinks for a component / equipment, crob pair --------------------- - size_t TrdReadoutConfig::GetNumElinks(uint16_t equipmentId, uint16_t crobId) + size_t ReadoutConfig::GetNumElinks(uint16_t equipmentId, uint16_t crobId) { size_t result = 0; if (crobId < GetNumCrobs(equipmentId)) result = fReadoutMap[equipmentId][crobId].size(); @@ -61,9 +61,8 @@ namespace cbm::algo // --- Initialise the mapping structure -------------------------------------------- - void - TrdReadoutConfig::Init(const std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>& addressMap, - std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>>& channelMap) + void ReadoutConfig::Init(const std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>& addressMap, + std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, size_t>>>>& channelMap) { // Constructing the map (equipmentId, crobId, eLink) -> (ASIC address) for (auto compMap : addressMap) { @@ -113,8 +112,7 @@ namespace cbm::algo // --- Mapping (equimentId, crobId, elink) -> (ASIC address, channel addresses) ----- - std::pair<int32_t, std::vector<uint32_t>> TrdReadoutConfig::Map(uint16_t equipmentId, uint16_t crobId, - uint16_t elinkId) + std::pair<int32_t, std::vector<uint32_t>> ReadoutConfig::Map(uint16_t equipmentId, uint16_t crobId, uint16_t elinkId) { std::pair<int32_t, std::vector<uint32_t>> result; result.first = -1; @@ -133,7 +131,7 @@ namespace cbm::algo // ----- Print readout map ------------------------------------------------ - std::string TrdReadoutConfig::PrintReadoutMap() + std::string ReadoutConfig::PrintReadoutMap() { std::stringstream ss; for (auto compMap : fReadoutMap) { @@ -165,4 +163,4 @@ namespace cbm::algo // ---------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd diff --git a/algo/detectors/trd/TrdReadoutConfig.h b/algo/detectors/trd/ReadoutConfig.h similarity index 89% rename from algo/detectors/trd/TrdReadoutConfig.h rename to algo/detectors/trd/ReadoutConfig.h index 62d6ec558b4f6b2ed56f254756cd7ad526aba559..bd927bb03e542d42b26adc2e669dad684d71b9c0 100644 --- a/algo/detectors/trd/TrdReadoutConfig.h +++ b/algo/detectors/trd/ReadoutConfig.h @@ -2,19 +2,19 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese [committer] */ -#ifndef ALGO_DETECTORS_TRD_TRDREADOUTCONFIG_H -#define ALGO_DETECTORS_TRD_TRDREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_TRD_READOUTCONFIG_H +#define ALGO_DETECTORS_TRD_READOUTCONFIG_H #include <map> #include <sstream> #include <utility> #include <vector> -namespace cbm::algo +namespace cbm::algo::trd { - /** @class TrdReadoutConfig + /** @class ReadoutConfig ** @author Volker Friese <v.friese@gsi.de> ** @since 3 March 2022 ** @brief Provides the hardware-to-software address mapping for the CBM-TRD @@ -26,15 +26,15 @@ namespace cbm::algo ** The mapping of the two address spaces is hard-coded in this class. **/ - class TrdReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - TrdReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~TrdReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration @@ -85,6 +85,6 @@ namespace cbm::algo std::map<uint16_t, std::vector<std::vector<std::vector<uint32_t>>>> fChannelMap = {}; //! }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd -#endif /* ALGO_DETECTORS_TRD_TRDREADOUTCONFIG_H_ */ +#endif /* ALGO_DETECTORS_TRD_READOUTCONFIG_H_ */ diff --git a/algo/detectors/trd/UnpackTrd.cxx b/algo/detectors/trd/Unpack.cxx similarity index 92% rename from algo/detectors/trd/UnpackTrd.cxx rename to algo/detectors/trd/Unpack.cxx index ed9fe1ee0a5922938b95d9fa9fe6935d7b1dccad..d16208fd22d8ef5e33511ec25e6a54af666bcb4b 100644 --- a/algo/detectors/trd/UnpackTrd.cxx +++ b/algo/detectors/trd/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#include "UnpackTrd.h" +#include "Unpack.h" #include <algorithm> #include <cassert> @@ -10,12 +10,12 @@ using std::unique_ptr; -namespace cbm::algo +namespace cbm::algo::trd { // ---- Algorithm execution --------------------------------------------- - UnpackTrd::resultType UnpackTrd::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) { // --- Output data resultType result = {}; @@ -207,7 +207,7 @@ namespace cbm::algo // -------------------------------------------------------------------------- // ---- digestBufInfoFlags ---- - Spadic::MsInfoType UnpackTrd::digestBufInfoFlags(const std::uint32_t frame) + Spadic::MsInfoType Unpack::digestBufInfoFlags(const std::uint32_t frame) { auto flag = (frame >> 15) & 0x3; Spadic::MsInfoType infotype; @@ -218,7 +218,7 @@ namespace cbm::algo } // ---- digestInfoMsg ---- - void UnpackTrd::digestInfoMsg(const std::uint32_t frame) + void Unpack::digestInfoMsg(const std::uint32_t frame) { /// Save info message if needed. //if (fOptOutBVec) { fOptOutBVec->emplace_back(std::make_pair(fLastFulltime, frame)); } @@ -227,7 +227,7 @@ namespace cbm::algo } // ---- digestInfoMsg ---- - void UnpackTrd::digestMsFlags(const std::uint16_t flags, UnpackTrdMonitorData& monitor) + void Unpack::digestMsFlags(const std::uint16_t flags, UnpackMonitorData& monitor) { if (flags & static_cast<std::uint16_t>(fles::MicrosliceFlags::CrcValid)) { monitor.fNumCrcValidFlags++; } if (flags & static_cast<std::uint16_t>(fles::MicrosliceFlags::OverflowFlim)) { monitor.fNumOverflowFlimFlags++; } @@ -236,7 +236,7 @@ namespace cbm::algo } // ---- extractSample ---- - std::float_t UnpackTrd::extractAvgSample(size_t* adcbuffer, size_t* nadcbits) + std::float_t Unpack::extractAvgSample(size_t* adcbuffer, size_t* nadcbits) { // can not extract samples from a buffer with less than 9 bits assert(*nadcbits >= 9); @@ -263,7 +263,7 @@ namespace cbm::algo } // ---- extractSample ---- - std::int16_t UnpackTrd::extractSample(size_t* adcbuffer, size_t* nadcbits) + std::int16_t Unpack::extractSample(size_t* adcbuffer, size_t* nadcbits) { // can not extract samples from a buffer with less than 9 bits assert(*nadcbits >= 9); @@ -284,7 +284,7 @@ namespace cbm::algo } // ---- getInfoType ---- - Spadic::MsInfoType UnpackTrd::getInfoType(const std::uint32_t frame) + Spadic::MsInfoType Unpack::getInfoType(const std::uint32_t frame) { // Set first 20 bits to 1 for the mask size_t mask = 0x000FFFFF; @@ -317,14 +317,14 @@ namespace cbm::algo return Spadic::MsInfoType::kMIS; } else { - std::cout << "UnpackTrd::GetInfoType] unknown type!" << std::endl; + std::cout << "Unpack::GetInfoType] unknown type!" << std::endl; exit(1); return Spadic::MsInfoType::kMSB; } } // ---- getMessageType ---- - Spadic::MsMessageType UnpackTrd::getMessageType(const std::uint32_t frame) + Spadic::MsMessageType Unpack::getMessageType(const std::uint32_t frame) { std::uint32_t checkframe = frame; checkframe &= 0xffffff; @@ -358,7 +358,7 @@ namespace cbm::algo } // ---- getTsMsb ---- - std::uint8_t UnpackTrd::getTsMsb(const std::uint32_t frame, UnpackTrdMonitorData& monitor) + std::uint8_t Unpack::getTsMsb(const std::uint32_t frame, UnpackMonitorData& monitor) { if ((frame & 0xf) > 0) return -2; // if a 'error' ts_msb is received the tsmsb value is not correct. To not mess up the counting -2 is returned. @@ -383,7 +383,7 @@ namespace cbm::algo } // ---- makeDigi ---- - CbmTrdDigi UnpackTrd::makeDigi(CbmTrdRawMessageSpadic raw) + CbmTrdDigi Unpack::makeDigi(CbmTrdRawMessageSpadic raw) { // Extract the trigger type and translate it to the digi enum auto rawTriggerType = static_cast<Spadic::eTriggerType>(raw.GetHitType()); @@ -393,9 +393,9 @@ namespace cbm::algo int32_t errClass = 0; // Get the address of the originating spadic - const UnpackTrdCrobPar& crobPar = fParams.fCrobParams.at(raw.GetCrobId()); - const UnpackTrdElinkPar& elinkPar = crobPar.fElinkParams.at(raw.GetElinkId()); - const uint32_t asicAddress = elinkPar.fAddress; + const UnpackCrobPar& crobPar = fParams.fCrobParams.at(raw.GetCrobId()); + const UnpackElinkPar& elinkPar = crobPar.fElinkParams.at(raw.GetElinkId()); + const uint32_t asicAddress = elinkPar.fAddress; // Get the channel id on the module int32_t padChNr = elinkPar.fChanAddress.at(raw.GetChannelId()); @@ -433,8 +433,8 @@ namespace cbm::algo } // ---- makeRaw ---- - CbmTrdRawMessageSpadic UnpackTrd::makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, - std::uint16_t elinkId, std::uint8_t istream) + CbmTrdRawMessageSpadic Unpack::makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, + std::uint16_t elinkId, std::uint8_t istream) { auto chId = static_cast<std::uint8_t>(((frame >> 17) & 0xf)); auto timestamp = static_cast<std::uint8_t>((frame >> 9) & 0xff); @@ -452,7 +452,7 @@ namespace cbm::algo // ---- GetDigiTriggerType ---- - CbmTrdDigi::eTriggerType UnpackTrd::GetDigiTriggerType(Spadic::eTriggerType tt) + CbmTrdDigi::eTriggerType Unpack::GetDigiTriggerType(Spadic::eTriggerType tt) { // Shift self trigger to digi selftrigger // Shift neighbour trigger to digi neighbour @@ -467,7 +467,7 @@ namespace cbm::algo } // --- GetCharge ---- - float_t UnpackTrd::GetMaxAdcValue(const std::vector<std::int16_t>* samples) + float_t Unpack::GetMaxAdcValue(const std::vector<std::int16_t>* samples) { // Safety for corrupted input samples assert(samples->size() >= fPeakingBinMin); @@ -494,7 +494,7 @@ namespace cbm::algo } // ---- GetBaseline ---- - float_t UnpackTrd::GetBaseline(const std::vector<std::int16_t>* samples) + float_t Unpack::GetBaseline(const std::vector<std::int16_t>* samples) { // The spadic 2.2 has a functionality that an average baseline can be written to the first sample. // So first we have to check if this is active. @@ -513,4 +513,4 @@ namespace cbm::algo } -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd diff --git a/algo/detectors/trd/UnpackTrd.h b/algo/detectors/trd/Unpack.h similarity index 79% rename from algo/detectors/trd/UnpackTrd.h rename to algo/detectors/trd/Unpack.h index 51d2ad038e03e1bf396e7f2485bde7d26fb3b58c..ff7e9e54b0e1fbc73c755a5a50e60bf24aca7638 100644 --- a/algo/detectors/trd/UnpackTrd.h +++ b/algo/detectors/trd/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACKTRD_H -#define CBM_ALGO_UNPACKTRD_H 1 +#ifndef CBM_ALGO_UNPACK_H +#define CBM_ALGO_UNPACK_H 1 #include "CbmTrdDigi.h" @@ -17,48 +17,48 @@ #include <cmath> -namespace cbm::algo +namespace cbm::algo::trd { - /** @struct UnpackTrdElinkPar + /** @struct UnpackElinkPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 - ** @brief TRD Unpacking parameters for one eLink + ** @brief TRD Unpacking parameters for one eLink **/ - struct UnpackTrdElinkPar { + struct UnpackElinkPar { std::vector<uint32_t> fChanAddress; ///< CbmTrdAddress for different channels uint32_t fAddress; ///< Asic address uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackTrdCrobPar + /** @struct UnpackCrobPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief TRD Unpacking parameters for one CROB **/ - struct UnpackTrdCrobPar { - std::vector<UnpackTrdElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackCrobPar { + std::vector<UnpackElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; - /** @struct UnpackTrdPar + /** @struct UnpackPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief Parameters required for the TRD unpacking (specific to one component) **/ - struct UnpackTrdPar { - bool fUseBaselineAvg = true; ///< Is baseline average function of Spadic activated - float_t fMaxAdcToEnergyCal = 1.0; ///< max adc to energy in keV - uint32_t fNumChansPerAsic = 0; ///< Number of channels per ASIC - uint32_t fNumAsicsPerModule = 0; ///< Number of ASICS per module - std::vector<UnpackTrdCrobPar> fCrobParams = {}; ///< Parameters for each CROB + struct UnpackPar { + bool fUseBaselineAvg = true; ///< Is baseline average function of Spadic activated + float_t fMaxAdcToEnergyCal = 1.0; ///< max adc to energy in keV + uint32_t fNumChansPerAsic = 0; ///< Number of channels per ASIC + uint32_t fNumAsicsPerModule = 0; ///< Number of ASICS per module + std::vector<UnpackCrobPar> fCrobParams = {}; ///< Parameters for each CROB }; - /** @struct UnpackTrdMoni + /** @struct UnpackMonitorData ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief Monitoring data for TRD unpacking **/ - struct UnpackTrdMonitorData { + struct UnpackMonitorData { size_t fNumNonMajorTsMsb = 0; ///< Counter for the ts_msb used to reconstruct the time size_t fNumCreatedRawMsgs = 0; ///< counter of created raw messages size_t fNumEpochMsgs = 0; ///< counter of created raw messages @@ -95,23 +95,23 @@ namespace cbm::algo }; - /** @class UnpackTrd + /** @class Unpack ** @author Dominik Smith <d.smith@gsi.de> - ** @since 31 January 2023 + ** @since 31 January 2023 ** @brief Unpack algorithm for TRD **/ - class UnpackTrd { + class Unpack { public: - typedef std::pair<std::vector<CbmTrdDigi>, UnpackTrdMonitorData> resultType; + typedef std::pair<std::vector<CbmTrdDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackTrd() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackTrd() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -126,53 +126,53 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackTrdPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } - private: // members - UnpackTrdPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container /** ** @brief Handle the output created by the explicit algorithms. E.g. write to output vectors. - ** @param digi - ** @param raw + ** @param digi + ** @param raw **/ void digestOutput(std::unique_ptr<CbmTrdDigi> digi, CbmTrdRawMessageSpadic raw); /** ** @brief Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages. - ** @param frame + ** @param frame ** @return Spadic::MsInfoType **/ Spadic::MsInfoType digestBufInfoFlags(const std::uint32_t frame); /** ** @brief Digest the flags of the currently unpacked µSlice. - ** @param flags flags stored in the µSlice descriptor + ** @param flags flags stored in the µSlice descriptor ** @param storage of monitoring data **/ - void digestMsFlags(const std::uint16_t flags, UnpackTrdMonitorData& monitor); + void digestMsFlags(const std::uint16_t flags, UnpackMonitorData& monitor); /** ** @brief Digest a info message run all default information forwarding from the msg. - ** @param frame + ** @param frame **/ void digestInfoMsg(const std::uint32_t frame); /** ** @brief Extract one adc sample from a given adcbuffer - ** @param[in] adcbuffer - ** @param[in,out] nadcbits - ** @return std::int16_t + ** @param[in] adcbuffer + ** @param[in,out] nadcbits + ** @return std::int16_t **/ std::int16_t extractSample(size_t* adcbuffer, size_t* nadcbits); /** ** @brief Extract the baseline average sample from a given adcbuffer. - ** Depending on the Spadic settings sample-0 is a plain sample or the averaged - ** baseline calculation. The latter is not a 9 bit signed integer, but a 9 bit + ** Depending on the Spadic settings sample-0 is a plain sample or the averaged + ** baseline calculation. The latter is not a 9 bit signed integer, but a 9 bit ** floating point number 7 digits before the point and 2 afterwards. - ** @param[in] adcbuffer - ** @param[in,out] nadcbits + ** @param[in] adcbuffer + ** @param[in,out] nadcbits ** @return std::float_t **/ std::float_t extractAvgSample(size_t* adcbuffer, size_t* nadcbits); @@ -187,15 +187,15 @@ namespace cbm::algo ** @param storage of monitoring data ** @return ts_msb value **/ - std::uint8_t getTsMsb(const std::uint32_t frame, UnpackTrdMonitorData& monitor); + std::uint8_t getTsMsb(const std::uint32_t frame, UnpackMonitorData& monitor); /** - ** @brief Create a CbmTrdRawMessageSpadic from the hit message input. - ** @param word + ** @brief Create a CbmTrdRawMessageSpadic from the hit message input. + ** @param word ** @param criId id of the cri that send the µSlice ** @param criobId id of the crob that send the µSlice (currently not used set to 0 062021 PR) ** @param istream - ** @return CbmTrdRawMessageSpadic + ** @return CbmTrdRawMessageSpadic ** @todo Check if we can get rid of the future obsolete microslice stuff. **/ CbmTrdRawMessageSpadic makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, @@ -203,36 +203,36 @@ namespace cbm::algo /** ** @brief Get the Digi Trigger Type from the raw message triggertype - ** @param tt - ** @return CbmTrdDigi::eTriggerType + ** @param tt + ** @return CbmTrdDigi::eTriggerType **/ static CbmTrdDigi::eTriggerType GetDigiTriggerType(Spadic::eTriggerType tt); /** ** @brief Create an actual digi from the raw message - ** @param raw + ** @param raw **/ CbmTrdDigi makeDigi(CbmTrdRawMessageSpadic raw); /** - ** @brief Get the Bin Time Shift value - ** @param samples - ** @return ULong64_t + ** @brief Get the Bin Time Shift value + ** @param samples + ** @return ULong64_t **/ uint64_t GetBinTimeShift(const std::vector<std::int16_t>* /*samples*/) { return 0.; }; /** ** @brief Get the MaxAdc value - ** @param samples - ** @return Float_t + ** @param samples + ** @return Float_t **/ std::float_t GetMaxAdcValue(const std::vector<std::int16_t>* samples); /** ** @brief Get the Baseline value ** The digi charge is an unsigned. Hence, we need to get the baseline to 0 - ** @param samples - ** @return float_t + ** @param samples + ** @return float_t **/ float_t GetBaseline(const std::vector<std::int16_t>* samples); @@ -274,13 +274,13 @@ namespace cbm::algo /** ** @brief Last sample to look for the max adc ** Default value is set based on the Shaping time + 5 samples safety margin. - ** @remark the peaking time strongly depends on the input signal. Effective range of + ** @remark the peaking time strongly depends on the input signal. Effective range of ** the shaping time is between 120 and 240 ns. **/ static constexpr size_t fPeakingBinMax = static_cast<size_t>(120.0 / fAsicClockCycle + fNrOfPresamples + 5); }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd -#endif /* CBM_ALGO_UNPACKTRD_H */ +#endif /* CBM_ALGO_UNPACK_H */ diff --git a/algo/detectors/trd2d/Trd2dReadoutConfig.cxx b/algo/detectors/trd2d/ReadoutConfig.cxx similarity index 87% rename from algo/detectors/trd2d/Trd2dReadoutConfig.cxx rename to algo/detectors/trd2d/ReadoutConfig.cxx index e5ffe41d97c26496092b0d1b3dbdc139ad22ba39..90914b95b9affa5ac09902f6c40e1c274f02ff03 100644 --- a/algo/detectors/trd2d/Trd2dReadoutConfig.cxx +++ b/algo/detectors/trd2d/ReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese, Dominik Smith [committer] */ -#include "Trd2dReadoutConfig.h" +#include "ReadoutConfig.h" //#include "CbmTrdAddress.h" @@ -14,22 +14,22 @@ using std::pair; using std::setw; -namespace cbm::algo +namespace cbm::algo::trd2d { // --- Constructor ------------------------------------------------------------------ - Trd2dReadoutConfig::Trd2dReadoutConfig() {} + ReadoutConfig::ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - Trd2dReadoutConfig::~Trd2dReadoutConfig() {} + ReadoutConfig::~ReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> Trd2dReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> ReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -40,7 +40,7 @@ namespace cbm::algo // --- Number of Asics for a component / equipment ------------------------------- - size_t Trd2dReadoutConfig::GetNumAsics(uint16_t equipmentId) + size_t ReadoutConfig::GetNumAsics(uint16_t equipmentId) { size_t result = 0; auto it = fChannelMap.find(equipmentId); @@ -51,7 +51,7 @@ namespace cbm::algo // --- Number of Channels for a component / equipment, asic pair --------------------- - size_t Trd2dReadoutConfig::GetNumChans(uint16_t equipmentId, uint16_t asicId) + size_t ReadoutConfig::GetNumChans(uint16_t equipmentId, uint16_t asicId) { size_t result = 0; auto it = fChannelMap.find(equipmentId); @@ -63,14 +63,14 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Initialise the component mapping structure ---------------------------------- - void Trd2dReadoutConfig::InitComponentMap(const std::map<uint32_t, uint16_t[NCROBMOD]>& map) + void ReadoutConfig::InitComponentMap(const std::map<uint32_t, uint16_t[NCROBMOD]>& map) { // Receive map (moduleId, crobId) -> (equipId) // Invert to obtain component map (equipId) -> (module iq, crob id) for (auto& entry : map) { uint16_t mod_id = entry.first; for (uint8_t crob_id = 0; crob_id < NCROBMOD; crob_id++) { - uint16_t eq_id = entry.second[crob_id]; + uint16_t eq_id = entry.second[crob_id]; if (!eq_id) continue; fReadoutMap[eq_id] = std::make_pair(mod_id, crob_id); } @@ -79,7 +79,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Initialise the mapping structure -------------------------------------------- - void Trd2dReadoutConfig::InitChannelMap( + void ReadoutConfig::InitChannelMap( const std::map<size_t, std::map<size_t, std::map<size_t, std::tuple<int32_t, bool, uint64_t>>>>& channelMap) { // Constructing the map (equipId, asicId, chanId) -> (pad address, mask flag, daq offset) @@ -104,7 +104,7 @@ namespace cbm::algo // --- Mapping (equimentId, asicId, channel) -> (pad address, mask flag, daq offset) ----- - std::tuple<int32_t, bool, uint64_t> Trd2dReadoutConfig::ChanMap(uint16_t equipId, uint16_t asic, uint16_t chan) + std::tuple<int32_t, bool, uint64_t> ReadoutConfig::ChanMap(uint16_t equipId, uint16_t asic, uint16_t chan) { std::tuple<int32_t, bool, uint64_t> result = std::make_tuple(-1, false, 0); auto it = fChannelMap.find(equipId); @@ -119,7 +119,7 @@ namespace cbm::algo // --- Mapping (equimentId) -> (module id, crob id) --------------------------------- - std::pair<uint16_t, uint8_t> Trd2dReadoutConfig::CompMap(uint16_t equipId) + std::pair<uint16_t, uint8_t> ReadoutConfig::CompMap(uint16_t equipId) { std::pair<uint16_t, uint8_t> result(0, 0); auto equipIter = fReadoutMap.find(equipId); @@ -130,7 +130,7 @@ namespace cbm::algo // ----- Print readout map ------------------------------------------------ - std::string Trd2dReadoutConfig::PrintReadoutMap() + std::string ReadoutConfig::PrintReadoutMap() { std::stringstream ss; for (auto comp : fReadoutMap) { @@ -166,4 +166,4 @@ namespace cbm::algo // ---------------------------------------------------------------------------- -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd2d diff --git a/algo/detectors/trd2d/Trd2dReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h similarity index 89% rename from algo/detectors/trd2d/Trd2dReadoutConfig.h rename to algo/detectors/trd2d/ReadoutConfig.h index 4330bc3a9bd2fca665f2b007cacacefcc1c5fc96..f3f1bf7921e826864a5df76c3dde8069a624a007 100644 --- a/algo/detectors/trd2d/Trd2dReadoutConfig.h +++ b/algo/detectors/trd2d/ReadoutConfig.h @@ -2,21 +2,21 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Volker Friese, Dominik Smith [committer] */ -#ifndef ALGO_DETECTORS_TRD2D_TRD2DREADOUTCONFIG_H -#define ALGO_DETECTORS_TRD2D_TRD2DREADOUTCONFIG_H +#ifndef ALGO_DETECTORS_TRD2D_READOUTCONFIG_H +#define ALGO_DETECTORS_TRD2D_READOUTCONFIG_H #include <map> #include <sstream> #include <utility> #include <vector> -#include "UnpackTrd2d.h" +#include "Unpack.h" -namespace cbm::algo +namespace cbm::algo::trd2d { - /** @class Trd2dReadoutConfig + /** @class ReadoutConfig ** @author Volker Friese <v.friese@gsi.de> ** @since 3 March 2022 ** @brief Provides the hardware-to-software address mapping for the CBM-TRD2D @@ -28,15 +28,15 @@ namespace cbm::algo ** The mapping of the two address spaces is hard-coded in this class. **/ - class Trd2dReadoutConfig { + class ReadoutConfig { public: /** @brief Constructor **/ - Trd2dReadoutConfig(); + ReadoutConfig(); /** @brief Destructor **/ - virtual ~Trd2dReadoutConfig(); + virtual ~ReadoutConfig(); /** @brief Equipment in the configuration @@ -97,6 +97,6 @@ namespace cbm::algo std::map<uint16_t, std::vector<std::vector<std::tuple<int32_t, bool, uint64_t>>>> fChannelMap = {}; //! }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd2d -#endif /* ALGO_DETECTORS_TRD2D_TRD2DREADOUTCONFIG_H_ */ +#endif /* ALGO_DETECTORS_TRD2D_READOUTCONFIG_H_ */ diff --git a/algo/detectors/trd2d/UnpackTrd2d.cxx b/algo/detectors/trd2d/Unpack.cxx similarity index 87% rename from algo/detectors/trd2d/UnpackTrd2d.cxx rename to algo/detectors/trd2d/Unpack.cxx index c23e1bc565e0feeccd6ec8d3c16349ae92ed807c..9e5b563b2acdc591d90671b165bbdb36ccae37e2 100644 --- a/algo/detectors/trd2d/UnpackTrd2d.cxx +++ b/algo/detectors/trd2d/Unpack.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Alexandru Bercuci, Dominik Smith [committer] */ -#include "UnpackTrd2d.h" +#include "Unpack.h" #include <algorithm> #include <cassert> @@ -12,10 +12,10 @@ using std::unique_ptr; -namespace cbm::algo +namespace cbm::algo::trd2d { // ---- Fasp message constructor ---------------------------------------- - CbmTrdFaspMessage::CbmTrdFaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t rob, uint8_t asic) + FaspMessage::FaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t rob, uint8_t asic) : ch(c) , type(typ) , tlab(t) @@ -26,14 +26,14 @@ namespace cbm::algo } // ---- Algorithm execution --------------------------------------------- - UnpackTrd2d::resultType UnpackTrd2d::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) + Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) { // --- Output data resultType result = {}; // Reset monitoring data - fMonitor = UnpackTrd2dMonitorData(); + fMonitor = UnpackMonitorData(); // define time wrt start of time slice in TRD/FASP clks [80 MHz]. Contains: // - relative offset of the MS wrt the TS @@ -51,7 +51,7 @@ namespace cbm::algo const uint32_t* wd = reinterpret_cast<const uint32_t*>(msContent); unsigned char lFaspOld(0xff); - std::vector<CbmTrdFaspMessage> vMess; + std::vector<FaspMessage> vMess; for (uint64_t j = 0; j < nwords; j++, wd++) { uint32_t w = *wd; uint8_t ch_id = w & 0xf; @@ -93,11 +93,11 @@ namespace cbm::algo } //_________________________________________________________________________________ - bool UnpackTrd2d::pushDigis(std::vector<CbmTrdFaspMessage> messes, const uint64_t time) + bool Unpack::pushDigis(std::vector<FaspMessage> messes, const uint64_t time) { - const uint16_t mod_id = fParams.fModId; - const UnpackTrd2dAsicPar& asicPar = fParams.fAsicParams[messes[0].fasp]; - const uint64_t tdaqOffset = asicPar.fChanParams[messes[0].ch].fDaqOffset; + const uint16_t mod_id = fParams.fModId; + const UnpackAsicPar& asicPar = fParams.fAsicParams[messes[0].fasp]; + const uint64_t tdaqOffset = asicPar.fChanParams[messes[0].ch].fDaqOffset; for (auto imess : messes) { const int32_t pad = std::abs(asicPar.fChanParams[imess.ch].fPadAddress); @@ -161,7 +161,7 @@ namespace cbm::algo return true; } - std::vector<CbmTrdDigi> UnpackTrd2d::FinalizeComponent() + std::vector<CbmTrdDigi> Unpack::FinalizeComponent() { std::vector<CbmTrdDigi> outputDigis; @@ -190,4 +190,4 @@ namespace cbm::algo } return outputDigis; } -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd2d diff --git a/algo/detectors/trd2d/UnpackTrd2d.h b/algo/detectors/trd2d/Unpack.h similarity index 71% rename from algo/detectors/trd2d/UnpackTrd2d.h rename to algo/detectors/trd2d/Unpack.h index 5381e067ac7c60742a4fc9538da5e2f4c73fcbfe..1421df91808d3542d407e9b5c319cae0c80a02ca 100644 --- a/algo/detectors/trd2d/UnpackTrd2d.h +++ b/algo/detectors/trd2d/Unpack.h @@ -2,8 +2,8 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Alexandru Bercuci, Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACKTRD2D_H -#define CBM_ALGO_UNPACKTRD2D_H 1 +#ifndef CBM_ALGO_TRD2D_UNPACK_H +#define CBM_ALGO_TRD2D_UNPACK_H 1 #include "CbmTrdDigi.h" @@ -25,18 +25,18 @@ #define FASP_EPOCH_LENGTH 128 -namespace cbm::algo +namespace cbm::algo::trd2d { - enum CbmTrdFaspMessageType + enum FaspMessageType { kEpoch = 0, kData }; /** @brief Data structure for unpacking the FASP word */ - struct CbmTrdFaspMessage { - CbmTrdFaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t rob, uint8_t asic); + struct FaspMessage { + FaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t rob, uint8_t asic); uint8_t ch = 0; ///< ch id in the FASP uint8_t type = 0; ///< message type 0 = epoch, 1 = data (not used for the moment) uint8_t tlab = 0; ///< time of the digi inside the epoch @@ -47,45 +47,45 @@ namespace cbm::algo uint8_t fasp = 0; ///< FASP id in the module }; - /** @struct UnpackTrd2dChannelPar + /** @struct UnpackChannelPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief TRD Unpacking parameters for one Asic channel **/ - struct UnpackTrd2dChannelPar { + struct UnpackChannelPar { int32_t fPadAddress; ///< Pad address for channel bool fMask; ///< Flag for channel masking uint64_t fDaqOffset = 0; ///< Time calibration parameter }; - /** @struct UnpackTrd2dAsicPar + /** @struct UnpackAsicPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief TRD Unpacking parameters for one Asic **/ - struct UnpackTrd2dAsicPar { - std::vector<UnpackTrd2dChannelPar> fChanParams; ///< Parameters for different channels + struct UnpackAsicPar { + std::vector<UnpackChannelPar> fChanParams; ///< Parameters for different channels }; - /** @struct UnpackTrd2dPar + /** @struct UnpackPar ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief Parameters required for the TRD unpacking (specific to one component) **/ - struct UnpackTrd2dPar { - int32_t fSystemTimeOffset = 0; ///< Time calibration parameter - uint16_t fModId = 0; ///< Module ID of component - uint8_t fCrobId = 0; ///< CROB ID of component - std::vector<UnpackTrd2dAsicPar> fAsicParams = {}; ///< Parameters for each ASIC + struct UnpackPar { + int32_t fSystemTimeOffset = 0; ///< Time calibration parameter + uint16_t fModId = 0; ///< Module ID of component + uint8_t fCrobId = 0; ///< CROB ID of component + std::vector<UnpackAsicPar> fAsicParams = {}; ///< Parameters for each ASIC }; - /** @struct UnpackTrd2dMoni + /** @struct UnpackMoni ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief Monitoring data for TRD unpacking **/ - struct UnpackTrd2dMonitorData { + struct UnpackMonitorData { uint32_t fNumSelfTriggeredData = 0; ///< word fulfills data & 0x2000 uint32_t fNumIncompleteDigis = 0; ///< incomplete digis left in pads after finalization uint32_t fNumErrEndBitSet = 0; ///< Corrupted data with end bit set @@ -104,23 +104,23 @@ namespace cbm::algo } }; - /** @class UnpackTrd2d + /** @class Unpack ** @author Dominik Smith <d.smith@gsi.de> - ** @since 31 January 2023 + ** @since 31 January 2023 ** @brief Unpack algorithm for TRD **/ - class UnpackTrd2d { + class Unpack { public: - typedef std::pair<std::vector<CbmTrdDigi>, UnpackTrd2dMonitorData> resultType; + typedef std::pair<std::vector<CbmTrdDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - UnpackTrd2d() {}; + Unpack() {}; /** @brief Destructor **/ - ~UnpackTrd2d() {}; + ~Unpack() {}; /** @brief Algorithm execution @@ -135,14 +135,14 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackTrd2dPar> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackPar> params) { fParams = *(std::move(params)); } - private: // members - UnpackTrd2dPar fParams = {}; ///< Parameter container + private: // members + UnpackPar fParams = {}; ///< Parameter container - UnpackTrd2dMonitorData fMonitor; ///< Container for monitoring data + UnpackMonitorData fMonitor; ///< Container for monitoring data - bool pushDigis(std::vector<CbmTrdFaspMessage> messages, const uint64_t time); + bool pushDigis(std::vector<FaspMessage> messages, const uint64_t time); /** @brief Finalize component (e.g. copy from temp buffers) */ std::vector<CbmTrdDigi> FinalizeComponent(); @@ -170,6 +170,6 @@ namespace cbm::algo }; -} /* namespace cbm::algo */ +} // namespace cbm::algo::trd2d -#endif /* CBM_ALGO_UNPACKTRD2D_H */ +#endif /* CBM_ALGO_TRD2D_UNPACK_H */ diff --git a/algo/evselector/DigiEventSelector.cxx b/algo/evselector/DigiEventSelector.cxx index 4b53fd9dfc743c0b94506b6620adaaed7c28a55c..2b7e16dc8e64623779ed4c2c4143f589b2b73826 100644 --- a/algo/evselector/DigiEventSelector.cxx +++ b/algo/evselector/DigiEventSelector.cxx @@ -6,7 +6,7 @@ #include "CbmStsDigi.h" -#include "tof/TofConfig.h" +#include "tof/Config.h" #include <iterator> #include <unordered_map> @@ -110,7 +110,7 @@ namespace cbm::algo::evbuild const int32_t smId = CbmTofAddress::GetSmId(digiAddr); // Super-module ID const int32_t smType = CbmTofAddress::GetSmType(digiAddr); // Super-module type const int32_t rpcId = CbmTofAddress::GetRpcId(digiAddr); // RPC ID - const int32_t TofStationId = TofConfig::GetTofTrackingStation(smType, smId, rpcId); + const int32_t TofStationId = tof::Config::GetTofTrackingStation(smType, smId, rpcId); stations.insert(TofStationId); if (stations.size() == minNum) break; } diff --git a/algo/global/Reco.h b/algo/global/Reco.h index aa5ad55fae89453ba318aab43c527fb054bb8df1..1b64462ac93d44c146106e1fa2d835fe53809a2e 100644 --- a/algo/global/Reco.h +++ b/algo/global/Reco.h @@ -10,7 +10,7 @@ #include "RecoResults.h" #include "SubChain.h" #include "UnpackChain.h" -#include "sts/StsHitfinderChain.h" +#include "sts/HitfinderChain.h" namespace fles { diff --git a/algo/test/_GTestDigiEventSelector.cxx b/algo/test/_GTestDigiEventSelector.cxx index d873199491e44d4d92d5ab3d20c4cc8d280291d5..cfc42fbd16ddcb62e0d8d136d52e494d0f394dc3 100644 --- a/algo/test/_GTestDigiEventSelector.cxx +++ b/algo/test/_GTestDigiEventSelector.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "tof/TofConfig.h" +#include "tof/Config.h" #include <unordered_set> @@ -195,7 +195,7 @@ TEST(_GTestDigiEventSelector, CheckDigiEventSelectorAlgorithmSimple) eventIn.fData.fTof.fDigis.push_back(CbmTofDigi(addrFront, 0.0, 0.0)); eventIn.fData.fTof.fDigis.push_back(CbmTofDigi(addrBack, 0.0, 0.0)); - const int32_t TofStationId = cbm::algo::TofConfig::GetTofTrackingStation(smType, sm, rpc); + const int32_t TofStationId = cbm::algo::tof::Config::GetTofTrackingStation(smType, sm, rpc); setTofStation.insert(TofStationId); YAML::Node node2; diff --git a/algo/unpack/Unpack.cxx b/algo/unpack/Unpack.cxx index f1cca939e7fa5efb203e2b3e11c1c8375ebdfc0c..05044639fc9a1783db4b3729fb5f6165bde50d30 100644 --- a/algo/unpack/Unpack.cxx +++ b/algo/unpack/Unpack.cxx @@ -282,12 +282,12 @@ namespace cbm::algo // Create one algorithm per component for STS and configure it with parameters auto equipIdsSts = fStsConfig.GetEquipmentIds(); for (auto& equip : equipIdsSts) { - std::unique_ptr<UnpackStsPar> par(new UnpackStsPar()); + std::unique_ptr<sts::UnpackPar> par(new sts::UnpackPar()); par->fNumChansPerAsic = numChansPerAsicSts; par->fNumAsicsPerModule = numAsicsPerModuleSts; const size_t numElinks = fStsConfig.GetNumElinks(equip); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackStsElinkPar elinkPar; + sts::UnpackElinkPar elinkPar; auto mapEntry = fStsConfig.Map(equip, elink); elinkPar.fAddress = mapEntry.first; // Module address for this elink elinkPar.fAsicNr = mapEntry.second; // ASIC number within module @@ -307,10 +307,10 @@ namespace cbm::algo // Create one algorithm per component for MUCH and configure it with parameters auto equipIdsMuch = fMuchConfig.GetEquipmentIds(); for (auto& equip : equipIdsMuch) { - std::unique_ptr<UnpackMuchPar> par(new UnpackMuchPar()); + std::unique_ptr<much::UnpackPar> par(new much::UnpackPar()); const size_t numElinks = fMuchConfig.GetNumElinks(equip); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackMuchElinkPar elinkPar; + much::UnpackElinkPar elinkPar; elinkPar.fAddress = fMuchConfig.Map(equip, elink); // Vector of MUCH addresses for this elink elinkPar.fTimeOffset = fSystemTimeOffset[Subsystem::MUCH]; elinkPar.fChanMask = fMuchConfig.MaskMap(equip, elink); @@ -323,10 +323,10 @@ namespace cbm::algo // Create one algorithm per component for TOF and configure it with parameters auto equipIdsTof = fTofConfig.GetEquipmentIds(); for (auto& equip : equipIdsTof) { - std::unique_ptr<UnpackTofPar> par(new UnpackTofPar()); + std::unique_ptr<tof::UnpackPar> par(new tof::UnpackPar()); const size_t numElinks = fTofConfig.GetNumElinks(equip); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackTofElinkPar elinkPar; + tof::UnpackElinkPar elinkPar; elinkPar.fChannelUId = fTofConfig.Map(equip, elink); // Vector of TOF addresses for this elink elinkPar.fTimeOffset = fSystemTimeOffset[Subsystem::TOF]; par->fElinkParams.push_back(elinkPar); @@ -338,10 +338,10 @@ namespace cbm::algo // Create one algorithm per component for T0 and configure it with parameters auto equipIdsBmon = fBmonConfig.GetEquipmentIds(); for (auto& equip : equipIdsBmon) { - std::unique_ptr<UnpackBmonPar> par(new UnpackBmonPar()); + std::unique_ptr<bmon::UnpackPar> par(new bmon::UnpackPar()); const size_t numElinks = fBmonConfig.GetNumElinks(equip); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackBmonElinkPar elinkPar; + bmon::UnpackElinkPar elinkPar; elinkPar.fChannelUId = fBmonConfig.Map(equip, elink); // Vector of T0 addresses for this elink elinkPar.fTimeOffset = fSystemTimeOffset[Subsystem::BMON]; par->fElinkParams.push_back(elinkPar); @@ -353,7 +353,7 @@ namespace cbm::algo // Create one algorithm per component and configure it with parameters auto equipIdsRich = fRichConfig.GetEquipmentIds(); for (auto& equip : equipIdsRich) { - std::unique_ptr<UnpackRichPar> par(new UnpackRichPar()); + std::unique_ptr<rich::UnpackPar> par(new rich::UnpackPar()); std::map<uint32_t, std::vector<double>> compMap = fRichConfig.Map(equip); for (auto const& val : compMap) { uint32_t address = val.first; @@ -368,15 +368,15 @@ namespace cbm::algo auto equipIdsTrd = fTrdConfig.GetEquipmentIds(); for (auto& equip : equipIdsTrd) { - std::unique_ptr<UnpackTrdPar> par(new UnpackTrdPar()); + std::unique_ptr<trd::UnpackPar> par(new trd::UnpackPar()); const size_t numCrobs = fTrdConfig.GetNumCrobs(equip); for (size_t crob = 0; crob < numCrobs; crob++) { - UnpackTrdCrobPar crobPar; + trd::UnpackCrobPar crobPar; const size_t numElinks = fTrdConfig.GetNumElinks(equip, crob); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackTrdElinkPar elinkPar; + trd::UnpackElinkPar elinkPar; auto addresses = fTrdConfig.Map(equip, crob, elink); elinkPar.fAddress = addresses.first; // Asic address for this elink elinkPar.fChanAddress = addresses.second; // Channel addresses for this elink @@ -393,15 +393,15 @@ namespace cbm::algo auto equipIdsTrd2d = fTrd2dConfig.GetEquipmentIds(); for (auto& equip : equipIdsTrd2d) { - std::unique_ptr<UnpackTrd2dPar> par(new UnpackTrd2dPar()); + std::unique_ptr<trd2d::UnpackPar> par(new trd2d::UnpackPar()); const size_t numAsics = fTrd2dConfig.GetNumAsics(equip); for (size_t asic = 0; asic < numAsics; asic++) { - UnpackTrd2dAsicPar asicPar; + trd2d::UnpackAsicPar asicPar; const size_t numChans = fTrd2dConfig.GetNumChans(equip, asic); for (size_t chan = 0; chan < numChans; chan++) { - UnpackTrd2dChannelPar chanPar; + trd2d::UnpackChannelPar chanPar; auto pars = fTrd2dConfig.ChanMap(equip, asic, chan); chanPar.fPadAddress = std::get<0>(pars); // Pad address for channel chanPar.fMask = std::get<1>(pars); // Flag channel mask diff --git a/algo/unpack/Unpack.h b/algo/unpack/Unpack.h index 13329f07a39aad0a7624d3d0c971c522ce5d309e..4b403b493612d0940a6efe3170cb1c7e30541c55 100644 --- a/algo/unpack/Unpack.h +++ b/algo/unpack/Unpack.h @@ -8,27 +8,27 @@ #include "CbmDigiTimeslice.h" -#include "tof/TofReadoutConfig.h" -#include "tof/UnpackTof.h" -#include "trd/TrdReadoutConfig.h" -#include "trd/UnpackTrd.h" -#include "trd2d/Trd2dReadoutConfig.h" -#include "trd2d/UnpackTrd2d.h" +#include "tof/ReadoutConfig.h" +#include "tof/Unpack.h" +#include "trd/ReadoutConfig.h" +#include "trd/Unpack.h" +#include "trd2d/ReadoutConfig.h" +#include "trd2d/Unpack.h" #include <gsl/span> #include <optional> #include <sstream> #include <vector> -#include "bmon/BmonReadoutConfig.h" -#include "bmon/UnpackBmon.h" -#include "much/MuchReadoutConfig.h" -#include "much/UnpackMuch.h" -#include "rich/RichReadoutConfig.h" -#include "rich/UnpackRich.h" +#include "bmon/ReadoutConfig.h" +#include "bmon/Unpack.h" +#include "much/ReadoutConfig.h" +#include "much/Unpack.h" +#include "rich/ReadoutConfig.h" +#include "rich/Unpack.h" #include "sts/Digi.h" -#include "sts/StsReadoutConfigLegacy.h" -#include "sts/UnpackSts.h" +#include "sts/ReadoutConfigLegacy.h" +#include "sts/Unpack.h" namespace cbm::algo { @@ -39,13 +39,13 @@ namespace cbm::algo ** @brief Monitoring data for unpacking **/ struct UnpackMonitorData { - std::vector<UnpackStsMonitorData> fSts; ///< Monitoring data for STS - std::vector<UnpackMuchMonitorData> fMuch; ///< Monitoring data for MUCH - std::vector<UnpackTofMonitorData> fTof; ///< Monitoring data for TOF - std::vector<UnpackBmonMonitorData> fBmon; ///< Monitoring data for T0 - std::vector<UnpackTrdMonitorData> fTrd; ///< Monitoring data for TRD - std::vector<UnpackTrd2dMonitorData> fTrd2d; ///< Monitoring data for TRD2D - std::vector<UnpackRichMonitorData> fRich; ///< Monitoring data for RICH + std::vector<sts::UnpackMonitorData> fSts; ///< Monitoring data for STS + std::vector<much::UnpackMonitorData> fMuch; ///< Monitoring data for MUCH + std::vector<tof::UnpackMonitorData> fTof; ///< Monitoring data for TOF + std::vector<bmon::UnpackMonitorData> fBmon; ///< Monitoring data for T0 + std::vector<trd::UnpackMonitorData> fTrd; ///< Monitoring data for TRD + std::vector<trd2d::UnpackMonitorData> fTrd2d; ///< Monitoring data for TRD2D + std::vector<rich::UnpackMonitorData> fRich; ///< Monitoring data for RICH size_t fNumMs = 0; size_t fNumBytes = 0; size_t fNumBytesInSts = 0; @@ -95,25 +95,25 @@ namespace cbm::algo ~Unpack() {}; /** @brief Parameters for STS unpackers **/ - StsReadoutConfigLegacy fStsConfig {}; + sts::ReadoutConfigLegacy fStsConfig {}; /** @brief Parameters for MUCH unpackers **/ - MuchReadoutConfig fMuchConfig {}; + much::ReadoutConfig fMuchConfig {}; /** @brief Parameters for TOF unpackers **/ - TofReadoutConfig fTofConfig {}; + tof::ReadoutConfig fTofConfig {}; /** @brief Parameters for T0 unpackers **/ - BmonReadoutConfig fBmonConfig {}; + bmon::ReadoutConfig fBmonConfig {}; /** @brief Parameters for TRD unpackers **/ - TrdReadoutConfig fTrdConfig {}; + trd::ReadoutConfig fTrdConfig {}; /** @brief Parameters for TRD2D unpackers **/ - Trd2dReadoutConfig fTrd2dConfig {}; + trd2d::ReadoutConfig fTrd2dConfig {}; /** @brief Parameters for RICH unpackers **/ - RichReadoutConfig fRichConfig {}; + rich::ReadoutConfig fRichConfig {}; /** @@ -169,25 +169,25 @@ namespace cbm::algo std::vector<Subsystem> fSubsystems = {}; ///< Detector identifiers to unpack /** @brief STS unpackers **/ - std::map<uint16_t, UnpackSts> fAlgoSts = {}; + std::map<uint16_t, sts::Unpack> fAlgoSts = {}; /** @brief MUCH unpackers **/ - std::map<uint16_t, UnpackMuch> fAlgoMuch = {}; + std::map<uint16_t, much::Unpack> fAlgoMuch = {}; /** @brief TOF unpackers **/ - std::map<uint16_t, UnpackTof> fAlgoTof = {}; + std::map<uint16_t, tof::Unpack> fAlgoTof = {}; /** @brief T0 unpackers **/ - std::map<uint16_t, UnpackBmon> fAlgoBmon = {}; + std::map<uint16_t, bmon::Unpack> fAlgoBmon = {}; /** @brief TRD unpackers **/ - std::map<uint16_t, UnpackTrd> fAlgoTrd = {}; + std::map<uint16_t, trd::Unpack> fAlgoTrd = {}; /** @brief TRD2D unpackers **/ - std::map<uint16_t, UnpackTrd2d> fAlgoTrd2d = {}; + std::map<uint16_t, trd2d::Unpack> fAlgoTrd2d = {}; /** @brief RICH unpackers **/ - std::map<uint16_t, UnpackRich> fAlgoRich = {}; + std::map<uint16_t, rich::Unpack> fAlgoRich = {}; /** @brief System time offsets **/ std::map<Subsystem, int32_t> fSystemTimeOffset = { diff --git a/reco/detectors/sts/CbmRecoSts.h b/reco/detectors/sts/CbmRecoSts.h index 5650d3b43e30fc66bbbdada2e8bf24817fc543da..94b68b9bf6ac3e376b218fe6cfa68b8844e24792 100644 --- a/reco/detectors/sts/CbmRecoSts.h +++ b/reco/detectors/sts/CbmRecoSts.h @@ -16,7 +16,7 @@ #include <TClonesArray.h> #include <TStopwatch.h> -#include "sts/StsHitfinderChain.h" +#include "sts/HitfinderChain.h" class CbmDigiManager; class CbmEvent; diff --git a/reco/tasks/CbmTaskTofHitFinder.cxx b/reco/tasks/CbmTaskTofHitFinder.cxx index b6b5e6d5bbf2d5bcdf6b9313ff7ea2e1447d82eb..722c88e67865eb066b4268349dd4ab38216febb1 100644 --- a/reco/tasks/CbmTaskTofHitFinder.cxx +++ b/reco/tasks/CbmTaskTofHitFinder.cxx @@ -45,9 +45,9 @@ using std::setprecision; using std::setw; using std::stringstream; -using cbm::algo::HitFinderTofRpcPar; -using cbm::algo::TofCell; -using cbm::algo::TofCluster; +using cbm::algo::tof::Cell; +using cbm::algo::tof::Cluster; +using cbm::algo::tof::HitFinderRpcPar; const int32_t numClWalkBinX = 20; const double TTotMean = 2.E4; @@ -333,7 +333,7 @@ bool CbmTaskTofHitFinder::InitAlgos() int32_t iNbRpc = fDigiBdfPar->GetNbRpc(iSmType); for (int32_t iSm = 0; iSm < iNbSm; iSm++) { for (int32_t iRpc = 0; iRpc < iNbRpc; iRpc++) { - std::unique_ptr<HitFinderTofRpcPar> par(new HitFinderTofRpcPar()); + std::unique_ptr<HitFinderRpcPar> par(new HitFinderRpcPar()); par->FeeTimeRes = fDigiBdfPar->GetFeeTimeRes(); par->SysTimeRes = 0.080; par->CPSigPropSpeed = fvCPSigPropSpeed[iSmType][iRpc]; @@ -355,7 +355,7 @@ bool CbmTaskTofHitFinder::InitAlgos() CbmTofCell* channelInfo = fDigiPar->GetCell(iChId); //init Tof cell - TofCell& cell = par->fChanPar[iCh].cell; + Cell& cell = par->fChanPar[iCh].cell; cell.pos.SetX(channelInfo->GetX()); cell.pos.SetY(channelInfo->GetY()); cell.pos.SetZ(channelInfo->GetZ()); @@ -422,7 +422,7 @@ pair<int32_t, int32_t> CbmTaskTofHitFinder::BuildClusters(CbmEvent* event) std::vector<int32_t>& digiInd = fStorDigiInd[iSmType][rpcIdx]; //call cluster finder - std::vector<TofCluster> clusters = fAlgo[iSmType][rpcIdx](digiExp, digiInd); + std::vector<Cluster> clusters = fAlgo[iSmType][rpcIdx](digiExp, digiInd); //Store hits and match for (auto const& cluster : clusters) { diff --git a/reco/tasks/CbmTaskTofHitFinder.h b/reco/tasks/CbmTaskTofHitFinder.h index 77760c973c9dd63553b005e7baef398fbee7c32b..3daa80c6daa64b80cb74ae53d67fe52179f9664f 100644 --- a/reco/tasks/CbmTaskTofHitFinder.h +++ b/reco/tasks/CbmTaskTofHitFinder.h @@ -23,7 +23,7 @@ class CbmTofCell; class CbmDigiManager; class CbmEvent; -#include "tof/HitFinderTof.h" +#include "tof/HitFinder.h" // FAIR classes and includes #include "FairTask.h" @@ -131,7 +131,7 @@ private: TClonesArray* fTofDigiMatchColl = nullptr; // TOF Digis // Hit finder algo - std::map<uint32_t, std::map<uint32_t, cbm::algo::HitFinderTof>> fAlgo = {}; //[nbType][nbSm*nbRpc] + std::map<uint32_t, std::map<uint32_t, cbm::algo::tof::HitFinder>> fAlgo = {}; //[nbType][nbSm*nbRpc] // Intermediate storage variables std::vector<std::vector<std::vector<CbmTofDigi>>> fStorDigiExp; //[nbType][nbSm*nbRpc][nbCh][nDigis] diff --git a/reco/tasks/CbmTaskUnpack.cxx b/reco/tasks/CbmTaskUnpack.cxx index 0858e427eb17134c8e837603f1237c2fa4b10c26..87eae87eb972b968614068fd68aaea0e1c5926f9 100644 --- a/reco/tasks/CbmTaskUnpack.cxx +++ b/reco/tasks/CbmTaskUnpack.cxx @@ -161,10 +161,10 @@ InitStatus CbmTaskUnpack::Init() // ---------------------------------------------------------------------------- // ----- Initialisation --------------------------------------------------- -cbm::algo::Trd2dReadoutConfig CbmTaskUnpack::InitTrd2dReadoutConfig() +cbm::algo::trd2d::ReadoutConfig CbmTaskUnpack::InitTrd2dReadoutConfig() { // Output object - cbm::algo::Trd2dReadoutConfig Trd2dConfig; + cbm::algo::trd2d::ReadoutConfig Trd2dConfig; // Initialize input files FairParAsciiFileIo asciiInput; @@ -232,10 +232,10 @@ cbm::algo::Trd2dReadoutConfig CbmTaskUnpack::InitTrd2dReadoutConfig() } // ----- Initialisation --------------------------------------------------- -cbm::algo::TrdReadoutConfig CbmTaskUnpack::InitTrdReadoutConfig() +cbm::algo::trd::ReadoutConfig CbmTaskUnpack::InitTrdReadoutConfig() { // Output object - cbm::algo::TrdReadoutConfig TrdConfig; + cbm::algo::trd::ReadoutConfig TrdConfig; std::string trdparfile = Form("%s/parameters/trd/trd_v22h_mcbm.asic.par", std::getenv("VMCWORKDIR")); diff --git a/reco/tasks/CbmTaskUnpack.h b/reco/tasks/CbmTaskUnpack.h index 57b799c7fc2736f482b66eec7220655fd41433e3..9fe372bcf3d633b5f6298cc7c76f2c7f7c16a56c 100644 --- a/reco/tasks/CbmTaskUnpack.h +++ b/reco/tasks/CbmTaskUnpack.h @@ -21,24 +21,11 @@ namespace cbm #include <FairTask.h> -#include "tof/TofReadoutConfig.h" -#include "tof/UnpackTof.h" -#include "trd/TrdReadoutConfig.h" -#include "trd/UnpackTrd.h" -#include "trd2d/Trd2dReadoutConfig.h" -#include "trd2d/UnpackTrd2d.h" - #include <sstream> #include <vector> #include "EventBuilder.h" #include "Unpack.h" -#include "bmon/BmonReadoutConfig.h" -#include "bmon/UnpackBmon.h" -#include "much/MuchReadoutConfig.h" -#include "much/UnpackMuch.h" -#include "sts/StsReadoutConfigLegacy.h" -#include "sts/UnpackSts.h" class CbmDigiManager; class CbmSourceTs; @@ -93,11 +80,11 @@ private: // methods /** @brief Initialisation of address maps for Trd **/ - cbm::algo::TrdReadoutConfig InitTrdReadoutConfig(); + cbm::algo::trd::ReadoutConfig InitTrdReadoutConfig(); /** @brief Initialisation of address maps for Trd2d **/ - cbm::algo::Trd2dReadoutConfig InitTrd2dReadoutConfig(); + cbm::algo::trd2d::ReadoutConfig InitTrd2dReadoutConfig(); private: // members CbmSourceTs* fSource = nullptr; diff --git a/reco/tasks/CbmTaskUnpackXpu.h b/reco/tasks/CbmTaskUnpackXpu.h index 4a99affee609fb9f2386e04cbd6f79d6b82a2507..d67ac35e1a47d2e0a4bd8a98d23455ce5b90c65f 100644 --- a/reco/tasks/CbmTaskUnpackXpu.h +++ b/reco/tasks/CbmTaskUnpackXpu.h @@ -15,7 +15,7 @@ #include <vector> #include "EventBuilder.h" -#include "sts/StsReadoutConfigLegacy.h" +#include "sts/ReadoutConfigLegacy.h" #include "sts/UnpackStsXpu.h" @@ -70,7 +70,7 @@ private: // members CbmSourceTs* fSource = nullptr; cbm::algo::UnpackStsXpu fAlgoStsXpu; - cbm::algo::StsReadoutConfigLegacy fStsConfig {}; + cbm::algo::sts::ReadoutConfigLegacy fStsConfig {}; size_t fNumTs = 0; size_t fNumMs = 0;