12def mergeHistoDefinition(hdef1, hdef2):
13 """Merge 2 histo definitions (assumming 1D definition) into a 2D histo definiton
14 hdef1/2 are either
15 - HistoDefinitionTool instances
16 - tuple in the form ('title', nbins, xlow, xup)
17 returns a tuple form
18 """
19 def makeTuple(hdef):
20 if isinstance(hdef,HistoDefinitionTool):
21 return (hdef.title, hdef.nbinsx, hdef.xlow, hdef.xup)
22 return hdef
23 hdef1 = makeTuple(hdef1)
24 hdef2 = makeTuple(hdef2)
25
26 topT1, xT1, n = hdef1[0].
split(
';')
27 topT2, xT2, n = hdef2[0].
split(
';')
28 title = ';'.join([topT2+' vs '+topT1 , xT1, xT2 ])
29
30 hdef = (title, ) + hdef1[1:] + hdef2[1:]
31 return hdef
std::vector< std::string > split(const std::string &s, const std::string &t=":")