#!/bin/tcsh -f if($#argv == 2) then set NEVENTS=$1 echo "Number of events: ${NEVENTS}" set VERTEX="0 0 50 80" # x y zmin zmax set NTHREADS=3 set INPUT = ${INPUT_DIR}/$2 if(-e ${INPUT}) then echo "Running genr8 ..." genr8 -M${NEVENTS} -Aoutput.ascii < ${INPUT} >& /dev/null echo "Converting generated events to HDDM ..." genr8_2_hddm -V"${VERTEX}" output.ascii >& /dev/null echo "Creating control.in file ..." cat - << EOF > control.in INFILE 'output.hddm' TRIG ${NEVENTS} OUTFILE 'hdgeant.hddm' RNDM 123 HADR 0 DCAY 0 EOF echo "Running hdgeant ..." hdgeant echo "Remove useless files ..." rm hdgeant.rz geant.hbook control.in echo "Running mcsmear ..." #mcsmear hdgeant.hddm echo "Running hd_root ..." hd_root -PPLUGINS=mc_tree hdgeant.hddm else echo "InputFile ${INPUT} does not exist." endif else echo "Invalid input format:" echo "hdgen " endif