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

python3 compatibility in PhysicsTools pieces of reco sequence #26368

Merged
merged 1 commit into from Apr 8, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions PhysicsTools/PatAlgos/python/tools/jetTools.py
Expand Up @@ -868,7 +868,7 @@ def __init__(self):
and \'type-2\' are not case sensitive.", tuple, acceptNoneValue=True)
self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging, in most cases just the labels of the btag discriminators that \
you are interested in is all relevant information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. \
If this list is empty no btag discriminator information will be added to your new patJet collection.", allowedValues=(supportedBtagDiscr.keys()+supportedMetaDiscr.keys()),Type=list)
If this list is empty no btag discriminator information will be added to your new patJet collection.", allowedValues=(list(set().union(supportedBtagDiscr.keys(),supportedMetaDiscr.keys()))),Type=list)
self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects contain all relevant information from which all discriminators of a certain \
type have been calculated. You might be interested in keeping this information for low level tests or to re-calculate some discriminators from hand. Note that this information \
on the one hand can be very space consuming and that it is not necessary to access the pre-calculated btag discriminator information that has been derived from it. Only in very \
Expand Down Expand Up @@ -1274,7 +1274,7 @@ def __init__(self):
applied. If you are not interested in MET(Type1) corrections to this new patJet collection pass None as third argument of the python tuple.", tuple, acceptNoneValue=True)
self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging in general the btag discriminators is all relevant \
information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. If this list is empty no btag \
discriminator information will be added to your new patJet collection.", allowedValues=(supportedBtagDiscr.keys()+supportedMetaDiscr.keys()),Type=list)
discriminator information will be added to your new patJet collection.", allowedValues=(list(set().union(supportedBtagDiscr.keys(),supportedMetaDiscr.keys()))),Type=list)
self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects conatin all relevant information from which all discriminators of a certain \
type have been calculated. Note that this information on the one hand can be very space consuming and on the other hand is not necessary to access the btag discriminator \
information that has been derived from it. Only in very special cases the btagInfos might really be needed in your analysis. Add here all btagInfos, that you are interested \
Expand Down Expand Up @@ -1487,7 +1487,7 @@ def __init__(self):
and \'type-2\' are not case sensitive.", tuple, acceptNoneValue=True)
self.addParameter(self._defaultParameters,'btagDiscriminators',['None'], "If you are interested in btagging, in most cases just the labels of the btag discriminators that \
you are interested in is all relevant information that you need for a high level analysis. Add here all btag discriminators, that you are interested in as a list of strings. \
If this list is empty no btag discriminator information will be added to your new patJet collection.", allowedValues=(supportedBtagDiscr.keys()+supportedMetaDiscr.keys()),Type=list)
If this list is empty no btag discriminator information will be added to your new patJet collection.", allowedValues=(list(set().union(supportedBtagDiscr.keys(),supportedMetaDiscr.keys()))),Type=list)
self.addParameter(self._defaultParameters,'btagInfos',['None'], "The btagInfos objects contain all relevant information from which all discriminators of a certain \
type have been calculated. You might be interested in keeping this information for low level tests or to re-calculate some discriminators from hand. Note that this information \
on the one hand can be very space consuming and that it is not necessary to access the pre-calculated btag discriminator information that has been derived from it. Only in very \
Expand Down
10 changes: 5 additions & 5 deletions PhysicsTools/SelectorUtils/python/centralIDRegistry.py
Expand Up @@ -12,10 +12,10 @@ def register(self,name,md5):
else:
raise Exception('md5 %s already exists with name %s!'%(md5,self.md5toName[md5]))
# register name -> md5
if name not in self.nameToMD5:
self.nameToMD5[name] = md5
if name.value() not in self.nameToMD5:
self.nameToMD5[name.value()] = md5
else:
raise Exception('Name %s already exists with md5 %s!'%(name,self.nameToMD5[name]))
raise Exception('Name %s already exists with md5 %s!'%(name.value(),self.nameToMD5[name.value()]))

def getNameFromMD5(self,md5):
if md5 in self.md5toName:
Expand All @@ -24,8 +24,8 @@ def getNameFromMD5(self,md5):
return ''

def getMD5FromName(self,name):
if name in self.nameToMD5:
return self.nameToMD5[name]
if name.value() in self.nameToMD5:
return self.nameToMD5[name.value()]
else:
return ''

Expand Down