Running MadGraph using a script

Asked by JamesB

Hello,

I think my issue is a simple problem related to running MadGraph using a script, which I need to do because I am submitting jobs through a batch system:

I have created a process (imported model, generated, outputted) and now want to generate events using this script:

<path>/bin/generate_events <path>/settings.txt

where settings.txt is:

pythia=ON
set ptj 250
set nevents 100

I'm looking at particular events with high transverse momentum.

But when I run this script the MadGraph interface doesn't use the information in the settings.txt file, and just displays the usual interface:

| 1. Choose the shower/hadronization program: shower = OFF
| 2. Choose the detector simulation program: detector = OFF
| 3. Run an analysis package on the events generated: analysis = No analysis tool interfaced to MG5aMC.
| 4. Decay particles with the MadSpin module: madspin = OFF
| 5. Add weights to events for different model hypothesis: reweight = OFF

A basic explanation of the best way to enter some simple parameters through a script would be appreciated. Copying the answers to previous questions doesn't seem to work for me. Thanks

Question information

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

Hi,

you should add in your script a line (at the top of the file)
generate_events

and then run it like this:
> <path>/bin/madevent <path>/settings.txt

./bin/generate_events is actually a script with some shortcut to ./bin/madevent which is designed to be retro-compatible with the old script which was present in MG4.

Cheers,

Olivier

> On Nov 13, 2017, at 16:42, JamesB <email address hidden> wrote:
>
> New question #660694 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/660694
>
> Hello,
>
> I think my issue is a simple problem related to running MadGraph using a script, which I need to do because I am submitting jobs through a batch system:
>
> I have created a process (imported model, generated, outputted) and now want to generate events using this script:
>
> <path>/bin/generate_events <path>/settings.txt
>
> where settings.txt is:
>
> pythia=ON
> set ptj 250
> set nevents 100
>
> I'm looking at particular events with high transverse momentum.
>
> But when I run this script the MadGraph interface doesn't use the information in the settings.txt file, and just displays the usual interface:
>
> | 1. Choose the shower/hadronization program: shower = OFF
> | 2. Choose the detector simulation program: detector = OFF
> | 3. Run an analysis package on the events generated: analysis = No analysis tool interfaced to MG5aMC.
> | 4. Decay particles with the MadSpin module: madspin = OFF
> | 5. Add weights to events for different model hypothesis: reweight = OFF
>
> A basic explanation of the best way to enter some simple parameters through a script would be appreciated. Copying the answers to previous questions doesn't seem to work for me. Thanks
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
JamesB (jamesb8) said :
#2

Hi Oliver,

I get this back:

./jobscript.sh: line 4: generate_events: command not found

Am I missing something?

Thanks
James

Revision history for this message
JamesB (jamesb8) said :
#3

Thanks Olivier Mattelaer, that solved my question.