Hello,
Recently I have installed ROOT 5.34.36 using python 3.5. I used this python version to make ROOT compatible with another package environment which requires python 3.5. I provide the piece of code which is now giving me a problem. When I compiled ROOT 5.34.36 with python 2.7, the same piece of code worked perfectly. Could you please see how this problem can be solved?
import ROOT
from ROOT import *
-------
gSystem.Load("$PATHFOLDER/mylibrary.so")
f = ROOT.TFile("data.root")
# Getting 'Event' Tree
t=f.Get("Events")
# Setting branch address for Event class
t.SetBranchStatus("*", 0);
t.SetBranchStatus("MEvt.", 1)
# calling the class (MEvt is a class from mylibrary.so)
cam_event = MEvt()
t.SetBranchAddress("MEvt.",cam_event)
It was working perfectly with python2.7. Now with this python3.5 version, it is giving me following error.
Traceback (most recent call last):
File "read_root.py", line 28, in <module>
t.SetBranchAddress("MEvt.",cam_event)
TypeError: none of the 3 overloaded methods succeeded. Full details:
Int_t TTree::SetBranchAddress(const char* bname, void** add, TBranch** ptr = 0) =>
could not convert argument 1 (SetBranchAddress() argument 1 must be bytes, not str)
Int_t TTree::SetBranchAddress(const char* bname, void* add, TClass* realClass, EDataType datatype, Bool_t isptr) =>
takes at least 5 arguments (2 given)
Int_t TTree::SetBranchAddress(const char* bname, void* add, TBranch** ptr, TClass* realClass, EDataType datatype, Bool_t isptr) =>
takes at least 6 arguments (2 given)