Skip to content

Commit

Permalink
Merge pull request #46414 from mmusich/fix_test_SiStripG2GainsValidator
Browse files Browse the repository at this point in the history
Fix `SiStripG2GainsValidator`
  • Loading branch information
cmsbuild authored Oct 17, 2024
2 parents 30920f5 + 953ee39 commit 3b1948c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 4 additions & 11 deletions CondCore/SiStripPlugins/scripts/SiStripG2GainsValidator
Original file line number Diff line number Diff line change
@@ -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

##############################################
Expand All @@ -31,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

##############################################
Expand Down Expand Up @@ -290,7 +283,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 '
Expand All @@ -299,13 +292,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'
Expand Down
6 changes: 6 additions & 0 deletions CondCore/SiStripPlugins/scripts/testCompareSiStripG2Gains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down

0 comments on commit 3b1948c

Please sign in to comment.