Skip to content

Commit

Permalink
modify hltScouting scenario to only take NANO:@scout as output, add s…
Browse files Browse the repository at this point in the history
…cenario to run_CfgTest_8.sh, add test script run_CfgTest_13.sh, and add it to BuildFile
  • Loading branch information
patinkaew committed Jul 24, 2024
1 parent 03ea62e commit bf4bc36
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
24 changes: 17 additions & 7 deletions Configuration/DataProcessing/python/Impl/hltScouting.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from Configuration.DataProcessing.Utils import stepSKIMPRODUCER, addMonitoring, dictIO, nanoFlavours, gtNameAndConnect
import FWCore.ParameterSet.Config as cms

import warnings

class hltScouting(Scenario):
def __init__(self):
Scenario.__init__(self)
Expand All @@ -41,6 +43,7 @@ def promptReco(self, globalTag, **args):
options = Options()
options.__dict__.update(defaultOptions.__dict__)
options.scenario = self.cbSc

if 'nThreads' in args:
options.nThreads = args['nThreads']

Expand All @@ -52,15 +55,23 @@ def promptReco(self, globalTag, **args):
nanoAODStep = ''

if 'outputs' in args:
print(args['outputs'])
outputs = []
for a in args['outputs']:
if a['dataTier'] == 'MINIAOD':
miniAODStep = ',PAT'
if a['dataTier'] in ['NANOAOD', 'NANOEDMAOD']:
if "nanoFlavours" in args:
if 'nanoFlavours' in args:
for nanoFlavour in args['nanoFlavours']:
if nanoFlavour != '@Scout':
warnings.warn('nanoFlavour: ' + nanoFlavour + 'is currently not supported and will be removed from outputs. Only supported nanoFlavour is @Scout')
args['nanoFlavours'] = ['@Scout']
nanoAODStep = ',NANO' + nanoFlavours(args['nanoFlavours'])
else:
nanoAODStep = ',NANO:@PHYS+@L1'
nanoAODStep = ',NANO:@Scout' # default to Scouting NANO
outputs.append(a)
else:
warnings.warn('dataTier:' + str(a['dataTier']) + ' is currently not supported and will be removed from outputs')
if {output['dataTier'] for output in outputs} != {a['dataTier'] for a in args['outputs']}:
warnings.warn('The outputs will be changed from ' + str(args['outputs']) + ' to' + str(outputs))
args['outputs'] = outputs

if not 'customs' in args:
args['customs'] = []
Expand All @@ -74,12 +85,11 @@ def promptReco(self, globalTag, **args):
options.step = ''
options.step += self.recoSeq + PhysicsSkimStep
options.step += miniAODStep + nanoAODStep
options.step += ',ENDJOB'

dictIO(options, args)
options.conditions = gtNameAndConnect(globalTag, args)

process = cms.Process('RECO', cms.ModifierChain(self.eras, self.promptModifiers) )
process = cms.Process('HLTSCOUT', cms.ModifierChain(self.eras, self.promptModifiers))
cb = ConfigBuilder(options, process = process, with_output = True)

# Input source
Expand Down
1 change: 1 addition & 0 deletions Configuration/DataProcessing/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
<test name="TestConfigDP_10" command="run_CfgTest_10.sh"/>
<test name="TestConfigDP_11" command="run_CfgTest_11.sh"/>
<test name="TestConfigDP_12" command="run_CfgTest_12.sh"/>
<test name="TestConfigDP_13" command="run_CfgTest_13.sh"/>
17 changes: 17 additions & 0 deletions Configuration/DataProcessing/test/run_CfgTest_13.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Test suite for various ConfigDP scenarios
# run using: scram build runtests
# feel free to contribute with your favourite configuration


# Pass in name and status
function die { echo $1: status $2 ; exit $2; }

function runTest { echo $1 ; python3 $1 || die "Failure for configuration: $1" $?; }

declare -a arr=("hltScoutingEra_Run3_2024")
for scenario in "${arr[@]}"
do
runTest "${SCRAM_TEST_PATH}/RunPromptReco.py --scenario $scenario --nanoaod --global-tag GLOBALTAG --lfn=/store/whatever --nanoFlavours=@Scout"
done
2 changes: 1 addition & 1 deletion Configuration/DataProcessing/test/run_CfgTest_8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function die { echo $1: status $2 ; exit $2; }

function runTest { echo $1 ; python3 $1 || die "Failure for configuration: $1" $?; }

declare -a arr=("ppEra_Run3" "ppEra_Run3_2023" "ppEra_Run3_2023_repacked" "ppEra_Run3_2024")
declare -a arr=("ppEra_Run3" "ppEra_Run3_2023" "ppEra_Run3_2023_repacked" "ppEra_Run3_2024" "hltScoutingEra_Run3_2024")
for scenario in "${arr[@]}"
do
runTest "${SCRAM_TEST_PATH}/RunPromptReco.py --scenario $scenario --reco --aod --miniaod --nanoaod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcareco TkAlMinBias+SiStripCalMinBias"
Expand Down

0 comments on commit bf4bc36

Please sign in to comment.