From be7478fb46643f29d310b41ee28094740207ce00 Mon Sep 17 00:00:00 2001 From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de> Date: Thu, 6 Mar 2025 12:08:22 +0100 Subject: [PATCH] BMon Q-factors moni: filter out pulser digis and single shot periods --- .../detectors/tof/unpack/CbmTofUnpackMonitor.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx index e859e7341..a53ac33d8 100644 --- a/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx +++ b/reco/detectors/tof/unpack/CbmTofUnpackMonitor.cxx @@ -1732,8 +1732,9 @@ double_t CbmTofUnpackMonitor::ExtractQFactor(TH1* pHistoIn) { // Q-Factor = Max Bin Content / Mean Content of all bin in range // => Tend toward 1 if bins are more identical - if (pHistoIn->Integral()) { - return (pHistoIn->GetBinContent(pHistoIn->GetMaximumBin())) / (pHistoIn->Integral() / pHistoIn->GetNbinsX()); + double_t mean = ExtractMean(pHistoIn); + if (0.0 < mean) { + return (pHistoIn->GetBinContent(pHistoIn->GetMaximumBin())) / mean; } else { return 0.0; @@ -1741,9 +1742,8 @@ double_t CbmTofUnpackMonitor::ExtractQFactor(TH1* pHistoIn) } double_t CbmTofUnpackMonitor::ExtractMean(TH1* pHistoIn) { - // Q-Factor = Max Bin Content / Mean Content of all bin in range - // => Tend toward 1 if bins are more identical - if (pHistoIn->Integral()) { + // Mean bin content, special case for histo with single entries to avoid unrealistic Q-Factors + if (pHistoIn->Integral() && 1 < pHistoIn->GetEntries()) { return (pHistoIn->Integral() / pHistoIn->GetNbinsX()); } else { @@ -1811,7 +1811,11 @@ void CbmTofUnpackMonitor::FinalizeTsBmonQfactorHistos(uint64_t uTsTimeNs, std::v fvuQfactorIdxHistoCycleinTS.assign(fvdQfactorIntegrationNs.size(), 0); if (vDigis && 0 < vDigis->size()) { for (auto it = vDigis->begin(); it != vDigis->end(); ++it) { - FillHitBmonQfactorHistos(uTsTimeNs, (*it).GetTime()); + // Filter out pulser digis + if ((0 != (*it).GetChannel() % 4) || ((*it).GetCharge() < fuMinTotPulser) + || (fuMaxTotPulser < (*it).GetCharge())) { + FillHitBmonQfactorHistos(uTsTimeNs, (*it).GetTime()); + } } } -- GitLab