------------------------------------------------------------------------ | | MCGEN, v1.0 June 2016 | A C++ program for generation of PDF Monte-Carlo replicas | and algebraic operations with LHAPDF6 grid files | Authors: Jun Gao, Pavel Nadolsky | (jgao@anl.gov, nadolsky@smu.edu) | | http://metapdf.hepforge.org/mcgen | | Developed in the following publications: | arXiv:1401.0013 (Combination of PDF ensembles, META PDFs) | arXiv:16XX.XXXX (Monte-Carlo replicas from Hessian PDF ensembles) | ------------------------------------------------------------------------ | | USAGE guidelines | ------------------------------------------------------------------------ MCGEN is a C++ program for generation of Monte-Carlo replicas for parton distribution functions and various operations with PDFs stored in the format of LHAPDF6 grid files, such as addition, averaging, and multiplication. MCGEN can be used as a standalone program or together with the Mathematica package MP4LHC for combination of PDF ensembles according the meta-parametrization method. System requirements ------------------- MCGEN requires the LHAPDF6 library and headers, and BOOST library headers. The LHAPDF6 library can be downloaded from http://lhapdf.hepforge.org. The headers for BOOST functions can be often installed as a part of the development packages for BOOST, such as libboost-all-dev on Ubuntu or boost-devel on Scientific Linux 6. MCGEN needs to find LHAPDF grids of the input PDF ensemble. This can be done by putting the input LHAPDF grids into the default directory of the LHAPDF library, into the current directory, or by specifying the directory with the grids inside the environmental variable LHAPDF_DATA_PATH. Structure of the code -------------------- src/mcgen.x -- main executable Reads ninput PDF sets from the input LHAPDF6 grids. If the input PDFs are Hessian, nmc output replicas are generated by random displacements of the input replilcas. If the input PDFs are Monte-Carlo ones, nmc input replicas are just copied into the output replicas. The x values, Q values, and random displacement values are read from input files in the ../inc directory: xgrid-xxx.dat, qgrid-xxx.dat, randnum_xxx.dat, etc. Optionally, a parameter nstart can be passed to force generation to begin from the nstart-th replica in the (always hard-wired) random sequence. *.sh: top-level bash scripts for various applications h2mc.sh (recommended for most users) -- a simple script to generate Monte-Carlo replicas from a Hessian eigenvector PDF set using linear, logarithmic, or Watt-Thorne sampling. Input and output PDF replicas are tabulated in the form of LHAPDF6 grid files. See description below. metamcrp.sh -- an advanced script for combination of PDF ensembles according to the meta-parametrization method *.card: steering cards for the scripts and mcgen.x inc/: templates and tables for producing final LHAPDF grids Compilation and execution ------------------------- Compilation option 1. Run one of the above Unix scripts. They will compile and execute the code. Paths to LHAPDF and BOOST are specified in the headers of the scripts. Example of usage: h2mc.sh generate mcgen.card Generate LHAPDF6 grids for random MC replicas generated from an input LHAPDF ensemble with Hessian error PDFs, reading the input parameters from mcgen.card. This will create a new subdirectory for the output MC replica ensemble specified inside mcgen.card. The input parameters are explained below. Compilation option 2. cd src/; make mcgen.x mcgen.x can perform additional low-level operations on individual .dat files Examples: mcgen.x average average.dat input1.dat input2.dat ... generate an LHAPDF6 file average.dat with a PDF that is equal to the average of the PDFs in input1.dat, input2.dat, ... mcgen.x add sum.dat input1.dat input2.dat w1 w2 generate an LHAPDF6 file sum.dat with a weighted sum of the PDFs in in input1.dat and input2.dat: f(sum) = w1*f(input1) + w2*f(input2) w1 and w2 are real numbers mcgen.x multiply prod.dat input1.dat input2.dat power1 power2 generate an LHAPDF6 file prod.dat with a product of the PDFs in in input1.dat and input2.dat, raised to powers w1 and w2, respectively f(prod) = f(input1)^w1 * f(input2)^w2 A sample mcgen.card =================== # Input parameters for mcgen program; do not modify comments after "#"! # Parameters for generation of random replicas CT14nnlo # input PDF ensemble from LHAPDF6 CT14MCnnlo-11 # output PDF ensemble, its directory with output he90 # input error type, he68/he90/mc=Hessian 68%/90%/MC 1000 # number of MC replicas to generate 1 # the ID of the first MC replica to generate -11 # ktype ../inc/xgrid-ct14.dat # grid with x values for output LHAPDF grids ../inc/qgrid-ct14.dat # grid with Q values for output LHAPDF grids NNLO # order of alpha_s (NLO/NNLO) 0.118 # alpha_s(MZ)=0.116, 0.117, 0.118, 0.119, or 0.120 Notes: 0. Do not modify comments beginning with "#"! 1. The error type for the initial PDF ensemble is either Hessian at 68% or 90%, or Monte-Carlo (in which case the input MC replicas are just converted into the output replicas on the requested x-Q grid) 2. The maximal number of final replicas is determined by the length of the file inc/randnum_gaussian.dat with random numbers from a standard normal distribution. Currently, up to about 3600 replicas can be generated for 60 Hessian parameters. 3. First Nskip replicas will be skipped by setting the ID of the first replica to (Nskip+1). 4. ktype determines the type of replica sampling. CT14 MC1 and MC2 PDFs correspond to ktype=-11 and -12, respectively. ktype=xy ktype > 0: symmetric errors ktype < 0: asymmetric errors y=1,2,3: linear/log/Watt-Thorne sampling x=0,1: unshifted/shifted 5. The order of PDF (NLO or NNLO) and alpha_s(MZ) value are only needed to produce the final YAML .info file. They are not necessary for generating .dat files. For each value of alpha_s(MZ), a table of alpha_s(Q) at arbitrary Q must be written into the .info file. Currently, template .info files are provided in inc/ for alpha_s(MZ)=0.116, 0.117, ..., 0.120. Additional templates for other alpha_s(MZ) can be included by the user if necessary.