Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #!/bin/sh
0002 
0003 # This script reads the online conditions for a specified L1KEY, writes them
0004 # to a sqlite file (l1config.db), and assigns them an infinite IOV starting
0005 # at run 10.
0006 
0007 # Runs 1-10 will have default conditions which are copies the most recently
0008 # valid payloads in ORCON (i.e. for run 4294967295).  For subsystems that
0009 # are not in the specified L1KEY, these default conditions will be valid for
0010 # 1-inf.
0011 
0012 nflag=0
0013 pflag=0
0014 while getopts 'nph' OPTION
0015   do
0016   case $OPTION in
0017       n) nflag=1
0018           ;;
0019       p) pflag=1
0020           ;;
0021       h) echo "Usage: [-n] l1Key"
0022           echo "  -n: no RS"
0023           echo "  -p: centrally installed release, not on local machine"
0024           exit
0025           ;;
0026   esac
0027 done
0028 shift $(($OPTIND - 1))
0029 
0030 # get argument
0031 l1Key=$1
0032 
0033 if [ $# -lt 1 ]
0034     then
0035     echo "Wrong number of arguments.  Usage: $0 l1Key"
0036     exit 127
0037 fi
0038 
0039 if [ -f l1config.db ]
0040     then
0041     mv l1config.db l1config.db.save
0042 fi
0043 
0044 ln -sf /nfshome0/centraltspro/secure/authentication.xml .
0045 
0046 if [ ${pflag} -eq 0 ]
0047     then
0048     export SCRAM_ARCH=""
0049     export VO_CMS_SW_DIR=""
0050     source /opt/cmssw/cmsset_default.sh
0051 else
0052     source /nfshome0/cmssw2/scripts/setup.sh
0053     centralRel="-p"
0054 fi
0055 eval `scramv1 run -sh`
0056 
0057 echo "`date` : initializing sqlite file for L1KEY ${l1Key}"
0058 if [ -e $CMSSW_BASE/src/CondFormats/L1TObjects/xml ]
0059     then
0060     $CMSSW_BASE/src/CondTools/L1Trigger/test/bootstrap.com -l
0061 else
0062     $CMSSW_RELEASE_BASE/src/CondTools/L1Trigger/test/bootstrap.com
0063 fi
0064 
0065 # copy default objects
0066 cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWritePayloadCondDB_cfg.py inputDBConnect=oracle://cms_orcon_prod/CMS_COND_31X_L1T inputDBAuth=/nfshome0/popcondev/conddb_taskWriters/L1T
0067 cmsRun $CMSSW_BASE/src/CondTools/L1Trigger/test/L1ConfigWriteIOVDummy_cfg.py useO2OTags=1
0068 
0069 echo "`date` : writing TSC payloads"
0070 tscKey=`$CMSSW_BASE/src/CondTools/L1Trigger/scripts/getKeys.sh -t ${l1Key}`
0071 $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-key.sh -c ${centralRel} ${tscKey}
0072 o2ocode=$?
0073 
0074 if [ ${o2ocode} -eq 0 ]
0075     then
0076     echo "L1-O2O-INFO: TSC payloads OK"
0077 else
0078     echo "L1-O2O-ERROR: TSC payloads not OK!"
0079     echo "L1-O2O-ERROR: TSC payloads not OK!" 1>&2
0080     exit ${o2ocode}
0081 fi
0082 
0083 echo "`date` : setting TSC IOVs"
0084 $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-iov.sh ${centralRel} 10 ${tscKey}
0085 o2ocode=$?
0086 
0087 if [ ${o2ocode} -eq 0 ]
0088     then
0089     echo "L1-O2O-INFO: TSC IOVs OK"
0090 else
0091     echo "L1-O2O-ERROR: TSC IOVs not OK!"
0092     echo "L1-O2O-ERROR: TSC IOVs not OK!" 1>&2
0093     exit ${o2ocode}
0094 fi
0095 
0096 if [ ${nflag} -eq 0 ]
0097     then
0098     echo "`date` : writing RS payloads and setting RS IOVs"
0099     $CMSSW_BASE/src/CondTools/L1Trigger/scripts/runL1-O2O-rs-keysFromL1Key.sh ${centralRel} 10 ${l1Key}
0100     o2ocode=$?
0101 
0102     if [ ${o2ocode} -eq 0 ]
0103         then
0104         echo "L1-O2O-INFO: RS OK"
0105     else
0106         echo "L1-O2O-ERROR: RS not OK!"
0107         echo "L1-O2O-ERROR: RS not OK!" 1>&2
0108         exit ${o2ocode}
0109     fi
0110 else
0111     echo "`date` : using default RS payloads"
0112 fi
0113 
0114 rm -f authentication.xml
0115 
0116 exit ${o2ocode}