nanoAOD skiming code for H->ZZ->2l2Q studies.
Step: 1: Get CMSSW release
cmsrel CMSSW_10_6_30
cd CMSSW_10_6_30/src
cmsenv
Step: 2: Get official nanoAODTools
git clone git@github.com:cms-nanoAOD/nanoAOD-tools.git PhysicsTools/NanoAODTools
cd PhysicsTools/NanoAODTools
git checkout 65359982275c476834ad4b37363d658166881f12 # Updated to commit on 16 June 2023 in official nanoAOD-tools
Step: 3: Get our analysis repository
cd $CMSSW_BASE/src
git clone git@github.com:YujiLee301/nanoAOD_skim.git PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
cd PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
git submodule init
git submodule update
cd -
cmsenv
# patch PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim/nanoAOD_tools.patch
cp PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim/data/btag/*.csv PhysicsTools/NanoAODTools/data/btagSF/.
scram b
voms-proxy-init --voms cms --valid 168:00
(Optional: Fix git repo)
find PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim/.git/ -name "*.py*" -delete
Step: 4: interactive running
cd $CMSSW_BASE/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
git clone -b v2.3.5 https://github.com/JHUGen/JHUGenMELA
sh JHUGenMELA/MELA/setup.sh -j 8
cd JHUGenMELA/MELA
make
cd $CMSSW_BASE/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim
python post_proc.py
batch job submission.
cd crab/
voms-proxy-init -voms cms --valid 200:00
source /cvmfs/cms.cern.ch/crab3/crab.sh
crab submit -c crab_cfg.py
In the file condor_setup.py
, specify the correct input text file from which you need to take input NanoAOD DAS names. Also, updated the output EOS path. Then do the following:
cd $CMSSW_BASE/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_vvVBS
# Edit condor_setup.py, then
python condor_setup.py
# Set proxy before submitting the condor jobs.
voms-proxy-init -voms cms --valid 200:00
condor_submit <Files-created-from-above-command>.jdl