Script that runs Delphes twice

Asked by Jan Hajer on 2018-08-14

Hi,

is it possible to write a madgraph script that runs delphes twice for each point of a scan (with different delphes cards)?
Without having to generate the events twice?

Best,
Jan

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Hajer
Solved:
2018-08-16
Last query:
2018-08-16
Last reply:
2018-08-16

Sure.

if you run via "./bin/madevent"
then you can use the command
delphes run_01

Cheers,

Olivier

> On 14 Aug 2018, at 19:32, Jan Hajer <email address hidden> wrote:
>
> New question #672261 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/672261
>
> Hi,
>
> is it possible to write a madgraph script that runs delphes twice for each point of a scan (with different delphes cards)?
> Without having to generate the events twice?
>
> Best,
> Jan
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Jan Hajer (jan.hajer) said : #2

Hi,

but I run the scan via ./bin/mg5
do I have to call ./bin/madevent from within my script that I have passed to ./bin/mg5?

Best,
Jan

Hi,

from ./bin/mg5 interface, you can start the madevent interface via the command
launch -i

so you can do something like
generate p p > t t~
output
launch
shower=PY8
launch -i
delphes run_01

Cheers,

Olivier

> On 15 Aug 2018, at 21:23, Jan Hajer <email address hidden> wrote:
>
> Question #672261 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/672261
>
> Status: Answered => Open
>
> Jan Hajer is still having a problem:
> Hi,
>
> but I run the scan via ./bin/mg5
> do I have to call ./bin/madevent from within my script that I have passed to ./bin/mg5?
>
> Best,
> Jan
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Jan Hajer (jan.hajer) said : #4

Hi,

My script is based on https://answers.launchpad.net/mg5amcnlo/+faq/2186

    generate p p > t t~ j
    output MYDIRECTORY
    launch MYDIRECTORY
       set mt 170 # changing the top mass
       set wt Auto # changing the top width
       set ptj 40 # changing the ptj cut
   launch
       set mt 175 # changing the top mass
       set wt Auto # changing the top width
   launch
       set mt 180 # changing the top mass
       set wt Auto # changing the top width
   launch MYDIRECTORY -i
       print_results --path=./cross_section_top.txt --format=short

should I call 'launch -i' at every point?
And how do I specify the run_card for e.g. CMS and ATLAS before I call Delphes?

Best,
Jan

Hi,

My advise in general is that you try a simple run manually.
then write in a file all the command that you used to make it trough and then you are done with your script.
(That's how I do it)

> should I call 'launch -i' at every point?

You can see that in this example, you already call "launch -i" (the last but one line)
you can add all run to Delphes below that line

> launch MYDIRECTORY -i
> delphes run_01
> delphes run_02

> delphes run_03

> And how do I specify the run_card for e.g. CMS and ATLAS before I call Delphes?

The run_card is not used by Delphes, so you only have a single one,
you can either defined it via set ptj 40
or you can replace that line by the path to the file.

If you want to edit the Delphes card for the second run, you can either edit the file
via the "edit" command or by also by specifying the path

> launch MYDIRECTORY -i
> delphes run_01
> PATH/TO/Delphes_card2.dat
> delphes run_02
> #. no need to respecify the delphes_card here since it will take the last one used

> delphes run_03

Cheers,

Olivier

PS: Note that the above method is not efficient for large scan, since it has a leak in the number of thread used.

> On 15 Aug 2018, at 21:47, Jan Hajer <email address hidden> wrote:
>
> Question #672261 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/672261
>
> Status: Answered => Open
>
> Jan Hajer is still having a problem:
> Hi,
>
> My script is based on https://answers.launchpad.net/mg5amcnlo/+faq/2186
>
> generate p p > t t~ j
> output MYDIRECTORY
> launch MYDIRECTORY
> set mt 170 # changing the top mass
> set wt Auto # changing the top width
> set ptj 40 # changing the ptj cut
> launch
> set mt 175 # changing the top mass
> set wt Auto # changing the top width
> launch
> set mt 180 # changing the top mass
> set wt Auto # changing the top width
> launch MYDIRECTORY -i
> print_results --path=./cross_section_top.txt --format=short
>
> should I call 'launch -i' at every point?
> And how do I specify the run_card for e.g. CMS and ATLAS before I call Delphes?
>
> Best,
> Jan
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Jan Hajer (jan.hajer) said : #6

thanks!