Skip to content

Commit 336fcd6

Browse files
committed
update test_DetectorStateFilter to test DCS bits combinations
1 parent 8339f5f commit 336fcd6

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

DQM/TrackerCommon/test/test_DetectorStateFilter.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,48 @@ else
5353
echo "WARNING!!! The number of events in the strip filter file ($stripCounts) does NOT match expectations (10)."
5454
exit 1
5555
fi
56+
57+
# Now take as input file an express FEVT file from 2024 pp running, run 380032
58+
# https://cmsoms.cern.ch/cms/runs/lumisection?cms_run=380032
59+
# it has all partitions ON excepted TIBTID (which was affected by a bad setting of the DCS bit)
60+
61+
INPUTFILE="/store/express/Run2024C/ExpressPhysics/FEVT/Express-v1/000/380/032/00000/26a18459-49a8-4e3c-849c-9b3e4c09712e.root"
62+
63+
# test Strips
64+
printf "TESTING Strips with all partitions...\n\n"
65+
cmsRun ${SCRAM_TEST_PATH}/test_DetectorStateFilter_cfg.py maxEvents=10 isStrip=True inputFiles=$INPUTFILE outputFile=outStrips_run380032_all.root || die "Failure filtering on strips" $?
66+
67+
printf "TESTING Strips with only TIBTID partitions...\n\n"
68+
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" $?
69+
70+
printf "TESTING Strips with several OK partition combinations...\n\n"
71+
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" $?
72+
73+
# count events
74+
allPartsCounts=`countEvents outStrips_run380032_all_numEvent10.root`
75+
onlyTIBTIDCounts=`countEvents outStrips_run380032_TIBTID_numEvent10.root`
76+
combinationCounts=`countEvents outStrips_run380032_OKCombos_numEvent10.root`
77+
78+
if [[ $allPartsCounts -eq 0 ]]
79+
then
80+
echo "The number of events in the all partitions filter file matches expectations ($allPartsCounts)."
81+
else
82+
echo "WARNING!!! The number of events in the pixel filter file ($allPartsCounts) does NOT match expectations (0)."
83+
exit 1
84+
fi
85+
86+
if [[ $onlyTIBTIDCounts -eq 0 ]]
87+
then
88+
echo "The number of events in the all partitions filter file matches expectations ($onlyTIBTIDCounts)."
89+
else
90+
echo "WARNING!!! The number of events in the pixel filter file ($onlyTIBTIDCounts) does NOT match expectations (0)."
91+
exit 1
92+
fi
93+
94+
if [[ $combinationCounts -eq 10 ]]
95+
then
96+
echo "The number of events in the all partitions filter file matches expectations ($combinationCounts)."
97+
else
98+
echo "WARNING!!! The number of events in the pixel filter file ($combinationCounts) does NOT match expectations (10)."
99+
exit 1
100+
fi

DQM/TrackerCommon/test/test_DetectorStateFilter_cfg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
VarParsing.VarParsing.multiplicity.singleton, # singleton or list
1717
VarParsing.VarParsing.varType.bool, # string, int, or float
1818
"true filters on Strips, false filters on Pixels")
19+
# Register the option as a list of strings
20+
options.register('testCombinations',
21+
'', # Default value as an empty string
22+
VarParsing.VarParsing.multiplicity.list, # Allows multiple values
23+
VarParsing.VarParsing.varType.string, # Specifies that the values are strings
24+
"List of combinations of partitions to test")
1925
options.parseArguments()
2026

2127
# import of standard configurations
@@ -71,7 +77,8 @@
7177
DebugOn = True)
7278

7379
process.SiStripFilter = detectorStateFilter.clone(DetectorType = 'sistrip',
74-
DebugOn = True)
80+
DebugOn = True,
81+
acceptedCombinations = options.testCombinations)
7582

7683
#process.analysis_step = cms.Path(process.detectorStateFilter)
7784
if(options.isStrip) :

0 commit comments

Comments
 (0)