We use the scram-venv utility to create a python virtual environment in our CMSSW area:
cmsrel CMSSW_14_1_0_pre4
cd CMSSW_14_1_0_pre4/src
cmsenv
scram-venv
cmsenv
git clone https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
cd HiggsAnalysis/CombinedLimit
git checkout v10.1.0
scram b -j4
python3 -m pip install git+https://github.com/nsmith-/rhalphalib.gitFirst, install Combine v10 using your choice of installation instructions (with CMSSW, using LCG, or inside a Conda environment). In a python virtual environment, run:
python3 -m pip install --user git+https://github.com/nsmith-/rhalphalib.gitTake a look at test_rhalphalib.py for examples of how to use the package. You can run a test with, e.g.
curl -Ol https://raw.githubusercontent.com/nsmith-/rhalphalib/master/tests/test_rhalphalib.py
python3 test_rhalphalib.py
cd tmp/testModel
. build.sh
combine -M FitDiagnostics model_combined.rootAn example output of the final line is:
<<< Combine >>>
<<< v10.1.0 >>>
>>> Random number generator seed is 123456
>>> Method used is FitDiagnostics
--- FitDiagnostics ---
Best fit r: 0.999999 -0.208174/+0.212715 (68% CL)
Done in 0.59 min (cpu), 0.59 min (real)
Clone this repo, and edit! To run tests, we use
nox to simplify the
configuration. If nox is installed systemwide, then simply running nox in
this directory will automatically create linting and testing virtual
environments and run the tests.
For vscode, you can set the python interpreter to .nox/tests/bin/python.
To build docs, run nox -s build_api_docs docs.