Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangWaltenberger committed Dec 18, 2023
2 parents 076dc21 + 3ce1d82 commit 5d34669
Show file tree
Hide file tree
Showing 36 changed files with 2,540 additions and 287 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ smodels/lib/nllfast/nllfast-1.2/old/
smodels/lib/nllfast/nllfast-2.1/fort.21
smodels/lib/pythia6/fort.61
smodels/lib/pythia6/pythia_card.dat
smodels/lib/resummino/resummino-*/
smodels/lib/resummino/resummino-*.zip
smodels/lib/resummino/lhapdf/
smodels/lib/resummino/LHAPDF-*/
smodels/lib/resummino/resummino_install/
debian/files
debian/python-module-stampdir/
debian/smodels.debhelper.log
Expand All @@ -53,6 +58,7 @@ docs/manual/source/recipes/compareUL.py
docs/manual/source/recipes/runAsLibrary.py
docs/manual/source/recipes/runWithParameterFile.py
docs/manual/source/recipes/compute_likelihood.py
docs/manual/source/recipes/lheLLPExample.py
docs/manual/source/recipes/lo_xsecs_from_slha.py
docs/manual/source/recipes/load_database.py
docs/manual/source/recipes/lookup_efficiency.py
Expand All @@ -75,6 +81,7 @@ docs/manual/source/RunSModelS.rst
docs/manual/source/SlhaChecker.rst
docs/manual/source/ToolBox.rst
docs/manual/source/XSecComputer.rst
docs/manual/source/XSecResummino.rst
docs/manual/source/FixPermissions.rst
docs/manual/source/InteractivePlots.rst
docs/manual/source/images/iplots_parameters.py
Expand Down
13 changes: 10 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# .readthedocs.yml

version: 2

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/manual/source/conf.py

python:
version: 3.6
setup_py_install: true
install:
- requirements: docs/manual/requirements.txt
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VER=$(shell cat smodels/version)
HAS_FC := $(shell smodels/lib/check_fortran_compiler.sh 2> /dev/null)
HAS_CXX := $(shell command -v $(CXX) 2> /dev/null)

all: resolve_deps externaltools
all: resolve_deps # make all just resolves dependencies

check_compilers: .PHONY
ifndef HAS_FC
Expand All @@ -17,14 +17,16 @@ resolve_deps: ## resolve the deps via pip
@echo "try to resolve the python dependencies via pip"
smodels/installation.py -R

smodels: all tidy
smodels_externaltools: resolve_deps externaltools
@echo
@echo "done. you can now run the software directly from this source directory.\n"
@echo "Try e.g. \n\n ./runSModelS.py --help\n"
@echo "The latest SModelS documentation can be found at: http://smodels.readthedocs.io/en/latest/"
@echo "For this version documentation go to: https://smodels.readthedocs.io/en/v$(VER)"

smodels_noexternaltools: resolve_deps tidy
smodels: resolve_deps

smodels_noexternaltools: resolve_deps
@echo
@echo "done. you can now run the software directly from this source directory.\n"
@echo "Try e.g. \n\n ./runSModelS.py --help\n"
Expand All @@ -47,6 +49,12 @@ pythia6:
pythia8:
cd smodels/lib && make pythia8

resummino:
cd smodels/lib && make resummino

nllfast:
cd smodels/lib && make nllfast

cpp: .PHONY
cd cpp && make

Expand All @@ -60,13 +68,13 @@ buildrpm:
builddeb: buildrpm
cd dist && fakeroot alien smodels-$(VER)-1.x86_64.rpm

pypi:
pypi: clean
## pypi user is walten, repository is https://upload.pypi.org/legacy/
rm -rf dist
python3 setup.py sdist bdist_wheel
twine upload dist/smodels-*.tar.gz

testpypi:
testpypi: clean
## testpypi user is smodels, repository is https://test.pypi.org/legacy/
# to install from testpypi:
# pip3 install --user --upgrade --index-url https://test.pypi.org/simple/ smodels
Expand Down
9 changes: 9 additions & 0 deletions ReleaseNotes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Release v2.3.3, Tue 19 Dec 2023
=======================================================

* added resummino cross section computer
* fixed bug in computation of error on muhat, for pyhf likelihoods
(affects mostly only numpy backend)
* small change in initialisation of gradient descent method for computation of
combined mu_hat, to increate robustness of method

Release v2.3.2, Wed 30 Aug 2023
=======================================================

