diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index 7a980fd045abcbce5e13a466da2fb2de62a130d0..e7591a0bc18983727527dc6072beb76de5bc11c3 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -91,23 +91,23 @@ set(SRCS detectors/sts/Unpack.cxx detectors/sts/UnpackMS.cxx detectors/much/ReadoutConfig.cxx - detectors/much/Unpack.cxx + detectors/much/UnpackMS.cxx detectors/tof/HitFinder.cxx detectors/tof/Calibrate.cxx detectors/tof/Clusterizer.cxx detectors/tof/ReadoutConfig.cxx - detectors/tof/Unpack.cxx + detectors/tof/UnpackMS.cxx detectors/tof/Hitfind.cxx detectors/tof/HitfinderChain.cxx detectors/tof/CalibratorChain.cxx detectors/bmon/ReadoutConfig.cxx - detectors/bmon/Unpack.cxx + detectors/bmon/UnpackMS.cxx detectors/trd/ReadoutConfig.cxx - detectors/trd/Unpack.cxx + detectors/trd/UnpackMS.cxx detectors/trd2d/ReadoutConfig.cxx - detectors/trd2d/Unpack.cxx + detectors/trd2d/UnpackMS.cxx detectors/rich/ReadoutConfig.cxx - detectors/rich/Unpack.cxx + detectors/rich/UnpackMS.cxx global/Reco.cxx qa/DigiEventQa.cxx qa/Histo1D.cxx diff --git a/algo/detectors/bmon/Unpack.cxx b/algo/detectors/bmon/UnpackMS.cxx similarity index 90% rename from algo/detectors/bmon/Unpack.cxx rename to algo/detectors/bmon/UnpackMS.cxx index 377c628d40fc7804f5cb1fc474c7decaccd85cf5..88204285120634d39396683c8a8cdb39b4e33a5e 100644 --- a/algo/detectors/bmon/Unpack.cxx +++ b/algo/detectors/bmon/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include <cassert> #include <cmath> @@ -17,8 +17,8 @@ namespace cbm::algo::bmon { // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -106,8 +106,8 @@ namespace cbm::algo::bmon // ----- Process hit message -------------------------------------------- - inline void Unpack::ProcessHitMessage(const critof001::Message& message, const TimeSpec& time, - vector<CbmBmonDigi>& digiVec, UnpackMonitorData& monitor) const + inline void UnpackMS::ProcessHitMessage(const critof001::Message& message, const TimeSpec& time, + vector<CbmBmonDigi>& digiVec, UnpackMonitorData& monitor) const { // IGNORES: // - Duplicate messages @@ -138,7 +138,7 @@ namespace cbm::algo::bmon // ----- Process an epoch message --------------------------------------- - inline void Unpack::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const + inline void UnpackMS::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const { const uint64_t epoch = message.getGdpbEpEpochNb(); diff --git a/algo/detectors/bmon/Unpack.h b/algo/detectors/bmon/UnpackMS.h similarity index 96% rename from algo/detectors/bmon/Unpack.h rename to algo/detectors/bmon/UnpackMS.h index 11e027c50de6ae14977a407eb437cebdc92ea526..58dfc4c7a1350d6fe0f5bdf4d1c946fbb0d188cd 100644 --- a/algo/detectors/bmon/Unpack.h +++ b/algo/detectors/bmon/UnpackMS.h @@ -1,10 +1,7 @@ /* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ - -#ifndef CBM_ALGO_BMON_UNPACK_H -#define CBM_ALGO_BMON_UNPACK_H 1 - +#pragma once #include "CbmBmonDigi.h" #include "CriGet4Mess001.h" @@ -81,18 +78,18 @@ namespace cbm::algo::bmon ** @since 25 November 2021 ** @brief Unpack algorithm for STS **/ - class Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmBmonDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution @@ -136,5 +133,3 @@ namespace cbm::algo::bmon } // namespace cbm::algo::bmon - -#endif /* CBM_ALGO_BMON_UNPACK_H */ diff --git a/algo/detectors/much/Unpack.cxx b/algo/detectors/much/UnpackMS.cxx similarity index 91% rename from algo/detectors/much/Unpack.cxx rename to algo/detectors/much/UnpackMS.cxx index 58350fecf4dbac5afddd9e27cf2eb312ab82e8a5..f7e1cd3a31523b36caedb64a437bba15883dab7f 100644 --- a/algo/detectors/much/Unpack.cxx +++ b/algo/detectors/much/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Volker Friese [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include "StsXyterMessage.h" @@ -18,8 +18,8 @@ namespace cbm::algo::much { // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -99,8 +99,8 @@ namespace cbm::algo::much // ----- Process hit message -------------------------------------------- - inline void Unpack::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, - vector<CbmMuchDigi>& digiVec, UnpackMonitorData& monitor) const + inline void UnpackMS::ProcessHitMessage(const stsxyter::Message& message, const TimeSpec& time, + vector<CbmMuchDigi>& digiVec, UnpackMonitorData& monitor) const { // --- Check eLink and get parameters uint16_t elink = message.GetLinkIndexHitBinning(); @@ -137,7 +137,7 @@ namespace cbm::algo::much // ----- Process an epoch (TS_MSB) message ------------------------------ - inline void Unpack::ProcessTsmsbMessage(const stsxyter::Message& message, TimeSpec& time) const + inline void UnpackMS::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). diff --git a/algo/detectors/much/Unpack.h b/algo/detectors/much/UnpackMS.h similarity index 96% rename from algo/detectors/much/Unpack.h rename to algo/detectors/much/UnpackMS.h index 0475a7269080c8f664b4aef402e761b0d45c9807..8a3162514e6ffb2896c4deb511effe2748735a64 100644 --- a/algo/detectors/much/Unpack.h +++ b/algo/detectors/much/UnpackMS.h @@ -1,10 +1,7 @@ /* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only Authors: Pierre-Alain Loizeau, Volker Friese [committer] */ - -#ifndef CBM_ALGO_MUCH_UNPACK_H -#define CBM_ALGO_MUCH_UNPACK_H 1 - +#pragma once #include "CbmMuchDigi.h" #include "MicrosliceDescriptor.hpp" @@ -71,24 +68,23 @@ namespace cbm::algo::much }; - /** @class Unpack + /** @class UnpackMS ** @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 Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmMuchDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; - + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution @@ -148,5 +144,3 @@ namespace cbm::algo::much } // namespace cbm::algo::much - -#endif /* CBM_ALGO_UNPACKMUCH_H */ diff --git a/algo/detectors/rich/Unpack.cxx b/algo/detectors/rich/UnpackMS.cxx similarity index 86% rename from algo/detectors/rich/Unpack.cxx rename to algo/detectors/rich/UnpackMS.cxx index c2b60505fb8137f4949181ac21b790df0f7f8498..b463e279c3aa7348a94a416a0d428d410f24fc4c 100644 --- a/algo/detectors/rich/Unpack.cxx +++ b/algo/detectors/rich/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include "AlgoFairloggerCompat.h" @@ -11,8 +11,8 @@ namespace cbm::algo::rich { // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { MSContext ctx; @@ -46,7 +46,7 @@ namespace cbm::algo::rich } - void Unpack::ProcessTrbPacket(rich::MicrosliceReader& reader, MSContext& ctx) const + void UnpackMS::ProcessTrbPacket(rich::MicrosliceReader& reader, MSContext& ctx) const { //process CBM time const uint32_t word_MSB = reader.NextWord(); // CBM 63:32 @@ -77,7 +77,7 @@ namespace cbm::algo::rich } - void Unpack::ProcessHubBlock(rich::MicrosliceReader& reader, MSContext& ctx) const + void UnpackMS::ProcessHubBlock(rich::MicrosliceReader& reader, MSContext& ctx) const { uint32_t word = reader.NextWord(); @@ -132,8 +132,8 @@ namespace cbm::algo::rich } } - int Unpack::ProcessCtsHeader(rich::MicrosliceReader& reader, uint32_t subSubEventSize, - uint32_t /*subSubEventId*/) const + int UnpackMS::ProcessCtsHeader(rich::MicrosliceReader& reader, uint32_t subSubEventSize, + uint32_t /*subSubEventId*/) const { const uint32_t word = reader.NextWord(); @@ -160,8 +160,8 @@ namespace cbm::algo::rich return nofTimeWords; } - void Unpack::ProcessSubSubEvent(rich::MicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId, - MSContext& ctx) const + void UnpackMS::ProcessSubSubEvent(rich::MicrosliceReader& reader, int nofTimeWords, uint32_t subSubEventId, + MSContext& ctx) const { uint32_t epoch = 0; // store last epoch obtained in sub-sub-event @@ -231,8 +231,8 @@ namespace cbm::algo::rich } // ---- ProcessTimeDataWord ---- - void Unpack::ProcessTimeDataWord(uint32_t epoch, uint32_t tdcWord, uint32_t subSubEventId, - std::vector<double>& raisingTime, MSContext& ctx) const + void UnpackMS::ProcessTimeDataWord(uint32_t epoch, uint32_t tdcWord, uint32_t subSubEventId, + std::vector<double>& raisingTime, MSContext& ctx) const { const TdcTimeData td = ProcessTimeData(tdcWord); const double fullTime = CalculateTime(epoch, td.fCoarse, td.fFine); @@ -266,12 +266,12 @@ namespace cbm::algo::rich } } - double Unpack::CalculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine) const + double UnpackMS::CalculateTime(uint32_t epoch, uint32_t coarse, uint32_t fine) const { return ((double) epoch) * 2048. * 5. + ((double) coarse) * 5. - ((double) fine) * 0.005; } - void Unpack::WriteOutputDigi(int32_t fpgaID, int32_t channel, double time, double tot, MSContext& ctx) const + void UnpackMS::WriteOutputDigi(int32_t fpgaID, int32_t channel, double time, double tot, MSContext& ctx) const { double ToTcorr = fbDoToTCorr ? fParams.fElinkParams.at(fpgaID).fToTshift[channel] : 0.; int32_t pixelUID = GetPixelUID(fpgaID, channel); @@ -284,7 +284,7 @@ namespace cbm::algo::rich ctx.digis.emplace_back(pixelUID, finalTime, tot - ToTcorr); } - bool Unpack::CheckMaskedDiRICH(int32_t subSubEventId) const + bool UnpackMS::CheckMaskedDiRICH(int32_t subSubEventId) const { for (unsigned int i = 0; i < fMaskedDiRICHes.size(); ++i) { if (fMaskedDiRICHes.at(i) == subSubEventId) return true; @@ -292,7 +292,7 @@ namespace cbm::algo::rich return false; } - TdcWordType Unpack::GetTdcWordType(uint32_t tdcWord) const + TdcWordType UnpackMS::GetTdcWordType(uint32_t tdcWord) const { uint32_t tdcTimeDataMarker = (tdcWord >> 31) & 0x1; // 1 bit uint32_t tdcMarker = (tdcWord >> 29) & 0x7; // 3 bits @@ -313,14 +313,14 @@ namespace cbm::algo::rich return TdcWordType::Error; } - int32_t Unpack::GetPixelUID(int32_t fpgaID, int32_t ch) const + int32_t UnpackMS::GetPixelUID(int32_t fpgaID, int32_t ch) const { // 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)); } - TdcTimeData Unpack::ProcessTimeData(uint32_t tdcWord) const + TdcTimeData UnpackMS::ProcessTimeData(uint32_t tdcWord) const { TdcTimeData out; out.fCoarse = static_cast<uint32_t>(tdcWord & 0x7ff); // 11 bits @@ -330,13 +330,13 @@ namespace cbm::algo::rich return out; } - uint32_t Unpack::ProcessEpoch(uint32_t tdcWord) const { return static_cast<uint32_t>(tdcWord & 0xfffffff); } + uint32_t UnpackMS::ProcessEpoch(uint32_t tdcWord) const { return static_cast<uint32_t>(tdcWord & 0xfffffff); } - uint16_t Unpack::ProcessHeader(uint32_t tdcWord) const + uint16_t UnpackMS::ProcessHeader(uint32_t tdcWord) const { return static_cast<uint16_t>(tdcWord & 0xff); //8 bits } - uint16_t Unpack::ProcessTrailer(uint32_t tdcWord) const { return static_cast<uint16_t>(tdcWord & 0xffff); } + uint16_t UnpackMS::ProcessTrailer(uint32_t tdcWord) const { return static_cast<uint16_t>(tdcWord & 0xffff); } } // namespace cbm::algo::rich diff --git a/algo/detectors/rich/Unpack.h b/algo/detectors/rich/UnpackMS.h similarity index 98% rename from algo/detectors/rich/Unpack.h rename to algo/detectors/rich/UnpackMS.h index ff77dc736e39cd9a47ab7843c914175258b66cf1..fc0897c88070609fcaf71de3b614e866bed7d877 100644 --- a/algo/detectors/rich/Unpack.h +++ b/algo/detectors/rich/UnpackMS.h @@ -1,9 +1,7 @@ /* Copyright (C) 2021 Goethe-University Frankfurt, Frankfurt SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ - -#ifndef CBM_ALGO_RICH_UNPACK_H -#define CBM_ALGO_RICH_UNPACK_H +#pragma once #include "CbmRichDigi.h" #include "Definitions.h" @@ -98,17 +96,17 @@ namespace cbm::algo::rich }; - class Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmRichDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution @@ -255,5 +253,3 @@ namespace cbm::algo::rich }; } // namespace cbm::algo::rich - -#endif // CBM_ALGO_RICH_UNPACK_H diff --git a/algo/detectors/tof/Unpack.cxx b/algo/detectors/tof/UnpackMS.cxx similarity index 89% rename from algo/detectors/tof/Unpack.cxx rename to algo/detectors/tof/UnpackMS.cxx index 4d93fef72bbcc4c37e09435f7054cba7280a247b..bf011c43fe1d675b219a099fa81ae0ceb16fda40 100644 --- a/algo/detectors/tof/Unpack.cxx +++ b/algo/detectors/tof/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include <cassert> #include <cmath> @@ -16,8 +16,8 @@ namespace cbm::algo::tof { // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data @@ -103,8 +103,8 @@ namespace cbm::algo::tof // ----- Process hit message -------------------------------------------- - inline void Unpack::ProcessHitMessage(const critof001::Message& message, vector<CbmTofDigi>& digiVec, - UnpackMonitorData& monitor, TimeSpec& time) const + inline void UnpackMS::ProcessHitMessage(const critof001::Message& message, vector<CbmTofDigi>& digiVec, + UnpackMonitorData& monitor, TimeSpec& time) const { // --- Check eLink and get parameters const uint32_t elink = message.getGet4Idx(); @@ -127,7 +127,7 @@ namespace cbm::algo::tof // ----- Process an epoch message --------------------------------------- - inline void Unpack::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const + inline void UnpackMS::ProcessEpochMessage(const critof001::Message& message, TimeSpec& time) const { const uint64_t epoch = message.getGdpbEpEpochNb(); diff --git a/algo/detectors/tof/Unpack.h b/algo/detectors/tof/UnpackMS.h similarity index 96% rename from algo/detectors/tof/Unpack.h rename to algo/detectors/tof/UnpackMS.h index 2210f66d9a4b1a11aafcd072afaf8d24d5d658e8..4fb1295ce73b4b31c86840704be8c19d784e3689 100644 --- a/algo/detectors/tof/Unpack.h +++ b/algo/detectors/tof/UnpackMS.h @@ -1,10 +1,7 @@ /* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only Authors: Dominik Smith [committer] */ - -#ifndef CBM_ALGO_TOF_UNPACK_H -#define CBM_ALGO_TOF_UNPACK_H 1 - +#pragma once #include "CbmTofDigi.h" #include "CriGet4Mess001.h" @@ -71,22 +68,22 @@ namespace cbm::algo::tof } }; - /** @class Unpack + /** @class UnpackMS ** @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 Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmTofDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution ** @param msContent Microslice payload @@ -127,5 +124,3 @@ namespace cbm::algo::tof }; } // namespace cbm::algo::tof - -#endif /* CBM_ALGO_TOF_UNPACK_H */ diff --git a/algo/detectors/trd/Unpack.cxx b/algo/detectors/trd/UnpackMS.cxx similarity index 92% rename from algo/detectors/trd/Unpack.cxx rename to algo/detectors/trd/UnpackMS.cxx index 40b11f7d2c320127f2230ef1e9a9b2e640b80fa8..72b6f7ab593316d405541e4d673cc149be043839 100644 --- a/algo/detectors/trd/Unpack.cxx +++ b/algo/detectors/trd/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include <algorithm> #include <cassert> @@ -14,8 +14,8 @@ namespace cbm::algo::trd { // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data resultType result = {}; @@ -217,7 +217,7 @@ namespace cbm::algo::trd // -------------------------------------------------------------------------- // ---- digestBufInfoFlags ---- - Spadic::MsInfoType Unpack::digestBufInfoFlags(const std::uint32_t frame) const + Spadic::MsInfoType UnpackMS::digestBufInfoFlags(const std::uint32_t frame) const { auto flag = (frame >> 15) & 0x3; Spadic::MsInfoType infotype; @@ -228,7 +228,7 @@ namespace cbm::algo::trd } // ---- digestInfoMsg ---- - void Unpack::digestInfoMsg(const std::uint32_t frame) const + void UnpackMS::digestInfoMsg(const std::uint32_t frame) const { /// Save info message if needed. //if (fOptOutBVec) { fOptOutBVec->emplace_back(std::make_pair(ctx.fLastFulltime, frame)); } @@ -237,7 +237,7 @@ namespace cbm::algo::trd } // ---- digestInfoMsg ---- - void Unpack::digestMsFlags(const std::uint16_t flags, UnpackMonitorData& monitor) const + void UnpackMS::digestMsFlags(const std::uint16_t flags, UnpackMonitorData& monitor) const { if (flags & static_cast<std::uint16_t>(fles::MicrosliceFlags::CrcValid)) { monitor.fNumCrcValidFlags++; @@ -254,7 +254,7 @@ namespace cbm::algo::trd } // ---- extractSample ---- - std::float_t Unpack::extractAvgSample(size_t* adcbuffer, size_t* nadcbits) const + std::float_t UnpackMS::extractAvgSample(size_t* adcbuffer, size_t* nadcbits) const { // can not extract samples from a buffer with less than 9 bits assert(*nadcbits >= 9); @@ -281,7 +281,7 @@ namespace cbm::algo::trd } // ---- extractSample ---- - std::int16_t Unpack::extractSample(size_t* adcbuffer, size_t* nadcbits) const + std::int16_t UnpackMS::extractSample(size_t* adcbuffer, size_t* nadcbits) const { // can not extract samples from a buffer with less than 9 bits assert(*nadcbits >= 9); @@ -302,7 +302,7 @@ namespace cbm::algo::trd } // ---- getInfoType ---- - Spadic::MsInfoType Unpack::getInfoType(const std::uint32_t frame) const + Spadic::MsInfoType UnpackMS::getInfoType(const std::uint32_t frame) const { // Set first 20 bits to 1 for the mask size_t mask = 0x000FFFFF; @@ -335,14 +335,14 @@ namespace cbm::algo::trd return Spadic::MsInfoType::kMIS; } else { - std::cout << "Unpack::GetInfoType] unknown type!" << std::endl; + std::cout << "UnpackMS::GetInfoType] unknown type!" << std::endl; exit(1); return Spadic::MsInfoType::kMSB; } } // ---- getMessageType ---- - Spadic::MsMessageType Unpack::getMessageType(const std::uint32_t frame) const + Spadic::MsMessageType UnpackMS::getMessageType(const std::uint32_t frame) const { std::uint32_t checkframe = frame; checkframe &= 0xffffff; @@ -376,7 +376,7 @@ namespace cbm::algo::trd } // ---- getTsMsb ---- - std::uint8_t Unpack::getTsMsb(const std::uint32_t frame, UnpackMonitorData& monitor) const + std::uint8_t UnpackMS::getTsMsb(const std::uint32_t frame, UnpackMonitorData& monitor) const { 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. @@ -401,7 +401,7 @@ namespace cbm::algo::trd } // ---- makeDigi ---- - CbmTrdDigi Unpack::makeDigi(CbmTrdRawMessageSpadic raw, MsContext& ctx) const + CbmTrdDigi UnpackMS::makeDigi(CbmTrdRawMessageSpadic raw, MsContext& ctx) const { // Extract the trigger type and translate it to the digi enum auto rawTriggerType = static_cast<Spadic::eTriggerType>(raw.GetHitType()); @@ -451,8 +451,8 @@ namespace cbm::algo::trd } // ---- makeRaw ---- - CbmTrdRawMessageSpadic Unpack::makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, - std::uint16_t elinkId, std::uint8_t istream, MsContext& ctx) const + CbmTrdRawMessageSpadic UnpackMS::makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, + std::uint16_t elinkId, std::uint8_t istream, MsContext& ctx) const { auto chId = static_cast<std::uint8_t>(((frame >> 17) & 0xf)); auto timestamp = static_cast<std::uint8_t>((frame >> 9) & 0xff); @@ -470,7 +470,7 @@ namespace cbm::algo::trd // ---- GetDigiTriggerType ---- - CbmTrdDigi::eTriggerType Unpack::GetDigiTriggerType(Spadic::eTriggerType tt) + CbmTrdDigi::eTriggerType UnpackMS::GetDigiTriggerType(Spadic::eTriggerType tt) { // Shift self trigger to digi selftrigger // Shift neighbour trigger to digi neighbour @@ -485,7 +485,7 @@ namespace cbm::algo::trd } // --- GetCharge ---- - float_t Unpack::GetMaxAdcValue(const std::vector<std::int16_t>* samples) const + float_t UnpackMS::GetMaxAdcValue(const std::vector<std::int16_t>* samples) const { // Safety for corrupted input samples assert(samples->size() >= fPeakingBinMin); @@ -512,7 +512,7 @@ namespace cbm::algo::trd } // ---- GetBaseline ---- - float_t Unpack::GetBaseline(const std::vector<std::int16_t>* samples) const + float_t UnpackMS::GetBaseline(const std::vector<std::int16_t>* samples) const { // 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. diff --git a/algo/detectors/trd/Unpack.h b/algo/detectors/trd/UnpackMS.h similarity index 98% rename from algo/detectors/trd/Unpack.h rename to algo/detectors/trd/UnpackMS.h index 02bcc8c8e33d40565a66806ef205e5ce594e03cc..c5918369a65019d5dc5d82379467b11a6d552a42 100644 --- a/algo/detectors/trd/Unpack.h +++ b/algo/detectors/trd/UnpackMS.h @@ -2,9 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Dominik Smith [committer] */ -#ifndef CBM_ALGO_UNPACK_H -#define CBM_ALGO_UNPACK_H 1 - +#pragma once #include "CbmTrdDigi.h" #include "CbmTrdRawMessageSpadic.h" @@ -98,18 +96,18 @@ namespace cbm::algo::trd ** @since 31 January 2023 ** @brief Unpack algorithm for TRD **/ - class Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmTrdDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution @@ -281,7 +279,4 @@ namespace cbm::algo::trd static constexpr size_t fPeakingBinMax = static_cast<size_t>(120.0 / fAsicClockCycle + fNrOfPresamples + 5); }; - } // namespace cbm::algo::trd - -#endif /* CBM_ALGO_UNPACK_H */ diff --git a/algo/detectors/trd2d/ReadoutConfig.h b/algo/detectors/trd2d/ReadoutConfig.h index f8e6f3060edd884b08493658ab613cff38d84f2d..a672169c6025480ee0d7ca661040164572ffcf4b 100644 --- a/algo/detectors/trd2d/ReadoutConfig.h +++ b/algo/detectors/trd2d/ReadoutConfig.h @@ -5,7 +5,7 @@ #ifndef ALGO_DETECTORS_TRD2D_READOUTCONFIG_H #define ALGO_DETECTORS_TRD2D_READOUTCONFIG_H -#include "Unpack.h" +#include "UnpackMS.h" #include "config/Property.h" #include <map> diff --git a/algo/detectors/trd2d/Unpack.cxx b/algo/detectors/trd2d/UnpackMS.cxx similarity index 94% rename from algo/detectors/trd2d/Unpack.cxx rename to algo/detectors/trd2d/UnpackMS.cxx index c7d2c736512dee5a6895570c29f60cdc9e531aae..c0e447c6c45df3b447a91f1f3b6c4af7d83b9ae1 100644 --- a/algo/detectors/trd2d/Unpack.cxx +++ b/algo/detectors/trd2d/UnpackMS.cxx @@ -2,7 +2,7 @@ SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Alexandru Bercuci, Dominik Smith [committer] */ -#include "Unpack.h" +#include "UnpackMS.h" #include "AlgoFairloggerCompat.h" @@ -26,8 +26,8 @@ namespace cbm::algo::trd2d } // ---- Algorithm execution --------------------------------------------- - Unpack::resultType Unpack::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, - const uint64_t tTimeslice) const + UnpackMS::resultType UnpackMS::operator()(const uint8_t* msContent, const fles::MicrosliceDescriptor& msDescr, + const uint64_t tTimeslice) const { // --- Output data resultType result = {}; @@ -96,7 +96,7 @@ namespace cbm::algo::trd2d } //_________________________________________________________________________________ - bool Unpack::pushDigis(std::vector<FaspMessage> messes, const uint64_t time, MsContext& ctx) const + bool UnpackMS::pushDigis(std::vector<FaspMessage> messes, const uint64_t time, MsContext& ctx) const { const uint16_t mod_id = fParams.fModId; const UnpackAsicPar& asicPar = fParams.fAsicParams[messes[0].fasp]; @@ -164,7 +164,7 @@ namespace cbm::algo::trd2d return true; } - std::vector<CbmTrdDigi> Unpack::FinalizeComponent(MsContext& ctx) const + std::vector<CbmTrdDigi> UnpackMS::FinalizeComponent(MsContext& ctx) const { std::vector<CbmTrdDigi> outputDigis; diff --git a/algo/detectors/trd2d/Unpack.h b/algo/detectors/trd2d/UnpackMS.h similarity index 96% rename from algo/detectors/trd2d/Unpack.h rename to algo/detectors/trd2d/UnpackMS.h index fb17e290ea5662c52dd036dd838f0bab0e91ce86..7f1f4f53567392f295fb3b35f6625ece934a9047 100644 --- a/algo/detectors/trd2d/Unpack.h +++ b/algo/detectors/trd2d/UnpackMS.h @@ -1,10 +1,7 @@ /* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only Authors: Pascal Raisig, Alexandru Bercuci, Dominik Smith [committer] */ - -#ifndef CBM_ALGO_TRD2D_UNPACK_H -#define CBM_ALGO_TRD2D_UNPACK_H 1 - +#pragma once #include "CbmTrdDigi.h" #include "CbmTrdRawMessageSpadic.h" @@ -102,23 +99,23 @@ namespace cbm::algo::trd2d } }; - /** @class Unpack + /** @class UnpackMS ** @author Dominik Smith <d.smith@gsi.de> ** @since 31 January 2023 ** @brief Unpack algorithm for TRD **/ - class Unpack { + class UnpackMS { public: typedef std::pair<std::vector<CbmTrdDigi>, UnpackMonitorData> resultType; /** @brief Default constructor **/ - Unpack(){}; + UnpackMS() = default; /** @brief Destructor **/ - ~Unpack(){}; + ~UnpackMS() = default; /** @brief Algorithm execution @@ -172,5 +169,3 @@ namespace cbm::algo::trd2d } // namespace cbm::algo::trd2d - -#endif /* CBM_ALGO_TRD2D_UNPACK_H */ diff --git a/algo/unpack/Unpack.h b/algo/unpack/Unpack.h index 99e10884348234bcfb0f74839e82a0cd1513ccae..8bd22febc408596a08aa3f3351ef5c26e25e9d59 100644 --- a/algo/unpack/Unpack.h +++ b/algo/unpack/Unpack.h @@ -9,19 +9,19 @@ #include "DigiData.h" #include "PODVector.h" #include "bmon/ReadoutConfig.h" -#include "bmon/Unpack.h" +#include "bmon/UnpackMS.h" #include "much/ReadoutConfig.h" -#include "much/Unpack.h" +#include "much/UnpackMS.h" #include "rich/ReadoutConfig.h" -#include "rich/Unpack.h" +#include "rich/UnpackMS.h" #include "sts/Digi.h" #include "sts/ReadoutConfigLegacy.h" #include "tof/ReadoutConfig.h" -#include "tof/Unpack.h" +#include "tof/UnpackMS.h" #include "trd/ReadoutConfig.h" -#include "trd/Unpack.h" +#include "trd/UnpackMS.h" #include "trd2d/ReadoutConfig.h" -#include "trd2d/Unpack.h" +#include "trd2d/UnpackMS.h" #include <gsl/span> #include <optional> @@ -160,22 +160,22 @@ namespace cbm::algo std::vector<Subsystem> fSubsystems = {}; ///< Detector identifiers to unpack /** @brief MUCH unpackers **/ - std::map<uint16_t, much::Unpack> fAlgoMuch = {}; + std::map<uint16_t, much::UnpackMS> fAlgoMuch = {}; /** @brief TOF unpackers **/ - std::map<uint16_t, tof::Unpack> fAlgoTof = {}; + std::map<uint16_t, tof::UnpackMS> fAlgoTof = {}; /** @brief Bmon unpackers **/ - std::map<uint16_t, bmon::Unpack> fAlgoBmon = {}; + std::map<uint16_t, bmon::UnpackMS> fAlgoBmon = {}; /** @brief TRD unpackers **/ - std::map<uint16_t, trd::Unpack> fAlgoTrd = {}; + std::map<uint16_t, trd::UnpackMS> fAlgoTrd = {}; /** @brief TRD2D unpackers **/ - std::map<uint16_t, trd2d::Unpack> fAlgoTrd2d = {}; + std::map<uint16_t, trd2d::UnpackMS> fAlgoTrd2d = {}; /** @brief RICH unpackers **/ - std::map<uint16_t, rich::Unpack> fAlgoRich = {}; + std::map<uint16_t, rich::UnpackMS> fAlgoRich = {}; /** @brief System time offsets **/ std::map<Subsystem, int32_t> fSystemTimeOffset = {