Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCPL file #1476

Open
Rohit-Raut opened this issue Jul 12, 2023 · 4 comments
Open

MCPL file #1476

Rohit-Raut opened this issue Jul 12, 2023 · 4 comments

Comments

@Rohit-Raut
Copy link

Rohit-Raut commented Jul 12, 2023

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.

@willend
Copy link
Contributor

willend commented Jul 13, 2023

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 mctools/mcpl#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".

@tkittel
Copy link
Contributor

tkittel commented Jul 13, 2023

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.

@Rohit-Raut
Copy link
Author

Thank you so much, I wrote a converter for root2mcpl, worked for me.

@tkittel
Copy link
Contributor

tkittel commented Jul 17, 2023

Great! If you wish, you can share it here - as inspiration for other people with a similar need in the future.

Cheers,
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants