Skip to content

Commit

Permalink
Merge pull request #41696 from Dr15Jones/nanoMultiTypeParameter
Browse files Browse the repository at this point in the history
Explicitly define all types allowed for 'precision' NANO parameter
  • Loading branch information
cmsbuild authored May 19, 2023
2 parents d5b4805 + c195cfe commit 42c7218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PhysicsTools/NanoAOD/python/common_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def OVar(valtype, doc=None, precision=-1):
return cms.PSet(
type = cms.string(valtype),
doc = cms.string(doc if doc else expr),
precision=cms.string(precision) if type(precision)==str else cms.int32(precision)
)
precision=cms.optional.allowed(cms.string, cms.int32, default = (cms.string(precision) if type(precision)==str else cms.int32(precision)
)))
def Var(expr, valtype, doc=None, precision=-1):
"""Create a PSet for a variable computed with the string parser
Expand Down

0 comments on commit 42c7218

Please sign in to comment.