43 def create2DHistoToolFrom1D(self, name, **otherArgs):
44 tool = self.jhm.tool(name, build2Difmissing=False)
45 if tool is not None : return tool
46
47
48
49 n1, n2 = name.split(':')
50 t1 = self.jhm.tool(n1)
51 t2 = self.jhm.tool(n2)
52
53 if None in (t1, t2):
54 missing = n1 if t1 is None else n2
55 print ("ERROR : can't build 2D histo", name, " : ",missing, " is unknonw")
56 return None
57
58 binning = mergeHistoDefinition( t1.HistoDef, t2.HistoDef)
59 def rebuildSuffix(index):
60 if index==-1: return ''
61 return '['+str(index)+']'
62 attInfo1 = (t1.AttributeNames[0]+rebuildSuffix(t1.SelectIndex), t1.AttributeTypes[0])
63 attInfo2 = (t2.AttributeNames[0]+rebuildSuffix(t2.SelectIndex), t2.AttributeTypes[0])
64
65 tool = create2DHistoTool(name, binning, attInfo1, attInfo2, **otherArgs)
66
67 return self.jhm.addTool( tool)
68