Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-01 05:01:00

0001 #!/bin/bash
0002 
0003 # ConfDB configurations to use
0004 #  - if no explicit version, the most recent one is taken
0005 #  - to use explicit version, specify it in the entries below
0006 #  - to skip a given configuration, remove or comment the corresponding entry in the array TABLES
0007 #  - new configurations can be added by expanding the array TABLES
0008 #  - for new configurations, ensure that the corresponding "auto" GTs are defined in
0009 #     Configuration/HLT/python/autoCondHLT.py , and
0010 #     HLTrigger/Configuration/python/Tools/options.py
0011 declare -A TABLES=(
0012   ["Fake"]="/dev/CMSSW_14_1_0/Fake"
0013   ["Fake1"]="/dev/CMSSW_14_1_0/Fake1"
0014   ["Fake2"]="/dev/CMSSW_14_1_0/Fake2"
0015   ["2024v14"]="/frozen/2024/2e34/v1.4/CMSSW_14_1_X/HLT"
0016 )
0017 
0018 # command-line arguments
0019 VERBOSE=false # print extra messages to stdout
0020 DBPROXYOPTS="" # db-proxy configuration
0021 while [[ $# -gt 0 ]]; do
0022   case "$1" in
0023     -v) VERBOSE=true; shift;;
0024     --dbproxy) DBPROXYOPTS="${DBPROXYOPTS} --dbproxy"; shift;;
0025     --dbproxyhost) DBPROXYOPTS="${DBPROXYOPTS} --dbproxyhost $2"; shift; shift;;
0026     --dbproxyport) DBPROXYOPTS="${DBPROXYOPTS} --dbproxyport $2"; shift; shift;;
0027     *) shift;;
0028   esac
0029 done
0030 
0031 # remove spurious whitespaces and tabs from DBPROXYOPTS
0032 DBPROXYOPTS=$(echo "${DBPROXYOPTS}" | xargs)
0033 
0034 # log: print to stdout only if VERBOSE=true
0035 function log() {
0036   ${VERBOSE} && echo -e "$@"
0037 }
0038 
0039 # path to directory hosting this script
0040 TESTDIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
0041 
0042 # ensure that directory hosting this script corresponds to ${CMSSW_BASE}/src/HLTrigger/Configuration/test
0043 if [ "${TESTDIR}" != "${CMSSW_BASE}"/src/HLTrigger/Configuration/test ]; then
0044   printf "\n%s\n" "ERROR -- the directory hosting getHLT.sh [1] does not correspond to \${CMSSW_BASE}/src/HLTrigger/Configuration/test [2]"
0045   printf "%s\n"   "         [1] ${TESTDIR}"
0046   printf "%s\n\n" "         [2] ${CMSSW_BASE}/src/HLTrigger/Configuration/test"
0047   exit 1
0048 fi
0049 
0050 # ensure that the python/ directory hosting cff fragments exists
0051 if [ ! -d "${CMSSW_BASE}"/src/HLTrigger/Configuration/python ]; then
0052   printf "\n%s\n" "ERROR -- the directory \${CMSSW_BASE}/src/HLTrigger/Configuration/python [1] does not exist"
0053   printf "%s\n\n" "         [1] ${CMSSW_BASE}/src/HLTrigger/Configuration/python"
0054   exit 1
0055 fi
0056 
0057 INITDIR="${PWD}"
0058 
0059 # execute the ensuing steps from ${CMSSW_BASE}/src/HLTrigger/Configuration/test
0060 cd "${CMSSW_BASE}"/src/HLTrigger/Configuration/test
0061 
0062 # create cff fragments and cfg configs
0063 for TABLE in "${!TABLES[@]}"; do
0064   CONFIG="${TABLES[${TABLE}]}"
0065   echo "${TABLE} (config: ${CONFIG})"
0066 
0067   # cff fragment of each HLT menu (do not use any conditions or L1T override)
0068   log "  creating cff fragment of HLT menu..."
0069   hltGetConfiguration "${CONFIG}" --cff --data --type "${TABLE}" ${DBPROXYOPTS} > ../python/HLT_"${TABLE}"_cff.py
0070 
0071   # GlobalTag
0072   AUTOGT="auto:run3_hlt_${TABLE}"
0073   if [ "${TABLE}" = "Fake" ]; then
0074     AUTOGT="auto:run1_hlt_${TABLE}"
0075   elif [ "${TABLE}" = "Fake1" ] || [ "${TABLE}" = "Fake2" ]; then
0076     AUTOGT="auto:run2_hlt_${TABLE}"
0077   fi
0078 
0079   # standalone cfg file of each HLT menu
0080   log "  creating full cfg of HLT menu..."
0081   hltGetConfiguration "${CONFIG}" --full --data --type "${TABLE}" --unprescale --process "HLT${TABLE}" --globaltag "${AUTOGT}" \
0082     --input "file:RelVal_Raw_${TABLE}_DATA.root" ${DBPROXYOPTS} > OnLine_HLT_"${TABLE}".py
0083 done
0084 
0085 cd "${INITDIR}"