Change parameters automatically

Asked by Sebastian Urrutia-Quiroga on 2015-09-28

I am using the Inert Doublet Model UFO model which is available at Feynrules website. I want to change a parameter value taking the new values from an external file.
I read something about the "set" command,
set mmH0 value

but it doesn't work:
Command "set mmH0 7E1" interrupted with error:
InvalidCmd : Possible options for set are ['group_subprocesses', 'ignore_six_quark_processes', 'stdout_level', 'fortran_compiler', 'cpp_compiler', 'loop_optimized_output', 'complex_mass_scheme', 'gauge', 'EWscheme', 'max_npoint_for_channel']
-- set options for generation or output.
syntax: set <option_name> <option_value>
Possible options are:
Details of each option:
group_subprocesses True/False/Auto:
 > (default Auto) Smart grouping of subprocesses into
   directories, mirroring of initial states, and
   combination of integration channels.
 > Example: p p > j j j w+ gives 5 directories and 184 channels
   (cf. 65 directories and 1048 channels for regular output)
 > Auto means False for decay computation and True for collisions.
ignore_six_quark_processes multi_part_label
 > (default none) ignore processes with at least 6 of any
   of the quarks given in multi_part_label.
 > These processes give negligible contribution to the
   cross section but have subprocesses/channels.
 > change the default level for printed information
fortran_compiler NAME
 > (default None) Force a specific fortran compiler.
   If None, it tries first g77 and if not present gfortran
   but loop output use gfortran.
loop_optimized_output True|False
 > Exploits the open loop thechnique for considerable
 > CP relations among helicites are detected and the helicity
   filter has more potential.
loop_color_flows True|False
 > Only relevant for the loop optimized output.
 > Reduces the loop diagrams at the amplitude level
   rendering possible the computation of the loop amplitude
   for a fixed color flow or color configuration.
 > This option can considerably slow down the loop ME
   computation time, especially when summing over all color
   and helicity configuration, hence turned off by default.
gauge unitary|Feynman
 > (default unitary) choose the gauge of the non QCD part.
 > For loop processes, only Feynman gauge is employable.
complex_mass_scheme True|False
 > (default False) Set complex mass scheme.
 > Complex mass scheme is not yet supported for loop processes.
timeout VALUE
 > (default 20) Seconds allowed to answer questions.
 > Note that pressing tab always stops the timer.
cluster_temp_path PATH
 > (default None) [Used in Madevent Output]
 > Allow to perform the run in PATH directory
 > This allow to not run on the central disk.
 > This is not used by condor cluster (since condor has
   its own way to prevent it).
OLP ProgramName
 > (default 'MadLoop') [Used for virtual generation]
 > Chooses what One-Loop Program to use for the virtual
 > matrix element generation via the BLAH accord.
output_dependencies <mode>
 > (default 'external') [Use for NLO outputs]
 > Choses how the external dependences (such as CutTools)
 > of NLO outputs are handled. Possible values are:
     o external: Some of the libraries the output depends
       on are links to their installation in MG5 root dir.
     o internal: All libraries the output depends on are
       copied and compiled locally in the output directory.
     o environment_paths: The location of all libraries the
       output depends on should be found in your env. paths.

What I am doing wrong?

Question information

English Edit question
MadGraph5_aMC@NLO Edit question
No assignee Edit question
Last query:
Last reply:


The reason is that you try to edit the card before typing "launch" and not after.
the command "set param_name value" is indeed value but only when the question about the cards is asked.
i.e. when you have the following question:

Do you want to edit a card (press enter to bypass editing)?
  1 / param : param_card.dat
  2 / run : run_card.dat
  9 / plot : plot_card.dat
 you can also
   - enter the path to a valid card or banner.
   - use the 'set' command to modify a parameter directly.
     The set option works only for param_card and run_card.
     Type 'help set' for more information on this command.
   - call an external program (ASperGE/MadWidth/...).
     Type 'help' for the list of available command
 [0, done, 1, param, 2, run, 9, plot, enter path][60s to answer]

As noted in the question, you can also specify the path to a valid card if you find that easier.

If you want to script those changes, you can look at the following FAQ:
FAQ #2186: “How to script MG5 run?”.

Hi Olivier,
Thank you for helping me... now it works!

If you don't mind, I have another question: how can I make a python script (or similar) which changes a parameter in a certain number of iterations?

Thank you,


Is the content of the FAQ not answering your question?
by writing such type of command file, you should be able to create any kind of scan that you are looking for.

In the next version of MG5, we will introduce a new syntax:
set mh scan: [100,125,150,175]
set mh scan: range(100,200,25)
which will simplify the way to do scan.
You can find the description of this syntax here:
(look at the end)
if you want to play with it, you can already download the alpha version with the following command:

bzr branch lp:~maddevelopers/mg5amcnlo/2.3.3_scan_options

Can you help with this problem?

Provide an answer of your own, or ask Sebastian Urrutia-Quiroga for more information if necessary.

To post a message you must log in.