Skip to content
5 changes: 5 additions & 0 deletions pinecards/ATLAS_WP_7TEV_MATRIX/distribution.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionname = etal
distributiontype = abseta
particle 1 = lep 1
binningtype = irregular
edges = 0.0:0.21:0.42:0.63:0.84:1.05:1.37:1.52:1.74:1.95:2.18:2.5
84 changes: 84 additions & 0 deletions pinecards/ATLAS_WP_7TEV_MATRIX/model.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
##########################
# MATRIX model parameter #
##########################

#--------\
# masses |
#--------/
Block MASS
1 0.000000 # M_d
2 0.000000 # M_u
3 0.000000 # M_s
4 0.000000 # M_c
5 0.000000 # M_b
6 1.725000e+02 # M_t
11 0.000000 # M_e
12 0.000000 # M_ve
13 0.000000 # M_mu
14 0.000000 # M_vm
15 1.777000e+00 # M_tau
16 0.000000 # M_vt
23 91.1535 # M_Z
24 80.352 # M_W
25 1.250000e+02 # M_H

#-------------------\
# inputs for the SM |
#-------------------/
Block SMINPUTS
1 1.280000e+02 # 1/alpha_e(MZ)
2 1.1663787e-5 # G_F
111 1.370360e+02 # 1/alpha_e(mu->0)

#------------------\
# Yukawa couplings |
#------------------/
#Block YUKAWA
# 5 4.750000e+00 # M_YB
# 6 1.730000e+02 # M_YT
# 15 1.777000e+00 # M_YTAU

#---------------\
# decays widths |
#---------------/
DECAY 6 1.37758 # WT
DECAY 23 2.4943 # WZ
DECAY 24 2.084 # WW
DECAY 25 4.07468e-3 # WH

#-----------\
# EW inputs |
#-----------/
Block EWINPUTS
1 1 # ew_scheme - determines scheme used for EW inputs
# 0: alpha_e_0 scheme (alpha_e(mu->0) above used to determine inputs)
# 1: G_mu scheme (G_F above used to determine inputs)
# 2: alpha_e_MZ scheme (alpha_e(MZ) above used to determine inputs)
3 1 # use_cms - switch for the complex mass scheme
# 0: off
# 1: on
# 2: on, but alpha_e is determined through real parameters


# NOTE: You can use EITHER Block CKM (full CKM) OR Block VCKMIN (1./2. generation mixing with Cabibbo angle).
# The other one must be removed/commented. If you remove/comment both blocks a trivial CKM (no mixing) is used.

#------------\
# CKM matrix |
#------------/
Block CKM
11 0.974170e+00 # V_ud
12 0.224800e+00 # V_us
13 0.004090e+00 # V_ub
21 0.220000e+00 # V_cd
22 0.995000e+00 # V_cs
23 0.040500e+00 # V_cb
31 0.008200e+00 # V_td
32 0.040000e+00 # V_ts
33 1.009000e+00 # V_tb

#---------------\
# Cabibbo angle |
#---------------/
#Block VCKMIN
# 1 0.227000e+00 # Cabibbo angle
126 changes: 126 additions & 0 deletions pinecards/ATLAS_WP_7TEV_MATRIX/parameter.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
##########################
# MATRIX input parameter #
##########################

#----------------------\
# General run settings |
#----------------------/
process_class = pp-epve+X # process id
E = 3500.0 # energy per beam
coll_choice = 1 # (1) PP collider; (2) PPbar collider
switch_PineAPPL = 1 #
use_TSV = 1 # switch to use new TSV scale variation instead of CV (1) or in addition to CV (2)
extrapolate_binwise = 1 # switch for bin-wise r_cut extrapolation of distributions
photon_induced = 1 # switch to turn on (1) and off (0) photon-induced contributions
enhance_tails = 0 # switch to improve statistics in tail of distributions (a factor of two slower)
approx_ckm_EW = 1 # trivial CKM for (1) 1-loop EW correction or (2) whole NLO EW correction


#----------------\
# Scale settings |
#----------------/
scale_ren = 80.352 # renormalization (muR) scale
scale_fact = 80.352 # factorization (muF) scale
dynamic_scale = 0 # dynamic ren./fac. scale
# 0: fixed scale above
# 1: invariant mass (Q) of system (of the colourless final states)
# 2: transverse mass (mT^2=Q^2+pT^2) of system (of the colourless final states)
factor_central_scale = 1 # relative factor for central scale (important for dynamic scales)
scale_variation = 1 # switch for muR/muF uncertainties (0) off; (1) 7-point (default); (2) 9-point variation
variation_factor = 2 # symmetric variation factor; usually a factor of 2 up and down (default)


