From 0d9155438ef46c998c87069efa44f3782ec465b5 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 16 Oct 2024 22:16:01 +0200 Subject: [PATCH 1/3] use the HLT FCSR as fall-back reference tag since --- CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator index e8ff3982a953a..a91ce03fd0f54 100755 --- a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator +++ b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator @@ -290,7 +290,7 @@ if __name__ == "__main__": for i,theValidationTagSince in enumerate(IOVsToValidate): # Construct the conddb_import command, modifying the 'since' value if necessary - since_value = FCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince + since_value = HLTFCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince command = ( f'conddb_import -c sqlite_file:toCompare.db ' f'-f frontier://FrontierPrep/CMS_CONDITIONS ' @@ -299,13 +299,13 @@ if __name__ == "__main__": # Print and execute the conddb_import command if theValidationTagSince < lastG2Payload[0]: - print("The last available IOV in the validation tag is older than the current last express IOV, taking FCSR as a since!") + print("The last available IOV in the validation tag is older than the current last express IOV, taking Express FCSR (HLT) as a since!") print(command) getCommandOutput(command) # Construct the testCompareSiStripG2Gains.sh command, adjusting the 'since' value similarly - since_value = FCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince + since_value = HLTFCSR + i if theValidationTagSince < lastG2Payload[0] else theValidationTagSince command = ( f'${{CMSSW_BASE}}/src/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh ' f'{Tag} {lastG2Payload[0]} {since_value} {current_directory}/toCompare.db' From be4adbcdc2d8527dd4f338f4c737411b7a68a58b Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 16 Oct 2024 22:25:48 +0200 Subject: [PATCH 2/3] remove unncessary imports in SiStripG2GainsValidator --- CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator index a91ce03fd0f54..285b355527d41 100755 --- a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator +++ b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator @@ -1,21 +1,13 @@ #!/usr/bin/env python3 -from __future__ import print_function - from datetime import datetime -import ROOT import configparser as ConfigParser -import datetime -import glob import json -import numpy import optparse import os -import re import sqlalchemy import string import subprocess import sys -import time import CondCore.Utilities.conddblib as conddb ############################################## From 953ee39716b1c57ce2653dc94e23de26a56fe556 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 16 Oct 2024 22:51:54 +0200 Subject: [PATCH 3/3] add protection against time-inverted IOVs in the comparator script --- CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator | 1 + .../SiStripPlugins/scripts/testCompareSiStripG2Gains.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator index 285b355527d41..4958161ddbc58 100755 --- a/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator +++ b/CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator @@ -23,6 +23,7 @@ def getCommandOutput(command): if err: print ('%s failed w/ exit code %d' % (command, err)) sys.exit(1) # This will stop the script immediately with the failure exit code + print(data) return data ############################################## diff --git a/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh b/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh index 3d4acc91e316a..7c1474a2b5baa 100755 --- a/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh +++ b/CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh @@ -24,6 +24,12 @@ W_DIR=$(pwd) STARTIOV=$2 ENDIOV=$3 +# Check if ENDIOV is greater than or equal to STARTIOV +if (( $ENDIOV < $STARTIOV )); then + echo "Error: ENDIOV ($ENDIOV) is less than STARTIOV ($STARTIOV). Skipping comparisons" + exit 0 +fi + source /cvmfs/cms.cern.ch/cmsset_default.sh eval "$(scram run -sh)"