Something that is capable of reading and writing R...
# science
a
Something that is capable of reading and writing ROOT files and EDM4Hep files.
a
Reading Root files is almost imposible outside of root. The closes thin there is is uproot in python, but it does not cover all cases. There is a reader in VisionForge: https://git.sciprog.center/kscience/visionforge/src/branch/dev/cern-root-loader, but it works with Root Json export, not binary root file itself. There is also a GDML builder in a separate library: https://github.com/SciProgCentre/gdml.kt (it is a bit outdated though
a
Hmmm I'll check them out. With what you said the cleaner approach would be to use C++ and ROOT and bridge them to kotlin right?
a
The best way is to export Json from Root by using JsonBuffer and import it in Kotlin. We tried to read binaries directly and it is possible in theory, but it requires a lot of effort (ROOT format is terrible). Also if you use some non-vanila root installation (like most experiment do) it won't work.
✅ 1
The main problem is that so called ROOT format is actually just a memory dump. So if you introduce new classes, it is broken.
We have actually developed an event display system for NICA experiment using Kotlin and VisionForge. But it uses C++-side json conversion right now
a
Hmm good to know. I'm working on FCC right now.
thanks
a