aminnj / NanoTools

tools, usage examples for CMS nanoAOD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Environment & setup

cd /cvmfs/cms.cern.ch/slc6_amd64_gcc700/cms/cmssw/CMSSW_10_2_9/ ; cmsenv ; cd -
git clone https://github.com/cmstas/NanoTools
cd NanoTools/NanoCORE
make test -j12

Unit tests

Unit tests of NanoCORE/ are inside NanoCORE/Tools/unit_tests/ and can be run with make test inside of NanoCORE/.

Style

We use clang-format based on LLVM style to format our code. To format the ElectronSelections.cc file in-place, do

clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, ColumnLimit: 120, AllowShortIfStatementsOnASingleLine: true, AllowShortBlocksOnASingleLine: true}" -i ElectronSelections.cc

Add this to the ~/.vimrc and use vim to code. (Assumes you are working on UAF)

autocmd BufNewFile,BufRead *.cc,*.h,*.C,*.cxx set formatprg=clang-format\ -style=\"{BasedOnStyle:\ llvm,\ IndentWidth:\ 4,\ ColumnLimit:\ 100,\ AllowShortIfStatementsOnASingleLine:\ true,\ AllowShortBlocksOnASingleLine:\ false,\ BreakBeforeBraces:\ Allman}\"

To format your code, press ggvGgq.

About

tools, usage examples for CMS nanoAOD


Languages

Language:C++ 80.7%Language:Perl 11.7%Language:Jupyter Notebook 4.6%Language:Python 1.9%Language:Makefile 0.5%Language:C 0.3%Language:Shell 0.2%