Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:14

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_CONDITIONS copyDBAuth=/nfshome0/l1emulator/run2/o2o/prod"
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     INDB_OPTIONS="inputDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS inputDBAuth=/nfshome0/l1emulator/run2/o2o/prod"
0047     OUTDB_OPTIONS="outputDBConnect=oracle://cms_orcon_prod/CMS_CONDITIONS outputDBAuth=/nfshome0/l1emulator/run2/o2o/prod"  
0048     #exit
0049 fi
0050 
0051 cmsRun $CMSSW_BASE/src/CondTools/L1TriggerExt/test/L1ConfigWritePayloadOnlineExt_cfg.py tscKey=${tsckey} ${CMS_OPTIONS} ${OUTDB_OPTIONS} ${COPY_OPTIONS} logTransactions=0 print
0052 o2ocode=$?
0053 if [ ${o2ocode} -eq 0 ]
0054 then
0055     echo
0056     echo "`date` : checking O2O"
0057     if cmsRun $CMSSW_BASE/src/CondTools/L1TriggerExt/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKeyListExt=1 | grep ${tsckey} ; then echo "L1TRIGGERKEY WRITTEN SUCCESSFULLY"
0058     else
0059         echo "L1-O2O-ERROR: L1TRIGGERKEY WRITING FAILED"
0060         echo "L1-O2O-ERROR: L1TRIGGERKEY WRITING FAILED" 1>&2
0061         exit 199
0062     fi
0063 else
0064     if [ ${o2ocode} -eq 66 ]
0065     then
0066         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check that /nfshome0/centraltspro/secure/authentication.xml is up to date (OMDS)."
0067         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
0068     else
0069         if [ ${o2ocode} -eq 65 ]
0070         then
0071             echo "L1-O2O-ERROR: problem writing object to ORCON."
0072             echo "L1-O2O-ERROR: problem writing object to ORCON." 1>&2
0073         fi
0074     fi
0075     exit ${o2ocode}
0076 fi