
This text presents  binary and script CalcHEP commands. 

s_calchep   - main CalcHEP code used for Feynman diagram generation, 
              their  symbolic calculation and presentation results 
              in  C, REDUCE, and MATHEMATICA formats. The user calls it 
              via ./calchep script.  
        

calc        - numerical scientific calculator. 
              Usage:  calc " formula"
              'formula'  can contains numbers and standard mathematic 
              functions. PI is user for pi constant.
              Example:      
              calc "sqrt(4*PI/128)"

      Export of LHAPDF structure functions
      ------------------------------------
      To make  LHAPDF structure functions  available in CalcHEP one has to
      define  environment variable  LHAPDFPATH  which should contains path to 
      LHAPDF libraries. In the same time there is an option to export PDF 
      tables of LHAPDF6 in CalcHEP format and use them without link to LHAPDF.
 lhapdf2pdt  LHAPDF6_DIR  
      transforms directory LHAPDF6_DIR into  LHAPDF6_DIR.pdt file. For instant
          lhapdf2pdt CT10  
      creates CT10.pdt file. Only PDF set corresponding to central value of distribution
      is exported. For other subsets use link with  LHAPDF library. CalcHEP  PDT files 
      should be disposed in CALCHEP/PDT directory.         
       


      Work with plots generated by CalcHEP.
      -------------------------------------
During numerical session CalcHEP generates two types of files which 
store histograms. distr_N contains all histograms which are calculated 
in  Monte Carlo sessions. N is the  number of session. tab_n.txt 
is a text file which presents single plot or histogram. Here 'n' doesn't 
corresponds to session number.  There are several programs which help 
to user to work with  plots produced by CalcHEP. In the examples presented 
below we assume that they are launched from directory 'results'


plot_view   - is used for graphical presentation of single plot generated by
CalcHEP:
             ../bin/plot_view  file_name 
There is a way to use GNUPLOT and PAW programs to display 'file_name'
family files  produced by CalcHEP. The corresponding code which 
should be moved to GNUPLOT and PAW scripts is marked by #GNUPLOT and #PAW 
correspondingly. 

show_distr - display all plots generated by Vegas.
             ../bin/show_distr distr_1 

sum_distr  - allows to create a sum of distributions obtained in precious
             numerical sessions. It is assumed that all this sessions have 
             the same list of outgoing particles. 
             ../bin/sum_distr distr_1 distr_2 distr_3 > dist_sum  
       

   Symbolic BATCH program s_blind
   ------------------------------
Has to be launched from user working directory
    ./bin/s_blind N Process Output
It select models 'N' form the list of available models,
calculates symbolically 'Process' and writes down results.
Process has not contains "*x" in specification of out particles 
as well as a composite input state. 'Output' has to be 'C , 'REDUCE', or 
'MATHEMATICA'. Example 
     ./bin/s_blind 1 "u,U->W+,W-" C
   
  Batches for numerical calculations  
  ----------------------------------
They are allow to continue numerical calculations in not-interactive, 
regime. These programs has to be launched from directory 'results'.
Being launched without parameters they explain  which parameters are expected 

   set_momenta   -changes momenta of incoming particles  
   set_param     -change value of one or several parameters 
   set_vegas     -set parameters of two loops Vegas  calculations:
                  it1,nCall1,it2,nCall2 nCubes. Note that parameters of second
                  loop can not be defined in graphic interface mode. The
                  parameters are stored in 'session.dat' file. nCubes fixed
                  number of sub-cubes used for fitting integrand for
                  subsequent  event generation.
 
   run_vegas     -launches Vegas Monte Carlo  session.  It makes it1 Vegas
                  sessions with nCall1 integrand calls in each session.
                  Interrelation grid is improved step by step. After that all
                  obtained results are discarded and next it2xnCall2
                  sessions are started to get the final results. If it2==0 
                  then only the firt cycle takes place.

   pcm_cycle     -organize Vegas cycle over momenta of center of mass.
   name_cycle    -organize Vegas cycle over some model parameter   
   gen_events    -launches generator of events.
   subproc_cycle -performs cycle over subprocess with events generation, 
                  summation of cross sections, and summation of histograms.
 
   par_scan      -cycle calculation for sets of parameters stored in file.
                  Call of program has to be done from the  directory '\results',
                  where exists compiled  executable file 'n_calchep'. It is assumed 
                  that cuts, scale,  structure functions, and parameters of 
                  integration are specified by the user in GUI mode.  
                  The data file should be passed as input 
                    $CALCHEP/bin/par_scan  < data_file 
                  Data file structure has to be
                       # Comments following the '#' symbol
                       par_name_1  par_name_2 ...   par_name_N & fun_name_1  fun_name_2 ... 
                         val11       val12    ....    val1N
                         val21       val12    ....    val1N
                       ........................
                  where 'par_name_#' present free parameters of the models. Among them 
                  one also can write momenta of incoming particles 'momentum1' and 
                  'momentum2'. 'fun_name_#' present names of constrained parameters which 
                  will be added to output.  Output file has the same structure as input file
                  but contains calculated  numerical values for  constrained parameters, an  
                  additional column for evaluated cross section with statistical error, 
                  and a column   which  specifies serial numbers of Monte Carlo sessions 
                  launched  for calculation. Presented cross section corresponds to sum over 
                  subprocesses.   If one would not like to control prt_# files  generated 
                  in  Monte Carlo sessions, then he can  call par_scan with 
                  additional parameter 'clean' 
                     $CALCHEP/bin/par_scan  clean < data_file
                  Then prt_# files will be deleted after session.
                  If during Monte Carlo session CalcHEP fills some distributions, then 
                  after  cycle over subprocesses they are collected in one file 
                  distr_#1-#2 where #1 and #2 are serial numbers of first and last sessions 
                  for given parametr set.  
                     If one includes "Widths" in list of costrained parameters, then CalcHEP
                     calculates particle widths and decay branging in SLHA format and save 
                  them in decaySLHA_#.txt files. The numerial value # is disposed in "Widths"
                  column.         

   make_main    script for compilation of  C-code which generates and uses
                squared matrix elements.

  Library generation
  -------------------
Two functions for generate libraries of matrix elements. They have to be
launched from 'results' directory after generation of C code.
 
  mkLibstat     - generates static library proclib_<suffix>.f where  in all 
                  global names _ext is replaced on _<suffix>. 'suffix' has to 
                  passed as a parameter.
  mkLibshared   - generates shared library proclib_<suffix>.so. 'suffix' again
                  is the first parameter of this command. The second parameter
                  has to be a destination of library in the runtime.  It can be 
                  omitted. 


 Fast test of generated events
 ----------------------------- 

events2tab      - reads  events generated by CalcHEP and creates a distribution
                  of some kinematic variable. The program needs the following 
                  parameters: 1- name of variable, 2- minimum limit,3- maximum
                  limit,4- number of bins(<=300). For example:
               ../bin/events2tab T3 1 100 200 < events_1.txt >tab.txt 
