Skip to content
Snippets Groups Projects

R(D) and R(D*) Analysis

This project contains the code for the R(D) and R(D^*) measurements.

It is heavily based on the Analysis Tools package, which contains general utilities not specific to R(D^{(*)}) analyses.

Installation

Clone the repository, e.g. with the command

git clone git@gitlab.etp.kit.edu:fmetzner/RDStar.git

which will download the repository into the directory RDStar.

For the installation, make sure to first install the necessary python packages on top of your basf2 externals via

pip3 install --upgrade pip
pip3 install -r requirements.txt

after setting up your local basf2 environment.

To install this package use

pip3 install <path/to/directory/containing/this/README>

or the command with the --editable option to allow for continuous development:

pip3 install -e <path/to/directory/containing/this/README>

If you are using a basf2 release or an externals version to which you do not have write access, you can install the package locally via

pip3 install --user -r requirements.txt
pip3 install --user <path/to/directory/containing/this/README>

Development

For development, please consider to also add the packages AnalysisTools and TemplateFitter manually via the instructions given in their README, instead of installing them via the -r option of pip3 install.

Pre-Commit Hooks

If you want to contribute to this package, please consider using the pre-commit hooks which can be installed by running the following commands:

pip3 install pre-commit
pre-commit install

Probfit

We use the probfit package to perform some simple fits to evaluate and correct data-MC discrepancies. However, probfit can currently not be used with iminuit versions >= 2.0. To fix this issue, just clone the probfit package and install its dependencies via

git clone git@github.com:scikit-hep/probfit.git
pip3 install cython

and then patch this version of probfit with the patch that is available under basf2_patches/probfit_iminuit_2.0_fix.diff in this repository by copying this file to and running

git apply probfit_iminuit_2.0_fix.diff

in the probfit directory. Then install your fixed version of probfit by running

pip3 install -e ./

in the probfit directory.

Old Template Fitter Package

An alternative older version of the TemplateFitter can also be used. Please follow the instructions given in the README in the directory max_template_fitter_patch of this repository to do so.

Further Information

  • Further information related to this R(D^{(*)}) analysis and more in-depth documentation is gathered in the project wiki.
  • Parts of the documentation will be ported to the Analysis Tools wiki

Setup Guideline

The provided script complete_setup.sh in scripts can be used to install the whole setup required to run the analysis:

mkdir -p </path/to/your/setupdir>
cd </path/to/your/setupdir>
git clone git@gitlab.etp.kit.edu:fmetzner/RDStar.git
chmod u+x ./RDStar/scripts/complete_setup.sh
./RDStar/scripts/complete_setup.sh </path/to/your/setupdir>