             I. Compilation

The program is compiled by the script "comp_Orsay-u20.sh". My version of the program uses only two external libraries: CUBA and LHAPDF (Liza's one uses also LoopTools). 

The installation of LHAPDF in /projet/pth/lhapdf/LHAPDF-6.2.1-installed/lib/ is used by the program, so you do not have to install LHAPDF.

 One have to install the CUBA library. Currently the path to my installation of CUBA is present in the script:

/homeijclab/nefedov/cuba-4.2.1_U20/lib

one should install the version 4.2.1 of CUBA and put the path to the library instead of the path above.  

The installation of CUBA is very easy. You download:

https://feynarts.de/cuba/Cuba-4.2.tar.gz

then cd to the directory and run

./configure --prefix=/name/of/the/directory/to/install/the/CUBA/into

where you should specify where to install the library if you do not have admin rights to install it to the usual place (/usr/local/lib or what is it...). Then you run

make
make install

then, after replacing the /homeijclab/nefedov/cuba-4.2.1_U20/lib with the /name/of/the/directory/to/install/the/CUBA/into in the script comp_Orsay-u20.sh, the program should compile. The executable is called: CS_3S11_NLO

             II. Runnung
   
   Before executing the program for the first time in the session, one should set up the environment variables for LHAPDF. This is done by running (in bash environment):

   source ./set_LHAPDF_Orsay.sh
   
   It is also wise to tell the CUBA on how many cores it should compute, otherwise it will occupy all available cores on the machine. My usual setting is:
   
   export CUBACORES=30
   
   Then executing ./CS_3S11_NLO results into:
  
        PROGRAM FOR CALCULATION OF
             DIFFERENTIAL CS
       gamma+g -> QQbar[3S1^1] + X
       gamma+q -> QQbar[3S1^1] + X
    FROM PRE-COMPUTED SCALING FUNCTIONS
     v. 1; M.N., Aug. 2022 - Aug. 2023 
 Use --help for help on input-file syntax.
 pi=   3.1415926535897931     
 ERROR: No input file. 
 
   Executing:
   ./CS_3S11_NLO --help
   
   provides a short help on input-file commands. I will not reproduce it here. I was trying to keep it up to date, so there should be no things which do not work in there. But not everything which works might be documented. In particular there is more scale-choice options than 0 and 1. See SUBROUTINE SET_SCALES in src/CS_3S11_NLO.F . 
   
   For the typical run one uses the input file:
   
   ./CS_3S11_NLO ./input/my-input.in
   
   The extension .in is optional, can be anything.
   
             III. Input file
   
   An input file consists of keywords, which are case-sensitive and should be written exactly as in --help, and values of parameters, which are separated from the keywords by at least one blank. One keyword per line is allowed. The lines starting with # are comments. The keyword END in the last line of the file is mandatory. If program runs into an un-familiar keyword it is terminated with an error. If some parameter is not set, it's value is set to some reasonable default, which are summarized in the src/input_params.F where all the code which reads the input file is present. The order of keywords in the input file is arbitrary.
   
   Examples of input files are provided in input_examples directory. The files in input directory should be used with caution, because there is a lot of files which where created for test purposes. 
   
   For example, let's go through the file test_NLO-ep_pT.in . It starts with initialization for the scaling-function grids:

VIRT_GRID "tables/C1_ga+g_virt_tab-04.dat"
REAL_GRID_G "tables/C1_ga+g_real_xi-rz_patched"
N_PROC_G 1
REAL_GRID_Q "tables/C1_ga+q_real_xi-rz_patched"
N_PROC_Q 1
VIRT_GRID_OLD "tables/C1_ga+g_virt_tab-04.dat"
REAL_GRID_G_OLD "tables/C1_ga+g_real_tab-04.dat"
REAL_GRID_Q_OLD "tables/C1_ga+q_real.dat"
ETA_MIN_OLD 50.0
ETA_MIN_ASY 250.0

!!! Please check that in all input files you use, these commands are present !!!

Then several lines starting with the keyword TASK are present, which specify what the program will compute. To compute the complete NLO result one should have:

TASK DSIG_LO
TASK DSIG_NLO_VIRT
TASK DSIG_NLO_DIP-PLUS
TASK DSIG_NLO_REAL+DIP
TASK DSIG_NLO_ASY

while to have only LO one should have only the

TASK DSIG_LO

The program performs each task separately, saves the results into files with extensions *.tsk1, *.tsk2, etc. and then adds up all the results and performs the scale-uncertainty analysis, outputting the final result into the file with extension *.sum . Usually the sum files are the only ones which are needed. All output files are dumped into the "output" directory, which is quite clogged now, you can delete all it's contents. The program automatically writes a gnuplot script and runs gnuplot to make plots for all intermediate tasks and the sum.   

The PDF from LHAPDF is chosen by the keyword

PDF "CT18NLO"

the keyword

CHANNELS "0g 0q"

means that both channels: gamma+g and gamma+q are added. 

SCALE_CHOICE 1

means the central scale choice muR=muF=M_T.  See SUBROUTINE SET_SCALES in src/CS_3S11_NLO.F for other options. 
   
MUR_FIX 10.0

overrides the previous scale choice and sets the central value of muR=10 GeV .

*** THE COLLIDING PARTICLES are selected by setting one of the collision energies non-zero:

   SQRTS-GP : ga+p c.o.m. energy (GeV)
   SQRTS-EP : e+p  c.o.m. energy (GeV) in WW appr.
   SQRTS-EE : e+e- c.o.m. energy (GeV) in WW appr. for single-resolved production computation

   Only one of these energies should be set nonzero!!!

   One can set various cuts, like:
   
   ZCUTS 0.3 0.9
   SQRTS-GP_CUTS 60 80

   See --help .
   
*** THE SPECTRUM VARIABLE is selected by the keyword PLOTVAR . Possible options are:

    PT (GeV) or PT2 (GeV^2)
    Z
    Y_EE (rapidity in the c.m.s. of e^+e^-, very slow for NLO)
    SQRT-SGP
    SQRT-SEP
    ETA (=(shat-M^2)/M^2)
    RHO (=pT^2/M^2)
    x (for PDF plot only)
 
    one can specify minimal, maximal value of the plot variable and number of points as in:
   PLOT_MIN 0.1
   PLOT_MAX 14
   N_PLOT 19
   
   The keyword  LOG_PLOT means that the spacing of the plot points is logarithmic, if it is not present, the spacing will be linear. 
   
   The keyword OUTPUT sets the beginning of the output file names (before extensions, see examples in the "output" directory).
   
   The keyword CUBA_VERBOSE will print the stats for each iteration of the CUBA integration. It is needed only for debugging. 
   
   The keyword END is mandatory.
    
 
