.. _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 $ cmake -DHepMC3_DIR=/path/to/hepmc3 -DRIVET_DIR=/path/to/rivet (Note: Both paths are equal if you used the Rivet bootstrap script.) In the case that the packages are installed in standard locations, you can instead use ``-DSHERPA_ENABLE_HEPMC3=ON`` and ``-DSHERPA_ENABLE_RIVET=ON``, respectively. 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. Further Rivet options (especially for Rivet v3) can be passed through the interface. The following ones are currently implemented: .. code-block:: yaml ANALYSIS: Rivet RIVET: --analyses: - MC_ZINC --ignore-beams: 1 --skip-weights: 0 --match_weights: ".*MUR.*" --unmatch-weights: "NTrials" --nominal-weight: "Weight" --weight-cap: 100.0 --nlo-smearing: 0.1 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. If you want to employ custom Rivet analyses you might need to set the corresponding Rivet path variable, for example via .. code-block:: shell-session $ export RIVET_ANALYSIS_PATH=$RIVET_ANALYSIS_PATH: The `RIVET:` block can be used with further options especially suitable for detailed studies. Adding `JETCONTS: 1` will create separate histograms split by jet multiplicity as created by the hard process. `SPLITSH: 1` creates histograms split by soft and hard events, and `SPLITPM: 1` creates histograms split by events with positive and negative event weights. Finally, `SPLITCOREPROCS: 1` will split by different processes if multiple ones are specified in the runcard. .. _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, To enable it, MCFM has to be installed and compiled into a single library @code{libmcfm.so} by using the ``-Dwith_library=ON`` flag when configuring MCFM using CMake. Finally, your Sherpa compilation has to be configured with the following option: .. code-block:: yaml $ cmake -DMCFM_DIR=/path/to/MCFM Or, if MCFM is installed in a standard location: .. code-block:: yaml $ cmake -DSHERPA_ENABLE_MCFM=ON 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`. MCFM's process.DAT file should automatically be copied to the current run directory during intitialisation. Note that for unweighted event generation, there is also an option to choose different loop-amplitude providers for the pilot run and the accepted events via the ``Pilot_Loop_Generator`` option. .. _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___