-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_package.sh
54 lines (42 loc) · 1.35 KB
/
test_package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
usage()
{
echo "Usage:"
echo ""
echo " sh test_package.sh PACKAGE.tar.gz NANOAODPATH"
echo ""
exit
}
if [ -z $1 ]; then usage; fi
if [ -z $2 ]; then usage; fi
PACKAGE=$(realpath $1)
NANOAODPATH=$2
echo "----------------------------------------------------"
echo "Testing NanoAOD Skimming with the PACKAGE=${PACKAGE}"
echo "on NanoAOD file NANOAODPATH=${NANOAODPATH}"
echo "----------------------------------------------------"
echo ""
# Create a test area to check the package
source /cvmfs/cms.cern.ch/cmsset_default.sh
SCRAMARCH=slc7_amd64_gcc700
CMSSWVERSION=CMSSW_10_2_13
# Go to a working directory that will be cleaned afterwards
mkdir -p tmp_test_package
cd tmp_test_package
# Setup environment (If already exists it will leave them be)
export SCRAM_ARCH=${SCRAMARCH} && scramv1 project CMSSW ${CMSSWVERSION}
cd ${CMSSWVERSION}/src/
tar xf ${PACKAGE} # It will overwrite if necessary
cd PhysicsTools/NanoAODTools/
eval `scramv1 runtime -sh`
scram b -j
python scripts/nano_postproc.py \
./ \
${NANOAODPATH} \
-b python/postprocessing/examples/keep_and_drop.txt \
-I PhysicsTools.NanoAODTools.postprocessing.examples.vbsHwwSkimModule \
vbsHwwSkimModuleConstr
# Copy back the output to parent directory
BASENAMEWITHEXT=$(basename ${NANOAODPATH})
BASENAME=${BASENAMEWITHEXT%.*}
cp ${BASENAME}_Skim.root ../../../../../