#------------------------------\
# Order-dependent run settings |
#------------------------------/
# LO-run
run_LO = 1 # switch for LO cross section (1) on; (0) off
LHAPDF_LO = NNPDF31_nnlo_as_0118_luxqed # LO LHAPDF set
PDFsubset_LO = 0 # member of LO PDF set
precision_LO = 1.e-2 # precision of LO cross section

# NLO-run
run_NLO_QCD = 0 # switch for NLO QCD cross section (1) on; (0) off
run_NLO_EW = 0 # switch for NLO EW cross section (1) on; (0) off
LHAPDF_NLO = NNPDF31_nnlo_as_0118_luxqed # NLO LHAPDF set
PDFsubset_NLO = 0 # member of NLO PDF set
precision_NLO_QCD = 1.e-2 # precision of NLO QCD cross section
precision_NLO_EW = 1.e-2 # precision of NLO EW correction
NLO_subtraction_method = 1 # switch to use (2) qT subtraction (1) Catani-Seymour at NLO

# NNLO-run
run_NNLO_QCD = 0 # switch for NNLO QCD cross section (1) on; (0) off
add_NLO_EW = 0 # switch to add NLO EW cross section to NNLO run (1) on; (0) off
# note: can be added only if also running NNLO
LHAPDF_NNLO = NNPDF31_nnlo_as_0118_luxqed # NNLO LHAPDF set
PDFsubset_NNLO = 0 # member of NNLO PDF set
precision_NNLO_QCD = 1.e-2 # precision of NNLO QCD cross section
precision_added_EW = 1.e-2 # precision of NLO EW correction in NNLO run
power_corrections = 0 # switch to include leading power corrections in qT-subtraction through recoil
# (incomplete for processes involving photons and heavy quarks)
# (note: increases written output for distributions by factor of 8)
# (TSV variation that has more flexibility and features, and will become the new
# standard in future releases; the final result output differs slightly from CV,
# but contains at the moment the identical information, unless obove switch
# power_corrections or extrapolate_binwise is turned on, then TSV variation will
# be used regardless of setting use_TSV and those features included in the results)


#----------------------------\
# Settings for fiducial cuts |
#----------------------------/
# Jet algorithm
jet_algorithm = 3 # (1) Cambridge-Aachen (2) kT (3) anti-kT
jet_R_definition = 0 # (0) pseudo-rapidity (1) rapidity
jet_R = 0.4 # DeltaR

# Photon recombination (lepton dressing)
photon_recombination = 1 # switch for photon recombination (1) on; (0) off; must be on for EW runs
photon_R_definition = 0 # (0) pseudorap; (1) rapidity
photon_R = 0.1 # DeltaR: photon combined with charged particle when inside this radius

# Jet cuts
define_pT jet = 25. # requirement on jet transverse momentum (lower cut)
define_eta jet = 4.5 # requirement on jet pseudo-rapidity (upper cut)
define_y jet = 1.e99 # requirement on jet rapidity (upper cut)
n_observed_min jet = 0 # minimal number of observed jets (with cuts above)
n_observed_max jet = 99 # maximal number of observed jets (with cuts above)

# Lepton cuts
define_pT lep = 25.0 # requirement on lepton transverse momentum (lower cut)
define_eta lep = 2.5 # requirement on lepton pseudo-rapidity (upper cut)
define_y lep = 1.e99 # requirement on lepton rapidity (upper cut)
n_observed_min lep = 1 # minimal number of observed leptons (with cuts above)
n_observed_max lep = 99 # maximal number of observed leptons (with cuts above)

# Neutrino cuts
define_pT missing = 25.0 # requirement on transverse momentum of sum of all neutrinos (lower cut)

####################
# User-defined cuts
# (only used if defined in 'MATRIX/prc/$process/user/specify.cuts.cxx')
#
user_switch MT_W = 1 # switch for transverse mass cut on W-boson defined as sqrt(2*pT_l*pT_nu*deltaPhi(l,nu))
user_cut min_MT_W = 40. # (lower cut)

####################
# Fiducial cuts
# (defined via general interface)
#

