.. _Tips and Tricks: ############### Tips and tricks ############### .. contents:: :local: .. _Shell completion: **************** Shell completion **************** Sherpa will install a file named ``$prefix/share/SHERPA-MC/sherpa-completion`` which contains tab completion functionality for the bash shell. You simply have to source it in your active shell session by running .. code-block:: shell-session $ . $prefix/share/SHERPA-MC/sherpa-completion and you will be able to tab-complete any parameters on a Sherpa command line. To permanently enable this feature in your bash shell, you'll have to add the source command above to your :file:`~/.bashrc`. .. _Rivet analyses: ************** Rivet analyses ************** .. index:: ANALYSIS_OUTPUT Sherpa is equipped with an interface to the analysis tool `Rivet `_. To enable it, Rivet and `HepMC `_ have to be installed (e.g. using the Rivet bootstrap script) and your Sherpa compilation has to be configured with the following options: .. code-block:: shell-session $ ./configure --enable-hepmc2=/path/to/hepmc2 --enable-rivet=/path/to/rivet (Note: Both paths are equal if you used the Rivet bootstrap script.) To use the interface, you need to enable it using the :option:`ANALYSIS` option and to configure it it using the :option:`RIVET` settings group as follows: .. code-block:: yaml ANALYSIS: Rivet RIVET: ANALYSES: - D0_2008_S7662670 - CDF_2007_S7057202 - D0_2004_S5992206 - CDF_2008_S7828950 The ``ANALYSES`` list specifies which Rivet analyses to run and the histogram output file can be changed with the normal ``ANALYSIS_OUTPUT`` switch. You can also use ``rivet-mkhtml`` (distributed with Rivet) to create plot webpages from Rivet's output files: .. code-block:: shell-session $ source /path/to/rivetenv.sh # see below $ rivet-mkhtml -o output/ file1.yoda [file2.yoda, ...] $ firefox output/index.html & If your Rivet installation is not in a standard location, the bootstrap script should have created a :file:`rivetenv.sh` which you have to source before running the ``rivet-mkhtml`` script. .. _HZTool analyses: *************** HZTool analyses *************** .. index:: ANALYSIS_OUTPUT Sherpa is equipped with an interface to the analysis tool `HZTool `_. To enable it, HZTool and `CERNLIB `_ have to be installed and your Sherpa compilation has to be configured with the following options: .. code-block:: shell-session $ ./configure --enable-hztool=/path/to/hztool --enable-cernlib=/path/to/cernlib --enable-hepevtsize=4000 Note that an example CERNLIB installation bootstrap script is provided in ``AddOns/HZTool/start_cern_64bit``. Note that this script is only provided for convenience, we will not provide support if it is not working as expected. To use the interface, enable it using the :option:`ANALYSIS` and configure it using the :option:`HZTool` settings group: .. code-block:: yaml ANALYSIS: HZTool HZTOOL: HISTO_NAME: output.hbook HZ_ENABLE: - hz00145 - hz01073 - hz02079 - hz03160 The ``HZ_ENABLE`` list specifies which HZTool analyses to run. The histogram output directory can be changed using the ``ANALYSIS_OUTPUT`` switch, while ``HZTOOL:HISTO_NAME`` specifies the hbook output file. .. _MCFM interface: ************** MCFM interface ************** .. index:: Loop_Generator Sherpa is equipped with an interface to the NLO library of `MCFM `_ for decdicated processes. To enable it, MCFM has to be installed and compiled into a single library, libMCFM.a. To this end, an installation script is provided in ``AddOns/MCFM/install_mcfm.sh``. Please note, due to some process specific changes that are made by the installation script to the MCFM code, only few selected processes of MCFM-6.3 are available through the interface. Finally, your Sherpa compilation has to be configured with the following options: .. code-block:: yaml $ ./configure --enable-mcfm=/path/to/mcfm To use the interface, specify .. code-block:: yaml Loop_Generator: MCFM in the process section of the run card and add it to the list of generators in :ref:`ME_GENERATORS`. Of course, MCFM's process.DAT file has to be copied to the current run directory. .. _Debugging a crashing/stalled event: ********************************** Debugging a crashing/stalled event ********************************** Crashing events =============== If an event crashes, Sherpa tries to obtain all the information needed to reproduce that event and writes it out into a directory named .. code-block:: text Status___