Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-18 22:49:02

0001 #! /bin/bash
0002 
0003 # ConfDB configurations to use
0004 TABLES="Fake Fake1 Fake2 2022v14"
0005 HLT_Fake="/dev/CMSSW_12_4_0/Fake"
0006 HLT_Fake1="/dev/CMSSW_12_4_0/Fake1"
0007 HLT_Fake2="/dev/CMSSW_12_4_0/Fake2"
0008 HLT_2022v14="/frozen/2022/2e34/v1.4/HLT"
0009 
0010 # print extra messages ?
0011 VERBOSE=false
0012 
0013 # this is used for brace expansion
0014 TABLES_=$(echo $TABLES | sed -e's/ \+/,/g')
0015 
0016 [ "$1" == "-v" ] && { VERBOSE=true;  shift; }
0017 [ "$1" == "-q" ] && { VERBOSE=false; shift; }
0018 
0019 function log() {
0020   $VERBOSE && echo -e "$@"
0021 }
0022 
0023 function getConfigForCVS() {
0024   local CONFIG="$1"
0025   local NAME="$2"
0026   log "  dumping HLT cffs for $NAME from $CONFIG"
0027   # do not use any conditions or L1 override
0028   hltGetConfiguration --cff --data $CONFIG --type $NAME  > HLT_${NAME}_cff.py
0029 }
0030 
0031 function getConfigForOnline() {
0032   local CONFIG="$1"
0033   local NAME="$2"
0034   log "  dumping full HLT for $NAME from $CONFIG"
0035   # override the conditions with a menu-dependent "virtual" global tag, which takes care of overriding the L1 menu
0036 
0037   if [ "$NAME" == "Fake" ]; then
0038     hltGetConfiguration --full --data $CONFIG --type $NAME --unprescale --process "HLT${NAME}" --globaltag "auto:run1_hlt_${NAME}" --input "file:RelVal_Raw_${NAME}_DATA.root" > OnLine_HLT_${NAME}.py
0039   elif [ "$NAME" == "Fake1" ] || [ "$NAME" == "Fake2" ] || [ "$NAME" == "2018" ]; then
0040    hltGetConfiguration --full --data $CONFIG --type $NAME --unprescale --process "HLT${NAME}" --globaltag "auto:run2_hlt_${NAME}" --input "file:RelVal_Raw_${NAME}_DATA.root" > OnLine_HLT_${NAME}.py
0041   else
0042     hltGetConfiguration --full --data $CONFIG --type $NAME --unprescale --process "HLT${NAME}" --globaltag "auto:run3_hlt_${NAME}" --input "file:RelVal_Raw_${NAME}_DATA.root" > OnLine_HLT_${NAME}.py
0043   fi
0044 }
0045 
0046 # make sure we're using *this* working area
0047 eval `scramv1 runtime -sh`
0048 hash -r
0049 
0050 # cff python dumps, in CVS under HLTrigger/Configuration/pyhon
0051 log "Extracting cff python dumps"
0052 echo "Extracting cff python dumps"
0053 FILES=$(eval echo HLT_{$TABLES_}_cff.py)
0054 rm -f $FILES
0055 for TABLE in $TABLES; do
0056   log "$TABLE"
0057   echo "$TABLE"
0058   CONFIG=$(eval echo \$$(echo HLT_$TABLE))
0059   getConfigForCVS    $CONFIG $TABLE
0060 done
0061 log "Done"
0062 log "$(ls -l $FILES)"
0063 mv -f $FILES ../python/
0064 log
0065 
0066 # full config dumps, in CVS under HLTrigger/Configuration/test
0067 log "Extracting full configuration dumps"
0068 echo "Extracting full configuration dumps"
0069 FILES=$(eval echo OnLine_HLT_{$TABLES_}.py)
0070 rm -f $FILES
0071 for TABLE in $TABLES; do
0072   log "$TABLE"
0073   echo "$TABLE"
0074   CONFIG=$(eval echo \$$(echo HLT_$TABLE))
0075   getConfigForOnline $CONFIG $TABLE
0076 done
0077 log "Done"
0078 log "$(ls -l $FILES)"
0079 log