#-----------------\
# MATRIX behavior |
#-----------------/
max_time_per_job = 12 # very rough time(hours) one main run job shall take (default: 24h)
# unreliable when < 1h, use as tuning parameter for degree of parallelization
# note: becomes ineffective when job number > max_nr_parallel_jobs
# which is set in MATRIX_configuration file
switch_distribution = 1 # switch to turn on (1) and off (0) distributions
save_previous_result = 1 # switch to save previous result of this run (in result/"run"/saved_result_$i)
save_previous_log = 0 # switch to save previous log of this run (in log/"run"/saved_result_$i)
#include_pre_in_results = 0 # switch to (0) only include main run in results; (1) also all extrapolation (pre) runs;
# crucial to set to 0 if re-running main with different inputs (apart from precision)
# note: if missing (default) pre runs used if important for precision
# (separately for each contribution)
reduce_workload = 0 # switch to keep full job output (0), reduce (1) or minimize (2) workload on slow clusters
random_seed = 0 # specify integer value (grid-/pre-run reproducible)
1 change: 1 addition & 0 deletions pinecards/ATLAS_WP_7TEV_MATRIX/process
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ppexne02
104 changes: 104 additions & 0 deletions run_matrix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash -x

set -euo pipefail

if [[ $# -lt 2 ]]; then
echo >&2 "usage: ./run_matrix MATRIXDIR DATASET"
exit 1
fi

matrix_dir=$1
card_dir=pinecards/$2
cwd=$2-$(date +%Y%m%d%H%M%S)

if [[ ! -d ${card_dir} ]]; then
echo >&2 "card directory doesn't exist"
exit 1
fi

card_dir=$(cd "${card_dir}" && pwd)

if [[ ! -x ${matrix_dir}/matrix ]]; then
echo >&2 "matrix binary not found"
exit 1
fi

if [[ ! -f ${matrix_dir}/config/MATRIX_configuration ]]; then
# copy the default configuration file if there isn't any yet
cp ${matrix_dir}/config/MATRIX_configuration_default ${matrix_dir}/config/MATRIX_configuration
fi

# we need to add the path to PineAPPL
sed -i "s:#path_to_pineappl .*:path_to_pineappl = $(pkg-config --variable=prefix pineappl_capi):" \
${matrix_dir}/config/MATRIX_configuration

process=$(cat "${card_dir}"/process)

# if the process hasn't been compiled, we have to do that before we can run the process
if [[ ! -x ${matrix_dir}/bin/${process} ]]; then
cd ${matrix_dir}
./matrix --agree_to_all ${process}
cd -
fi

mkdir "${cwd}"
cd "${cwd}"
# we need an absoute path here
cwd=$(pwd)

cd ${matrix_dir}/run/${process}_MATRIX

last_run=0

if [[ -d log ]]; then
cd log
# log files aren't cleaned, so we should avoid overwriting those. Pick the last
# log file with an integer in its name
last_run=$(for i in run_*.log; do
i=${i#run_}
i=${i#0}
i=${i#0}
i=${i%.log}
if [[ $i =~ ^[0-9]+$ ]]; then
echo $i
fi
done | sort -n | tail -n1)
cd -
fi

# increase the integer found by one and pad with zeros
run_dir=run_$(printf "%03d" $(( $((last_run)) + 1)))

mkdir -p input/${run_dir}

# copy input files
cp "${card_dir}"/{distribution,model,parameter}.dat input/${run_dir}/

# run MATRIX
bin/run_process --run_mode run ${run_dir}

# copy results
bin/run_process --run_mode tar_run ${run_dir}

# clean up
bin/run_process --run_mode delete_run ${run_dir}

# copy the tar'ed results
mv ${run_dir}.tar "${cwd}"/

cd "${cwd}"

# TODO: we assume that only one distribution is generated by MATRIX
distribution_name=$(sed -nE 's/distributionname[[:space:]]*=[[:space:]]*//p' "${card_dir}"/distribution.dat)

# extract the grid with the highest order
for order in NNLO NLO LO; do
# TODO: this won't work with EW corrections
file="result/${run_dir}/${order}-run/PineAPPL_grids/${distribution_name}_${order}.QCD.lz4"

if tar tf ${run_dir}.tar | grep ${file} >/dev/null; then
tar xf ${run_dir}.tar ${file} --strip-components 4
mv ${distribution_name}_${order}.QCD.lz4 $2.pineappl.lz4
break
fi
done