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 CMS_OPTIONS=""
0005 
0006 while getopts 'xfh' OPTION
0007   do
0008   case $OPTION in
0009       x) xflag=1
0010           ;;
0011       f) CMS_OPTIONS=$CMS_OPTIONS" forceUpdate=1"
0012           ;;
0013       h) echo "Usage: [-xf] runnum tsckey"
0014           echo "  -x: write to ORCON instead of sqlite file"
0015           echo "  -f: force IOV update"
0016           exit
0017           ;;
0018   esac
0019 done
0020 shift $(($OPTIND - 1))
0021 
0022 runnum=$1
0023 tsckey=$2
0024 
0025 echo "INFO: ADDITIONAL CMS OPTIONS:  " $CMS_OPTIONS
0026 
0027 if [ ${xflag} -eq 0 ]
0028 then
0029     echo "Writing to sqlite_file:l1config.db instead of ORCON."
0030     INDB_OPTIONS="inputDBConnect=sqlite_file:l1config.db inputDBAuth=." 
0031     OUTDB_OPTIONS="outputDBConnect=sqlite_file:l1config.db outputDBAuth=." 
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 else
0035     echo "Writing to cms_orcoff_prep"
0036     INDB_OPTIONS="inputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS inputDBAuth=/nfshome0/l1emulator/run2/o2o/v1"
0037     OUTDB_OPTIONS="outputDBConnect=oracle://cms_orcoff_prep/CMS_CONDITIONS outputDBAuth=/nfshome0/l1emulator/run2/o2o/v1"
0038     #echo "Cowardly refusing to write to the online database"
0039     #exit
0040 fi
0041 
0042 
0043 if cmsRun ${CMSSW_BASE}/src/CondTools/L1Trigger/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKeyList=1 | grep ${tsckey} ; then echo "TSC payloads present"
0044 else
0045     echo "TSC payloads absent; writing now"
0046     cmsRun ${CMSSW_BASE}/src/CondTools/L1Trigger/test/L1ConfigWritePayloadOnline_cfg.py tscKey=${tsckey} ${OUTDB_OPTIONS} ${COPY_OPTIONS} logTransactions=0 print
0047     o2ocode=$?
0048     if [ ${o2ocode} -ne 0 ]
0049     then
0050         echo "L1-O2O-ERROR: could not write TSC payloads"
0051         echo "L1-O2O-ERROR: could not write TSC payloads" 1>&2
0052         exit ${o2ocode}
0053     fi
0054 fi
0055 
0056 cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteIOVOnline_cfg.py ${CMS_OPTIONS} tscKey=${tsckey} runNumber=${runnum} ${OUTDB_OPTIONS} logTransactions=0 print
0057 o2ocode=$?
0058 
0059 if [ ${o2ocode} -eq 0 ]
0060 then
0061     echo
0062     echo "`date` : checking O2O"
0063     if cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/l1o2otestanalyzer_cfg.py ${INDB_OPTIONS} printL1TriggerKey=1 runNumber=${runnum} | grep ${tsckey} ; then echo "L1-O2O-INFO: IOV OK"
0064     else
0065         echo "L1-O2O-ERROR: IOV NOT OK"
0066         echo "L1-O2O-ERROR: IOV NOT OK" 1>&2
0067         exit 199
0068     fi
0069 else
0070     if [ ${o2ocode} -eq 66 ]
0071     then
0072         echo "L1-O2O-ERROR: unable to connect to OMDS or ORCON.  Check that /nfshome0/centraltspro/secure/authentication.xml is up to date (OMDS)."
0073         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
0074     else
0075         if [ ${o2ocode} -eq 65 ]
0076         then
0077             echo "L1-O2O-ERROR: problem writing object to ORCON."
0078             echo "L1-O2O-ERROR: problem writing object to ORCON." 1>&2
0079         fi
0080     fi
0081     exit ${o2ocode}
0082 fi
0083 
0084 
0085