Skip to content

Commit

Permalink
Merge pull request #10227 from franzoni/confDataProcessing-from-CMSSW…
Browse files Browse the repository at this point in the history
…_7_5_0

SKIMS in Conf data processing 75
  • Loading branch information
cmsbuild committed Jul 24, 2015
2 parents 80b34e2 + 48a8587 commit 078af15
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Configuration/DataProcessing/python/Reco.py
Expand Up @@ -10,7 +10,7 @@
import sys

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

Expand All @@ -34,6 +34,9 @@ def promptReco(self, globalTag, **args):
"""
step = stepALCAPRODUCER(args['skims'])
PhysicsSkimStep = ''
if (args.has_key("PhysicsSkims")) :
PhysicsSkimStep = stepSKIMPRODUCER(args['PhysicsSkims'])
dqmStep= dqmSeq(args,'')
options = Options()
options.__dict__.update(defaultOptions.__dict__)
Expand All @@ -56,8 +59,7 @@ def promptReco(self, globalTag, **args):
if self.cbSc == 'pp':
eiStep=',EI'

options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+eiStep+step+miniAODStep+',DQM'+dqmStep+',ENDJOB'

options.step = 'RAW2DIGI,L1Reco,RECO'+self.recoSeq+eiStep+step+PhysicsSkimStep+miniAODStep+',DQM'+dqmStep+',ENDJOB'

dictIO(options,args)
options.conditions = gtNameAndConnect(globalTag, args)
Expand Down Expand Up @@ -262,7 +264,6 @@ def alcaHarvesting(self, globalTag, datasetName, **args):
"""
skims = []
if 'skims' in args:
print 'here'
skims = args['skims']


Expand Down
15 changes: 15 additions & 0 deletions Configuration/DataProcessing/python/Utils.py
Expand Up @@ -20,6 +20,21 @@ def stepALCAPRODUCER(skims):
step = ',ALCAPRODUCER:'+('+'.join(skims))
return step


def stepSKIMPRODUCER(PhysicsSkims):
"""
_stepSKIMPRODUCER_
Creates and returns the configuration string for the SKIM step
starting from the list of skims to be run.
"""

step = ''
if len(PhysicsSkims) >0 :
step = ',SKIM:'+('+'.join(PhysicsSkims))
return step

def addMonitoring(process):
"""
_addMonitoring_
Expand Down
12 changes: 10 additions & 2 deletions Configuration/DataProcessing/test/RunPromptReco.py
Expand Up @@ -27,6 +27,7 @@ def __init__(self):
self.globalTag = None
self.inputLFN = None
self.alcaRecos = None
self.PhysicsSkims = None

def __call__(self):
if self.scenario == None:
Expand Down Expand Up @@ -85,6 +86,8 @@ def __call__(self):

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

process = scenario.promptReco(self.globalTag, **kwds)

Expand Down Expand Up @@ -112,7 +115,7 @@ def __call__(self):

if __name__ == '__main__':
valid = ["scenario=", "reco", "aod", "miniaod","dqm", "dqmio", "no-output",
"global-tag=", "lfn=", "alcarecos=" ]
"global-tag=", "lfn=", "alcarecos=", "PhysicsSkims=" ]
usage = \
"""
RunPromptReco.py <options>
Expand All @@ -127,14 +130,17 @@ def __call__(self):
--no-output (create config with no output, overrides other settings)
--global-tag=GlobalTag
--lfn=/store/input/lfn
--alcarecos=plus_seprated_list
--alcarecos=alcareco_plus_seprated_list
--PhysicsSkims=skim_plus_seprated_list
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=ppRun2 --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcarecos=TkAlMinBias+SiStripCalMinBias --PhysicsSkims=@SingleMuon
"""
try:
opts, args = getopt.getopt(sys.argv[1:], "", valid)
Expand Down Expand Up @@ -167,5 +173,7 @@ def __call__(self):
recoinator.inputLFN = arg
if opt == "--alcarecos":
recoinator.alcaRecos = [ x for x in arg.split('+') if len(x) > 0 ]
if opt == "--PhysicsSkims":
recoinator.PhysicsSkims = [ x for x in arg.split('+') if len(x) > 0 ]

recoinator()
1 change: 1 addition & 0 deletions Configuration/DataProcessing/test/run_CfgTest.sh
Expand Up @@ -40,6 +40,7 @@ declare -a arr=("ppRun2" "ppRun2B0T")
for scenario in "${arr[@]}"
do
runTest "${LOCAL_TEST_DIR}/RunPromptReco.py --scenario $scenario --reco --aod --miniaod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcareco TkAlMinBias+SiStripCalMinBias"
runTest "${LOCAL_TEST_DIR}/RunPromptReco.py --scenario $scenario --reco --aod --dqmio --global-tag GLOBALTAG --lfn=/store/whatever --alcareco TkAlMinBias+SiStripCalMinBias --PhysicsSkim=@SingleMuon"
done


Expand Down

0 comments on commit 078af15

Please sign in to comment.