ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/scripts/mergeTrees.sh
Revision: 1.2
Committed: Tue May 22 06:43:33 2012 UTC (12 years, 11 months ago) by guiducci
Content type: application/x-sh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +7 -4 lines
Log Message:
updated script for ntuple from singlemu

File Contents

# User Rev Content
1 guiducci 1.2 min=$3
2     max=$4
3     NFILE=`rfdir $2 | grep root | awk '{print $9}' | awk -v mmin=$min '{ if (substr($1,13,6) >= mmin) print $1}' | awk -v mmax=$max '{ if (substr($1,13,6) <= mmax) print $1}' | wc -l `
4     rfdir $2 | grep root | awk '{print $9}' | awk -v mmin=$min '{ if (substr($1,13,6) >= mmin) print $1}' | awk -v mmax=$max '{ if (substr($1,13,6) <= mmax) print $1}' | sed "s|^| stager_get -M $2/|" | tr "\n" ";" > tmp.sh
5 guiducci 1.1 source tmp.sh
6 guiducci 1.2 rfdir $2 | grep root | awk '{print $9}' | awk -v mmin=$min '{ if (substr($1,13,6) >= mmin) print $1}' | awk -v mmax=$max '{ if (substr($1,13,6) <= mmax) print $1}' | sed "s|^| stager_qry -M $2/|" | tr "\n" ";" > tmp.sh
7 guiducci 1.1 source tmp.sh
8     NSTAGED=`source tmp.sh | grep STAGED | wc -l `
9     echo "Found $NFILE files, of which $NSTAGED staged."
10     echo "stager_get was called, please try again later if you like"
11     echo "now hadding staged files..."
12 guiducci 1.2 #source tmp.sh | grep STAGED | grep root | awk -v name=$USER '{print $1,"/tmp/"name"/$1}' | sed "s|^|rfcp |"
13 guiducci 1.1 `source tmp.sh | grep STAGED | grep root | awk '{print $1}' | sed "s|^|rfio://|" | tr "\n" " " | sed "s|^|hadd $1 |"`
14     rm tmp.sh
15 guiducci 1.2 echo "no further actions taken..."