Creating New G4NDL or G4PARTICLEXS Data Set From JENDL 5.0

I have seen that it is possible to create new, custom cross-section libraries for Geant4 to use with ParticleHP beyond the set that can be downloaded from the Geant4 web page.

I have two questions on this:

  1. Does anyone have experience setting up custom cross-sections and using them with the ParticleHP models?

  2. Does anyone know how to convert data from an ENDF6 file format to the zipped format that all of the G4 data uses? I have found this report from the IAEA: https://www-nds.iaea.org/publications/indc/indc-nds-0612.pdf It does explain how the G4NDL files were converted from various file formats to a more usable ENDF6 format, however, after the steps in PREPRO the report simply states that the data was “translated with a specific program developed by the authors into the G4NDL data format” and I cannot find enough documentation on the G4NDL data format to reproduce such a program myself.

Thanks in advance for any help!
Arthur Zangi


Replying to my own thread in case others are looking for an answer:

I have found a way to do this relatively simply, by using PREPRO to prepare the ENDF tape as described in the IAEA publication linked above, and then writing a small python script to format the ENDF tape output from PREPRO to the specifications of the G4TENDL format. I imagine it would be relatively easy to adapt this to the G4NDL or other library formats, I’ve just been using G4TENDL.

I then use the code helpfully provided by this post: How to open .z files in downloaded G4Data files and check the cross section data - #6 by gunter
to zip the file into a zlib *.z format which is used by the G4TENDL library.

I have compiled all of these codes into a github repo here: GitHub - SZangi/ENDF_To_G4: A small set of codes to convert a file in ENDF format to G4TENDL format
I would strongly advise reading through all the documentation for the PREPRO commands used and looking through the code before using it as I am a novice at all this and there is a good chance I have made an error.