From 7b6e3331f174ef0d9dca90d7d8897c01984ace37 Mon Sep 17 00:00:00 2001 From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de> Date: Tue, 7 May 2024 16:19:41 +0200 Subject: [PATCH] Add support for new TOF components in online unpacker config --- algo/CMakeLists.txt | 1 + algo/detectors/tof/config/ReadoutPars.h | 1 + .../tof/config/ReadoutPars_mCBM2024_05.cxx | 69 +++++++++++++++++++ algo/global/Reco.cxx | 5 +- 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 algo/detectors/tof/config/ReadoutPars_mCBM2024_05.cxx diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index 358c59fea0..f7c26cbbd1 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -117,6 +117,7 @@ set(SRCS detectors/tof/TrackingInterface.cxx detectors/tof/config/ReadoutPars_mCBM2022.cxx detectors/tof/config/ReadoutPars_mCBM2024.cxx + detectors/tof/config/ReadoutPars_mCBM2024_05.cxx detectors/bmon/ReadoutConfig.cxx detectors/bmon/Unpack.cxx detectors/bmon/UnpackMS.cxx diff --git a/algo/detectors/tof/config/ReadoutPars.h b/algo/detectors/tof/config/ReadoutPars.h index f40b53c326..c342753577 100644 --- a/algo/detectors/tof/config/ReadoutPars.h +++ b/algo/detectors/tof/config/ReadoutPars.h @@ -21,6 +21,7 @@ namespace cbm::algo::tof::config static ReadoutPars MakeMCBM2022(); static ReadoutPars MakeMCBM2024(); + static ReadoutPars MakeMCBM2024_05(); bool mcbmTof2024 = false; diff --git a/algo/detectors/tof/config/ReadoutPars_mCBM2024_05.cxx b/algo/detectors/tof/config/ReadoutPars_mCBM2024_05.cxx new file mode 100644 index 0000000000..4e83e1a665 --- /dev/null +++ b/algo/detectors/tof/config/ReadoutPars_mCBM2024_05.cxx @@ -0,0 +1,69 @@ +/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Felix Weiglhofer [committer], Dominik Smith */ +#include "Exceptions.h" +#include "ReadoutPars.h" + +using namespace cbm::algo::tof::config; + +ReadoutPars ReadoutPars::MakeMCBM2024_05() +{ + // This here refers to the mCBM 2022 and 2024 setups. + // Taken from CbmMcbm2018TofPar in combination with macro/beamtime/mcbm2022/mTofCriParNickel.par + // and mTofCriParNickel_withBmon.par (?) + + ReadoutPars pars; + + pars.mcbmTof2024 = true; + + pars.nFebsPerComponent = 5; + pars.nAsicsPerFeb = 8; + pars.nChannelsPerAsic = 4; + pars.nCrobPerComponent = 1; + + constexpr int NumCrob = 19; + + // Module Identifier connected to Gbtx link, has to match geometry + const int32_t moduleId[NumCrob] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 0, 0, 1, 0, 1, 1, 5, 5}; + + // type of Rpcs connected to Gbtx link + const int32_t rpcType[NumCrob] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 9, 9, 6, 2, 2, 0, 0}; + + // side of Rpcs connected to Gbtx link, i.e. 0 or 1 + const int32_t rpcSide[NumCrob] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 4, 0, 1, 0, 1}; + + // number of Rpcs connected to Gbtx link, i.e. 3 or 5 + const int32_t numRpc[NumCrob] = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 2, 2, 5, 5, 5, 5}; + + for (int i = 0; i < NumCrob; ++i) { + pars.crobs.push_back({moduleId[i], rpcType[i], rpcSide[i], numRpc[i]}); + } + + pars.eqIds = {0xabc0, 0xabc1, 0xabc2, 0xabc3, 0xabc4, 0xabc5, 0xabc6, 0xabc7, 0xabc8, 0xabc9, + 0xabca, 0xabcb, 0xabd0, 0xabd1, 0xbbc0, 0xabcc, 0xabcd, 0xabce, 0xabcf}; + + pars.elink2Asic = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14, 10, 15, 17, 21, 16, 35, + 34, 38, 25, 24, 0, 6, 20, 23, 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11}; + pars.elink2AsicInner = {0, 16, 8, 17, 1, 18, 9, 19, 2, 20, 10, 21, 3, 22, 11, 23, 4, 24, 12, 25, + 5, 26, 13, 27, 6, 28, 14, 29, 7, 30, 15, 31, 32, 33, 34, 35, 36, 37, 38, 39}; + + // Mapping in Readout chain PCBs + pars.asic2PadI = { + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, + 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28}; //! Map from GET4 channel to PADI channel + + if (pars.NElinksPerCrob() != static_cast<i32>(pars.elink2Asic.size())) { + throw FatalError("tof::ReadoutPars::MakeMCBM2024_05 => size of elink2Asic not matching, {} vs {}, stop there!", + static_cast<uint32_t>(pars.elink2Asic.size()), static_cast<uint32_t>(pars.NElinksPerCrob())); + } + if (pars.NElinksPerCrob() != static_cast<i32>(pars.elink2AsicInner.size())) { + throw FatalError("tof::ReadoutPars::MakeMCBM2024_05 => size of elink2AsicInner not matching, {} vs {}, stop there!", + static_cast<uint32_t>(pars.elink2Asic.size()), static_cast<uint32_t>(pars.NElinksPerCrob())); + } + if (pars.NChansPerFeb() != static_cast<i32>(pars.asic2PadI.size())) { + throw FatalError("tof::ReadoutPars::MakeMCBM2024_05 => size of asic2PadI not matching, {} vs {}, stop there!", + static_cast<uint32_t>(pars.elink2Asic.size()), static_cast<uint32_t>(pars.NChansPerFeb())); + } + + return pars; +} diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx index a6e2b98fe2..6eabeac03e 100644 --- a/algo/global/Reco.cxx +++ b/algo/global/Reco.cxx @@ -134,8 +134,9 @@ void Reco::Init(const Options& opts) } if (Opts().Has(Subsystem::TOF) && Opts().Has(Step::Unpack)) { - tof::ReadoutConfig cfg{2724 <= Opts().RunId() ? tof::config::ReadoutPars::MakeMCBM2024() - : tof::config::ReadoutPars::MakeMCBM2022()}; + tof::ReadoutConfig cfg{2918 <= Opts().RunId() ? tof::config::ReadoutPars::MakeMCBM2024_05() + : 2724 <= Opts().RunId() ? tof::config::ReadoutPars::MakeMCBM2024() + : tof::config::ReadoutPars::MakeMCBM2022()}; fTofUnpack = std::make_unique<tof::Unpack>(cfg); } -- GitLab