Set run parameters in MadGraph5

Asked by Matthew Baumgart

Hello,

I have recently upgraded to MadGraph5 from 4 and I appreciate the greater ability to use the command line. Unfortunately, I cannot figure out how to set my run parameters when I run on the command line. Principally, I would like to be able to change the beam energies and number of events. Is it possible to change these from the command line? If not, in what file are the defaults set such that I can edit them so that running from the command line gives me the desired collision energy and quantity of events?

I realize it's possible to still use the old MadGraph4 procedure of copying the Template directory and changing card files, but this seems cumbersome compared to the slick command line approach that is being promoted.

Thank you for your help.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Matthew Baumgart
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi Matthew,

If you want to launch your run from the MG5 interface, you have the command "launch".
This one will ask either one [or two] question (depending if you have install pythia-pgs/Delphes)

The second (or only) question is the following:
Do you want to edit one cards (press enter to bypass editing)?
  1 / param : param_card.dat (be carefull about parameter consistency, especially widths)
  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.
 [0, done, 1, param, 2, run, 9, plot, enter path][60s to answer]

As written you can either
1) type "param" (or "1") and the code will open an editor where you can edit the param_card
(the same for the run_card,…)
2) enter directly a path to a file, MG5 will recognize automatically which type of file it is and will
copy it at the right position
3) you can use the "set" command like for example:
set ebeam1 3500
set ebeam2 3500
set nevents 50000
set MT 176
set MH 126

As soon as don't have answer this question by done (or just press enter), it will be re-asked as long as needed.

Note that you arrive at the same question if you do from the SubProcess directory
./bin/madevent

Cheers,

Olivier

On May 14, 2013, at 12:21 PM, Matthew Baumgart <email address hidden> wrote:

> New question #228880 on MadGraph5:
> https://answers.launchpad.net/madgraph5/+question/228880
>
> Hello,
>
> I have recently upgraded to MadGraph5 from 4 and I appreciate the greater ability to use the command line. Unfortunately, I cannot figure out how to set my run parameters when I run on the command line. Principally, I would like to be able to change the beam energies and number of events. Is it possible to change these from the command line? If not, in what file are the defaults set such that I can edit them so that running from the command line gives me the desired collision energy and quantity of events?
>
> I realize it's possible to still use the old MadGraph4 procedure of copying the Template directory and changing card files, but this seems cumbersome compared to the slick command line approach that is being promoted.
>
> Thank you for your help.
>
>
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
Matthew Baumgart (baumgart-a) said :
#2

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Matthew Baumgart (baumgart-a) said :
#3

Thank you for stating this all so clearly. I had figured "set" was the command to use, but when I typed "help set", it gave me a list of options like "ignore_six_quark_processes" and "complex_mass_scheme argument" that didn't seem to have much to do with setting run parameters.

Of course, editing the run file after being prompted works is an obvious fix, too.

Revision history for this message
Matthew Baumgart (baumgart-a) said :
#4

I just attempted to use the 'set' command as you suggested above and got an error, which I attached below. I used "set" after issuing my "generate" and "output" commands, but before issuing "launch".

mg5>set nevents 1000
syntax: set group_subprocesses|ignore_six_quark_processes|stdout_level|fortran_compiler|gauge|complex_mass_scheme argument|default
-- set options for generation or output.
   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.
   stdout_level DEBUG|INFO|WARNING|ERROR|CRITICAL
     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.
   gauge unitary|Feynman
      (default unitary) choose the gauge.
   complex_mass_scheme True|False
      (default False) Set complex mass scheme.
   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 it's own way to prevent it).
Command "set nevents 1000" interrupted with error:
InvalidCmd : Possible options for set are ['group_subprocesses', 'ignore_six_quark_processes', 'stdout_level', 'fortran_compiler', 'gauge', 'complex_mass_scheme']
syntax: set group_subprocesses|ignore_six_quark_processes|stdout_level|fortran_compiler|gauge|complex_mass_scheme argument|default
-- set options for generation or output.
   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.
   stdout_level DEBUG|INFO|WARNING|ERROR|CRITICAL
     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.
   gauge unitary|Feynman
      (default unitary) choose the gauge.
   complex_mass_scheme True|False
      (default False) Set complex mass scheme.
   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 it's own way to prevent it).

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#5

Hi Matthew,

This set command need to be used AFTER the launch command.
(when the code ask you the question about the card modification, see the question below).

I have written below, the question and the answer provide if you type "help set" at that stage.

Cheers,

Olivier

Do you want to edit one cards (press enter to bypass editing)?
  1 / param : param_card.dat (be carefull about parameter consistency, especially widths)
  2 / run : run_card.dat
  3 / pythia : pythia_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.
 [0, done, 1, param, 2, run, 3, pythia, 9, enter path, ... ][60s to answer]
>help set
********************* HELP SET ***************************
syntax: set [run_card|param_card] NAME [VALUE|default]
syntax: set [param_card] BLOCK ID(s) [VALUE|default]

-- Edit the param_card/run_card and replace the value of the
    parameter by the value VALUE.

-- Example:
     set run_card ebeam1 4000
     set ebeam2 4000
     set lpp1 0
     set ptj default

     set param_card mass 6 175
     set mass 25 125.3
     set mass mh 125
     set mh 125
     set decay 25 0.004
     set decay wh 0.004
     set vmix 2 1 2.326612e-01

     set param_card default #return all parameter to default
     set run_card default
********************* HELP SET ***************************

Do you want to edit one cards (press enter to bypass editing)?
  1 / param : param_card.dat (be carefull about parameter consistency, especially widths)
  2 / run : run_card.dat
  3 / pythia : pythia_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.
 [0, done, 1, param, 2, run, 3, pythia, 9, enter path, ... ][60s to answer]

Revision history for this message
Matthew Baumgart (baumgart-a) said :
#6

I understand now, thank you. I got this to work now.