Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #!/bin/sh
0002 
0003 xflag=0
0004 cflag=0
0005 CMS_OPTIONS=""
0006 
0007 while getopts 'xoch' OPTION
0008   do
0009   case $OPTION in
0010       x) xflag=1
0011           ;;
0012       o) CMS_OPTIONS=$CMS_OPTIONS" overwriteKeys=1"
0013           ;;
0014       c) cflag=1
0015           ;;
0016       h) echo "Usage: [-x] [-o] tsckey"
0017           echo "  -x: write to ORCON instead of sqlite file"
0018           echo "  -o: overwrite keys"
0019           echo "  -c: copy non-O2O payloads from ORCON"
0020           exit
0021           ;;
0022   esac
0023 done
0024 shift $(($OPTIND - 1))
0025 
0026 tsckey=$1
0027 shift 1
0028 
0029 COPY_OPTIONS=""
0030 if [ ${cflag} -eq 1 ]
0031 then
0032 #   COPY_OPTIONS="copyNonO2OPayloads=1 copyDBConnect=oracle://cms_orcon_prod/CMS_COND_31X_L1T copyDBAuth=."
0033     COPY_OPTIONS="copyNonO2OPayloads=1 copyDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS copyDBAuth=/nfshome0/l1emulator/run2/o2o/v1"
0034 fi
0035 
0036 if [ ${xflag} -eq 0 ]
0037 then
0038     echo "Writing to sqlite_file:l1config.db instead of ORCON."
0039     INDB_OPTIONS="inputDBConnect=sqlite_file:l1config.db inputDBAuth=."
0040     OUTDB_OPTIONS="outputDBConnect=sqlite_file:l1config.db outputDBAuth=." 
0041 else
0042     echo "Writing to cms_orcoff_prep"
0043     INDB_OPTIONS="inputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS inputDBAuth=/nfshome0/l1emulator/run2/o2o/v1"
0044     OUTDB_OPTIONS="outputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS outputDBAuth=/nfshome0/l1emulator/run2/o2o/v1"
0045     #echo "Cowardly refusing to write to the online database"
0046     #exit
0047 fi
0048 
0049 cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWritePayloadOnline_cfg.py tscKey=${tsckey} ${CMS_OPTIONS} ${OUTDB_OPTIONS} ${COPY_OPTIONS} logTransactions=0 print
0050 o2ocode=$?
0051 if [ ${o2ocode} -eq 0 ]
0052 then
0053     echo
0054     echo "`date` : checking O2O"
0055     if cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKeyList=1 | grep ${tsckey} ; then echo "L1TRIGGERKEY WRITTEN SUCCESSFULLY"
0056     else
0057         echo "L1-O2O-ERROR: L1TRIGGERKEY WRITING FAILED"
0058         echo "L1-O2O-ERROR: L1TRIGGERKEY WRITING FAILED" 1>&2
0059         exit 199
0060     fi
0061 else
0062     if [ ${o2ocode} -eq 66 ]
0063     then
0064         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check that /nfshome0/centraltspro/secure/authentication.xml is up to date (OMDS)."
0065         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check that /nfshome0/centraltspro/secure/authentication.xml is up to date (OMDS)." 1>&2
0066     else
0067         if [ ${o2ocode} -eq 65 ]
0068         then
0069             echo "L1-O2O-ERROR: problem writing object to ORCON."
0070             echo "L1-O2O-ERROR: problem writing object to ORCON." 1>&2
0071         fi
0072     fi
0073     exit ${o2ocode}
0074 fi