Skip to content

cms-cat/nanoAOD-tools-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modules for nanoAOD-tools

This repo provides some modules that can be used with the nanoAOD-tools framework for post-processing CMS's nanoAOD files.

The modules add new branches like lepton scale factors, using the correctionlib tool, and official JSON correction files provided by the CMS POGs.

Installation

Install CMSSW

First, install your favorite CMSSW release. If you rely on correctionlib and python3, it is strongly recommend to use CMSSW 11.3 or newer. For example,

CMSSW 11.3.4 (for combine v9) CMSSW 12.4.8
export SCRAM_ARCH=slc7_amd64_gcc900
cmsrel CMSSW_11_3_4
cd CMSSW_11_3_4/src
cmsenv
export SCRAM_ARCH=slc7_amd64_gcc10
cmsrel CMSSW_12_4_8
cd CMSSW_12_4_8/src/
cmsenv

Install nanoAOD-tools (for CMSSW 12 or older, 13_0_X with X < 16, 13_1_X with X < 5, 13_2_X)

Install nanoAOD-tools to process nanoAOD files. Note that starting from CMSSW 13_0_16, 13_1_5 and 13_3_0, a basic version of nanoAOD-tools is included. To install the standalone version, please do

cd $CMSSW_BASE/src/
git clone https://github.com/cms-nanoAOD/nanoAOD-tools.git PhysicsTools/NanoAODTools

Install NATModules

Now install this repository as PhysicsTools/NATModules and compile (build) everything:

cd $CMSSW_BASE/src/
cmsenv
git clone [email protected]:cms-cat/nanoAOD-tools-modules.git PhysicsTools/NATModules
scram b

Install correctionlib (for CMSSW 11.2 or older)

Starting from CMSSW 11.3, correctionlib should come pre-installed. To install yourself for older CMSSW versions, please see have a look at documentation. Note that correctionlib works best for python3.

Install correctionlib data

Finally, install the correctionlib JSON files provided by CMS into PhysicsTools/NATModules/data from the cms-nanoAOD/jsonpog-integration repository on GitLab:

cd $CMSSW_BASE/src/PhysicsTools/NATModules
git clone ssh://[email protected]:7999/cms-nanoAOD/jsonpog-integration.git data

or clone via Kerberos, where $USER is your CERN lxplus name:

kinit $USER@CERN.CH
git clone https://$USER:@gitlab.cern.ch:8443/cms-nanoAOD/jsonpog-integration.git

Alternatively, this repository is regularly synchronized to /cvmfs/, so if your system has access, you can copy the latest version

cd $CMSSW_BASE/src/PhysicsTools/NATModules
cp -r /cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration data

Test the installation

Run a module, for example

cd $CMSSW_BASE/src/PhysicsTools/NATModules
python3 ./test/example_muonSF.py -i root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL16NanoAODv9/DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8/NANOAODSIM/20UL16JMENano_106X_mcRun2_asymptotic_v17-v1/2820000/11061525-9BB6-F441-9C12-4489135219B7.root

Usage

To use in your own analysis, you can use the standalone scripts in test as an example. If you compiled this package correctly, you can import the modules in PhysicsTools/NATModules/python/modules as

from PhysicsTools.NATModules.modules.muonSF import *

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published