Skip to content

Commit

Permalink
Showing 4 changed files with 30 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Configuration/DataProcessing/python/Reco.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
import sys

from Configuration.DataProcessing.Scenario import *
from Configuration.DataProcessing.Utils import stepALCAPRODUCER,stepSKIMPRODUCER,addMonitoring,dictIO,dqmIOSource,harvestingMode,dqmSeq,gtNameAndConnect
from Configuration.DataProcessing.Utils import stepALCAPRODUCER,stepSKIMPRODUCER,addMonitoring,dictIO,dqmIOSource,harvestingMode,dqmSeq,nanoFlavours,gtNameAndConnect
import FWCore.ParameterSet.Config as cms
from Configuration.DataProcessing.RecoTLR import customisePrompt,customiseExpress

@@ -71,6 +71,8 @@ def promptReco(self, globalTag, **args):
miniAODStep = ',PAT'
if a['dataTier'] in ['NANOAOD', 'NANOEDMAOD']:
nanoAODStep = ',NANO'
if "nanoFlavours" in args:
nanoAODStep += nanoFlavours(args['nanoFlavours'])
args['customs'].append('PhysicsTools/NanoAOD/nano_cff.nanoL1TrigObjCustomize')

self._checkRepackedFlag(options, **args)
14 changes: 14 additions & 0 deletions Configuration/DataProcessing/python/Utils.py
Original file line number Diff line number Diff line change
@@ -132,6 +132,20 @@ def dqmSeq(args,default):
else:
return default

def nanoFlavours(flavours):
"""
_nanoFlavours_
Creates and returns the configuration string for the NANO flavours
from the list of flavors to be run.
"""

step = ''
if len(flavours) >0 :
step = ':'+('+'.join(flavours))
return step

def gtNameAndConnect(globalTag, args):
if 'globalTagConnect' in args and args['globalTagConnect'] != '':
return globalTag + ','+args['globalTagConnect']
17 changes: 12 additions & 5 deletions Configuration/DataProcessing/test/RunPromptReco.py
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ def __init__(self):
self.noOutput = False
self.globalTag = None
self.inputLFN = None
self.nanoFlavours = None
self.alcaRecos = None
self.PhysicsSkims = None
self.dqmSeq = None
@@ -92,6 +93,9 @@ def __call__(self):
'moduleLabel' : "write_%s" % dataTier })
kwds['outputs'] = outputs

if self.nanoFlavours:
kwds['nanoFlavours'] = self.nanoFlavours

if self.alcaRecos:
kwds['skims'] = self.alcaRecos

@@ -103,7 +107,7 @@ def __call__(self):

if self.setRepacked:
kwds['repacked'] = self.isRepacked

if self.nThreads:
kwds['nThreads'] = self.nThreads

@@ -148,7 +152,7 @@ def __call__(self):

if __name__ == '__main__':
valid = ["scenario=", "reco", "aod", "miniaod", "nanoaod", "dqm", "dqmio", "no-output", "nThreads=",
"global-tag=", "lfn=", "alcarecos=", "PhysicsSkims=", "dqmSeq=", "isRepacked", "isNotRepacked" ]
"global-tag=", "lfn=", "nanoFlavours=", "alcarecos=", "PhysicsSkims=", "dqmSeq=", "isRepacked", "isNotRepacked" ]
usage = \
"""
RunPromptReco.py <options>
@@ -158,20 +162,21 @@ def __call__(self):
--aod (to enable AOD output)
--miniaod (to enable MiniAOD output)
--nanoaod (to enable NanoAOD output)
--nanoFlavours=flavour_plus_separated_list
--dqm (to enable DQM output)
--dqmio (to enable DQMIO output)
--isRepacked --isNotRepacked (to override default repacked flags)
--no-output (create config with no output, overrides other settings)
--global-tag=GlobalTag
--lfn=/store/input/lfn
--alcarecos=alcareco_plus_seprated_list
--PhysicsSkims=skim_plus_seprated_list
--alcarecos=alcareco_plus_separated_list
--PhysicsSkims=skim_plus_separated_list
--dqmSeq=dqmSeq_plus_separated_list
--nThreads=Number_of_cores_or_Threads_used
Example:
python RunPromptReco.py --scenario=cosmics --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcarecos=TkAlCosmics0T+MuAlGlobalCosmics
python RunPromptReco.py --scenario=pp --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcarecos=TkAlMinBias+SiStripCalMinBias
python RunPromptReco.py --scenario=ppEra_Run2_2016 --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcarecos=TkAlMinBias+SiStripCalMinBias --PhysicsSkims=@SingleMuon
python RunPromptReco.py --scenario=ppEra_Run2_2016 --reco --aod --miniaod --nanoaod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --nanoFlavours=@MUPOG --alcarecos=TkAlMinBias+SiStripCalMinBias --PhysicsSkims=@SingleMuon
"""
try:
opts, args = getopt.getopt(sys.argv[1:], "", valid)
@@ -206,6 +211,8 @@ def __call__(self):
recoinator.globalTag = arg
if opt == "--lfn" :
recoinator.inputLFN = arg
if opt == "--nanoFlavours":
recoinator.nanoFlavours = [ x for x in arg.split('+') if len(x) > 0 ]
if opt == "--alcarecos":
recoinator.alcaRecos = [ x for x in arg.split('+') if len(x) > 0 ]
if opt == "--PhysicsSkims":
1 change: 1 addition & 0 deletions Configuration/DataProcessing/test/run_CfgTest_8.sh
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ declare -a arr=("ppEra_Run3" "ppEra_Run3_2023" "ppEra_Run3_2023_repacked")
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"
runTest "${SCRAM_TEST_PATH}/RunPromptReco.py --scenario $scenario --reco --aod --miniaod --nanoaod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcareco TkAlMinBias+SiStripCalMinBias --nanoFlavours=@PHYS"
runTest "${SCRAM_TEST_PATH}/RunPromptReco.py --scenario $scenario --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcareco TkAlMinBias+SiStripCalMinBias --PhysicsSkim=@Muon0"
done

0 comments on commit 23e94df

Please sign in to comment.