I am familiar with using TTrees in C++, but I am confused about what the equivalent of a reference is in the Python translation of the following:
TTree t("TestTree", "TestTree");
float f = 0.0;
t.Branch("myFloat", &f, "f/F"); // how do I do this in python?
for(int i=0; i<numEvents; i++)
f = myFunc();
there is a simple example in the User’s Guide (ftp://root.cern.ch/root/doc/19PythonRuby.pdf), and the same is also here: http://cern.ch/wlav/pyroot/tpytree.html. There is also the little $ROOTSYS/tutorials/pyroot/staff.py script.
In short, either use a C++ object with a dictionary attached to it (either compiled or interpreted), or use python array.array (of size 1, if need be). Putting actual python objects into a TTree only works by pickling them into a TObjString, and then putting the TObjString into the TTree.