From 35ed85cd0429850864c0443ebb3cde80e8155ef5 Mon Sep 17 00:00:00 2001 From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de> Date: Wed, 13 Jul 2022 16:59:24 +0200 Subject: [PATCH] [mBMON] Fix/adapt to the new 16ch diamond while keeping old data support - Fix mapping range for 2022 BMon in Tof Parameter class (16ch assumption instead of 2x8) - Disable Digi output in the online Bmon unp macro (pure monitor) - Fix SysId used to switch filling of BMon Error plots in unpacking Algo - Add accessor for the monitor pointer in TOF unpack config class - Add possibility to remap up to 16 channels in TOF unpack monitor class - Add possibility to disable the internal HttpServer in TOF unpack monitor class (later needed for MQ) --- core/detectors/tof/CbmMcbm2018TofPar.cxx | 4 +- .../detectors/tof/unpack/CbmTofUnpackAlgo.cxx | 4 +- .../detectors/tof/unpack/CbmTofUnpackConfig.h | 3 ++ .../tof/unpack/CbmTofUnpackMonitor.cxx | 25 +++++++------ .../tof/unpack/CbmTofUnpackMonitor.h | 37 ++++++++++++++++++- 5 files changed, 57 insertions(+), 16 deletions(-) diff --git a/core/detectors/tof/CbmMcbm2018TofPar.cxx b/core/detectors/tof/CbmMcbm2018TofPar.cxx index 9212ad578a..82c681410e 100644 --- a/core/detectors/tof/CbmMcbm2018TofPar.cxx +++ b/core/detectors/tof/CbmMcbm2018TofPar.cxx @@ -381,8 +381,8 @@ void CbmMcbm2018TofPar::BuildChannelsUidMapT0_2022(UInt_t& uCh, UInt_t uGbtx) /// Mapping for the 2022 beamtime if (-1 < fiModuleId[uGbtx] && uGet4 < 32 && 0 == uGet4 % 4 && 0 == uGet4Ch) { /// 1 channel per physical GET4, 2 links per physical GET4, 4 physical GET4s per GBTx, 1 GBTx per comp. - /// 8 channels for one side, 8 for the other - UInt_t uChannelT0 = (uGet4 / 8 + 4 * (uGbtx / 2)) % 8; + /// 16 channels for one side, 16 for the other + UInt_t uChannelT0 = (uGet4 / 8 + 4 * (uGbtx / 2)) % 16; /// Type hard-coded to allow different parameter values to separate 2022 T0 and pre-2022 T0 fviRpcChUId[uCh] = CbmTofAddress::GetUniqueAddress(fiModuleId[uGbtx], 0, uChannelT0, fiRpcSide[uGbtx], 5); LOG(info) << Form(" Bmon channel: %u side %u from GBTx %2u, " diff --git a/reco/detectors/tof/unpack/CbmTofUnpackAlgo.cxx b/reco/detectors/tof/unpack/CbmTofUnpackAlgo.cxx index 1b95f9c895..74aa75f767 100644 --- a/reco/detectors/tof/unpack/CbmTofUnpackAlgo.cxx +++ b/reco/detectors/tof/unpack/CbmTofUnpackAlgo.cxx @@ -296,11 +296,11 @@ bool CbmTofUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, UI fMonitor->FillErrMonitoringHistos(fuCurrDpbIdx, fuGet4Id, pMess[uIdx].getGdpbSysErrChanId(), pMess[uIdx].getGdpbSysErrData()); - if (90 == fuCurrentMsSysId) { + if (0x90 == fuCurrentMsSysId) { fMonitor->FillErrBmonMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id, critof001::GET4_V2X_ERR_LOST_EVT == pMess[uIdx].getGdpbSysErrData()); - } // if (90 == fuCurrentMsSysId) + } // if (0x90 == fuCurrentMsSysId) } // if (critof001::SYS_GET4_ERROR == pMess[uIdx].getGdpbSysSubType()) } // if (fMonitor ) break; diff --git a/reco/detectors/tof/unpack/CbmTofUnpackConfig.h b/reco/detectors/tof/unpack/CbmTofUnpackConfig.h index f743abab93..0d5aecbaa2 100644 --- a/reco/detectors/tof/unpack/CbmTofUnpackConfig.h +++ b/reco/detectors/tof/unpack/CbmTofUnpackConfig.h @@ -94,6 +94,9 @@ public: /** @brief Add a monitor to the unpacker. @param value CbmStsUnpackMonitor */ void SetMonitor(std::shared_ptr<CbmTofUnpackMonitor> value) { fMonitor = value; } + /** @brief Returns the monitor of the unpacker if any. @return value CbmTofUnpackMonitor */ + std::shared_ptr<CbmTofUnpackMonitor> GetMonitor() { return fMonitor; } + protected: /** * @brief Choose the derived unpacker algorithm to be used for the DAQ output to Digi translation. If algo was already set manually by the user this algorithm is used. diff --git a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx index 3e8d15ab09..9576dbeebb 100644 --- a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx +++ b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx @@ -1320,18 +1320,21 @@ Bool_t CbmTofUnpackMonitor::Init(CbmMcbm2018TofPar* parset) // sSystem = "bmon"; } - THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); - if (nullptr != server) { - for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) { - server->Register(Form("/%s/%s", sSystem.data(), vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); - } - for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { - server->Register(Form("/%s/%s", sSystem.data(), vHistos[uHisto].second.data()), vHistos[uHisto].first); + + if (fbInternalHttp) { + THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); + if (nullptr != server) { + for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) { + server->Register(Form("/%s/%s", sSystem.data(), vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first); + } + for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { + server->Register(Form("/%s/%s", sSystem.data(), vHistos[uHisto].second.data()), vHistos[uHisto].first); + } + /* + server->RegisterCommand(Form("/Reset_%s_Hist", sSystem.data()), "bMcbm2018UnpackerTaskStsResetHistos=kTRUE"); + server->Restrict("/Reset_UnpSts_Hist", "allow=admin"); + */ } - /* - server->RegisterCommand(Form("/Reset_%s_Hist", sSystem.data()), "bMcbm2018UnpackerTaskStsResetHistos=kTRUE"); - server->Restrict("/Reset_UnpSts_Hist", "allow=admin"); -*/ } return kTRUE; diff --git a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.h b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.h index 7c29a41a31..75ecaff525 100644 --- a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.h +++ b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.h @@ -62,6 +62,28 @@ public: fuBmonChanMap[6] = uChan6; fuBmonChanMap[7] = uChan7; } + inline void SetBmonChannelMap(UInt_t uChan0, UInt_t uChan1, UInt_t uChan2, UInt_t uChan3, UInt_t uChan4, + UInt_t uChan5, UInt_t uChan6, UInt_t uChan7, UInt_t uChan8, UInt_t uChan9, + UInt_t uChan10, UInt_t uChan11, UInt_t uChan12, UInt_t uChan13, UInt_t uChan14, + UInt_t uChan15) + { + fuBmonChanMap[0] = uChan0; + fuBmonChanMap[1] = uChan1; + fuBmonChanMap[2] = uChan2; + fuBmonChanMap[3] = uChan3; + fuBmonChanMap[4] = uChan4; + fuBmonChanMap[5] = uChan5; + fuBmonChanMap[6] = uChan6; + fuBmonChanMap[7] = uChan7; + fuBmonChanMap[8] = uChan8; + fuBmonChanMap[9] = uChan9; + fuBmonChanMap[10] = uChan10; + fuBmonChanMap[11] = uChan11; + fuBmonChanMap[12] = uChan12; + fuBmonChanMap[13] = uChan13; + fuBmonChanMap[14] = uChan14; + fuBmonChanMap[15] = uChan15; + } void SetLongDurationLimits(UInt_t uDurationSeconds, UInt_t uBinSize) { @@ -115,6 +137,18 @@ public: /** @brief Read the Bmon mode */ bool GetBmonMode() { return fBmonMode; } + /** @brief Activate/de-activate the internal histo serve mode */ + void SetInternalHttpMode(bool value) { fbInternalHttp = value; } + + /** @brief Read the Bmon mode */ + bool GetInternalHttpMode() { return fbInternalHttp; } + + /** @brief Set start time for evolution histos */ + void SetHistosStartTime(double_t value) { fdStartTime = value; } + + /** @brief Set start time for evolution histos */ + double_t GetHistosStartTime() { return fdStartTime; } + private: TString fHistoFileName = "data/mon.tof.root"; @@ -137,7 +171,8 @@ private: UInt_t fuLongHistoBinNb = 1; /** @brief Flag if debug mode is active or not */ - bool fBmonMode = false; + bool fBmonMode = false; + bool fbInternalHttp = true; /// ---> Constants static const UInt_t kuMaxNbFlibLinks = 32; -- GitLab