Expand Down
16 changes: 9 additions & 7 deletions docs/manual/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
###### pythonic requirements for readthedocs.io ######
jupyter
nbconvert
unum
pyslha
numpy
scipy
sphinx_rtd_theme
plotly
pyhf
torch
docutils==0.16
numpy>=1.22.0
scipy>=1.0.0
unum>=4.0.0
requests>=2.0.0
pyslha>=3.1.0
pyhf>=0.6.1
jsonpatch>=1.25
jsonschema>=3.2.0
1 change: 1 addition & 0 deletions docs/manual/rstFromHelpFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ def runSModelS ():
run ( "interactive-plots", "InteractivePlots" )
run ( "toolbox", "ToolBox" )
run ( "fixpermissions", "FixPermissions" )
run ( "xsecresummino", "XSecResummino" )
runSModelS()
57 changes: 32 additions & 25 deletions docs/manual/source/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ SModelS is a Python library that requires Python version 3.6 or later. It depend

.. include:: dependencies.rst

For speed reasons, we moreover recommend pytorch>=1.8.0 as backend for pyhf. This is, however, optional: if pytorch is not available, SModelS will use the default backend.
For performance reasons, we moreover recommend pytorch>=1.8.0 as backend for pyhf. This is, however, optional: if pytorch is not available, SModelS will use the default backend.

In addition, the :ref:`cross section computer <xsecCalc>` provided by :ref:`smodelsTools.py <smodelsTools>`
requires:
In addition, the :ref:`cross section computers <xsecCalc>` provided by :ref:`smodelsTools.py <smodelsTools>`
require:

* `Pythia 8.3 <https://arxiv.org/abs/1410.3012>`_ (requires a C++ compiler) or `Pythia 6.4.27 <http://arxiv.org/abs/hep-ph/0603175>`_ (requires gfortran)
* `NLL-fast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_ 1.2 (7 TeV), 2.1 (8 TeV), and 3.1 (13 TeV) (requires a fortran compiler)
* `Pythia 8.3 <https://arxiv.org/abs/1410.3012>`_ (needs a C++ compiler) or `Pythia 6.4.27 <http://arxiv.org/abs/hep-ph/0603175>`_ (needs gfortran)
* `NLL-fast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_ 1.2 (7 TeV), 2.1 (8 TeV), and 3.1 (13 TeV) (needs a Fortran compiler)
* `Resummino <https://resummino.hepforge.org>`_ (needs a C++ compiler and gfortran). Moreover, in rpm-based Linux distributions, this tool needs boost, boost-devel, gsl and gsl-devel. For deb-based distributions, libboost-dev and libgsl-dev are required.

These tools need not be installed separately, as the SModelS build system takes care of that. The current default is that both Pythia6 and Pythia8 are installed together with NLLfast.
The tools themselves, i.e. Pythia6|8, NLL-fast, and/or Resummino need not be installed separately, as the SModelS build system takes care of that (see below). SModelS however expects the tools' dependencies (boost, gsl for Resummino, as well as the compilers) to be installed by the user.
Finally, the :ref:`database browser <databaseBrowser>` provided by :ref:`smodelsTools.py <smodelsTools>`
requires `IPython <https://ipython.org/>`_, while the :ref:`interactive plotter <interactivePlots>` requires `plotly <https://plot.ly/python/>`_ and `pandas <https://pandas.pydata.org/>`_.

Expand All @@ -43,27 +44,30 @@ Installation Methods

make smodels

in the top-level directory. The installation will remove redundant folders, install the required
dependencies (using pip install) and compile Pythia and NLL-fast.
If the MSSM cross section computer is not needed, one can install SModelS without Pythia and NLL-fast. To this end, run::
in the top-level directory. SModelS will install the required dependencies (using pip install), but none of the external tools (Pythia6|8, NLL-fast, Resummino).
If the MSSM :ref:`cross section computers <xsecCalc>` are needed, one can directly install SModelS together with its external tools. To this end, run::

make smodels_noexternaltools
make smodels_externaltools
instead of *make smodels*.
In case the Python libraries can not be successfully
installed, the user can install them separately using his/her preferred method. Pythia and NLL-fast can also be compiled separately
In case the Python libraries cannot be successfully
installed, the user can install them separately using his/her preferred method. Pythia, NLL-fast and Resummino can also be compiled separately
running **make externaltools**. In case the Fortran comiler isn't found,
try *make FCC=<path-to-gfortran> smodels* or *make FCC=<path-to-gfortran> externaltools*.

