diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index dafbf5fbc51b8e71e4beecb2bda0a760ff0061a4..eedb1a9ebaf2f427bb7856986325da8a48b0092b 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -13,8 +13,8 @@ set(SRCS detectors/tof/HitFinderTof.cxx detectors/tof/TofReadoutConfig.cxx detectors/tof/UnpackTof.cxx - detectors/t0/T0ReadoutConfig.cxx - detectors/t0/UnpackT0.cxx + detectors/bmon/BmonReadoutConfig.cxx + detectors/bmon/UnpackBmon.cxx ) add_library(Algo SHARED ${SRCS}) @@ -27,7 +27,7 @@ target_include_directories(Algo ${CMAKE_CURRENT_SOURCE_DIR}/detectors/sts ${CMAKE_CURRENT_SOURCE_DIR}/detectors/much ${CMAKE_CURRENT_SOURCE_DIR}/detectors/tof - ${CMAKE_CURRENT_SOURCE_DIR}/detectors/t0 + ${CMAKE_CURRENT_SOURCE_DIR}/detectors/bmon ) target_link_libraries(Algo PUBLIC OnlineData ROOT::GenVector INTERFACE FairLogger::FairLogger external::fles_ipc) diff --git a/algo/detectors/t0/T0ReadoutConfig.cxx b/algo/detectors/bmon/BmonReadoutConfig.cxx similarity index 91% rename from algo/detectors/t0/T0ReadoutConfig.cxx rename to algo/detectors/bmon/BmonReadoutConfig.cxx index 662ba589db43cc995db49a6e510f9e3810480a20..6c6eeb39a756e2bc14d4b20eab3ff9ebc4cac788 100644 --- a/algo/detectors/t0/T0ReadoutConfig.cxx +++ b/algo/detectors/bmon/BmonReadoutConfig.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "T0ReadoutConfig.h" +#include "BmonReadoutConfig.h" #include "CbmTofAddress.h" @@ -18,15 +18,15 @@ using namespace std; namespace cbm::algo { // --- Constructor ------------------------------------------------------------------ - T0ReadoutConfig::T0ReadoutConfig() { Init(); } + BmonReadoutConfig::BmonReadoutConfig() { Init(); } // ------------------------------------------------------------------------------------ // --- Destructor ----------------------------------------------------------------- - T0ReadoutConfig::~T0ReadoutConfig() {} + BmonReadoutConfig::~BmonReadoutConfig() {} // ------------------------------------------------------------------------------------ // --- Equipment IDs -------------------------------------------------------------- - std::vector<uint16_t> T0ReadoutConfig::GetEquipmentIds() + std::vector<uint16_t> BmonReadoutConfig::GetEquipmentIds() { std::vector<uint16_t> result; for (auto& entry : fReadoutMap) @@ -36,7 +36,7 @@ namespace cbm::algo // ------------------------------------------------------------------------------------ // --- Number of elinks for a component / equipment ------------------------------- - size_t T0ReadoutConfig::GetNumElinks(uint16_t equipmentId) + size_t BmonReadoutConfig::GetNumElinks(uint16_t equipmentId) { size_t result = 0; auto it = fReadoutMap.find(equipmentId); @@ -47,7 +47,7 @@ namespace cbm::algo // --- Mapping (equimentId, elink) -> address[channel] ------------------------------ - std::vector<uint32_t> T0ReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) + std::vector<uint32_t> BmonReadoutConfig::Map(uint16_t equipmentId, uint16_t elinkId) { std::vector<uint32_t> result; auto equipIter = fReadoutMap.find(equipmentId); @@ -58,7 +58,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------------------ - void T0ReadoutConfig::Init() + void BmonReadoutConfig::Init() { // This here refers to the mCBM 2022 setup. // Taken from CbmMcbm2018TofPar in combination with macro/beamtime/mcbm2022/mBmonCriPar.par @@ -98,7 +98,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void T0ReadoutConfig::BuildChannelsUidMap() + void BmonReadoutConfig::BuildChannelsUidMap() { const uint32_t numAsics = numComp * numFebsPerComp * numAsicsPerFeb; const uint32_t numChan = numAsics * numChanPerAsic; @@ -134,7 +134,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void T0ReadoutConfig::BuildChannelsUidMapT0(uint32_t& uCh, uint32_t uGbtx) + void BmonReadoutConfig::BuildChannelsUidMapT0(uint32_t& uCh, uint32_t uGbtx) { LOG(info) << " Map diamond " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; for (uint32_t uGet4 = 0; uGet4 < numElinksPerCrob; ++uGet4) { @@ -155,7 +155,7 @@ namespace cbm::algo } // ------------------------------------------------------------------------- - void T0ReadoutConfig::BuildChannelsUidMapT0_2022(uint32_t& uCh, uint32_t uGbtx) + void BmonReadoutConfig::BuildChannelsUidMapT0_2022(uint32_t& uCh, uint32_t uGbtx) { LOG(info) << " Map 2022 diamond " << moduleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; for (uint32_t uGet4 = 0; uGet4 < numElinksPerCrob; ++uGet4) { diff --git a/algo/detectors/t0/T0ReadoutConfig.h b/algo/detectors/bmon/BmonReadoutConfig.h similarity index 90% rename from algo/detectors/t0/T0ReadoutConfig.h rename to algo/detectors/bmon/BmonReadoutConfig.h index a12f3a396a8f5959b2c93aaf10a5c5d19a3da6ad..5cfa0e09ea1d9ff5890adc9ae4c99daa06057bc1 100644 --- a/algo/detectors/t0/T0ReadoutConfig.h +++ b/algo/detectors/bmon/BmonReadoutConfig.h @@ -3,13 +3,13 @@ Authors: Dominik Smith [committer] */ // ------------------------------------------------------------------------- -// ----- T0ReadoutConfig header file ----- +// ----- BmonReadoutConfig header file ----- // ----- Created 22/02/22 by P.-A. Loizeau ----- // ----- Modified 07/12/18 by A Kumar ----- // ------------------------------------------------------------------------- -#ifndef ALGO_DETECTORS_T0_T0READOUTCONFIG_H -#define ALGO_DETECTORS_T0_T0READOUTCONFIG_H +#ifndef ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H +#define ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H #include <cstdint> #include <map> @@ -17,14 +17,14 @@ namespace cbm::algo { - class T0ReadoutConfig { + class BmonReadoutConfig { public: /** @brief Constructor **/ - T0ReadoutConfig(); + BmonReadoutConfig(); /** @brief Destructor **/ - virtual ~T0ReadoutConfig(); + virtual ~BmonReadoutConfig(); /** @brief Equipment in the configuration ** @return Vector of equipment IDs @@ -82,4 +82,4 @@ namespace cbm::algo } /* namespace cbm::algo */ -#endif //ALGO_DETECTORS_T0_T0READOUTCONFIG_H +#endif //ALGO_DETECTORS_BMON_BMONREADOUTCONFIG_H diff --git a/algo/detectors/t0/UnpackT0.cxx b/algo/detectors/bmon/UnpackBmon.cxx similarity index 89% rename from algo/detectors/t0/UnpackT0.cxx rename to algo/detectors/bmon/UnpackBmon.cxx index 9ba037315772ef0fa0a02d4d08de6a6b543c8a32..d199b301d8dee32912172a7eff5ee5b14d5403bf 100644 --- a/algo/detectors/t0/UnpackT0.cxx +++ b/algo/detectors/bmon/UnpackBmon.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "UnpackT0.h" +#include "UnpackBmon.h" #include <cassert> #include <sstream> @@ -18,8 +18,8 @@ namespace cbm::algo { // ---- Algorithm execution --------------------------------------------- - UnpackT0::resultType UnpackT0::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) + UnpackBmon::resultType UnpackBmon::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) { // --- Output data @@ -101,8 +101,8 @@ namespace cbm::algo // ----- Process hit message -------------------------------------------- - inline void UnpackT0::ProcessHitMessage(const critof001::Message& message, vector<CbmTofDigi>& digiVec, - UnpackT0MonitorData& monitor) const + inline void UnpackBmon::ProcessHitMessage(const critof001::Message& message, vector<CbmBmonDigi>& digiVec, + UnpackBmonMonitorData& monitor) const { // IGNORES: // - Duplicate messages @@ -118,7 +118,7 @@ namespace cbm::algo monitor.fNumErrElinkOutOfRange++; return; } - const UnpackT0ElinkPar& elinkPar = fParams.fElinkParams.at(elink); + const UnpackBmonElinkPar& elinkPar = fParams.fElinkParams.at(elink); const uint32_t channel = message.getGdpbHitChanId(); const uint32_t channelUId = (elinkPar.fChannelUId)[channel]; @@ -139,7 +139,7 @@ namespace cbm::algo // ----- Process an epoch message --------------------------------------- - inline void UnpackT0::ProcessEpochMessage(const critof001::Message& message) + inline void UnpackBmon::ProcessEpochMessage(const critof001::Message& message) { const uint64_t epoch = message.getGdpbEpEpochNb(); diff --git a/algo/detectors/t0/UnpackT0.h b/algo/detectors/bmon/UnpackBmon.h similarity index 76% rename from algo/detectors/t0/UnpackT0.h rename to algo/detectors/bmon/UnpackBmon.h index d4b2b07325d1ed0223e716219666d6abff6a1a59..5549a677c7bf3e010fc05a13a9968eecb9b5b7e7 100644 --- a/algo/detectors/t0/UnpackT0.h +++ b/algo/detectors/bmon/UnpackBmon.h @@ -2,11 +2,11 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACKT0_H -#define CBM_ALGO_UNPACKT0_H 1 +#ifndef CBM_ALGO_UNPACKBMON_H +#define CBM_ALGO_UNPACKBMON_H 1 -#include "CbmTofDigi.h" +#include "CbmBmonDigi.h" #include "MicrosliceDescriptor.hpp" #include "Timeslice.hpp" @@ -23,33 +23,33 @@ namespace cbm::algo { - /** @struct UnpackT0ElinkPar + /** @struct UnpackBmonElinkPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 - ** @brief T0 Unpacking parameters for one eLink / ASIC + ** @brief Bmon Unpacking parameters for one eLink / ASIC **/ - struct UnpackT0ElinkPar { - std::vector<uint32_t> fChannelUId; ///< CbmT0Address for different channels + struct UnpackBmonElinkPar { + std::vector<uint32_t> fChannelUId; ///< CbmBmonAddress for different channels uint64_t fTimeOffset = 0.; ///< Time calibration parameter }; - /** @struct UnpackT0Par + /** @struct UnpackBmonPar ** @author Volker Friese <v.friese@gsi.de> ** @since 25 November 2021 ** @brief Parameters required for the STS unpacking (specific to one component) **/ - struct UnpackT0Par { - std::vector<UnpackT0ElinkPar> fElinkParams = {}; ///< Parameters for each eLink + struct UnpackBmonPar { + std::vector<UnpackBmonElinkPar> fElinkParams = {}; ///< Parameters for each eLink }; - /** @struct UnpackT0Moni + /** @struct UnpackBmonMoni ** @author Volker Friese <v.friese@gsi.de> ** @since 2 December 2021 ** @brief Monitoring data for STS unpacking **/ - struct UnpackT0MonitorData { + struct UnpackBmonMonitorData { uint32_t fNumNonHitOrTsbMessage = 0; uint32_t fNumErrElinkOutOfRange = 0; ///< Elink not contained in parameters uint32_t fNumErrInvalidFirstMessage = 0; ///< First message is not EPOCH @@ -66,24 +66,24 @@ namespace cbm::algo }; - /** @class UnpackT0 + /** @class UnpackBmon ** @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 UnpackT0 { + class UnpackBmon { public: - typedef std::pair<std::vector<CbmTofDigi>, UnpackT0MonitorData> resultType; + typedef std::pair<std::vector<CbmBmonDigi>, UnpackBmonMonitorData> resultType; /** @brief Default constructor **/ - UnpackT0() {}; + UnpackBmon() {}; /** @brief Destructor **/ - ~UnpackT0() {}; + ~UnpackBmon() {}; /** @brief Algorithm execution @@ -98,7 +98,7 @@ namespace cbm::algo /** @brief Set the parameter container ** @param params Pointer to parameter container **/ - void SetParams(std::unique_ptr<UnpackT0Par> params) { fParams = *(std::move(params)); } + void SetParams(std::unique_ptr<UnpackBmonPar> params) { fParams = *(std::move(params)); } private: // methods @@ -107,8 +107,8 @@ namespace cbm::algo ** @param digiVec Vector to append the created digi to ** @param monitor Reference to monitor object **/ - void ProcessHitMessage(const critof001::Message& message, std::vector<CbmTofDigi>& digiVec, - UnpackT0MonitorData& monitor) const; + void ProcessHitMessage(const critof001::Message& message, std::vector<CbmBmonDigi>& digiVec, + UnpackBmonMonitorData& monitor) const; /** @brief Process an epoch message (TS_MSB) ** @param message SMX message (32-bit word) @@ -119,10 +119,10 @@ namespace cbm::algo private: // members uint64_t fCurrentTsTime = 0; ///< Unix time of timeslice in units of epoch length uint32_t fCurrentEpochInTs = 0; ///< Current epoch number relative to timeslice start epoch - UnpackT0Par fParams = {}; ///< Parameter container + UnpackBmonPar fParams = {}; ///< Parameter container }; } /* namespace cbm::algo */ -#endif /* CBM_ALGO_UNPACKT0_H */ +#endif /* CBM_ALGO_UNPACKBMON_H */ diff --git a/reco/tasks/CbmTaskUnpack.cxx b/reco/tasks/CbmTaskUnpack.cxx index e394e45c5a38016a24125c89ca1c70949150153b..a736afb4f29a1a182421fd0536b590ceae1cc9d8 100644 --- a/reco/tasks/CbmTaskUnpack.cxx +++ b/reco/tasks/CbmTaskUnpack.cxx @@ -34,12 +34,12 @@ using namespace std; +using cbm::algo::UnpackBmonElinkPar; +using cbm::algo::UnpackBmonPar; using cbm::algo::UnpackMuchElinkPar; using cbm::algo::UnpackMuchPar; using cbm::algo::UnpackStsElinkPar; using cbm::algo::UnpackStsPar; -using cbm::algo::UnpackT0ElinkPar; -using cbm::algo::UnpackT0Par; using cbm::algo::UnpackTofElinkPar; using cbm::algo::UnpackTofPar; @@ -172,11 +172,11 @@ void CbmTaskUnpack::Exec(Option_t*) numCompUsed++; } // system TOF - // T0 + // Bmon if (systemId == fles::SubsystemIdentifier::T0) { const uint16_t equipmentId = timeslice->descriptor(comp, 0).eq_id; - const auto algoIt = fAlgoT0.find(equipmentId); - assert(algoIt != fAlgoT0.end()); + const auto algoIt = fAlgoBmon.find(equipmentId); + assert(algoIt != fAlgoBmon.end()); // The current algorithm works for the T0 data format version XXXX used in 2021. // Other versions are not yet supported. @@ -346,17 +346,17 @@ InitStatus CbmTaskUnpack::Init() } // Create one algorithm per component and configure it with parameters - auto equipIdsT0 = fT0Config.GetEquipmentIds(); - for (auto& equip : equipIdsT0) { - std::unique_ptr<UnpackT0Par> par(new UnpackT0Par()); - const size_t numElinks = fT0Config.GetNumElinks(equip); + auto equipIdsBmon = fBmonConfig.GetEquipmentIds(); + for (auto& equip : equipIdsBmon) { + std::unique_ptr<UnpackBmonPar> par(new UnpackBmonPar()); + const size_t numElinks = fBmonConfig.GetNumElinks(equip); for (size_t elink = 0; elink < numElinks; elink++) { - UnpackT0ElinkPar elinkPar; - elinkPar.fChannelUId = fT0Config.Map(equip, elink); // Vector of T0 addresses for this elink + UnpackBmonElinkPar elinkPar; + elinkPar.fChannelUId = fBmonConfig.Map(equip, elink); // Vector of T0 addresses for this elink elinkPar.fTimeOffset = 0.; par->fElinkParams.push_back(elinkPar); } - fAlgoT0[equip].SetParams(std::move(par)); + fAlgoBmon[equip].SetParams(std::move(par)); LOG(info) << "--- Configured equipment " << equip << " with " << numElinks << " elinks"; } @@ -365,7 +365,7 @@ InitStatus CbmTaskUnpack::Init() LOG(debug) << "Readout map:" << fStsConfig.PrintReadoutMap(); LOG(info) << "--- Configured " << fAlgoMuch.size() << " unpacker algorithms for MUCH."; LOG(info) << "--- Configured " << fAlgoTof.size() << " unpacker algorithms for TOF."; - LOG(info) << "--- Configured " << fAlgoT0.size() << " unpacker algorithms for T0."; + LOG(info) << "--- Configured " << fAlgoBmon.size() << " unpacker algorithms for T0."; LOG(info) << "=================================================="; diff --git a/reco/tasks/CbmTaskUnpack.h b/reco/tasks/CbmTaskUnpack.h index 4c8cccc4ea7d867649e722f9a94fab8ef1edd89b..040dbc0175e24fdaf32789cea63ee4bcadb530fd 100644 --- a/reco/tasks/CbmTaskUnpack.h +++ b/reco/tasks/CbmTaskUnpack.h @@ -11,18 +11,18 @@ #include <FairTask.h> -#include "T0ReadoutConfig.h" #include "TofReadoutConfig.h" #include <sstream> #include <vector> +#include "BmonReadoutConfig.h" #include "EventBuilder.h" #include "MuchReadoutConfig.h" #include "StsReadoutConfig.h" +#include "UnpackBmon.h" #include "UnpackMuch.h" #include "UnpackSts.h" -#include "UnpackT0.h" #include "UnpackTof.h" class CbmDigiManager; @@ -85,8 +85,8 @@ private: // members std::map<uint16_t, cbm::algo::UnpackTof> fAlgoTof = {}; cbm::algo::TofReadoutConfig fTofConfig {}; - std::map<uint16_t, cbm::algo::UnpackT0> fAlgoT0 = {}; - cbm::algo::T0ReadoutConfig fT0Config {}; + std::map<uint16_t, cbm::algo::UnpackBmon> fAlgoBmon = {}; + cbm::algo::BmonReadoutConfig fBmonConfig {}; size_t fNumTs = 0; size_t fNumMs = 0;