I have read that I can convert the ROOT file into a JSON using TBufferJSON. Is there a simple example do start with ?
you cannot convert files but rather single objects which are not TTrees.
The operation is very easy: https://root.cern.ch/doc/master/classTBufferJSON.html#a2dd3ce085948fcee17114cdaf3325575
In ROO5 docu there is simple example:
If you want to save result into text file, you can directly use method TBufferJSON::ExportToFile
This method used, when you call obj->SaveAs(“file.json”);
Great, exactly what I was looking for !
I am on ROOT v6.04, and couldn’t find TBufferJSON.h header file in the $ROOTSYS/include directory. Is it included by default during installation?
For ROOT 6.04 you should enable compilation of http server.
I have recompiled ROOT for JSON. Noticed that in my ROOT version, the ExportToFile is not available, checked the include file, didn’t find such a method obviously. Is it possible to write to a JSON file or I have to just write to a file manually ?
If your ROOT version does not have TBufferJSON::ExportToFile function,
you need to create text file yourself.
Sorry, I somehow miss notification for this topic.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.