From d64b28bfb0646a7fd3eacc4b2ab1c1cf00b4a64e Mon Sep 17 00:00:00 2001 From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de> Date: Thu, 5 May 2022 16:13:03 +0200 Subject: [PATCH] [mSTS][mMUCH] Fixes to get the evolution plots in the monitors running --- .../much/unpack/CbmMuchUnpackAlgo.cxx | 24 +++++----- .../detectors/much/unpack/CbmMuchUnpackAlgo.h | 6 --- .../much/unpack/CbmMuchUnpackMonitor.cxx | 43 +++++++++++------- .../much/unpack/CbmMuchUnpackMonitor.h | 11 +++-- .../detectors/sts/unpack/CbmStsUnpackAlgo.cxx | 24 +++++----- reco/detectors/sts/unpack/CbmStsUnpackAlgo.h | 6 --- .../sts/unpack/CbmStsUnpackMonitor.cxx | 45 +++++++++++-------- .../sts/unpack/CbmStsUnpackMonitor.h | 11 +++-- 8 files changed, 93 insertions(+), 77 deletions(-) diff --git a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx index 5cd08b6c79..baa1cf61f7 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.cxx @@ -567,22 +567,23 @@ void CbmMuchUnpackAlgo::processHitInfo(const stsxyter::Message& mess) } } - // Convert the Hit time in bins to Hit time in ns - const double dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs; - if (fMonitor) { - // Check Starting point of histos with time as X axis - if (-1 == fdStartTime) { fdStartTime = dHitTimeNs; } - if (fMonitor->GetDebugMode()) { - fMonitor->FillHitDebugMonitoringHistos(uAsicIdx, usChan, usRawAdc, usRawTs, mess.IsHitMissedEvts()); - } + // Convert the Hit time in bins within the TS to Hit time in secondes within Unix frame (UTC or TAI) + const double dHitTimeAbsSec = + (static_cast<double_t>(ulHitTime) * stsxyter::kdClockCycleNs - fSystemTimeOffset + fTsStartTime) * 1e-9; + + // Prepare monitoring values const uint32_t uAsicInFeb = uAsicIdx % fNrAsicsPerFeb; - const double dTimeSinceStartSec = (dHitTimeNs - fdStartTime) * 1e-9; const double dCalAdc = usRawAdc; // const double dCalAdc = fvdFebAdcOffs[uFebIdx] + (usRawAdc - 1) * fvdFebAdcGain[uFebIdx]; + fMonitor->FillHitMonitoringHistos(uFebIdx, usChan, uChanInFeb, usRawAdc, dCalAdc, usRawTs, mess.IsHitMissedEvts()); - fMonitor->FillHitEvoMonitoringHistos(uFebIdx, uAsicIdx, uAsicInFeb, uChanInFeb, dTimeSinceStartSec, + fMonitor->FillHitEvoMonitoringHistos(uFebIdx, uAsicIdx, uAsicInFeb, uChanInFeb, dHitTimeAbsSec, mess.IsHitMissedEvts()); + + if (fMonitor->GetDebugMode()) { + fMonitor->FillHitDebugMonitoringHistos(uAsicIdx, usChan, usRawAdc, usRawTs, mess.IsHitMissedEvts()); + } } } @@ -914,10 +915,9 @@ bool CbmMuchUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, U if (fMonitor->GetDebugMode()) { const double dMsTime = (1e-9) * static_cast<double>(fMsStartTime); if (icomp < fMonitor->GetMaxNbFlibLinks()) { - if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime; fMonitor->CreateMsComponentSizeHistos(icomp); fMonitor->FillMsSize(icomp, uSize); - fMonitor->FillMsSizeTime(icomp, dMsTime - fdStartTimeMsSz, uSize); + fMonitor->FillMsSizeTime(icomp, dMsTime, uSize); } } diff --git a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h index 27317fab53..32a19adacb 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h +++ b/reco/detectors/much/unpack/CbmMuchUnpackAlgo.h @@ -324,12 +324,6 @@ protected: /** @brief TS MSB in TS of last hit message for each channel, [ AsicIdx ][ Chan ] */ std::vector<std::vector<uint64_t>> fvvulLastTsMsbChan = {}; //! - /** @brief Time of first valid hit (TS_MSB available), used as reference for evolution plots @todo move this to the monitor the algo does not need it!*/ - double fdStartTime = 0; - - /** @brief Time of first microslice, used as reference for evolution plots @todo move this to the monitor the algo does not need it!*/ - double fdStartTimeMsSz = 0; - // Monitoring /** @brief Potential (online) monitor for the unpacking process */ std::shared_ptr<CbmMuchUnpackMonitor> fMonitor = nullptr; diff --git a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx index 624caa020b..b091e9c1ac 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx +++ b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.cxx @@ -90,15 +90,15 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) /// Hit rates evo per FEB in system sHistName = "hMuchAllFebsHitRateEvo"; title = "Hits per second & FEB; Time [s]; FEB []; Hits []"; - fhMuchAllFebsHitRateEvo = new TH2I(sHistName, title, 5, 0, 5, uNbFebs, -0.5, uNbFebs - 0.5); - fhMuchAllFebsHitRateEvo->SetCanExtend(TH1::kAllAxes); + fhMuchAllFebsHitRateEvo = new TH2I(sHistName, title, 600, 0, 600, uNbFebs, -0.5, uNbFebs - 0.5); + // fhMuchAllFebsHitRateEvo->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhMuchAllFebsHitRateEvo, ""); /// Hit rates evo per ASIC in system sHistName = "hMuchAllAsicsHitRateEvo"; title = "Hits per second & ASIC; Time [s]; ASIC []; Hits []"; - fhMuchAllAsicsHitRateEvo = new TH2I(sHistName, title, 5, 0, 5, uNbAsics, -0.5, uNbAsics - 0.5); - fhMuchAllAsicsHitRateEvo->SetCanExtend(TH1::kAllAxes); + fhMuchAllAsicsHitRateEvo = new TH2I(sHistName, title, 600, 0, 600, uNbAsics, -0.5, uNbAsics - 0.5); + // fhMuchAllAsicsHitRateEvo->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhMuchAllAsicsHitRateEvo, ""); /// Hit counts map in system @@ -195,42 +195,46 @@ Bool_t CbmMuchUnpackMonitor::CreateHistograms(CbmMuchUnpackPar* pUnpackPar) title = Form("Missed Evt flags per second & channel in FEB #%03u; Time " "[s]; Channel []; Missed Evt flags []", uFebIdx); - fvhMuchFebChanMissEvtEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - fvhMuchFebChanMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebChanMissEvtEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); + // fvhMuchFebChanMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Missed event flag counts evolution sHistName = Form("hMuchFebAsicMissEvtEvo_%03u", uFebIdx); title = Form("Missed Evt flags per second & StsXyter in FEB #%03u; Time " "[s]; Asic []; Missed Evt flags []", uFebIdx); - fvhMuchFebAsicMissEvtEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); - fvhMuchFebAsicMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebAsicMissEvtEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); + // fvhMuchFebAsicMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Missed event flag counts evolution sHistName = Form("hMuchFebMissEvtEvo_%03u", uFebIdx); title = Form("Missed Evt flags per second & channel in FEB #%03u; Time " "[s]; Missed Evt flags []", uFebIdx); - fvhMuchFebMissEvtEvo.push_back(new TH1I(sHistName, title, 5, 0, 5)); - fvhMuchFebMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebMissEvtEvo.push_back(new TH1I(sHistName, title, 600, 0, 600)); + // fvhMuchFebMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per channel sHistName = Form("hMuchFebChanRateEvo_%03u", uFebIdx); title = Form("Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []", uFebIdx); - fvhMuchFebChanHitRateEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - fvhMuchFebChanHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebChanHitRateEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); + // fvhMuchFebChanHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per MuchXyter sHistName = Form("hMuchFebAsicRateEvo_%03u", uFebIdx); title = Form("Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []", uFebIdx); - fvhMuchFebAsicHitRateEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); - fvhMuchFebAsicHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebAsicHitRateEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); + // fvhMuchFebAsicHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per FEB sHistName = Form("hMuchFebRateEvo_%03u", uFebIdx); title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx); - fvhMuchFebHitRateEvo.push_back(new TH1I(sHistName, title, 5, 0, 5)); - fvhMuchFebHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhMuchFebHitRateEvo.push_back(new TH1I(sHistName, title, 600, 0, 600)); + // fvhMuchFebHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per channel, 1 minute bins, 24h sHistName = Form("hMuchFebChanRateEvoLong_%03u", uFebIdx); @@ -674,8 +678,13 @@ void CbmMuchUnpackMonitor::FillHitDebugMonitoringHistos(const UInt_t& uAsicIdx, // ------------------------------------------------------------------------- void CbmMuchUnpackMonitor::FillHitEvoMonitoringHistos(const UInt_t& uFebIdx, const UInt_t& uAsicIdx, const UInt_t& uAsicInFeb, const UInt_t& uChanInFeb, - const Double_t& dTimeSinceStartSec, const bool& isHitMissedEvts) + const Double_t& dAbsTimeSec, const bool& isHitMissedEvts) { + // Check Starting point of histos with time as X axis + if (-1 == fdStartTime) { fdStartTime = dAbsTimeSec; } + + Double_t dTimeSinceStartSec = dAbsTimeSec - fdStartTime; + // Fill histos with time as X axis FillMuchFebAsicHitCounts(uFebIdx, uAsicInFeb); FillMuchFebChanHitRateEvo(uFebIdx, dTimeSinceStartSec, uChanInFeb); diff --git a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h index a9d4a01e5d..9696d4c145 100644 --- a/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h +++ b/reco/detectors/much/unpack/CbmMuchUnpackMonitor.h @@ -202,7 +202,11 @@ public: //Fill Ms Component Size Histos void FillMsSize(UInt_t uMsComp, UInt_t uSize) { fvhMsSize[uMsComp]->Fill(uSize); } - void FillMsSizeTime(UInt_t uMsComp, Double_t dTime, UInt_t uSize) { fvhMsSizeTime[uMsComp]->Fill(dTime, uSize); } + void FillMsSizeTime(UInt_t uMsComp, Double_t dTime, UInt_t uSize) + { + if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dTime; + fvhMsSizeTime[uMsComp]->Fill(dTime - fdStartTimeMsSz, uSize); + } void FillHitMonitoringHistos(const UInt_t& uFebIdx, const UShort_t& usChan, const UInt_t& uChanInFeb, const UShort_t& usRawAdc, const Double_t& dCalAdc, const UShort_t& usRawTs, @@ -212,8 +216,7 @@ public: const UShort_t& usRawTs, const bool& isHitMissedEvts); void FillHitEvoMonitoringHistos(const UInt_t& uFebIdx, const UInt_t& uAsicIdx, const UInt_t& uAsicInFeb, - const UInt_t& uChanInFeb, const Double_t& dTimeSinceStartSec, - const bool& isHitMissedEvts); + const UInt_t& uChanInFeb, const Double_t& dAbsTimeSec, const bool& isHitMissedEvts); void CountRawHit(uint32_t uFebIdx, uint32_t uChanInFeb) { @@ -242,6 +245,8 @@ private: /// Rate evolution histos double_t dFirstTsStartTime = 0; + double fdStartTime = -1; + double fdStartTimeMsSz = -1; //Bool_t fbLongHistoEnable; UInt_t fuLongHistoNbSeconds = 3600; UInt_t fuLongHistoBinSizeSec = 10; diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx index aa59345c4a..6ee6e00cca 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx @@ -545,21 +545,22 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess) } } - // Convert the Hit time in bins to Hit time in ns - const double dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs; - if (fMonitor) { - // Check Starting point of histos with time as X axis - if (-1 == fdStartTime) { fdStartTime = dHitTimeNs; } - if (fMonitor->GetDebugMode()) { - fMonitor->FillHitDebugMonitoringHistos(uAsicIdx, usChan, usRawAdc, usRawTs, mess.IsHitMissedEvts()); - } + // Convert the Hit time in bins within the TS to Hit time in secondes within Unix frame (UTC or TAI) + const double dHitTimeAbsSec = + (static_cast<double_t>(ulHitTime) * stsxyter::kdClockCycleNs - fSystemTimeOffset + fTsStartTime) * 1e-9; + + // Prepare monitoring values const uint32_t uAsicInFeb = uAsicIdx % fNrAsicsPerFeb; - const double dTimeSinceStartSec = (dHitTimeNs - fdStartTime) * 1e-9; const double dCalAdc = fvdFebAdcOffs[uFebIdx] + (usRawAdc - 1) * fvdFebAdcGain[uFebIdx]; + fMonitor->FillHitMonitoringHistos(uFebIdx, usChan, uChanInFeb, usRawAdc, dCalAdc, usRawTs, mess.IsHitMissedEvts()); - fMonitor->FillHitEvoMonitoringHistos(uFebIdx, uAsicIdx, uAsicInFeb, uChanInFeb, dTimeSinceStartSec, + fMonitor->FillHitEvoMonitoringHistos(uFebIdx, uAsicIdx, uAsicInFeb, uChanInFeb, dHitTimeAbsSec, mess.IsHitMissedEvts()); + + if (fMonitor->GetDebugMode()) { + fMonitor->FillHitDebugMonitoringHistos(uAsicIdx, usChan, usRawAdc, usRawTs, mess.IsHitMissedEvts()); + } } } @@ -743,10 +744,9 @@ bool CbmStsUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, UI if (fMonitor->GetDebugMode()) { const double dMsTime = (1e-9) * static_cast<double>(fMsStartTime); if (icomp < fMonitor->GetMaxNbFlibLinks()) { - if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime; fMonitor->CreateMsComponentSizeHistos(icomp); fMonitor->FillMsSize(icomp, uSize); - fMonitor->FillMsSizeTime(icomp, dMsTime - fdStartTimeMsSz, uSize); + fMonitor->FillMsSizeTime(icomp, dMsTime, uSize); } } diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h index 3fef26acc7..8dc4f1a10f 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h @@ -251,12 +251,6 @@ protected: /** @brief TS MSB in TS of last hit message for each channel, [ AsicIdx ][ Chan ] */ std::vector<std::vector<uint64_t>> fvvulLastTsMsbChan = {}; //! - /** @brief Time of first valid hit (TS_MSB available), used as reference for evolution plots @todo move this to the monitor the algo does not need it!*/ - double fdStartTime = 0; - - /** @brief Time of first microslice, used as reference for evolution plots @todo move this to the monitor the algo does not need it!*/ - double fdStartTimeMsSz = 0; - private: ClassDef(CbmStsUnpackAlgo, 2) }; diff --git a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx index c9af9980a9..7b7181542a 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.cxx @@ -90,15 +90,15 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) /// Hit rates evo per FEB in system sHistName = "hStsAllFebsHitRateEvo"; title = "Hits per second & FEB; Time [s]; FEB []; Hits []"; - fhStsAllFebsHitRateEvo = new TH2I(sHistName, title, 5, 0, 5, uNbFebs, -0.5, uNbFebs - 0.5); - fhStsAllFebsHitRateEvo->SetCanExtend(TH1::kAllAxes); + fhStsAllFebsHitRateEvo = new TH2I(sHistName, title, 600, 0, 600, uNbFebs, -0.5, uNbFebs - 0.5); + // fhStsAllFebsHitRateEvo->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhStsAllFebsHitRateEvo, ""); /// Hit rates evo per ASIC in system sHistName = "hStsAllAsicsHitRateEvo"; title = "Hits per second & ASIC; Time [s]; ASIC []; Hits []"; - fhStsAllAsicsHitRateEvo = new TH2I(sHistName, title, 5, 0, 5, uNbAsics, -0.5, uNbAsics - 0.5); - fhStsAllAsicsHitRateEvo->SetCanExtend(TH1::kAllAxes); + fhStsAllAsicsHitRateEvo = new TH2I(sHistName, title, 600, 0, 600, uNbAsics, -0.5, uNbAsics - 0.5); + // fhStsAllAsicsHitRateEvo->SetCanExtend(TH1::kAllAxes); AddHistoToVector(fhStsAllAsicsHitRateEvo, ""); /// Hit counts map in system @@ -195,42 +195,46 @@ Bool_t CbmStsUnpackMonitor::CreateHistograms(CbmMcbm2018StsPar* pUnpackPar) title = Form("Missed Evt flags per second & channel in FEB #%03u; Time " "[s]; Channel []; Missed Evt flags []", uFebIdx); - fvhStsFebChanMissEvtEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - fvhStsFebChanMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebChanMissEvtEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); + // fvhStsFebChanMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Missed event flag counts evolution sHistName = Form("hStsFebAsicMissEvtEvo_%03u", uFebIdx); title = Form("Missed Evt flags per second & StsXyter in FEB #%03u; Time " "[s]; Asic []; Missed Evt flags []", uFebIdx); - fvhStsFebAsicMissEvtEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); - fvhStsFebAsicMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebAsicMissEvtEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); + // fvhStsFebAsicMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Missed event flag counts evolution sHistName = Form("hStsFebMissEvtEvo_%03u", uFebIdx); title = Form("Missed Evt flags per second & channel in FEB #%03u; Time " "[s]; Missed Evt flags []", uFebIdx); - fvhStsFebMissEvtEvo.push_back(new TH1I(sHistName, title, 5, 0, 5)); - fvhStsFebMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebMissEvtEvo.push_back(new TH1I(sHistName, title, 600, 0, 600)); + // fvhStsFebMissEvtEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per channel sHistName = Form("hStsFebChanRateEvo_%03u", uFebIdx); title = Form("Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []", uFebIdx); - fvhStsFebChanHitRateEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); - fvhStsFebChanHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebChanHitRateEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbChanPerFeb, -0.5, uNbChanPerFeb - 0.5)); + // fvhStsFebChanHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per StsXyter sHistName = Form("hStsFebAsicRateEvo_%03u", uFebIdx); title = Form("Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []", uFebIdx); - fvhStsFebAsicHitRateEvo.push_back(new TH2I(sHistName, title, 5, 0, 5, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); - fvhStsFebAsicHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebAsicHitRateEvo.push_back( + new TH2I(sHistName, title, 600, 0, 600, uNbAsicsPerFeb, -0.5, uNbAsicsPerFeb - 0.5)); + // fvhStsFebAsicHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per FEB sHistName = Form("hStsFebRateEvo_%03u", uFebIdx); title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx); - fvhStsFebHitRateEvo.push_back(new TH1I(sHistName, title, 5, 0, 5)); - fvhStsFebHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); + fvhStsFebHitRateEvo.push_back(new TH1I(sHistName, title, 600, 0, 600)); + // fvhStsFebHitRateEvo.back()->SetCanExtend(TH1::kAllAxes); /// Hit rates evo per channel, 1 minute bins, 24h sHistName = Form("hStsFebChanRateEvoLong_%03u", uFebIdx); @@ -642,7 +646,7 @@ Bool_t CbmStsUnpackMonitor::ResetDebugHistograms() // ------------------------------------------------------------------------- -void CbmStsUnpackMonitor::FillHitMonitoringHistos(const UInt_t& uFebIdx, const UShort_t& usChan, +void CbmStsUnpackMonitor::FillHitMonitoringHistos(const UInt_t& uFebIdx, const UShort_t& /*usChan*/, const UInt_t& uChanInFeb, const UShort_t& usRawAdc, const Double_t& dCalAdc, const UShort_t& usRawTs, const bool& isHitMissedEvts) @@ -673,8 +677,13 @@ void CbmStsUnpackMonitor::FillHitDebugMonitoringHistos(const UInt_t& uAsicIdx, c // ------------------------------------------------------------------------- void CbmStsUnpackMonitor::FillHitEvoMonitoringHistos(const UInt_t& uFebIdx, const UInt_t& uAsicIdx, const UInt_t& uAsicInFeb, const UInt_t& uChanInFeb, - const Double_t& dTimeSinceStartSec, const bool& isHitMissedEvts) + const Double_t& dAbsTimeSec, const bool& isHitMissedEvts) { + // Check Starting point of histos with time as X axis + if (-1 == fdStartTime) { fdStartTime = dAbsTimeSec; } + + Double_t dTimeSinceStartSec = dAbsTimeSec - fdStartTime; + // Fill histos with time as X axis FillStsFebAsicHitCounts(uFebIdx, uAsicInFeb); FillStsFebChanHitRateEvo(uFebIdx, dTimeSinceStartSec, uChanInFeb); diff --git a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h index 8c9b747712..f20118496b 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackMonitor.h @@ -196,7 +196,11 @@ public: //Fill Ms Component Size Histos void FillMsSize(UInt_t uMsComp, UInt_t uSize) { fvhMsSize[uMsComp]->Fill(uSize); } - void FillMsSizeTime(UInt_t uMsComp, Double_t dTime, UInt_t uSize) { fvhMsSizeTime[uMsComp]->Fill(dTime, uSize); } + void FillMsSizeTime(UInt_t uMsComp, Double_t dTime, UInt_t uSize) + { + if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dTime; + fvhMsSizeTime[uMsComp]->Fill(dTime - fdStartTimeMsSz, uSize); + } void FillHitMonitoringHistos(const UInt_t& uFebIdx, const UShort_t& usChan, const UInt_t& uChanInFeb, const UShort_t& usRawAdc, const Double_t& dCalAdc, const UShort_t& usRawTs, @@ -206,8 +210,7 @@ public: const UShort_t& usRawTs, const bool& isHitMissedEvts); void FillHitEvoMonitoringHistos(const UInt_t& uFebIdx, const UInt_t& uAsicIdx, const UInt_t& uAsicInFeb, - const UInt_t& uChanInFeb, const Double_t& dTimeSinceStartSec, - const bool& isHitMissedEvts); + const UInt_t& uChanInFeb, const Double_t& dAbsTimeSec, const bool& isHitMissedEvts); void CountRawHit(uint32_t uFebIdx, uint32_t uChanInFeb) { @@ -236,6 +239,8 @@ private: /// Rate evolution histos double_t dFirstTsStartTime = 0; + double fdStartTime = -1; + double fdStartTimeMsSz = -1; //Bool_t fbLongHistoEnable; UInt_t fuLongHistoNbSeconds = 3600; UInt_t fuLongHistoBinSizeSec = 10; -- GitLab