-
Notifications
You must be signed in to change notification settings - Fork 10
/
makeStep1.sh
executable file
·49 lines (39 loc) · 1.04 KB
/
makeStep1.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
hostname
infilename=${1}
outfilename=${2}
inputDir=${3}
outputDir=${4}
idlist=${5}
scratch=${PWD}
macroDir=${PWD}
source /cvmfs/cms.cern.ch/cmsset_default.sh
scramv1 project CMSSW CMSSW_9_4_6_patch1
cd CMSSW_9_4_6_patch1
eval `scramv1 runtime -sh`
cd -
export PATH=$PATH:$macroDir
XRDpath=root://cmseos.fnal.gov/$inputDir
#root -l -b -q makeStep1.C\(\"$macroDir\",\"$XRDpath/$infilename\",\"$outfilename\"\)
echo "Running step1 over $idlist"
for iFile in $idlist; do
echo "creating ${outfilename}_${iFile}.root"
root -l -b -q makeStep1.C\(\"$macroDir\",\"$XRDpath/${infilename}_${iFile}.root\",\"${outfilename}_${iFile}.root\"\)
done
echo "ROOT Files:"
ls -l *.root
# copy output to eos
echo "xrdcp output for condor"
for FILE in *.root
do
echo "xrdcp -f ${FILE} root://cmseos.fnal.gov/${outputDir}/${FILE}"
xrdcp -f ${FILE} root://cmseos.fnal.gov/${outputDir}/${FILE} 2>&1
XRDEXIT=$?
if [[ $XRDEXIT -ne 0 ]]; then
rm *.root
echo "exit code $XRDEXIT, failure in xrdcp"
exit $XRDEXIT
fi
rm ${FILE}
done
echo "done"