From 56cc47b127c6a649d003585fc593065f6a308422 Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Tue, 19 Mar 2024 13:29:53 +0100 Subject: [PATCH 1/8] ITS efficiency maps pretection for digitization out of range --- .../include/DataFormatsITSMFT/TimeDeadMap.h | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h index aaf7a1a95aa04..46978b931ad9e 100644 --- a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h +++ b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h @@ -73,8 +73,8 @@ class TimeDeadMap } } - void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true) - { // for time-dependent and (optionally) static part + void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true, long orbitGapAllowed = 33000) + { // for time-dependent and (optionally) static part. Use orbitGapAllowed = -1 to ignore check on orbit difference if (mMAP_VERSION != "3" && mMAP_VERSION != "4") { LOG(error) << "Trying to decode time-dependent deadmap version " << mMAP_VERSION << ". Not implemented, doing nothing."; @@ -84,14 +84,16 @@ class TimeDeadMap if (mEvolvingDeadMap.empty()) { LOG(warning) << "Time-dependent dead map is empty. Doing nothing."; return; - } else if (orbit > mEvolvingDeadMap.rbegin()->first + 11000 * 300 || orbit < mEvolvingDeadMap.begin()->first - 11000 * 300) { - // the map should not leave several minutes uncovered. - LOG(warning) << "Time-dependent dead map: the requested orbit " << orbit << " seems to be out of the range stored in the map."; } std::vector closestVec; long dT = getMapAtOrbit(orbit, closestVec); + if (orbitGapAllowed >= 0 && std::abs(dT) > orbitGapAllowed) { + LOG(warning) << "Requested orbit " << orbit << ", found " << orbit - dT << ". Orbit gap is too high, skipping time-dependent map."; + closestVec.clear(); + } + // add static part if requested. something may be masked twice if (includeStaticMap && mMAP_VERSION != "3") { closestVec.insert(closestVec.end(), mStaticDeadMap.begin(), mStaticDeadMap.end()); @@ -125,18 +127,19 @@ class TimeDeadMap void getStaticMap(std::vector& mmap) { mmap = mStaticDeadMap; }; long getMapAtOrbit(unsigned long orbit, std::vector& mmap) - { // fills mmap and returns orbit - lower_bound + { // fills mmap and returns requested_orbit - found_orbit. Found orbit is the highest key lower or equal to the requested one if (mEvolvingDeadMap.empty()) { LOG(warning) << "Requested orbit " << orbit << "from an empty time-dependent map. Doing nothing"; return (long)orbit; } auto closest = mEvolvingDeadMap.lower_bound(orbit); - if (closest != mEvolvingDeadMap.end()) { + if (closest != mEvolvingDeadMap.begin()) { + --closest; mmap = closest->second; return (long)orbit - closest->first; } else { - mmap = mEvolvingDeadMap.rbegin()->second; - return (long)(orbit)-mEvolvingDeadMap.rbegin()->first; + mmap = mEvolvingDeadMap.begin()->second; + return (long)(orbit)-mEvolvingDeadMap.begin()->first; } } From ab90fe54060776a0ab6cc0d898f9071c747bbbc7 Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Tue, 19 Mar 2024 13:38:26 +0100 Subject: [PATCH 2/8] ITS efficiency maps pretection for digitization out of range --- .../ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h index 46978b931ad9e..ce4b51f3e93f9 100644 --- a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h +++ b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h @@ -1,4 +1,4 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +33// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -73,7 +73,7 @@ class TimeDeadMap } } - void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true, long orbitGapAllowed = 33000) + void decodeMap(unsigned long orbit, o2::itsmft::NoiseMap& noisemap, bool includeStaticMap = true, long orbitGapAllowed = 330000) { // for time-dependent and (optionally) static part. Use orbitGapAllowed = -1 to ignore check on orbit difference if (mMAP_VERSION != "3" && mMAP_VERSION != "4") { From d33bb2814d3786a0fc9d7259891bb81a30bc113b Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Tue, 19 Mar 2024 13:40:03 +0100 Subject: [PATCH 3/8] ITS efficiency maps pretection for digitization out of range --- .../ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h index ce4b51f3e93f9..6afcb258e76b6 100644 --- a/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h +++ b/DataFormats/Detectors/ITSMFT/common/include/DataFormatsITSMFT/TimeDeadMap.h @@ -1,4 +1,4 @@ -33// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // From 5de44bd9a71c737c8c41e0aab27eb635e09dca1a Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Wed, 20 Mar 2024 15:08:18 +0100 Subject: [PATCH 4/8] typo in info message --- Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx index 3194a62d6b273..d11f6e24cb2c0 100644 --- a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx @@ -284,7 +284,7 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string else if (!ccdburl.empty()) { // send from this workflow - LOG(info) << mSelfName << "sending object " << ccdburl << "/browse/" << info.getFileName() + LOG(info) << mSelfName << "sending object " << ccdburl << "/browse/" << info.getPath() << "/" << info.getFileName() << " of size " << image->size() << " bytes, valid for " << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); From 2124158de61a4809c2025478aefed09881933e79 Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Wed, 20 Mar 2024 15:11:21 +0100 Subject: [PATCH 5/8] sending message at EOR to infologger --- Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx index d11f6e24cb2c0..561234bd79d52 100644 --- a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx @@ -269,7 +269,7 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string if (ec != nullptr) { - LOG(info) << "Sending object " << info.getPath() << "/" << info.getFileName() + LOG(important) << "Sending object " << info.getPath() << "/" << info.getFileName() << "to ccdb-populator, of size " << image->size() << " bytes, valid for " << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); @@ -284,7 +284,7 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string else if (!ccdburl.empty()) { // send from this workflow - LOG(info) << mSelfName << "sending object " << ccdburl << "/browse/" << info.getPath() << "/" << info.getFileName() + LOG(important) << mSelfName << "sending object " << ccdburl << "/browse/" << info.getPath() << "/" << info.getFileName() << " of size " << image->size() << " bytes, valid for " << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); @@ -335,7 +335,7 @@ void ITSMFTDeadMapBuilder::stop() LOG(warning) << "endOfStream not processed. Sending output to ccdb from the " << detname << "deadmap builder workflow."; PrepareOutputCcdb(nullptr, mCCDBUrl); } else { - LOG(warning) << "endOfStream not processed. Nothing forwarded as output."; + LOG(alert) << "endOfStream not processed. Nothing forwarded as output."; } isEnded = true; } From 7dd01da99593ff64fcd59a0c094086d94d8c75fa Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Wed, 20 Mar 2024 15:19:05 +0100 Subject: [PATCH 6/8] fix formatting --- .../ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx index 561234bd79d52..650d43cfd5a59 100644 --- a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx @@ -270,8 +270,8 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string if (ec != nullptr) { LOG(important) << "Sending object " << info.getPath() << "/" << info.getFileName() - << "to ccdb-populator, of size " << image->size() << " bytes, valid for " - << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); + << "to ccdb-populator, of size " << image->size() << " bytes, valid for " + << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); if (mRunMFT) { ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TimeDeadMap", 1}, *image.get()); @@ -285,8 +285,8 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string else if (!ccdburl.empty()) { // send from this workflow LOG(important) << mSelfName << "sending object " << ccdburl << "/browse/" << info.getPath() << "/" << info.getFileName() - << " of size " << image->size() << " bytes, valid for " - << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); + << " of size " << image->size() << " bytes, valid for " + << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); o2::ccdb::CcdbApi mApi; mApi.init(ccdburl); From 00e9c16159688c09eefd996e61d27ed8e869364d Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Wed, 20 Mar 2024 16:30:51 +0100 Subject: [PATCH 7/8] fix --- Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx index 650d43cfd5a59..cdc4928906db5 100644 --- a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx @@ -278,7 +278,7 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 1}, info); } else { ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TimeDeadMap", 0}, *image.get()); - ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 0}, info); + ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 0}, info);a } } @@ -335,7 +335,7 @@ void ITSMFTDeadMapBuilder::stop() LOG(warning) << "endOfStream not processed. Sending output to ccdb from the " << detname << "deadmap builder workflow."; PrepareOutputCcdb(nullptr, mCCDBUrl); } else { - LOG(alert) << "endOfStream not processed. Nothing forwarded as output."; + LOG(alarm) << "endOfStream not processed. Nothing forwarded as output."; } isEnded = true; } From 907f5ecd6075267e71d7a2ea4dc813dd39a3e6d8 Mon Sep 17 00:00:00 2001 From: Nicolo Valle Date: Wed, 20 Mar 2024 16:32:22 +0100 Subject: [PATCH 8/8] fix --- Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx index cdc4928906db5..362787500a617 100644 --- a/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx +++ b/Detectors/ITSMFT/common/workflow/src/DeadMapBuilderSpec.cxx @@ -278,7 +278,7 @@ void ITSMFTDeadMapBuilder::PrepareOutputCcdb(EndOfStreamContext* ec, std::string ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 1}, info); } else { ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TimeDeadMap", 0}, *image.get()); - ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 0}, info);a + ec->outputs().snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TimeDeadMap", 0}, info); } }