From 9daecd7fcb47b3ade9e53e7fbc287d8ac0e30800 Mon Sep 17 00:00:00 2001 From: "s.zharko@gsi.de" <s.zharko@gsi.de> Date: Tue, 4 Mar 2025 15:42:03 +0100 Subject: [PATCH] Updates: - TOF online and offline readout was set up to meet the one of Norbert - TOF online QA module - reco macro for offline: smaller windows --- algo/CMakeLists.txt | 2 + algo/detectors/tof/ReadoutConfig.cxx | 53 ++++++++- algo/detectors/tof/ReadoutConfig.h | 3 +- algo/global/Reco.cxx | 11 ++ algo/global/Reco.h | 2 + algo/qa/Histogram.h | 3 +- algo/qa/hitfind/TofHitfindQa.cxx | 110 +++++++++++++++++++ algo/qa/hitfind/TofHitfindQa.h | 91 +++++++++++++++ algo/qa/hitfind/TofHitfindQaParameters.cxx | 40 +++++++ algo/qa/hitfind/TofHitfindQaParameters.h | 39 +++++++ core/detectors/tof/CbmMcbm2018TofPar.cxx | 61 +++++++++- core/detectors/tof/CbmMcbm2018TofPar.h | 4 +- external/InstallParameter.cmake | 4 +- macro/beamtime/mcbm2025/mcbm_event_reco_L1.C | 16 +-- 14 files changed, 418 insertions(+), 21 deletions(-) create mode 100644 algo/qa/hitfind/TofHitfindQa.cxx create mode 100644 algo/qa/hitfind/TofHitfindQa.h create mode 100644 algo/qa/hitfind/TofHitfindQaParameters.cxx create mode 100644 algo/qa/hitfind/TofHitfindQaParameters.h diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt index 82f767e3bf..7b865b38dd 100644 --- a/algo/CMakeLists.txt +++ b/algo/CMakeLists.txt @@ -159,6 +159,8 @@ set(SRCS qa/QaManager.cxx qa/hitfind/BmonHitfindQa.cxx qa/hitfind/BmonHitfindQaParameters.cxx + qa/hitfind/TofHitfindQa.cxx + qa/hitfind/TofHitfindQaParameters.cxx qa/unpack/StsDigiQa.cxx ca/TrackingSetup.cxx ca/TrackingChain.cxx diff --git a/algo/detectors/tof/ReadoutConfig.cxx b/algo/detectors/tof/ReadoutConfig.cxx index 3323882010..36310a9d4b 100644 --- a/algo/detectors/tof/ReadoutConfig.cxx +++ b/algo/detectors/tof/ReadoutConfig.cxx @@ -417,7 +417,7 @@ namespace cbm::algo::tof fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(iModuleId, 7 - iRpc, 0, 0, iModuleType); uCh++; } - uCh += (24 + 2 * 32); + uCh += (24 + 4 * 32); L_(debug) << " Map end ceramics box at GBTX - uCh = " << uCh; } @@ -557,7 +557,7 @@ namespace cbm::algo::tof int iSideMap = -1; int iStrMap = -1; int iRpcMap = -1; - const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5}; // Get4 after Gbtx + const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5}; //Get4 after Gbtx for (int32_t iFeet = 0; iFeet < 5; iFeet++) { for (int32_t iStr = 0; iStr < 32; iStr++) { switch (iFeet) { @@ -592,6 +592,49 @@ namespace cbm::algo::tof } } } + else if (crob.rpcSide == 5) { + int iSideMap = -1; + int iStrMap = -1; + int iRpcMap = -1; + const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5}; // Get4 after Gbtx + for (int32_t iFeet = 0; iFeet < 5; iFeet++) { + for (int32_t iStr = 0; iStr < 32; iStr++) { + switch (iFeet) { + case 0: iSideMap = -1; break; + case 1: + iRpcMap = 0; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 1; + break; + case 2: + iRpcMap = 0; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 0; + break; + case 3: + iRpcMap = 1; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 0; + break; + case 4: + iRpcMap = 1; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 1; + break; + } + if (iSideMap > -1) + fviRpcChUId[uCh] = + CbmTofAddress::GetUniqueAddress(crob.moduleId, iRpcMap, iStrMap, iSideMap, crob.rpcType); + else + fviRpcChUId[uCh] = 0; + uCh++; + } + } + } } } @@ -645,7 +688,11 @@ namespace cbm::algo::tof case 4: // HD cosmic 2019, Buc2018, v18o iRpcMap = 1 - iRpcMap; break; - case 5: // HD cosmic 2020, Buc2018, v20a + case 5: // Buc2025, mCBM + iRpcMap = 1 - iRpcMap; + iSideMap = 1 - iSideMap; + break; + case 55: // HD cosmic 2020, Buc2018, v20a iStrMap = 31 - iStr; break; case 6: //BUC special diff --git a/algo/detectors/tof/ReadoutConfig.h b/algo/detectors/tof/ReadoutConfig.h index 07c91d7292..6b9ac632fa 100644 --- a/algo/detectors/tof/ReadoutConfig.h +++ b/algo/detectors/tof/ReadoutConfig.h @@ -69,7 +69,8 @@ namespace cbm::algo::tof i32 NCrobsPerComponent() const { return nCrobPerComponent; } bool CheckBmonComp(uint32_t uCompId) const { return ((uCompId & 0xFFF0) == 0xABF0); } - bool CheckInnerComp(uint32_t uCompId) const { return ((uCompId & 0xFFF0) == 0xBBC0); } + //bool CheckInnerComp(uint32_t uCompId) const { return ((uCompId & 0xFFF0) == 0xBBC0); } + bool CheckInnerComp(uint32_t uCompId) const { return ((uCompId & 0xFF00) == 0xBB00); } }; diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx index 0f192df1b6..bd406247a8 100644 --- a/algo/global/Reco.cxx +++ b/algo/global/Reco.cxx @@ -26,6 +26,7 @@ #include "much/Unpack.h" #include "qa/QaManager.h" #include "qa/hitfind/BmonHitfindQa.h" +#include "qa/hitfind/TofHitfindQa.h" #include "rich/Unpack.h" #include "sts/ChannelMaskSet.h" #include "sts/HitfinderChain.h" @@ -215,6 +216,12 @@ void Reco::Init(const Options& opts) auto hitfindSetup = yaml::ReadFromFile<tof::HitfindSetup>(opts.ParamsDir() / parFiles.tof.hitfinder); fTofHitFinder = std::make_unique<tof::Hitfind>(hitfindSetup); + + if (fQaManager != nullptr && Opts().Has(QaStep::RecoTof)) { + fTofHitFinderQa = std::make_unique<tof::HitfindQa>(fQaManager, "TofHitfind"); + fTofHitFinderQa->InitParameters(hitfindSetup); + fTofHitFinderQa->Init(); + } } if (Opts().Has(fles::Subsystem::TRD) && Opts().Has(Step::LocalReco)) { @@ -365,6 +372,10 @@ RecoResults Reco::Run(const fles::Timeslice& ts) L_(error) << "TOF Digis with unknown RPCs: " << nUnknownRPC; } auto [hits, hitmonitor, digiindices] = (*fTofHitFinder)(caldigis); + if (fTofHitFinderQa != nullptr) { + fTofHitFinderQa->RegisterHits(&hits); + fTofHitFinderQa->Exec(); + } recoData.tofHits = std::move(hits); QueueTofCalibMetrics(calmonitor); QueueTofRecoMetrics(hitmonitor); diff --git a/algo/global/Reco.h b/algo/global/Reco.h index 35cb5c3462..e5a8412151 100644 --- a/algo/global/Reco.h +++ b/algo/global/Reco.h @@ -60,6 +60,7 @@ namespace cbm::algo class Calibrate; struct CalibrateMonitorData; class Hitfind; + class HitfindQa; struct HitfindMonitorData; } @@ -175,6 +176,7 @@ namespace cbm::algo std::unique_ptr<tof::Unpack> fTofUnpack; std::unique_ptr<tof::Calibrate> fTofCalibrator; std::unique_ptr<tof::Hitfind> fTofHitFinder; + std::unique_ptr<tof::HitfindQa> fTofHitFinderQa; // TRD std::unique_ptr<trd::Unpack> fTrdUnpack; diff --git a/algo/qa/Histogram.h b/algo/qa/Histogram.h index 1b70f3b058..44040934a4 100644 --- a/algo/qa/Histogram.h +++ b/algo/qa/Histogram.h @@ -55,7 +55,8 @@ namespace cbm::algo::qa enum class EHistFlag : uint8_t { StoreVsTsId = 0b00000001, ///< Store the histogram vs timeslice index - OmitIntegrated = 0b00000010 ///< Omits storing integrated histogram + OmitIntegrated = 0b00000010, ///< Omits storing integrated histogram + SetMinimum = 0b00000100 ///< Sets minimum to the histogram }; /// \class HistogramMetadata diff --git a/algo/qa/hitfind/TofHitfindQa.cxx b/algo/qa/hitfind/TofHitfindQa.cxx new file mode 100644 index 0000000000..c037dc6764 --- /dev/null +++ b/algo/qa/hitfind/TofHitfindQa.cxx @@ -0,0 +1,110 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file TofHitfindQa.cxx +/// \brief A TOF hitfinder QA (implementation) +/// \since 04.03.2025 +/// \author Sergei Zharko <s.zharko@gsi.de> + +#include "qa/hitfind/TofHitfindQa.h" + +#include "CbmTofAddress.h" +#include "qa/Histogram.h" +#include "tof/Hit.h" + +#include <fmt/format.h> + +using cbm::algo::tof::HitfindQa; + +// --------------------------------------------------------------------------------------------------------------------- +// +void HitfindQa::Init() +try { + using fmt::format; + using qa::CanvasConfig; + using qa::PadConfig; + if (!IsActive()) { + return; + } + + size_t nRpcs = fParameters.rpcs.size(); + if (nRpcs < 1) { + throw std::runtime_error("parameters were not initialized. Please, provide the configuration using the function " + "HitfindQa::InitParameters(hitSetup)"); + } + + // Histogram initialization + fvphRpcHitOccupX.resize(nRpcs, nullptr); + fvphRpcHitOccupY.resize(nRpcs, nullptr); + fvphRpcHitOccupCh.resize(nRpcs, nullptr); + + auto cOccupX = CanvasConfig(format("{}/tof_rpc_occup_x", GetTaskName()), "RPC hit occupancy vs. X", 1, 1); + auto cOccupY = CanvasConfig(format("{}/tof_rpc_occup_y", GetTaskName()), "RPC hit occupancy vs. Y", 1, 1); + auto cOccupCh = CanvasConfig(format("{}/tof_rpc_occup_ch", GetTaskName()), "RPC hit occupancy vs. channel", 1, 1); + for (size_t iRpc = 0; iRpc < nRpcs; ++iRpc) { + const auto& rpcPar = fParameters.rpcs[iRpc]; + int nCh = rpcPar.chAddresses.size(); + auto sDN = format("{:#010x}", rpcPar.address); // diamond suffix + auto sDT = CbmTofAddress::ToString(rpcPar.address); + + // Histograms initialisation + fvphRpcHitOccupX[iRpc] = MakeObj<qa::H1D>(format("tof_hit_occup_x_{}", sDN), format("RPC {};x [cm];counts", sDT), + kHitOccupB, kHitOccupL, kHitOccupU); + fvphRpcHitOccupY[iRpc] = MakeObj<qa::H1D>(format("tof_hit_occup_y_{}", sDN), format("RPC {};y [cm];counts", sDT), + kHitOccupB, kHitOccupL, kHitOccupU); + fvphRpcHitOccupCh[iRpc] = MakeObj<qa::H1D>(format("tof_hit_occup_chan_{}", sDN), + format("RPC {};channel;counts", sDT), nCh, -0.5, nCh - 0.5); + + { + auto pad = PadConfig(fvphRpcHitOccupX[iRpc], "hist"); + pad.SetLog(false, true, false); + cOccupX.AddPadConfig(pad); + } + { + auto pad = PadConfig(fvphRpcHitOccupY[iRpc], "hist"); + pad.SetLog(false, true, false); + cOccupY.AddPadConfig(pad); + } + { + auto pad = PadConfig(fvphRpcHitOccupCh[iRpc], "hist"); + pad.SetLog(false, true, false); + cOccupCh.AddPadConfig(pad); + } + } + + AddCanvasConfig(cOccupX); + AddCanvasConfig(cOccupY); + AddCanvasConfig(cOccupCh); +} +catch (const std::exception& err) { + L_(fatal) << "tof::HitfindQa: initialization failed. Reason: " << err.what(); + throw std::runtime_error("tof::HitfindQa initialization failure"); +} + +// --------------------------------------------------------------------------------------------------------------------- +// +void HitfindQa::Exec() +{ + if (!IsActive()) { + return; + } + + // Fill hit distributions + const auto& hits = fpHits->Data(); + for (size_t iH = 0; iH < hits.size(); ++iH) { + const auto& hit = hits[iH]; + int32_t hitAddress = hit.address; + int32_t iCh = CbmTofAddress::GetChannelId(hitAddress); + uint32_t rpcAddress = CbmTofAddress::GetModFullId(hitAddress); + auto itAddress = fParameters.lookupMap.find(rpcAddress); + if (itAddress == fParameters.lookupMap.end()) { + L_(error) << "tof::HitfindQa: unknown RPC address " << CbmTofAddress::ToString(rpcAddress); + continue; + } + uint32_t iRpc = itAddress->second; + fvphRpcHitOccupX[iRpc]->Fill(hit.X()); + fvphRpcHitOccupY[iRpc]->Fill(hit.Y()); + fvphRpcHitOccupCh[iRpc]->Fill(iCh); + } +} diff --git a/algo/qa/hitfind/TofHitfindQa.h b/algo/qa/hitfind/TofHitfindQa.h new file mode 100644 index 0000000000..3c630b0b2a --- /dev/null +++ b/algo/qa/hitfind/TofHitfindQa.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file TofHitfindQa.h +/// \brief A TOF hitfinder QA +/// \since 04.03.2025 +/// \author Sergei Zharko <s.zharko@gsi.de> + + +#pragma once + +#include "PODVector.h" +#include "PartitionedVector.h" +#include "qa/QaTaskHeader.h" +#include "qa/hitfind/TofHitfindQaParameters.h" + +namespace cbm::algo +{ + namespace qa + { + class H1D; + class H2D; + } // namespace qa + + namespace tof + { + class Hit; + } +} // namespace cbm::algo + +namespace cbm::algo::tof +{ + /// \class HitfindQa + /// \brief A QA module for the BMON hit-finder + class HitfindQa : public qa::TaskHeader { + public: + /// \brief Constructor + /// \param pManager Pointer to the QA manager + /// \param name Name of the QA (directory) + HitfindQa(const std::unique_ptr<qa::Manager>& pManager, std::string_view name) : qa::TaskHeader(pManager, name) {} + + /// \brief Constructor from the configuration object + HitfindQa() = default; + + /// \brief Copy constructor + HitfindQa(const HitfindQa&) = delete; + + /// \brief Move constructor + HitfindQa(HitfindQa&&) = delete; + + /// \brief Destructor + ~HitfindQa() = default; + + /// \brief Copy assignment operator + HitfindQa& operator=(const HitfindQa&) = delete; + + /// \brief Move assignment operator + HitfindQa& operator=(HitfindQa&&) = delete; + + /// \brief Executes the task, fills the histograms + void Exec(); + + /// \brief Initialized the task + void Init(); + + /// \brief Initialisation of the parameters + void InitParameters(const HitfindSetup& hitSetup) { fParameters = std::move(HitfindQaParameters(hitSetup)); } + + /// \brief Registers a sample of hits + /// \param pHits A pointer to a vector of hits + void RegisterHits(const PartitionedVector<tof::Hit>* pHits) { fpHits = pHits; } + + private: + //* Constants + static constexpr int kHitOccupB{200}; ///< Hit occupancy: n bins + static constexpr double kHitOccupL{-100.}; ///< Hit occupancy: lower bound [cm] + static constexpr double kHitOccupU{+100.}; ///< Hit occupancy: upper bound [cm] + + //* Parameters + HitfindQaParameters fParameters; ///< Parameters of the hit finder QA + + //* Data samples + const PartitionedVector<tof::Hit>* fpHits{nullptr}; ///< Pointer to TOF hit sample + + //* Histograms + std::vector<qa::H1D*> fvphRpcHitOccupX; ///< Hit occupancy in RPC vs. x + std::vector<qa::H1D*> fvphRpcHitOccupY; ///< Hit occupancy in RPC vs. y + std::vector<qa::H1D*> fvphRpcHitOccupCh; ///< Hit occupancy in RPC vs. channel + }; +} // namespace cbm::algo::tof diff --git a/algo/qa/hitfind/TofHitfindQaParameters.cxx b/algo/qa/hitfind/TofHitfindQaParameters.cxx new file mode 100644 index 0000000000..95251731a1 --- /dev/null +++ b/algo/qa/hitfind/TofHitfindQaParameters.cxx @@ -0,0 +1,40 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file BmonHitfindQaParameters.cxx +/// \brief A BMON hitfinder QA parameter configuration (implementation) +/// \since 10.02.2025 +/// \author Sergei Zharko <s.zharko@gsi.de> + +#include "qa/hitfind/TofHitfindQaParameters.h" + +#include "AlgoFairloggerCompat.h" +#include "CbmTofAddress.h" + +using cbm::algo::tof::HitfindQaParameters; +using cbm::algo::tof::HitfindSetup; + +// --------------------------------------------------------------------------------------------------------------------- +// +HitfindQaParameters::HitfindQaParameters(const HitfindSetup& hitSetup) +{ + rpcs.clear(); + lookupMap.clear(); + uint32_t iUniqueRpcId = 0; + for (const auto& smType : hitSetup.rpcs) { + for (const auto& rpc : smType) { + uint32_t address = static_cast<uint32_t>(CbmTofAddress::GetModFullId(rpc.chanPar[0].address)); + lookupMap[address] = iUniqueRpcId; + auto& rpcPar = rpcs.emplace_back(); + rpcPar.address = address; + rpcPar.chAddresses.resize(rpc.chanPar.size()); + L_(info) << "RPC: " << CbmTofAddress::ToString(address); + for (int iCh = 0; iCh < rpcPar.chAddresses.size(); ++iCh) { + rpcPar.chAddresses[iCh] = rpc.chanPar[iCh].address; + L_(info) << "----> ch: " << CbmTofAddress::ToString(rpcPar.chAddresses[iCh]); + } + iUniqueRpcId++; + } + } +} diff --git a/algo/qa/hitfind/TofHitfindQaParameters.h b/algo/qa/hitfind/TofHitfindQaParameters.h new file mode 100644 index 0000000000..f64fe1e9f3 --- /dev/null +++ b/algo/qa/hitfind/TofHitfindQaParameters.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt + SPDX-License-Identifier: GPL-3.0-only + Authors: Sergei Zharko [committer] */ + +/// \file TofHitfindQaParameters.h +/// \brief A TOF hitfinder QA parameter configuration +/// \since 03.03.2025 +/// \author Sergei Zharko <s.zharko@gsi.de> + +#pragma once + +#include "tof/HitfindSetup.h" + +#include <unordered_map> +#include <vector> + +namespace cbm::algo::tof +{ + /// \struct HitfindQaParameters + /// \brief A structure to handle TOF QA parameters + struct HitfindQaParameters { + + /// \struct Rpc + struct Rpc { + std::vector<uint32_t> chAddresses; ///< Address of channel vs channel ID + uint32_t address; ///< Address of RPC + }; + + std::unordered_map<uint32_t, uint32_t> lookupMap; ///< A lookup map for RPC addresses + std::vector<Rpc> rpcs; ///< A map for different RPC properties + + /// \brief Default constructor + HitfindQaParameters() = default; + + /// \brief Constructor + /// \param hitSetup Hitfinder parameters + HitfindQaParameters(const HitfindSetup& hitSetup); + }; +} // namespace cbm::algo::tof diff --git a/core/detectors/tof/CbmMcbm2018TofPar.cxx b/core/detectors/tof/CbmMcbm2018TofPar.cxx index d2441aecf6..ad8f36aff7 100644 --- a/core/detectors/tof/CbmMcbm2018TofPar.cxx +++ b/core/detectors/tof/CbmMcbm2018TofPar.cxx @@ -268,13 +268,15 @@ void CbmMcbm2018TofPar::BuildChannelsUidMap() uint32_t uGdpb = uCh0 / (fiNrOfFeesPerGdpb * fiNrOfGet4PerFee * fiNrOfChannelsPerGet4); LOG(info) << "Map at ch " << uCh << ", Gdpb " << uGdpb << ", Id " << std::hex << fiGdpbIdArray[uGdpb] << std::dec; switch (fiRpcType[uGbtx]) { + case 3: // intended fall-through case 2: // intended fall-through + case 1: // intended fall-through case 0: { // CBM modules BuildChannelsUidMapCbm(uCh, uGbtx); break; } - case 1: { + case 11: { // STAR eTOF modules BuildChannelsUidMapStar(uCh, uGbtx); break; @@ -418,7 +420,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapStar(UInt_t& uCh, UInt_t uGbtx) // ------------------------------------------------------------------------- void CbmMcbm2018TofPar::BuildChannelsUidMapBmon(UInt_t& uCh, UInt_t uGbtx) { - LOG(info) << " Map diamond at GBTX - uCh = " << uCh; + LOG(info) << " Map diamond at GBTX " << uGbtx << " - uCh = " << uCh; for (UInt_t uFee = 0; uFee < kuNbFeePerGbtx; ++uFee) { for (UInt_t uFeeCh = 0; uFeeCh < kuNbChannelsPerFee; ++uFeeCh) { /// Mapping for the 2019 beamtime @@ -432,6 +434,7 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapBmon(UInt_t& uCh, UInt_t uGbtx) /// => 1 Bmon channel per GET4 /// => 1-2 eLinks per GET4 => GET4 ID = GET4 * 2 (+ 1) UInt_t uChannelBmon = uFeeCh / 8 + 4 * fiRpcSide[uGbtx]; + fiRpcType[uGbtx] = 5; //for compatibility with TOF convention fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], 0, uChannelBmon, 0, fiRpcType[uGbtx]); LOG(info) << Form("Bmon channel: %u from GBTx %2u Fee %2u " "Channel %2u, indx %d address %08x", @@ -506,7 +509,8 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapCera(UInt_t& uCh, UInt_t /*uGbtx*/) fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(iModuleId, 7 - iRpc, 0, 0, iModuleType); uCh++; } - uCh += (24 + 2 * 32); + uCh += (24 + 4 * 32); //for 2024 FSD + //uCh += (24 + 2 * 32); LOG(info) << " Map end ceramics box at GBTX - uCh = " << uCh; } // ------------------------------------------------------------------------- @@ -684,10 +688,52 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapStar2A(UInt_t& uCh, UInt_t uGbtx) } } } + else if (fiRpcSide[uGbtx] == 5) { + int iSideMap = -1; + int iStrMap = -1; + int iRpcMap = -1; + const int ConOff[8] = {0, 2, 4, 6, 7, 1, 3, 5}; //Get4 after Gbtx + for (Int_t iFeet = 0; iFeet < 5; iFeet++) { + for (Int_t iStr = 0; iStr < 32; iStr++) { + switch (iFeet) { + case 0: iSideMap = -1; break; + case 1: + iRpcMap = 0; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 1; + break; + case 2: + iRpcMap = 0; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 0; + break; + case 3: + iRpcMap = 1; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 0; + break; + case 4: + iRpcMap = 1; + iStrMap = 3 - iStr % 4 + 4 * ConOff[iStr / 4]; + iStrMap = 31 - iStrMap; + iSideMap = 1; + break; + } + if (iSideMap > -1) + fviRpcChUId[uCh] = + CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], iRpcMap, iStrMap, iSideMap, fiRpcType[uGbtx]); + else + fviRpcChUId[uCh] = 0; + uCh++; + } + } + } } } -// ------------------------------------------------------------------------- void CbmMcbm2018TofPar::BuildChannelsUidMapBuc(UInt_t& uCh, UInt_t uGbtx) { LOG(info) << " Map Buc box " << fiModuleId[uGbtx] << " at GBTX " << uGbtx << " - uCh = " << uCh; @@ -745,7 +791,12 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapBuc(UInt_t& uCh, UInt_t uGbtx) case 4: // HD cosmic 2019, Buc2018, v18o iRpcMap = 1 - iRpcMap; break; - case 5: // HD cosmic 2020, Buc2018, v20a + case 5: // Buc2025, mCBM + iRpcMap = 1 - iRpcMap; + //iStrMap = 31 - iStr; + iSideMap = 1 - iSideMap; + break; + case 55: // HD cosmic 2020, Buc2018, v20a iStrMap = 31 - iStr; break; case 6: //BUC special diff --git a/core/detectors/tof/CbmMcbm2018TofPar.h b/core/detectors/tof/CbmMcbm2018TofPar.h index 6ede9c726a..fa38cb39ec 100644 --- a/core/detectors/tof/CbmMcbm2018TofPar.h +++ b/core/detectors/tof/CbmMcbm2018TofPar.h @@ -85,7 +85,8 @@ class CbmMcbm2018TofPar : public FairParGenericSet { inline Double_t GetTsDeadtimePeriod() { return fdTsDeadtimePeriod; } inline bool CheckBmonComp(uint32_t uCompId) { return ((uCompId & 0xFFF0) == 0xABF0); } - inline bool CheckInnerComp(uint32_t uCompId) { return ((uCompId & 0xFFF0) == 0xBBC0); } + //inline bool CheckInnerComp(uint32_t uCompId) { return ((uCompId & 0xFFF0) == 0xBBC0); } + inline bool CheckInnerComp(uint32_t uCompId) { return ((uCompId & 0xFF00) == 0xBB00); } private: void BuildChannelsUidMap(); @@ -121,6 +122,7 @@ class CbmMcbm2018TofPar : public FairParGenericSet { const UInt_t kuPaditoget4[kuNbChannelsPerFee] = { 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 PADI channel to GET4 channel + const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {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}; diff --git a/external/InstallParameter.cmake b/external/InstallParameter.cmake index 2fd8559eea..9aac4ca497 100644 --- a/external/InstallParameter.cmake +++ b/external/InstallParameter.cmake @@ -1,5 +1,5 @@ -set(PARAMETER_VERSION 8c8540d957031516d149f86eb6ed1008ab67ebee) # 2025/02/24 -set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git") +set(PARAMETER_VERSION 125dc2b53e6123739a19deabd9465e4fe568a5dc) # 2025/02/24 +set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/s.zharko/cbmroot_parameter.git") download_project_if_needed(PROJECT Parameter_source GIT_REPOSITORY ${PARAMETER_SRC_URL} diff --git a/macro/beamtime/mcbm2025/mcbm_event_reco_L1.C b/macro/beamtime/mcbm2025/mcbm_event_reco_L1.C index 4e1143a875..7596b67bca 100644 --- a/macro/beamtime/mcbm2025/mcbm_event_reco_L1.C +++ b/macro/beamtime/mcbm2025/mcbm_event_reco_L1.C @@ -273,25 +273,25 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId = 3453, // mCbm track trigger Tof, Bmon & STS (case 4 of mcbm_unp_event.C) const Int_t eb_TriggerMinNumberBmon{1}; const Int_t eb_TriggerMaxNumberBmon{2}; - const Int_t eb_TriggerMinNumberSts{2}; + const Int_t eb_TriggerMinNumberSts{1}; const Int_t eb_TriggerMinNumberStsLayers{1}; const Int_t eb_TriggerMinNumberMuch{1}; - const Int_t eb_TriggerMinNumberTof{8}; - const Int_t eb_TriggerMinNumberTofLayers{4}; + const Int_t eb_TriggerMinNumberTof{1}; + const Int_t eb_TriggerMinNumberTofLayers{1}; const Int_t eb_TriggerMinNumberRich{0}; - const Int_t eb_TrigWinMinBmon{-65}; - const Int_t eb_TrigWinMaxBmon{65}; + const Int_t eb_TrigWinMinBmon{-15}; + const Int_t eb_TrigWinMaxBmon{15}; const Int_t eb_TrigWinMinSts{-75}; const Int_t eb_TrigWinMaxSts{75}; const Int_t eb_TrigWinMinMuch{-50}; const Int_t eb_TrigWinMaxMuch{500}; const Int_t eb_TrigWinMinTrd1d{-100}; const Int_t eb_TrigWinMaxTrd1d{300}; - const Int_t eb_TrigWinMinTrd2d{-100}; - const Int_t eb_TrigWinMaxTrd2d{350}; + const Int_t eb_TrigWinMinTrd2d{-75}; + const Int_t eb_TrigWinMaxTrd2d{200}; const Int_t eb_TrigWinMinTof{-10}; - const Int_t eb_TrigWinMaxTof{70}; + const Int_t eb_TrigWinMaxTof{40}; const Int_t eb_TrigWinMinRich{-20}; const Int_t eb_TrigWinMaxRich{120}; -- GitLab