-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerge_from_storage.sh
executable file
·69 lines (62 loc) · 3.5 KB
/
merge_from_storage.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
maindirec=/pnfs/iihe/cms/store/user/`whoami`/BtagExtractor_44X
dirs_to_merge=(QCD_Pt-1000to1400_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-120to170_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-1400to1800_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-15to30_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-170to300_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-1800_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-300to470_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-30to50_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-470to600_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-50to80_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-600to800_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-800to1000_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM QCD_Pt-80to120_Tune4C_7TeV_pythia8_Fall11-PU_S6_START44_V9B-v1_AODSIM)
homedirec=/user/pvmulder/NewEraOfDataAnalysis/BTagServiceWork/CMSSW_4_4_4/src/BTagging/RootFilesPetra
CAT=(CombinedSVRecoVertex CombinedSVPseudoVertex CombinedSVNoVertex)
#CAT=(CombinedSVRecoVertex)
FLAV=(B C DUSG)
cd $homedirec
for l in ${dirs_to_merge[@]} ;
do
for k in ${CAT[@]} ;
do
for j in $( ls $maindirec/$l/${k}_B*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}Bfiles.txt; done
for j in $( ls $maindirec/$l/${k}_C*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}Cfiles.txt; done
if [ $k=="CombinedSVNoVertex" ]
then
let countfiles=0
for j in $( ls $maindirec/$l/${k}_D*); do
echo "at file number $countfiles"
((countfiles++))
if [ $countfiles -ne 1 ] ; then if [ $countfiles -eq 10 ] ; then countfiles=0 ; fi ; continue ; fi #this makes sure that only 1/10 files is used!
printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt
done
let countfiles=0
for j in $( ls $maindirec/$l/${k}_U*); do
echo "at file number $countfiles"
((countfiles++))
if [ $countfiles -ne 1 ] ; then if [ $countfiles -eq 10 ] ; then countfiles=0 ; fi ; continue ; fi #this makes sure that only 1/10 files is used!
printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt
done
let countfiles=0
for j in $( ls $maindirec/$l/${k}_S*); do
echo "at file number $countfiles"
((countfiles++))
if [ $countfiles -ne 1 ] ; then if [ $countfiles -eq 10 ] ; then countfiles=0 ; fi ; continue ; fi #this makes sure that only 1/10 files is used!
printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt
done
let countfiles=0
for j in $( ls $maindirec/$l/${k}_G*); do
echo "at file number $countfiles"
((countfiles++))
if [ $countfiles -ne 1 ] ; then if [ $countfiles -eq 10 ] ; then countfiles=0 ; fi ; continue ; fi #this makes sure that only 1/10 files is used!
printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt
done
else
for j in $( ls $maindirec/$l/${k}_D*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt; done
for j in $( ls $maindirec/$l/${k}_U*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt; done
for j in $( ls $maindirec/$l/${k}_S*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt; done
for j in $( ls $maindirec/$l/${k}_G*); do printf "dcap://maite.iihe.ac.be/$j " >> ${k}DUSGfiles.txt; done
fi
done
done
for k in ${CAT[@]} ;
do
for i in ${FLAV[@]} ;
do
echo cat ${k}${i}files.txt
rootfiles=`cat ${k}${i}files.txt`
hadd tmp.root $rootfiles
mv tmp.root ${k}_${i}.root
done
done