* If Python's *setuptools* is installed in your machine, SModelS and its dependencies
can also be installed without the use of pip.
* Every external tool can also be compiled individually, run e.g.::

make pythia6 pythia8 nllfast resummino

Remember, though, that the compilers as well as Resummino's dependencies (boost, gsl, see above) need to be installed already.

* Python's *setuptools*, if installed in your machine, can also be used for installing SModelS and its dependencies.
After downloading the source from the `SModelS releases page <https://github.com/SModelS/smodels/releases>`_
and extracting it, run::


setup.py install

within the main smodels directory. If the python libraries are installed in a system folder (as is the default behavior),
within the main SModelS directory. If the python libraries are installed in a system folder (as is the default behavior),
it will be necessary to run the install command with superuser privilege.
Alternatively, one can run setup.py with the "--user" flag: ::

Expand All @@ -73,16 +77,16 @@ Installation Methods
manually and then rerun setup.py.
For Ubuntu, SL6 machines and other platforms, a recipe is given below.


Note that this installation method will install smodels into the default system or user directory (e.g. ~/.local/lib/python3/site-packages/).
Note that this installation method will install SModelS into the default system or user directory (e.g. ~/.local/lib/python3.10/site-packages/).
Depending on your platform, the environment variables $PATH, $PYTHONPATH, $LD_LIBRARY_PATH
(or $DYLD_LIBRARY_PATH) might have to be set appropriately.

Note also, that setup.py will *not* attempt at downloading and compiling the external tools (Pythia6|8, NLL-fast, Resummino) at install time.
Instead, this will be done on the fly, at runtime, upon call of the :ref:`cross section computer(s) <xsecCalc>`.
The external tools will also be located in the above smodels installation directory (<installdir>/lib/...).



* Finally, SModelS is `indexed on pypi <https://pypi.org/project/smodels/>`_. Thus, if *pip3* (or *pip*) is installed in your machine, it is also possible to install SModelS directly without the need for
downloading the source code: ::
* Finally, SModelS is `indexed on pypi <https://pypi.org/project/smodels/>`_. Thus, if *pip3* (or *pip*) is installed in your machine, it is possible to install SModelS without downloading the source code: ::

pip3 install smodels

Expand All @@ -92,14 +96,17 @@ Installation Methods
for user-specific installations.


Note that this installation method will install smodels into the default system or user directory (e.g. ~/.local/lib/python3/site-packages/).
This installation method will install SModelS into the default system or user directory (e.g. ~/.local/lib/python3.10/site-packages/).
Depending on your platform, the environment variables $PATH, $PYTHONPATH, $LD_LIBRARY_PATH
(or $DYLD_LIBRARY_PATH) might have to be set appropriately.
Be aware that the example files and the |parameters| discussed in the manual
will also be located in your default system or user directory. Furthermore the database
folder is not included (see :ref:`database installation <installingDB>` below).
This installation method is best suited for experienced python users.
folder is not included (see :ref:`database installation <installingDB>` below).

Moreover, pip will *not* attempt at downloading and compiling the external tools (Pythia6|8, NLL-fast, Resummino) at install time. Instead, this will be done on the fly, at runtime, upon call of the :ref:`cross section computer(s) <xsecCalc>`.
The external tools will also be located in the above smodels installation directory (<installdir>/lib/...).

Generally, this installation method is best suited for experienced python users.


There is also a diagnostic tool available: ::
Expand Down
9 changes: 9 additions & 0 deletions docs/manual/source/ReleaseUpdate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ What's New
==========
The major novelties of all releases since v1.0 are as follows:

New in Version 2.3.3:
^^^^^^^^^^^^^^^^^^^^^

* added :ref:`resummino cross section <xsecResummino>` computer
* fixed bug in computation of error on muhat, for `pyhf likelihoods <tools.html#tools.pyhfInterface.PyhfUpperLimitComputer.lmax>`_
(affects mostly only numpy backend)
* small change in initialisation of gradient descent method for computation of
`combined mu_hat <tools.html#tools.analysesCombinations.AnaCombLikelihoodComputer.lmax>`_, to increate robustness of method

New in Version 2.3.2:
^^^^^^^^^^^^^^^^^^^^^

Expand Down
49 changes: 39 additions & 10 deletions docs/manual/source/SModelSTools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ SModelS Tools

Inside SModelS there is a number of tools that may be convenient for the user:

