Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SiStripG2GainsValidator #46414

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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