Skip to content

Commit

Permalink
python3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlange6 committed Apr 5, 2019
1 parent e37bcff commit a04aa6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit a04aa6e

Please sign in to comment.