How to make a parameter scan.

Created by Olivier Mattelaer on on 2015-10-26
Keywords:
scan
Last updated by:
Olivier Mattelaer on on 2016-02-25

MadGraph5_aMC@NLO 2.3.3 introduces a new method to performs a scan over parameter (only entry of the param_card can be handle by this new syntax, for run_card parameter scan, please see FAQ#2186).
This scan syntax is compatible with
1) LO generation (param_card.dat)
2) NLO generation (param_card.dat)
3) LO/NLO reweighting (reweighting_card.dat)

The main idea is that in the param_card instead of having the following line:
Block mass
    5 4.700000e+00 # MB
    6 1.730000e+02 # MT
you can put
Block mass
    5 4.700000e+00 # MB
    6 scan: [171, 173, 175] # MT

The above syntax is 100% equivalent to the following script: (see FAQ#2186)
launch
  set MT 171
launch
  set MT 173
launch
  set MT 175

Note:
1) A summary file with the cross-section for the various entry of the card will be created at the end of the run
2) if some width are set on "Auto" they will be re-computed for each point of the scan.
3) The above syntax launches three sequential run creating each of them an associate events file.
4) this options is compatible with scripting (i.e. "set MT scan:[171,173,175]" is supported at the same level as "set MT 171")
(see FAQ #2186)

###############################################################
# 2D scan
###############################################################
you can do
Block mass
    5 scan: [3,4,5,6] # MB
    6 scan: [171, 173, 175] # MT
and this will compute 12 (4*3) cross-sections

###############################################################
# 1D scan but changing more than one parameter
###############################################################
you can do
Block mass
    5 scan1: [3,4,5] # MB
    6 scan1: [171, 173, 175] # MT
and this will do three computation (for (mb=3, mt=171),(mb=4, mt=173),(mb=5, mt=175)

Note: You can use "scan2:", "scan3:", "scan4:", ... to have 2D (or more) scan with some synchronized parameter

###############################################################
# Advance use: use python function
###############################################################
want to scan over a parameter from 100 to 200Gev by step of 20 Gev,?
Block mass
    6 scan1: range(100,201,20) # MT
(range is a python function which do not include the upper bound)

want to make a log scale scan:
Block mass
    6 scan1: [10**i for i in range(1,5)]# MT

you can use the command range for example to scan over 5 dimension 6 operator having only one different of zero at the same time, you can do:
Block EWDIM6
  1 scan1: [1 if i==0 else 0 for i in range(5)]
  2 scan1: [1 if i==1 else 0 for i in range(5)]
  3 scan1: [1 if i==2 else 0 for i in range(5)]
  4 scan1: [1 if i==3 else 0 for i in range(5)]
  5 scan1: [1 if i==4 else 0 for i in range(5)]

Note: you CAN NOT make a function of other entry of the param_card