export mydir=`echo $1 | awk -F '/' '{print substr($0,1,length($0)-length($NF))}'`
export myfil=`echo $1 | awk -F '/' '{print $NF}'`
echo "mydir = "$mydir
echo "myfil = "$myfil
mkdir /u/ey/homer/tagged_files/$myfil-dir
cd /u/ey/homer/tagged_files/$myfil-dir
rm /u/ey/homer/tagged_files/$myfil-dir/*.{slcio,log}
#ln -s $1 input_prejet.slcio
source /u/ey/homer/sidhome/sid/lcsim-homer/testrunsubDetHitNum $1 input_prejet.slcio
Marlin /u/ey/homer/sidhome/lcfi/mfast-all-batch-6jet-step1.xml > /u/ey/homer/tagged_files/$myfil-dir/jet-6jet-step1.log
Marlin /u/ey/homer/sidhome/lcfi/mfast-all-batch-4jet-step2.xml > /u/ey/homer/tagged_files/$myfil-dir/jet-4jet-step2.log
Marlin /u/ey/homer/sidhome/lcfi/steering/revertex-all-batch.xml >& /u/ey/homer/tagged_files/$myfil-dir/vtx.log
Marlin /u/ey/homer/sidhome/lcfi/steering/flavortag-all-batch-revtx-350-4jets.xml > /u/ey/homer/tagged_files/$myfil-dir/flav.log
rm -v output_postjet.slcio
rm -v output_postjet-6jet.slcio
rm -v output_postjet_vtx.slcio
rm -v input_prejet.slcio
ln -s output_postjet_flavtag.slcio $myfil-flav.slcio
cd /u/ey/homer/sidhome/sid/lcsim-homer/batch2/
source runitallbatch2 /u/ey/homer/tagged_files/$myfil-dir/$myfil-flav.slcio
