Re: python RooFit createIntegral

From: <wlavrijsen_at_lbl.gov>
Date: Mon, 28 Nov 2011 12:01:47 -0800


Margar,

> Say in python I have a function which returns somethings like this
> {'a':1, 'b':2}, obviously this has to be converted to map<string, double>.
> Can this work via TPython calls?

after the conversion, yes. Make sure to cast the TPyReturn to void* first, before casting to std::map<std::string, double>* and to either copy it or keep it alive on the python side. (You can also cast the TPyReturn to a PyObject*, Py_INCREF that, so that the C++ side holds its own copy, then get the C++ object out using TPython::ObjectProxy_AsVoidPtr.)

Let me know if any of the above doesn't work.

Best regards,

            Wim

-- 
WLavrijsen_at_lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
Received on Mon Nov 28 2011 - 21:01:57 CET

This archive was generated by hypermail 2.2.0 : Tue Nov 29 2011 - 11:50:01 CET