Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-19 23:19:51

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 "${SCRAM_TEST_PATH}/"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 "${SCRAM_TEST_PATH}/"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 "${SCRAM_TEST_PATH}/"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 "${SCRAM_TEST_PATH}/"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 checkers
0057 for entry in "${SCRAM_TEST_PATH}/"SiStrip*Checker_cfg.py
0058 do
0059   echo "===== Test \"cmsRun $entry \" ===="
0060   (cmsRun $entry) || die "Failure using cmsRun $entry" $?
0061 done
0062 
0063 echo -e " Done with the checkers \n\n"
0064 
0065 ## do the scaler
0066 
0067 # copy all the necessary conditions in order to run the miscalibration tool
0068 G1TAG=SiStripApvGain_GR10_v1_hlt
0069 G2TAG=SiStripApvGain_FromParticles_GR10_v1_express
0070 OLDG1since=325642
0071 NEWG1since=343828
0072 OLDG2since=336067
0073 
0074 echo -e "\n\n Copying IOVs $OLDG1since and $NEWG1since from $G1TAG and IOV $OLDG2since from $G2TAG"
0075 
0076 conddb --yes --db pro copy ${G1TAG} G1_old --from ${OLDG1since} --to $((++OLDG1since)) --destdb gainManipulations.db
0077 conddb --yes --db pro copy ${G1TAG} G1_new --from ${NEWG1since} --to $((++NEWG1since)) --destdb gainManipulations.db
0078 conddb --yes --db pro copy ${G2TAG} G2_old --from ${OLDG2since} --to $((++OLDG2since)) --destdb gainManipulations.db
0079 
0080 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--OLDG1since))" # sets the IOV since to 1
0081 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--NEWG1since))" # sets the IOV since to 1
0082 sqlite3 gainManipulations.db "update IOV SET SINCE=1 where SINCE=$((--OLDG2since))" # sets the IOV since to 1
0083 
0084 echo -e "\n\n Checking the content of the local conditions file \n\n"
0085 sqlite3 gainManipulations.db "select * from IOV"
0086 
0087 (cmsRun ${SCRAM_TEST_PATH}/SiStripApvGainRescaler_cfg.py additionalConds=sqlite_file:${PWD}/gainManipulations.db) || die "Failure using cmsRun SiStripApvGainRescaler_cfg.py)" $?
0088 echo -e " Done with the gain rescaler \n\n"
0089 
0090 ## do the visualization code
0091 
0092 (cmsRun "${SCRAM_TEST_PATH}/"SiStripCondVisualizer_cfg.py) || die "Failure using cmsRun SiStripCondVisualizer_cfg.py" $?
0093 (python3 "${SCRAM_TEST_PATH}/"db_tree_dump_wrapper.py) || die "Failure running python3 db_tree_dump_wrapper.py" $?
0094 echo -e " Done with the visualization \n\n"
0095 
0096 echo -e "\n\n Testing the conditions patching code: \n\n"
0097 ## do the bad components patching code
0098 myFEDs=""
0099 for i in {51..490..2}; do
0100     myFEDs+="${i},"
0101 done
0102 myFEDs+=491
0103 echo " masking the following FEDs: "${myFEDs}
0104 
0105 (cmsRun "${SCRAM_TEST_PATH}/"SiStripBadChannelPatcher_cfg.py isUnitTest=True FEDsToAdd=${myFEDs} outputTag=OddFEDs) || die "Failure using cmsRun SiStripBadChannelPatcher_cfg.py when adding FEDs" $?
0106 (cmsRun "${SCRAM_TEST_PATH}/"SiStripBadChannelPatcher_cfg.py isUnitTest=True inputConnection=sqlite_file:outputDB.db inputTag=OddFEDs FEDsToRemove=${myFEDs} outputTag=OddFEDsRemoved) || die "Failure using cmsRun SiStripBadChannelPatcher_cfg.py when removing FEDs" $?
0107 
0108 echo -e " Done with the bad components patching \n\n"