Complete compatibility with MADX syntax

Issue #180 on hold
Laurie Nevay created an issue

GMAD was originally designed to be MAD + 'G'eant4 extensions to the syntax with the original idea being that one could use a MAD script directly with BDSIM as one would with MAD. You could then envision the user having much less input to maintain.

I'd like to make it so that any MADX (note X only) script would run through BDSIM. I think to the level where it would run with warnings (as is the case now) for unsupported commands that we can't support.

We cannot support the matching commands for example with GMAD and we preferably would work from a 'rendered' flat description from MADX in a TFS file, but you could foresee the lattice definition in a MADX script being sufficient.

We have nearly full support already I believe of commands we pass over, but we would just need to check through MADX as it is just now for confirmation.

In future we could find MADX in cmake and support the following syntax in a gmad file:

includemadx, myfile.madx; // runs file through madx, possibly adding required tfs output at the end

Comments (2)

  1. Jochem Snuverink

    If I understand correctly you propose two things (please correct me if I am wrong):

    1. support any .madx file (one that does not have matching commands, and perhaps if there any do point 2)
    2. run a .madx file within BDSIM through MADX and pymadx producing the gmad files.

    1) is quite possible, GMAD might actually be not so complete right now, so in the beginning GMAD needs to be updated quite often.

    2) is certainly possible of course, but not so straightforward to do properly, hence I wonder if it would be worth the effort. Would there be an advantage over the single manual running of MADX and pymadx besides convenience? The disadvantage is that MADX would run every time, and a layer of complexity is added to farm jobs where MADX needs to be installed/updated.

    To find MADX in CMake one can simply do find_package(MadX). We do this already in examples/features/optics/CMakeLists.txt .. I propose to make it an optional dependency.

  2. Log in to comment