Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-01 23:53:47

0001 #!/bin/sh
0002 
0003 function die { echo $1: status $2 ; exit $2; }
0004 
0005 if [ "${SCRAM_TEST_NAME}" != "" ] ; then
0006   mkdir ${SCRAM_TEST_NAME}
0007   cd ${SCRAM_TEST_NAME}
0008 fi
0009 if test -f "SiStripConditionsDBFile.db"; then
0010     echo "cleaning the local test area"
0011     rm -fr SiStripConditionsDBFile.db  # builders test
0012     rm -fr modifiedSiStrip*.db         # miscalibrator tests
0013     rm -fr gainManipulations.db        # rescaler tool
0014 fi
0015 pwd
0016 echo " testing CondTools/SiStrip"
0017 
0018 # do the builders first (need the input db file)
0019 for entry in "${LOCAL_TEST_DIR}/"SiStrip*Builder_cfg.py
0020 do
0021   echo "===== Test \"cmsRun $entry \" ===="
0022   (cmsRun $entry) || die "Failure using cmsRun $entry" $?
0023 done
0024 
0025 echo -e " Done with the writers \n\n"
0026 
0027 ## do the readers
0028 for entry in "${LOCAL_TEST_DIR}/"SiStrip*Reader_cfg.py
0029 do
0030   echo "===== Test \"cmsRun $entry \" ===="
0031   (cmsRun $entry) || die "Failure using cmsRun $entry" $?
0032 done
0033 
0034 echo -e " Done with the readers \n\n"
0035 
0036 sleep 5
0037 
0038 ## do the builders from file
0039 for entry in "${LOCAL_TEST_DIR}/"SiStrip*FromASCIIFile_cfg.py
0040 do
0041   echo "===== Test \"cmsRun $entry \" ===="
0042   (cmsRun $entry) || die "Failure using cmsRun $entry" $?
0043 done
0044 
0045 echo -e " Done with the builders from file \n\n"
0046 
0047 ## do the miscalibrators
0048 for entry in "${LOCAL_TEST_DIR}/"SiStrip*Miscalibrator_cfg.py
0049 do
0050   echo "===== Test \"cmsRun $entry \" ===="
0051   (cmsRun $entry) || die "Failure using cmsRun $entry" $?
0052 done
0053 
0054 echo -e " Done with the miscalibrators \n\n"
0055 
0056 ## do the scaler
0057 
0058 # copy all the necessary conditions in order to run the miscalibration tool
0059 G1TAG=SiStripApvGain_GR10_v1_hlt
0060 G2TAG=SiStripApvGain_FromParticles_GR10_v1_express
0061 OLDG1since=325642
0062 NEWG1since=343828
0063 OLDG2since=336067
0064 
0065 echo -e "\n\n Copying IOVs $OLDG1since and $NEWG1since from $G1TAG and IOV $OLDG2since from $G2TAG"
0066 
0067 conddb --yes --db pro copy ${G1TAG} G1_old --from ${OLDG1since} --to $((++OLDG1since)) --destdb gainManipulations.db
0068 conddb --yes --db pro copy ${G1TAG} G1_new --from ${NEWG1since} --to $((++NEWG1since)) --destdb gainManipulations.db
0069 conddb --yes --db pro copy ${G2TAG} G2_old --from ${OLDG2since} --to $((++OLDG2since)) --destdb gainManipulations.db
0070 
0071 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--OLDG1since))" # sets the IOV since to 1
0072 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--NEWG1since))" # sets the IOV since to 1
0073 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--OLDG2since))" # sets the IOV since to 1
0074 
0075 echo -e "\n\n Checking the content of the local conditions file \n\n"
0076 sqlite3 gainManipulations.db "select * from IOV"
0077 
0078 (cmsRun ${LOCAL_TEST_DIR}/SiStripApvGainRescaler_cfg.py additionalConds=sqlite_file:${PWD}/gainManipulations.db) || die "Failure using cmsRun SiStripApvGainRescaler_cfg.py)" $?
0079 echo -e " Done with the gain rescaler \n\n"
0080 
0081 ## do the visualization code
0082 
0083 (cmsRun "${LOCAL_TEST_DIR}/"SiStripCondVisualizer_cfg.py) || die "Failure using cmsRun SiStripCondVisualizer_cfg.py" $?
0084 (python3 "${LOCAL_TEST_DIR}/"db_tree_dump_wrapper.py) || die "Failure running python3 db_tree_dump_wrapper.py" $?
0085 echo -e " Done with the visualization \n\n"