Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-28 02:36:14

0001 #!/bin/sh
0002 
0003 function die { echo $1: status $2 ; exit $2; }
0004 
0005 function countEvents() {
0006     local FILE="$1"
0007     NUMBER=$(echo `edmFileUtil $FILE | grep events` | awk '{print $6}')
0008     echo $NUMBER
0009 }
0010 
0011 echo "TESTING detectorStateFilter ..."
0012 
0013 # Take as input file an express FEVT file from 2021 commissioning, Run 343498
0014 # https://cmsoms.cern.ch/cms/runs/report/fullscreen/4637?cms_run=343498&cms_run_sequence=GLOBAL-RUN
0015 # It has Pixels and Strips HV ON
0016 # Also used to feed RelVal Matrix wfs 138.1, 138.2
0017 
0018 ### LS2 - MWGR 2021 - CSC, DAQ, DCS, DQM, DT, ECAL, GEM, HCAL, L1SCOUT, PIXEL, RPC, TCDS, TRACKER, TRG ###
0019 #INPUTFILE="/store/express/Commissioning2021/ExpressCosmics/FEVT/Express-v1/000/343/498/00000/004179ae-ac29-438a-bd2d-ea98139c21a7.root"
0020 
0021 # Take as input file an express FEVT file from 2021 commissioning, Run 338714
0022 # https://cmsoms.cern.ch/cms/runs/report/fullscreen/4637?cms_run=338714&cms_run_sequence=GLOBAL-RUN
0023 # It has Pixels HV OFF but Strips HV ON
0024 # It was used to feed RelVal Matrix wfs 138.1, 138.2
0025 
0026  ### LS2 - MWGR#5 2020 - CSC, DAQ, DCS, DQM, DT, ECAL, GEM, HCAL, RPC, TCDS, TRACKER, TRG ###
0027 INPUTFILE="/store/express/Commissioning2020/ExpressCosmics/FEVT/Express-v1/000/338/714/00000/515CD930-9BBA-1945-87C3-AD555E25F301.root"
0028 
0029 # test Pixel
0030 printf "TESTING Pixels ...\n\n"
0031 cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=False inputFiles=$INPUTFILE outputFile=outPixels.root || die "Failure filtering on pixels" $?
0032 
0033 # test Strips
0034 printf "TESTING Strips ...\n\n"
0035 cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=True inputFiles=$INPUTFILE outputFile=outStrips.root || die "Failure filtering on strips" $?
0036 
0037 # count events
0038 pixelCounts=`countEvents outPixels_numEvent10.root`
0039 stripCounts=`countEvents outStrips_numEvent10.root`
0040 
0041 if [[ $pixelCounts -eq 0 ]]
0042 then
0043   echo "The number of events in the pixel filter file matches expectations ($pixelCounts)."
0044 else 
0045   echo "WARNING!!! The number of events in the pixel filter file ($pixelCounts) does NOT match expectations (0)."
0046   exit 1
0047 fi
0048 
0049 if [[ $stripCounts -eq 10 ]]
0050 then
0051   echo "The number of events in the strip filter file matches expectations ($stripCounts)."
0052 else 
0053   echo "WARNING!!! The number of events in the strip filter file ($stripCounts) does NOT match expectations (10)."
0054   exit 1
0055 fi
0056 
0057 # Now take as input file an express FEVT file from 2024 pp running, run 380032
0058 # https://cmsoms.cern.ch/cms/runs/lumisection?cms_run=380032
0059 # it has all partitions ON excepted TIBTID (which was affected by a bad setting of the DCS bit)
0060 
0061 INPUTFILE="/store/express/Run2024C/ExpressPhysics/FEVT/Express-v1/000/380/032/00000/26a18459-49a8-4e3c-849c-9b3e4c09712e.root"
0062 
0063 # test Strips
0064 printf "TESTING Strips with all partitions...\n\n"
0065 cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=True inputFiles=$INPUTFILE outputFile=outStrips_run380032_all.root || die "Failure filtering on strips" $?
0066 
0067 printf "TESTING Strips with only TIBTID partitions...\n\n"
0068 cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=True inputFiles=$INPUTFILE testCombinations='TIBTID' outputFile=outStrips_run380032_TIBTID.root || die "Failure filtering on strips" $?
0069 
0070 printf "TESTING Strips with several OK partition combinations...\n\n"
0071 cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=True inputFiles=$INPUTFILE testCombinations='TOB+TECp+TECm','TIBTID+TECp+TECm','TECp+TECm' outputFile=outStrips_run380032_OKCombos.root || die "Failure filtering on strips" $?
0072 
0073 # count events
0074 allPartsCounts=`countEvents outStrips_run380032_all_numEvent10.root`
0075 onlyTIBTIDCounts=`countEvents outStrips_run380032_TIBTID_numEvent10.root`
0076 combinationCounts=`countEvents outStrips_run380032_OKCombos_numEvent10.root`
0077 
0078 if [[ $allPartsCounts -eq 0 ]]
0079 then
0080   echo "The number of events in the all partitions filter file matches expectations ($allPartsCounts)."
0081 else
0082   echo "WARNING!!! The number of events in the pixel filter file ($allPartsCounts) does NOT match expectations (0)."
0083   exit 1
0084 fi
0085 
0086 if [[ $onlyTIBTIDCounts -eq 0 ]]
0087 then
0088   echo "The number of events in the all partitions filter file matches expectations ($onlyTIBTIDCounts)."
0089 else
0090   echo "WARNING!!! The number of events in the pixel filter file ($onlyTIBTIDCounts) does NOT match expectations (0)."
0091   exit 1
0092 fi
0093 
0094 if [[ $combinationCounts -eq 10 ]]
0095 then
0096   echo "The number of events in the all partitions filter file matches expectations ($combinationCounts)."
0097 else
0098   echo "WARNING!!! The number of events in the pixel filter file ($combinationCounts) does NOT match expectations (10)."
0099   exit 1
0100 fi