Skip to content

Installation

Izaak edited this page Aug 7, 2024 · 29 revisions

CMSSW environment

First, setup a CMSSW release. For example,

🔥 CMSSW 14 (EL9/AlmaLinux9, python3) 🔥 [NEW!] CMSSW 12 (SLC7/CentOS7, python3) Older versions (python2)
source /cvmfs/cms.cern.ch/cmsset_default.sh
export CMSSW=CMSSW_14_1_0_pre4 # match Combine v10
export SCRAM_ARCH=el9_amd64_gcc12
cmsrel $CMSSW
cd $CMSSW/src
cmsenv
source /cvmfs/cms.cern.ch/cmsset_default.sh
export CMSSW=CMSSW_12_4_8
export SCRAM_ARCH=slc7_amd64_gcc10
cmsrel $CMSSW
cd $CMSSW/src
cmsenv
source /cvmfs/cms.cern.ch/cmsset_default.sh
export CMSSW=CMSSW_11_3_4
export SCRAM_ARCH=slc7_amd64_gcc900
cmsrel $CMSSW
cd $CMSSW/src
cmsenv

New sessions

Every time you start a new shell session, you need to do the usual cmsenv:

# run container (e.g. cmssw-cc7) if you need it
source /cvmfs/cms.cern.ch/cmsset_default.sh
export SCRAM_ARCH=<architecture> # e.g. el9_amd64_gcc12 or slc7_amd64_gcc700
cd <CMSSW path>/src
cmsenv

Notes

Important

Some notes on choice of CMSSW and operating system (OS):

  • Which CMSSW release should not really matter for post-processing of nanoAOD itself, but if you like to use combine in the same repository, it is better to use at least the recommended release for the latest Combine version, see below.
  • Python 2 is no longer supported for the latest TauFW. It is needed for correctionlib JSONs for SFs. This means you need CMSSW 12 or newer.
  • CERN's lxplus system is phasing out SLC7/CentOS7 and EL8/AlmaLinux8 in favor of EL9/AlmaLinux9. It is strongly recommend to move to CMSSW 14 on lxplus9. If you still want to use the older CMSSW versions, you need a Singularity container (see below).
  • For CMSSW 12, you can use the el8_amd64_gcc10 architecture instead of slc7_*. Note however that HTCondor on CERN's lxplus does not offer EL8 nodes anymore, and you would need to submit in a CMSSW Singularity container (see below).

Singularities containers

If you want to use CMSSW 12 or older with an SLC7/CentOS7 (slc7_*_*) architecture on a system with a newer OS (e.g. EL9/AlmaLinux9), you must first set a Singularity container before you run the commands below.

source /cvmfs/cms.cern.ch/cmsset_default.sh
cmssw-cc7 # container for CC7 OS (e.g. slc7_*_*)

Note, however, that the standard CMSSW containers will likely break your ability to submit jobs to the batch system with the TauFW. CMS's CAT group has instructions here to setup a CMSSW singularity that contains HTCondor for CERN's lxplus system.

Warning

The TauFW has not been fully validated with CMSSW Singularity containers, see Issue #66.

TauFW

To install TauFW:

cd $CMSSW_BASE/src/
git clone https://github.com/cms-tau-pog/TauFW TauFW
scram b -j4

With each new session, do

export SCRAM_ARCH=<architecture> # e.g. el9_amd64_gcc12 or slc7_amd64_gcc700
cd <CMSSW path>/src
cmsenv

PicoProducer

NanoAOD-tools

Important

Since CMSSW 14, PhysicsTools/NanoAODTools is automatically included, and you can skip this step. If you want to process nanoAOD using PicoProducer in CMSSW 13 or older, install NanoAODTools:

cd $CMSSW_BASE/src/
git clone https://github.com/cms-nanoAOD/nanoAOD-tools.git PhysicsTools/NanoAODTools
scram b -j4 # compile

Corrections

If you want to use tau ID SFs, please install TauIDSFs tool:

cd $CMSSW_BASE/src/
git clone https://github.com/cms-tau-pog/TauIDSFs TauPOG/TauIDSFs
cmsenv
scram b -j4 # compile

If you want to use the lepton SFs from the HTT group, please do

cd $CMSSW_BASE/src/TauFW/PicoProducer/data/lepton/
rm -rf HTT
git clone https://github.com/CMS-HTT/LeptonEfficiencies HTT

correctionlib

If you want to use the corrections from the central correctionlib JSON, please retrieve them from the central XPOG JSON repository (about 300MB):

# clone from GitLab
cd $CMSSW_BASE/src/TauFW/PicoProducer
git clone ssh://[email protected]:7999/cms-nanoAOD/jsonpog-integration.git data/jsonpog

# OR copy them from CVMFS:
cd $CMSSW_BASE/src/TauFW/PicoProducer
cp -rv /cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration data/jsonpog

Please test that you have correctionlib installed correctly by running the following shell command:

python3 -c '
import correctionlib; print(correctionlib.__file__)
from correctionlib import CorrectionSet;
import correctionlib._core; print(correctionlib._core.__file__)'

Warning

Note this is currently under development, and we are adding new correctionlib modules one by one, see this issue on GitLab.

Tip

If you want to clone from the CERN GitLab via ssh, make sure you have your public SSH keys (typically ~/.ssh/id_{rsa,ed25519}.pub) added to your CERN GitLab account, see these instructions. Alternatively, you can either use Kerberos:

kinit <lxplus_user>@CERN.CH
git clone https://<lxplus_user>:@gitlab.cern.ch:8443/<project>/<repo>.git <target>

or, HTTPS if you have an access token, see these instructions:

git clone https://gitlab.cern.ch/<project>/<repo>.git <target>

Combine

If you want to use the combine tools in Fitter, install combine following the latest instructions, for example, at the time of writing:

cd $CMSSW_BASE/src
git clone https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
cd HiggsAnalysis/CombinedLimit
git fetch origin
#git checkout v9.1.0 # for CMSSW_11_X
git checkout v10.0.2 # for CMSSW_14_X

and then CombineHarvester,

cd $CMSSW_BASE/src
git clone https://github.com/cms-analysis/CombineHarvester.git CombineHarvester
cd CombineHarvester
#git checkout v2.0.0 # for CMSSW_11_X only
git checkout v3.0.0 # for CMSSW_14_X

Clean & compile full CMSSW:

scramv1 b clean # clean previous built
scramv1 b -j4   # speed up compilation with 4 cores

TauPOG corrections

For TauPOG-internal work: To create JSON files with TauPOG corrections for correctionlib, please follow the instructions here. From at least CMSSW_11_3_X, correctionlib should be pre-installed.

To create ROOT files including the measured SFs please install TauIDSFs tool. Modify the TauIDSFs/utils/createSFFiles.py script to include your measured SFs into the script. Finally, run the TauFW/scripts/tau_createROOT.sh to generate your ROOT files. They will be created into TauFW/scripts/data/ IMPORTANT: please comment and do not delete older SFs