I’m porting some plotting methods to C++ for wider use. I use a python dict of TH1F objects indexed by their name.
Here’s the c++ prototype:
typedef std::map<std::string,TH1*> HistogramBook;
THStack* makeStackFromList(HistogramBook histList,std::string name="");
From python, I would have a structure like:
histList={'h1':ROOT.TH1F('h1','Hist 1',50,-5,5),'h2':ROOT.TH2F('h2','Hist 2',50,-5,5),'h3':ROOT.TH3F('h3','Hist 3',50,-5,5)}
makeStackFromList(histList)
What I get out is:
[...]
File "path/to/source/python/PrettyPlotsUtils.py", line 119, in makeStackFromList
_PPlotsUtil.makeStackFromList(histList,name)
TypeError: THStack* PrettyPlotsUtils::makeStackFromList(HistogramBook histList, string name = "") =>
could not convert argument 1
Is there a way to make this work?