-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathresolutionScaleFiller_batchScript.sh
executable file
·49 lines (43 loc) · 1.25 KB
/
resolutionScaleFiller_batchScript.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
#!/bin/bash
## External vars
currentDir=${1}
CMSSWDIR=${2}
CMSSWVER=${3}
CMSSWARCH=${4}
fileList=${5}
outDir=${6}
sampleName=${7}
gunType=${8}
pid=${9}
genValue=${10}
tag=${11}
refName=${12}
objName=${13}
##Create Work Area
cd $TMPDIR || exit
export SCRAM_ARCH=${CMSSWARCH}
source /afs/cern.ch/cms/cmsset_default.sh
eval `scramv1 project CMSSW ${CMSSWVER}`
cd ${CMSSWVER}/ || exit
# this is dangerous!
rm -rf ./*
cp -r -d ${CMSSWDIR}/* ./
cd src || exit
eval `scramv1 runtime -sh`
edmPluginRefresh -p ../lib/$SCRAM_ARCH
## Execute job and retrieve the outputs
echo "Job running on `hostname` at `date`"
cd $TMPDIR || exit
cp -r $currentDir analysis
cd analysis || exit
#cd RecoNtuples/HGCalAnalysis/test/HGCalAnalysis
pwd
echo python resolutionScaleFiller.py --files $fileList --gunType $gunType --pid $pid --genValue $genValue --tag $tag --ref $refName --obj $objName
python resolutionScaleFiller.py --files $fileList --gunType $gunType --pid $pid --genValue $genValue --tag $tag --ref $refName --obj $objName
ls -l
outfilename="${gunType}_${pid}_${genValue}GeV_${refName}_${objName}_${tag}.root"
# copy to outDir
echo "mkdir -p $outDir/${sampleName}"
mkdir -p $outDir/${sampleName}
echo "cp $outfilename $outDir/${sampleName}/"
cp $outfilename $outDir/${sampleName}/