ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/JetAnalysis/scripts/haddsync.sh
Revision: 1.1.2.1
Committed: Fri Aug 12 23:33:17 2011 UTC (13 years, 9 months ago) by frankma
Content type: application/x-sh
Branch: cmssw39x_branch
Changes since 1.1: +23 -0 lines
Log Message:
script to add the two output files in sync

File Contents

# User Rev Content
1 frankma 1.1.2.1 dir=$1
2    
3     list1=`ls $dir | grep mpa | sort`
4     list2=`ls $dir | grep Jet | sort`
5    
6     mkdir -p $dir/merge
7    
8     cmd1="hadd $dir/merge/mpa_all_0.root"
9     cmd2="hadd $dir/merge/JetAnaTrees_all_0.root"
10     for i in $list1; do
11     tag=`echo $i | awk 'BEGIN { FS = "mpa_" } ; { print $2 }'`
12     echo $list2 | grep -q $tag
13     if [ $? -eq 0 ]; then
14     cmd1+=" $dir/mpa_"$tag
15     cmd2+=" $dir/JetAnaTrees_"$tag
16     else echo "not in both: " $tag
17     fi
18     done
19    
20     #echo $cmd1
21     #echo $cmd2
22     eval $cmd1
23     eval $cmd2