#!/bin/zsh ###### Run with: source RunHerwigJobSafe.sh PowhegZmumu 100000 >&! launched.`date +%s`.100000 & ############################ ############################ redefine arg.s inputConf=$1 nEvs=$2 echo "******************************************** Running Herwig++ with configuration " $inputConf "on" `hostname` "********************* N. of events requested = " $nEvs ############################ ############################ ##setupAthena # #################################################### export AtlasBase=/cvmfs/atlas.cern.ch/repo/sw/software/17.2.3 export AtlasSetup=$AtlasBase/AtlasSetup # alias asetup='source $HOME/utl/localAsetup.sh' #################################################### asetup 17.2.3.7,AtlasProduction --testarea=/afs/le.infn.it/user/s/spagnolo/atlas/Physics/Generators/Herwig++/viaAthena ###########export CMTCONFIG=i686-slc5-gcc43-opt ls -al $AtlasBase echo "*************************************************" echo CMTPATH=$CMTPATH echo PATH=$PATH echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH echo PYTHONPATH=$PYTHONPATH ##cmt co -r Herwigpp_i-00-05-07 Generators/Herwig++ export MCGeneratorsPath=$AtlasBase/sw/lcg/external/MCGenerators_hepmc2.06.05/ export HerwigPath=$MCGeneratorsPath/herwig++/2.5.2/$CMTCONFIG ls -al $HerwigPath export RivetPath=$MCGeneratorsPath/rivet/1.8.0.a/$CMTCONFIG ls -al $RivetPath alias Herwig=$HerwigPath/bin/Herwig++ which Herwig source $RivetPath/rivetenv.sh export RIVET_ANALYSIS_PATH=/afs/le.infn.it/user/s/spagnolo/atlas/Physics/Generators/Herwig++/rivetAtlasProd_17.2.3.7/$CMTCONFIG echo "*************************************************" echo "********** rivet is `which rivet` ***************" echo "********** herwig++ is `which Herwig` ***************" echo "************************************************* Herwig input will be " $inputConf.in echo "************************************************* Herwig will run on " $nEvs "events" echo "++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++ DUMP input to avoid confusion ........ " echo "++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++" cat $inputConf.in echo "++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++ DUMP of input DONE .................. " echo "++++++++++++++++++++++++++++" echo "++++++++++++++++++++++++++++" echo "************************************************* Herwig start parsing input " Herwig read $inputConf.in mv -f Atlas.run $inputConf.run echo "************************************************* Herwig input parsed at `date` = `date +%s`" myAfsDir=$PWD fifoDir=/data/stefania/$inputConf.WorkDir.`date +%s` mkdir $fifoDir ln -sf $fifoDir ./$inputConf.WorkDir.`date +%s`.`hostname` echo "********** created running directory: " $fifoDir cp $inputConf.run $fifoDir/ cd $fifoDir echo "********** Now working in " $PWD fifoName=Atlas.hepmc echo "********** Will use fifo named " $fifoName mkfifo $fifoName ls -al $fifoName echo "************************************************* Launching Herwig at `date` " nohup $HerwigPath/bin/Herwig++ run $inputConf.run -N$nEvs -d1 >&! $inputConf.HerwigLog & echo "************************************************* Check if MC_ZB exists in the Rivet Analysis Library" rivet --list-analyses echo "************************************************* Launching Rivet on Herwig hepmc fifo at `date` " nohup `which rivet` -a MC_ZB $fifoName >&! $inputConf.RivetLog & echo "************************************************* " echo "************************************************* " echo "All done ... jobs running ... " echo "Herwig log can be viewed with tail -f $PWD/$inputConf.HerwigLog" on `hostname` echo "Rivet log can be viewed with tail -f $PWD/$inputConf.RivetLog" on `hostname` echo "Full output will be available in $PWD" on `hostname` echo "************************************************* " echo "************************************************* "