Skip to content
Snippets Groups Projects

Add support for realistic RICH PMT encoding and decoding

Compare and Show latest version
2 files
+ 11
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -15,7 +15,10 @@ and also simple manipulators of the database it creates:
validate(db), decodersForBank(db,bank,ignoreActive=False), decoderToLocation(db,location,ignoreActive=False)
"""
from GaudiConf.Manipulations import configurableInstanceFromString, addPrivateToolFromString
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
try:
from GaudiKernel.DataHandle import DataHandle
except ImportError: # backward compatibility with Gaudi < v34r0
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase as DataHandle
class Decoder(object):
@@ -247,9 +250,9 @@ class Decoder(object):
self.FullName + " " + input.__str__())
elif ensuretype is list and type(input) is str:
self.Inputs[k] = [input]
elif ensuretype is DataObjectHandleBase:
elif ensuretype is DataHandle:
path = input if type(input) is str else ':'.join(input)
self.Inputs[k] = DataObjectHandleBase(path)
self.Inputs[k] = DataHandle(path)
else:
raise TypeError(
self.FullName + " cannot convert input from type " +
@@ -286,7 +289,7 @@ class Decoder(object):
#determine default type, first get my configurable
thedecoder = configurableInstanceFromString(self.FullName)
prop = self.__getprop__(thedecoder, k)
if isinstance(prop, DataObjectHandleBase):
if isinstance(prop, DataHandle):
# special case for datahandles
ensuretype = str
else:
@@ -341,7 +344,7 @@ class Decoder(object):
#only add if not already in the list
if ops is not None and type(ops) is str:
ops = [ops]
elif isinstance(ops, DataObjectHandleBase):
elif isinstance(ops, DataHandle):
ops = ops.Path.split(":")
for op in ops:
if op not in outputs:
@@ -378,7 +381,7 @@ class Decoder(object):
#only add if not already in the list
if type(ips) is str:
ips = [ips]
elif isinstance(ips, DataObjectHandleBase):
elif isinstance(ips, DataHandle):
ips = ips.Path.split(":")
for ip in ips:
if ip not in inputs:
Loading