Hi,
I am trying to write a simple TreeWriter class that has reflection built in so I can use it in python and C++. It seems that everything compiles well however I cannot get my code to run in the pyROOT environment. I attach the code in a simple example in test.tar.gz the error I am getting is as follows
Traceback (most recent call last):
File "./TreeWriter.py", line 8, in <module>
tw.column( "test", int(0) )
TypeError: void TreeWriter::column(const string& variable, const boost::any& value) =>
could not convert argument 2
I have 4 files in the upload Dict.h, Dict.xml, TreeWriter.cpp, TreeWriter.hpp and TreeWriter.py. Dict.h is simply the header files to be compiled and passed to genreflex, Dict.xml is the lcgdict definitions, TreeWriter.{hpp,cpp} are the source code and finally TreeWriter.py is the loading of the created dictionary.
I am doing the following to create the libs:-
g++ -fPIC -shared -c -W -Wall TreeWriter.cpp -o TreeWriter.so `root-config --cflags`
genreflex Dict.h --deep --rootmap=libCharmlessSelection.rootmap --rootmap-lib=libCharmlessSelection.so --select=Dict.xml -I/usr/local/root/include/root
g++ -O2 -fPIC -shared Dict.h Dict_rflx.cpp TreeWriter.so -o libCharmlessSelection.so `root-config --cflags --glibs` -lReflex -lCintex -lEG -lGui -lHist -lTMVA -lTreePlayer -lGenVector -lRooFitCore -lRooFit -lRooStats
Then to reproduce the error I run
./TreeWriter.py
Traceback (most recent call last):
File "./TreeWriter.py", line 8, in <module>
tw.column( "test", int(0) )
TypeError: void TreeWriter::column(const string& variable, const boost::any& value) =>
could not convert argument 2
TFile** output.root
TFile* output.root
OBJ: TTree data data : 0 at: 0x2be9730
I tried hiding the boost things from CINT but that clearly will not help since it still doesn’t know how to use them. Thanks for any help you can provide.
Cheers
Matt
test.tar.gz (2.84 KB)