* a :ref:`cross section calculator <xsecCalc>` based on `Pythia8 <http://pythia.org>`_ (or `Pythia6 <http://pythia6.hepforge.org>`_) and
`NLLfast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_,
* a :ref:`cross section calculator <xsecCalc>` based on `Pythia8 <http://pythia.org>`_ (or `Pythia6 <http://pythia6.hepforge.org>`_),
`NLLfast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_, and one based on `Resummino <https://resummino.hepforge.org>`_,
* :ref:`SLHA and LHE file checkers <fileChecks>` to check your input files for completeness and sanity,
* a :ref:`database browser <databaseBrowser>` to provide easy access to the |database| of experimental results,
* a plotting tool to make :ref:`interactive plots <interactivePlots>` based on `plotly <https://plot.ly/python/>`_ (v1.1.3 onwards),
Expand All @@ -39,15 +39,19 @@ Inside SModelS there is a number of tools that may be convenient for the user:

.. _xsecCalc:

Cross Section Calculator
------------------------
Cross Section Calculators
-------------------------

This tool computes LHC production cross sections for *MSSM particles*
and writes them out in :ref:`SLHA convention <xsecblock>`. This can in particular be
These tools compute LHC production cross sections for *MSSM particles*
and write them out in :ref:`SLHA convention <xsecblock>`. This is particularly
convenient for adding cross sections to SLHA input files, see :doc:`Basic Input <BasicInput>`.
The calculation is done at LO with `Pythia8 <http://pythia.org>`_ or `Pythia6.4 <http://pythia6.hepforge.org>`_ ; K-factors
for colored particles are computed with `NLLfast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_. Signal strength multipliers can optionally be supplied for each "mother" particle. However, use at your own risk! Make sure the
output is sensible and contains all cross sections for all production mechanisms


Pythia and NLLfast Cross Sections
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In the basic "xseccomputer", the calculation is done at LO with `Pythia8 <http://pythia.org>`_ or `Pythia6.4 <http://pythia6.hepforge.org>`_ ; K-factors
for colored particles are computed with `NLLfast <http://pauli.uni-muenster.de/~akule_01/nllwiki/index.php/NLL-fast>`_. Signal strength multipliers can optionally be supplied for each "mother" particle. However, use at your own risk! Make sure the output is sensible and contains all cross sections for all production mechanisms
you are interested in!

**The usage of the cross section calculator is:**
Expand Down Expand Up @@ -83,8 +87,33 @@ This will compute 8 TeV and 13 TeV LO cross sections as above, but the cross sec
Note that signal strength multipliers get applied only to LO cross sections. This means they are propagated to NLO and NLL level only if the LO cross sections are computed first and the NLO/NLL corrections added afterwards. In other words, if the xseccomputer is called with -n or -N argument but without -O (--LOfromSLHA), the --ssmultipliers argument will be ignored.


* **The cross section calculation is implemented by the** `xsecComputer function <tools.html#tools.xsecComputer.XSecComputer>`_
* **The cross section calculation is implemented by the** `XSecComputer class <tools.html#tools.xsecComputer.XSecComputer>`_

.. _xsecResummino:

Resummino Cross Sections
^^^^^^^^^^^^^^^^^^^^^^^^

For electroweak-ino and/or slepton production cross sections, another tool based on `Resummino <https://resummino.hepforge.org>`_ is available. This can calculate EW cross sections at LO, NLO, and NLL+NLO orders. No K-factors are used, all orders are calculated independently.

**The usage of the Resummino cross section calculator is:**

.. include:: XSecResummino.rst

A typical
usage example is: ::

smodelsTools.py xsecresummino -s 13 -p -n -f test/testFiles/resummino/resummino_example.slha -part 1000023 1000024

This will compute the (1000023,-1000024), (1000023, 1000024) and (-1000024,1000024) cross sections for sqrt(s)=13 TeV at NLO for the spectrum given in resummino_example.slha and append them to that SLHA file.
Additional settings, like the PDF sets to use, are taken from the Resummino configuration file, smodels/etc/resummino.py. There, also the default threshold for the minimum cross section is set.

Instead of providing a list of particles via the --part argument, one can also directly specify in the resummino.py configuration file which production channels shall be considered. To this end one can either adapt the resummino.py file in the smodels/etc folder, or provide their own configuration file via the --conf argument.
Note that options set directly on the command line always take precedence over the settings in the
configuration file.


* **The resummino cross section calculation is implemented by the** `XSecResummino class <tools.html#tools.xsecResummino.XSecResummino>`_

.. _fileChecks:

Expand Down
Loading

0 comments on commit 5d34669

Please sign in to comment.