#! /bin/sh cd /rooms/bulls/Athena/pass2/em1trk/ pwd >home_dir.txt homedir=$(cat home_dir.txt) rm home_dir.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.03.00/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files1=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files1>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events1=$(cat num_events.txt) echo "Number of events processed =" $num_events1>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files1.txt cat files1.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files1=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files1>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size1=$(cat total_size.txt) total_size_gb1=$(echo "scale=2; $total_size1/1000000" | bc -l) echo "Disk space used =" $total_size_gb1 "Gb">>$homedir/summary.txt avg_event1=$(echo "scale=2; $total_size1/$num_events1" | bc -l) echo "Average event size =" $avg_event1 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.03.01/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files2=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files2>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events2=$(cat num_events.txt) echo "Number of events processed =" $num_events2>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files2.txt cat files2.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files2=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files2>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size2=$(cat total_size.txt) total_size_gb2=$(echo "scale=2; $total_size2/1000000" | bc -l) echo "Disk space used =" $total_size_gb2 "Gb">>$homedir/summary.txt avg_event2=$(echo "scale=2; $total_size2/$num_events2" | bc -l) echo "Average event size =" $avg_event2 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.03.02/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files3=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files3>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events3=$(cat num_events.txt) echo "Number of events processed =" $num_events3>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files3.txt cat files3.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files3=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files3>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size3=$(cat total_size.txt) total_size_gb3=$(echo "scale=2; $total_size3/1000000" | bc -l) echo "Disk space used =" $total_size_gb3 "Gb">>$homedir/summary.txt avg_event3=$(echo "scale=2; $total_size3/$num_events3" | bc -l) echo "Average event size =" $avg_event3 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.05.02_dst/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files4=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files4>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events4=$(cat num_events.txt) echo "Number of events processed =" $num_events4>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files4.txt cat files4.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files4=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files4>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size4=$(cat total_size.txt) total_size_gb4=$(echo "scale=2; $total_size4/1000000" | bc -l) echo "Disk space used =" $total_size_gb4 "Gb">>$homedir/summary.txt avg_event4=$(echo "scale=2; $total_size4/$num_events4" | bc -l) echo "Average event size =" $avg_event4 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.05.00/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files5=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files5>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events5=$(cat num_events.txt) echo "Number of events processed =" $num_events5>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files5.txt cat files5.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files5=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files5>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size5=$(cat total_size.txt) total_size_gb5=$(echo "scale=2; $total_size5/1000000" | bc -l) echo "Disk space used =" $total_size_gb5 "Gb">>$homedir/summary.txt avg_event5=$(echo "scale=2; $total_size5/$num_events5" | bc -l) echo "Average event size =" $avg_event5 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.05.02/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files6=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files6>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events6=$(cat num_events.txt) echo "Number of events processed =" $num_events6>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files6.txt cat files6.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files6=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files6>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size6=$(cat total_size.txt) total_size_gb6=$(echo "scale=2; $total_size6/1000000" | bc -l) echo "Disk space used =" $total_size_gb6 "Gb">>$homedir/summary.txt avg_event6=$(echo "scale=2; $total_size6/$num_events6" | bc -l) echo "Average event size =" $avg_event6 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.06.00/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files7=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files7>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events7=$(cat num_events.txt) echo "Number of events processed =" $num_events7>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files7.txt cat files7.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files7=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files7>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size7=$(cat total_size.txt) total_size_gb7=$(echo "scale=2; $total_size7/1000000" | bc -l) echo "Disk space used =" $total_size_gb7 "Gb">>$homedir/summary.txt avg_event7=$(echo "scale=2; $total_size7/$num_events7" | bc -l) echo "Average event size =" $avg_event7 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt cd /rooms/bulls/Athena/pass2/em1trk/p14.06.01/ pwd >$homedir/pwd_root.txt cd $homedir rootdir=$(cat pwd_root.txt) echo "Athena root-tuple location: " $rootdir>>$homedir/summary.txt grep Input $rootdir/files/pr*.txt > $homedir/files.txt cat files.txt | awk '{nlines++} END{print nlines}' >$homedir/num_files.txt num_files8=$(cat num_files.txt) echo "Number of SAM files processed =" $num_files8>>$homedir/summary.txt grep Total $rootdir/files/pr*.txt > $homedir/junk.txt ls | tr -s ' ' | cut -d ' ' -f 3 junk.txt > $homedir/events.txt awk '{sum+=$1; print sum}' events.txt | tail -1 >$homedir/num_events.txt num_events8=$(cat num_events.txt) echo "Number of events processed =" $num_events8>>$homedir/summary.txt rm pwd_root.txt junk.txt files.txt events.txt num_events.txt num_files.txt ls $rootdir/*.root >$homedir/files8.txt cat files8.txt | awk '{nlines++} END{print nlines}' >num_root_files.txt num_root_files8=$(cat num_root_files.txt) echo "Number of root-tuples produced =" $num_root_files8>>$homedir/summary.txt ls -l $rootdir>$homedir/junk.txt head -1 junk.txt >$homedir/size.txt ls | tr -s ' ' | cut -d ' ' -f 2 size.txt > $homedir/total_size.txt total_size8=$(cat total_size.txt) total_size_gb8=$(echo "scale=2; $total_size8/1000000" | bc -l) echo "Disk space used =" $total_size_gb8 "Gb">>$homedir/summary.txt avg_event8=$(echo "scale=2; $total_size8/$num_events8" | bc -l) echo "Average event size =" $avg_event8 "kb">>$homedir/summary.txt rm junk.txt size.txt total_size.txt num_root_files.txt echo >>$homedir/summary.txt num_files=$(echo "scale=2; $num_files1+$num_files2+$num_files3+$num_files4+$num_files5+$num_files6+$num_files7+$num_files8" | bc -l) echo "Number of total SAM files processed =" $num_files>>$homedir/summary.txt num_events=$(echo "scale=2; $num_events1+$num_events2+$num_events3+$num_events4+$num_events5+$num_events6+$num_events7+$num_events8" | bc -l) echo "Number of total events processed =" $num_events>>$homedir/summary.txt num_root_files=$(echo "scale=2; $num_root_files1+$num_root_files2+$num_root_files3+$num_root_files4+$num_root_files5+$num_root_files6+$num_root_files7+$num_root_files8" | bc -l) echo "Number of total root_tuples produced =" $num_root_files>>$homedir/summary.txt total_size=$(echo "scale=2; $total_size1+$total_size2+$total_size3+$total_size4+$total_size5+$total_size6+$total_size7+$total_size8" | bc -l) total_size_gb=$(echo "scale=2; $total_size/1000000" | bc -l) echo "Disk space used =" $total_size_gb "Gb">>$homedir/summary.txt avg_event=$(echo "scale=2; $total_size/$num_events" | bc -l) echo "Average event size =" $avg_event "kb">>$homedir/summary.txt mv summary.txt pass2_em1trk_summary.txt cat files1.txt > pass2_em1trk_all_files.txt cat files2.txt >> pass2_em1trk_all_files.txt cat files3.txt >> pass2_em1trk_all_files.txt cat files4.txt >> pass2_em1trk_all_files.txt cat files5.txt >> pass2_em1trk_all_files.txt cat files6.txt >> pass2_em1trk_all_files.txt cat files7.txt >> pass2_em1trk_all_files.txt cat files8.txt >> pass2_em1trk_all_files.txt cat header.txt > run_pass2_em1trk_all_skim.C cat pass2_em1trk_all_files.txt | awk '{ print " c1->Add(\""$1"\");"}' >> run_pass2_em1trk_all_skim.C cat tail.txt >> run_pass2_em1trk_all_skim.C cp pass2_em1trk_summary.txt /work/morgan-clued0/alstone/D0Work/Athena/pass2/ cp pass2_em1trk_all_files.txt /work/morgan-clued0/alstone/D0Work/Athena/pass2/ cp run_pass2_em1trk_all_skim.C /work/morgan-clued0/alstone/D0Work/Athena/pass2/ cp bookkeeping_all_em1trk /work/morgan-clued0/alstone/D0Work/Athena/pass2/ chmod 777 /work/morgan-clued0/alstone/D0Work/Athena/pass2/*