Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:19

0001 #!/bin/sh
0002 
0003 xflag=0
0004 CMS_OPTIONS=""
0005 KEY_CONTENT=""
0006 TAG_UPDATE=""
0007 UNSAFE=""
0008 
0009 while getopts 'xfk:t:s:h' OPTION
0010   do
0011   case $OPTION in
0012       x) xflag=1
0013           ;;
0014       f) CMS_OPTIONS=$CMS_OPTIONS" forceUpdate=1"
0015           ;;
0016       k) KEY_CONTENT=$KEY_CONTENT" subsystemLabels=$OPTARG"
0017           ;;
0018       t) if [ -z $TAG_UPDATE ] ; then TAG_UPDATE="tagUpdate="; else TAG_UPDATE=$TAG_UPDATE","; fi
0019          TAG_UPDATE=$TAG_UPDATE$OPTARG
0020           ;;
0021       s) if [ -z $UNSAFE ] ; then UNSAFE="unsafe="; else UNSAFE=$UNSAFE","; fi
0022          UNSAFE=$UNSAFE$OPTARG
0023           ;;
0024       h) echo "Usage: [-xf] runnum tsckey"
0025           echo "  -x: write to ORCON instead of sqlite file"
0026           echo "  -f: force IOV update"
0027           echo "  -k: limit update to the specific systems (default are all, which is equivalent to -k uGT,uGTrs,GMT,EMTF,OMTF,BMTF,CALO)"
0028           echo "  -t: override tag name as TYPE:NEW_TAG_BASE (e.g. -t L1TCaloParams:Stage2v1)"
0029           echo "  -s: lift transaction safety: carry on even problems are encountered (e.g. -s EMTF,OMTF,CALO)"
0030           exit
0031           ;;
0032   esac
0033 done
0034 shift $(($OPTIND - 1))
0035 
0036 runnum=$1
0037 tsckey=$2
0038 rskey=$3
0039 
0040 export TNS_ADMIN=/opt/offline/slc6_amd64_gcc493/cms/oracle-env/29/etc/
0041 
0042 echo "INFO: ADDITIONAL CMS OPTIONS:  " $CMS_OPTIONS $KEY_CONTENT $TAG_UPDATE
0043 
0044 ONLINEDB_OPTIONS="onlineDBConnect=oracle://cms_omds_adg/CMS_TRG_R onlineDBAuth=./"
0045 PROTODB_OPTIONS="protoDBConnect=oracle://cms_orcon_adg/CMS_CONDITIONS protoDBAuth=./"
0046 #ONLINEDB_OPTIONS="onlineDBConnect=oracle://cms_omds_lb/CMS_TRG_R onlineDBAuth=/data/O2O/L1T/"
0047 #PROTODB_OPTIONS="protoDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS protoDBAuth=/data/O2O/L1T/"
0048 
0049 if [ ${xflag} -eq 0 ]
0050 then
0051     echo "Writing to sqlite_file:l1config.db instead of ORCON."
0052     INDB_OPTIONS="inputDBConnect=sqlite_file:l1config.db inputDBAuth=/data/O2O/L1T/" 
0053     OUTDB_OPTIONS="outputDBConnect=sqlite_file:l1config.db outputDBAuth=/data/O2O/L1T/" 
0054     COPY_OPTIONS="copyNonO2OPayloads=1 copyDBConnect=sqlite_file:l1config.db"
0055 #    COPY_OPTIONS="copyNonO2OPayloads=1 copyDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS copyDBAuth=/data/O2O/L1T/"
0056 #    COPY_OPTIONS="copyNonO2OPayloads=1 copyDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS copyDBAuth=/data/O2O/L1T/"
0057 else
0058 #    echo "Writing to cms_orcoff_prep"
0059     echo "Writing to cms_orcon_prod"
0060 #    INDB_OPTIONS="inputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS inputDBAuth=/data/O2O/L1T/"
0061 #    OUTDB_OPTIONS="outputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS outputDBAuth=/data/O2O/L1T/"
0062     INDB_OPTIONS="inputDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS inputDBAuth=/data/O2O/L1T/"
0063     OUTDB_OPTIONS="outputDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS outputDBAuth=/data/O2O/L1T/"
0064     #echo "Cowardly refusing to write to the online database"
0065     #exit
0066 fi
0067 
0068 #export UTM_XSD_DIR=/data/O2O/L1T/v9_20160823/CMSSW_8_0_18/utm/tmXsd
0069 
0070 if cmsRun ${CMSSW_RELEASE_BASE}/src/CondTools/L1TriggerExt/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKeyListExt=1 | grep "${tsckey}:${rskey}" ; then echo "TSC payloads present"
0071 else
0072     echo "TSC payloads absent; writing $KEY_CONTENT now"
0073     cmsRun ${CMSSW_RELEASE_BASE}/src/CondTools/L1TriggerExt/test/L1ConfigWritePayloadOnlineExt_cfg.py tscKey=${tsckey} rsKey=${rskey} ${ONLINEDB_OPTIONS} ${PROTODB_OPTIONS} ${OUTDB_OPTIONS} ${COPY_OPTIONS} ${KEY_CONTENT} ${TAG_UPDATE} ${UNSAFE} logTransactions=0 print
0074     o2ocode=$?
0075     if [ ${o2ocode} -ne 0 ]
0076     then
0077         echo "L1-O2O-ERROR: could not write TSC payloads"
0078         echo "L1-O2O-ERROR: could not write TSC payloads" 1>&2
0079         exit ${o2ocode}
0080     fi
0081 fi
0082 
0083 cmsRun $CMSSW_RELEASE_BASE/src/CondTools/L1TriggerExt/test/L1ConfigWriteIOVOnlineExt_cfg.py ${CMS_OPTIONS} tscKey=${tsckey} rsKey=${rskey} runNumber=${runnum} ${OUTDB_OPTIONS} ${TAG_UPDATE} logTransactions=0 print | grep -Ev "CORAL.*Info|CORAL.*Debug"
0084 o2ocode=${PIPESTATUS[0]}
0085 
0086 if [ ${o2ocode} -eq 0 ]
0087 then
0088     echo
0089     echo "`date` : checking O2O"
0090     if cmsRun $CMSSW_RELEASE_BASE/src/CondTools/L1TriggerExt/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKeyExt=1 runNumber=${runnum} ${TAG_UPDATE} | grep ${tsckey} ; then echo "L1-O2O-INFO: IOV OK"
0091     else
0092         echo "L1-O2O-ERROR: IOV NOT OK"
0093         echo "L1-O2O-ERROR: IOV NOT OK" 1>&2
0094         exit 199
0095     fi
0096 else
0097     if [ ${o2ocode} -eq 66 ]
0098     then
0099         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check authentication token .cms_cond/db.key"
0100         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check authentication token .cms_cond/db.key" 1>&2
0101     else
0102         if [ ${o2ocode} -eq 65 ]
0103         then
0104             echo "L1-O2O-ERROR: problem writing object to ORCON."
0105             echo "L1-O2O-ERROR: problem writing object to ORCON." 1>&2
0106         fi
0107     fi
0108     exit ${o2ocode}
0109 fi
0110 
0111 
0112