How to run MG and ME using a bash script

Asked by Flip

Greetings, I'd like to be able to do batch runs of MadGraph and MadEvent. I'd like to be able to use the bash command line to run a script which will generate a process and then run Pythia and PGS on the resulting sample.

I have copied the template directory an modified:
param_card.dat,
proc_card.dat,
pythia_card.dat, and
pgs_card.dat.

However, when I run ./generate_events, I still have to manually interact with the MG interface to specify which programs I want to run. This prevents me from scripting my parameter space scan.

Is there a way to run Pythia and PGS on the parton-level data without me having to actually work inside the MG interface to tell it to run Pythia and PGS?

Update: is it correct that MadGraph will default, for example, to running Pythia/PGS so long as the pythia_card.dat and pgs_card.dat exist in the /cards directory? If so, is there a way to get rid of the 60 second timer? (I know I can edit the 60s timer in the MG settings---but I wanted something that would only affect this batch run.)

Thanks,

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

I think that the options that you want to look for is
./bin/generate_events -f
(or from the mg5 interface launch -f)
the -f options prevent that the code ask you any question (default are automatically taken)

Otherwise you have the access to ./bin/madevent
where you have access to a series of functions. (like pythia, pgs, plot, …)
As for MG5, you can pass a file to bin/madevent with the list of command
that you want to use.

In order to make a scan I would advise to use the bin/madevent script.
For example if the content of the file me5.cmd is
#First generation
generate_events
    set MT 175 #answer to the edition of the file
    set WT Auto #answer to the edition of the file
#Second generation
generate_events
    set MT 180
    set WT Auto #answer to the edition of the file

the you can run this by typing in a shell
./bin/madevent me5.cmd
and you will have two generation one, with the top mass at 175 and the second at 180.
In each case the top width will be recomputed according to the top mass.
(Carefull that only 2 body decay are taken into account. i.e. this is not valid for the higgs)

Cheers,

Olivier

On May 17, 2013, at 2:01 PM, Flip <email address hidden> wrote:

> New question #229140 on MadGraph5:
> https://answers.launchpad.net/madgraph5/+question/229140
>
> Greetings, I'd like to be able to run MadGraph and MadEvent from the bash command line so that I can run a script which will generate a process and then run Pythia and PGS on the resulting sample.
>
> I have copied the template directory an modified:
> param_card.dat,
> proc_card.dat,
> pythia_card.dat, and
> pgs_card.dat.
>
> However, when I run ./generate_events, I still have to manually interact with the MG interface to specify which programs I want to run. This prevents me from scripting my parameter space scan.
>
> Is there a way to run Pythia and PGS on the parton-level data without me having to actually work inside the MG interface to tell it to run Pythia and PGS?
>
> Thanks,
>
> --
> You received this question notification because you are a member of
> MadTeam, which is an answer contact for MadGraph5.

Revision history for this message
guy pitman (guy-pitman) said :
#2

I tried /bin/madevent me5.cmd from within the PROC_ directory (created after a launch of the process) to run a batch of jobs as described above but got the error

Command "import command ME0.cmd" interrupted in sub-command:
"set MXi 1.3e+01" with error:
InvalidCmd : Possible options for set are ['stdout_level', 'fortran_compiler', 'timeout']

I cant see how it is possible to automatically run a batch of jobs with different parameters- is this possible?

Thanks and Regards

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

Hi,

Did you put the command in the correct order? I would guess no.
You have to have first "generate_events" and AFTER the associate set command to modify the cards.

If this is not clear, please attach your card and I will take a look.

Cheers,

Olivier

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

Just to comment more,

Now the "Auto" option includes also the Three (and more) body decay (see arXiv:1402.1178).
But this is still not ok for the Higgs in the SM due to the loop induced decay (h > g g and h > a a )

Cheers,

Olivier

Revision history for this message
guy pitman (guy-pitman) said :
#5

This answered my question- thanks

Can you help with this problem?

Provide an answer of your own, or ask Flip for more information if necessary.

To post a message you must log in.