taken from https://github.com/cms-nanoAOD/nanoAOD-tools and modify for personal use. Tools for working with NanoAOD (requiring only python + root, not CMSSW)
You need to setup python 2.7 and a recent ROOT version first.
git clone git@github.com:LambdaFramework/LambdaNano.git LambdaNano
cd LambdaNano
bash standalone/env_standalone.sh build
source standalone/env_standalone.sh
Repeat only the last command at the beginning of every session.
Please never commit neither the build directory, nor the empty init.py files created by the script.
cd $CMSSW_BASE/src
git clone git@github.com:LambdaFramework/LambdaNano.git PhysicsTools/NanoAODTools
cd PhysicsTools/NanoAODTools
cmsenv
scram b