Skip to content

Commit

Permalink
Merge pull request #12326 from slava77/CMSSW_7_5_X_2015-11-05-2300/si…
Browse files Browse the repository at this point in the history
…gn626/hiRepackSettings

pass isRepacked flag to config builder if set in a scenario
  • Loading branch information
davidlange6 committed Nov 10, 2015
2 parents 912bdd0 + e91576a commit d66c207
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Configuration/DataProcessing/python/Impl/HeavyIonsRun2.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def _checkMINIAOD(self,**args):
if a['dataTier'] == 'MINIAOD':
raise RuntimeError("MINIAOD is not supported in HeavyIonsRun2")


def _setRepackedFlag(self,args):
if not 'repacked' in args:
args['repacked']= True

def promptReco(self, globalTag, **args):
"""
_promptReco_
Expand All @@ -41,6 +46,7 @@ def promptReco(self, globalTag, **args):
"""
self._checkMINIAOD(**args)
self._setRepackedFlag(args)

if not 'skims' in args:
args['skims']=['@allForPrompt']
Expand All @@ -64,6 +70,7 @@ def expressProcessing(self, globalTag, **args):
"""
self._checkMINIAOD(**args)
self._setRepackedFlag(args)

if not 'skims' in args:
args['skims']=['@allForExpress']
Expand Down
13 changes: 13 additions & 0 deletions Configuration/DataProcessing/python/Reco.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ def __init__(self):
"""


def _checkRepackedFlag(self, options, **args):
if 'repacked' in args:
if args['repacked'] == True:
options.isRepacked = True
else:
options.isRepacked = False



def promptReco(self, globalTag, **args):
"""
_promptReco_
Expand Down Expand Up @@ -55,6 +65,7 @@ def promptReco(self, globalTag, **args):
"""
options.runUnscheduled=True

self._checkRepackedFlag(options, **args)

if 'customs' in args:
options.customisation_file=args['customs']
Expand Down Expand Up @@ -116,6 +127,8 @@ def expressProcessing(self, globalTag, **args):
if 'customs' in args:
options.customisation_file=args['customs']

self._checkRepackedFlag(options,**args)

cb = ConfigBuilder(options, process = process, with_output = True, with_input = True)

cb.prepare()
Expand Down
15 changes: 14 additions & 1 deletion Configuration/DataProcessing/test/RunPromptReco.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def __init__(self):
self.alcaRecos = None
self.PhysicsSkims = None
self.dqmSeq = None
self.setRepacked = False
self.isRepacked = False

def __call__(self):
if self.scenario == None:
Expand Down Expand Up @@ -93,6 +95,9 @@ def __call__(self):
if self.dqmSeq:
kwds['dqmSeq'] = self.dqmSeq

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

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

except NotImplementedError, ex:
Expand All @@ -119,7 +124,7 @@ def __call__(self):

if __name__ == '__main__':
valid = ["scenario=", "reco", "aod", "miniaod","dqm", "dqmio", "no-output",
"global-tag=", "lfn=", "alcarecos=", "PhysicsSkims=", "dqmSeq=" ]
"global-tag=", "lfn=", "alcarecos=", "PhysicsSkims=", "dqmSeq=", "isRepacked", "isNotRepacked" ]
usage = \
"""
RunPromptReco.py <options>
Expand All @@ -131,6 +136,7 @@ def __call__(self):
--miniaod (to enable MiniAOD output)
--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
Expand Down Expand Up @@ -182,5 +188,12 @@ def __call__(self):
recoinator.PhysicsSkims = [ x for x in arg.split('+') if len(x) > 0 ]
if opt == "--dqmSeq":
recoinator.dqmSeq = [ x for x in arg.split('+') if len(x) > 0 ]
if opt == "--isRepacked":
recoinator.setRepacked = True
recoinator.isRepacked = True
if opt == "--isNotRepacked":
recoinator.setRepacked = True
recoinator.isRepacked = False


recoinator()

0 comments on commit d66c207

Please sign in to comment.