Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass isRepacked flag to config builder if set in a scenario #12326

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slava77 - I think this would be more consistent if the default of isRepacked here is True (as that is default elsewhere in the PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 11/10/15 12:04 AM, David Lange wrote:

In Configuration/DataProcessing/test/RunPromptReco.py
#12326 (comment):

@@ -29,6 +29,8 @@ def init(self):
self.alcaRecos = None
self.PhysicsSkims = None
self.dqmSeq = None

  •    self.setRepacked = False
    
  •    self.isRepacked = False
    

@slava77 https://github.com/slava77 - I think this would be more
consistent if the default of isRepacked here is True (as that is default
elsewhere in the PR)

I'm not sure I understand the logic.

As defined here, the defaults in this file leave it to the corresponding
scenarios to set their values.
The isRepacked has no effect if setRepacked is false.
If the defaults need to be reset (the main purpose of these flags here),
and so far it's only needed in HI, it would be reset to false.

I can change, if you confirm that you still want it at a true value.
(the file is useful only in local tests; in T0 perspective, these flags
are invisible)


Reply to this email directly or view it on GitHub
https://github.com/cms-sw/cmssw/pull/12326/files#r44378627.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah - good point. Ok - thanks


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()