McCode
McCode copied to clipboard
MCPL file
Hi, I have been trying to learn MCPL file format and file conversion. The neutron data are in root , but could not find any way for the conversion to mcpl file format. I am looking for any documentation for cmd line for converter.
Thank you so much.
Hello @Rohit-Raut,
For documentation on MCPL, the best place to look is in fact over at https://mctools.github.io/mcpl/ . Looking at https://mctools.github.io/mcpl/hooks/ however, I don't think we have a readily available solution for ROOT.
That being said there are python developments recently contributed (see https://github.com/mctools/mcpl/issues/70) that may allow you to do a small, dedicated conversion tool yourself?
Also @tkittel might have points of view when he is back from vacation and @ebknudsen may have a hack "up his sleeve".
I don't think a general converter from "data in ROOT" is possible, since a ROOT file (like an HDF5 file, or a tar-ball) allows you to put anything inside, and we would have no way to automatically the particle data.
So yes, you need to write a custom converter. Since you are working in ROOT, I suggest you use the C/C++ API:
https://mctools.github.io/mcpl/usage_c/#creating-mcpl-files
ps. MCPL issues/questions would more naturally go to the MCPL issue tracker, since this question does not appear to have anything to do with McCode.
Thank you so much, I wrote a converter for root2mcpl, worked for me.
Great! If you wish, you can share it here - as inspiration for other people with a similar need in the future.
Cheers, Thomas