Skip to content
Snippets Groups Projects
Carl Mikael Berggren's avatar
Carl Mikael Berggren authored
Updating comments in .steer files to better reflect the options,

See merge request mikael.berggren/sgv!9
e781bad0
History
  This is Simulation a Grande Vitesse (SGV) v 3 
  ===================================================

    Main author: Mikael Berggren, DESY-Hamburg
    mail: mikael dot berggren at desy dot de

 Documentation: Created by installing SGV

 Language: Fortran08

 Over-all structure after installing:

  a top-directory (where this README is). It's name will be in the environment variable 
    SGV_DIR. Contains the installation script, the script to recompile libraries, and
    the script to compile and link the user's program.
    After installation, a script setting up the environment variables is created, to
    be sourced.
    It also contains template user-routines and steering-files, and the user's guide
    
  a sub-directory with 6 libraries, it's name will be in the environment variable SGV_LIB:
    sgvlib    : core.
    sgvdeflib : sensible defaults for some routines the user
                might want to alter.
    sgvdumlib : no-op defaults for some routines the user
                might want to alter.
    mod       : all interface modules.
    sgvmodule : binaries of interface-blocks.
    c_f_fieldconverterlib : helper-functions for C(++)-fortran communication,
                 in particular how to handle STL-containers.
		 

  a sub-directory (src) with source-code:
     sgvdeflib, sgvdumlib, sgvlib, sgvmodule and  c_f_fieldconverterlib: 
                 source of the libraries.
     sgvevsim : code to interface to various event-generators
     sgvinclude : .h files to interface to external Fortran77 code.
     sgvnews  : empty directory for upgrades (for backward compatibility)
     sgvuser  : the routines a user might want to modify.

  a sub-directory (samples) with more elaborate examples. Also contains
   scripts to aid to install various external packages, that might be
   useful.

  If requested, a user-named sub-directory (default: tests) is created and
  filled with example code. This directory could be "cp -a":ed as a starting
  point for any user.
   
  
Obligatory environment:
======================

  Fortran08 compiler, assumed to be gfortran (but other compilers probably
  also work)

  The system libraries blas and lapack . Install with your package-manager before attempting to run install.
  
  IMPORTANT note for *RedHat-EL9* and *ALMA9*: At the time of writing, there is an error in the configuration
  of the shared lapack and blas libraries, such that the 64bit versions will always be loaded, even if
  the 32bit ones are requested - as is the case for SGV. Do:

  . samples/ld_preload_for_el9

  to force pre-loading the 32bit libraries

  git client.

  Pythia6 (searched for under the value of PYTHIA_DIR, or if that is not set using the
           locate command). This is needed *even* *if* Pythia6 is not going to be used
	   as an event generator: SGV uses several Pyhtia6 tools internally. If you do
	   not have a Pythia6 installation, proceed as follows, before running the install
	   script:

              cd samples
	      bash ./install-pythia ../
	      . ./install-pythia ../ "" env
	      cd ..

              (the first argument is the directory under which pythia will be installed, so "../" is just
	       an example. Note that a tool needed for the installation is managed on GitHub, so you need
	       to have a git-client.)

Useful environment:
===================

  stdhep libraries *if* STDHEP input of generated events is needed.
    If you need that, but don't have stdhep, install it using the
    script install-stdhep in the samples-sub-directory - it is easy
    and fast. 

  LCIO libraries *if* LCIO I/O is needed.
  
  HepMC (v2 or 3) libraries *if* HepMC I/O is needed.

  CERNLIB if usage of HBOOK and/or ZEBRA is desired.

  ROOT if creation of root histos and/or ntuples is desired.

  Scripts for installation of STDHEP, PYTHIA6 and CERNLIB, and of
  the fortran-to-C++ glue for ROOT, LCIO and HepMC can be found in the
  "samples" sub-directory.

  There is no need to decide directly which of the optional components you
  might need in the future. They can easily be installed later, by simply
  doing  'bash makesgvlibs lib' again, once the components are there.
  The script knows what needs to be done.

  pandoc to create the User's guide during installation. 

To install:
===========

  
Do (if your default shell is not bash, it is recommended to start a bash shell (just type "bash<CR>"),
before executing the following):

. ./install

Answer the questions:

 [Depending on whether STDHEP/CERNLIB/ROOT/LCIO is found, some further questions
  might be made before the following ones]

 install tests (y/n) ?  : 
      default is y. Do that.
 
 directory for tests ? (default ./tests). 
      Accept default.

 Make libraries (y/n) ? : 
      default is y. Do that.
 
 Directory for libraries ? : 
      default is lib. Accept that.

 Compile options ? : 
      Reasonable default is defined. Accept that.
      NOTE: if you *do* give an option here, compilation 
      will be at the default optimisation level (0 for gfortran), not 
      the SGV default (fast), so you probably want to give -Ofast, as well in 
      that case.
 
The last step is the compilation of the libraries. 


Now do
 . ./sgvenv.sh  (or source sgvenv.csh under the c-shell)

The libraries, documentation and test sub-directory are now set up,
as well as the environment variables SGV_DIR, SGV_LIB and STDHEP_DIR. The
environment variables indicating the status of StdHep, Root and/or
Cernlib support are also set, and $SGV_DIR is added to the PATH.
[NB. if libraries are recompiled with changed settings, SGV_LIB is
updated in sgvenv.sh, but *not* other settings, so after a library
recompilation, it might be a good idea to check if the settings
are still correct. This will be automated in a future release]


Note that documentation refers to the old fortran77 + PATCHY version
in the details. However, the logic and the mathematics are the same,
as is the format of the detector-geometry file, so it is still useful 
(this will be fixed in a future release).

You can now do

 cd tests/


and then

 cresgvexe merge sgvuser

Then, if Root is used

 ./sgvass.sh basic
 root -b sgv_ex.C
 ./sgvuser.exe

Look at the result with

 root -l  basic_sgv.root  


The test produces 1000 Pythia  MSUB=25 events (ie. ee->WW->qqqq) at 500 GeV 
in the ILD detector for ILC, and produces a few histograms. If all seems 
reasonable, and used not more than 10 seconds of CPU, or so, the 
installation is OK.

If Root was not active during installation, the test
still works, but as no plots are done, it's less interesting...
It will, however, show that the SGV part woks - events are generated
and simulated.

Further, more interesting, examples can be found in the samples sub-directory. 
Study the README in that directory to see what is available: whizard-integration,
LCIO input/output (including creating LCIO DSTs), stdhep-input/output, HepMC input/output
detector performance plots, ... 


                            /MB. 2024-08-05