[RFC] Call nanoAOD_runMETfixEE2017() only if the modifiers are chosen #287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally from cms-sw#25587
The customizations
cmssw/PhysicsTools/NanoAOD/python/nano_cff.py
Lines 275 to 276 in 4fdeedc
and
cmssw/PhysicsTools/NanoAOD/python/nano_cff.py
Lines 282 to 283 in 4fdeedc
were introduced in cms-sw#25373. The code look like the intention was to call
nanoAOD_runMETfixEE2017()
only ifrun2_nanoAOD_94XMiniAODv1
orrun2_nanoAOD_94XMiniAODv2
modifiers are turned on.The actual behavior is, however, different. The lines 276 and 283 contain a call to
nanoAOD_runMETfixEE2017()
function (instead of a function "object" to be called bytoModify()
), so it is called regardless of the status of the two modifiers (and twice because of the loop). The function itselfcmssw/PhysicsTools/NanoAOD/python/nano_cff.py
Lines 236 to 241 in 4fdeedc
does not explicitly return anything, so the return value is
None
. TheModifier
then interprets thatcmssw/FWCore/ParameterSet/python/Config.py
Line 1354 in 4fdeedc
such that the
func
argument isNone
, and there are no keyword arguments, so it has nothing to do.If my guess above on the intention is correct, this PR suggests to fix the behavior to the intended one.
Tested in 10_4_0.