How to access Tree.Draw("...>>hist", ...) hist variable?

Hi,

I’d like to add histograms created via Tree.Draw("…>>hist") to a THStack.

How can I access the histogram variable from Python, please?
With the naive version shown below Python/pyROOT obviously complains:

TIA & regards,
Roland

Code snippet:

    _combiStack = THStack("combiStack", "combiStack")
    for _i, _params in enumerate(drawParams):
        theTree.Draw(_params+">>hist"+str(_i), _settings['drawFilter'], _settings['drawStyle'])
        _combiStack.Add( "hist"+str(_i) )

    _combiStack.Draw("nosame")

_combiStack.Add( eval("ROOT.hist"+str(_i)) )
does the trick

Cheers,
Roland

Hi,

‘getattr( ROOT, “hist”+str(_i) )’ should be equivalent to that eval.

Cheers,
Wim