Use Combine
The same installation supports notebooks, an activated terminal, single isolated commands, and an interactive Combine shell.
In a notebook
Choose the combine-v11 kernel, displayed as:
The kernel provides both CMSSW Python packages and Combine executables:
import os
import ROOT
import HiggsAnalysis.CombinedLimit.PhysicsModel
print(os.environ["CMSSW_VERSION"])
print(ROOT.gROOT.GetVersion())
Command-line tools can be invoked with subprocess:
import subprocess
subprocess.run(
["combine", "-M", "AsymptoticLimits", "card.txt", "--run", "blind"],
check=True,
)
Paths and outputs are relative to the notebook's working directory unless the command supplies another path.
In the current terminal
Explicitly switch the terminal from SWAN's LCG environment to the pinned CMSSW environment:
After activation, the shell intentionally uses CMSSW's Python and shared libraries. Open another terminal if you also need the untouched SWAN/LCG environment.
Run one isolated command
Use combine-run when you do not want to alter the calling shell:
The helper activates the pinned runtime in its own process and then replaces itself with the requested command.
Open an interactive Combine shell
You can also pass a command directly:
Validate the installation again
Run the installed-runtime check at any time:
It checks the exact tag, imports, utilities, and a real blind asymptotic-limit workflow. The temporary datacard and ROOT output are deleted automatically.
Keep workflows portable
- Build paths from
COMBINE_SWAN_ROOTrather than embedding another user's EOS path. - Use
CMSSW_BASEwhen you need the active CMSSW area. - Keep analysis inputs and final outputs outside the generated
CMSSW_16_0_0tree. - Do not source
activate.shfromswan_env.sh; the parent notebook server must retain its own Python runtime. - Rerun
scripts/install_kernel.shafter moving or renaming the checkout.