#! /bin/sh # example how to analyze one file from 2018E with fbs as batch system # Runs on the batch node # Jurgen Engelfried, January 14, 2022 HOMEDIR=$(dirname $0) VERSION=$(basename $HOMEDIR | sed 's|MyAnalysis-||') thisnode=$(hostname) if [ $# -eq 1 ]; then INPUTFILE=$1 else echo "No inputfile provided" exit 1 fi if [ "$FBS_SCRATCH" ]; then cd $FBS_SCRATCH else echo "Only can run on fbs batch system" exit 2 fi source $HOMEDIR/scripts/env.sh if [ $thisnode = "hep03" -o $thisnode = "hep04" ]; then fname=$(basename $(dirname $INPUTFILE))"/"$(basename $INPUTFILE) locfile=$(find $(df -l | awk '{print $NF}' | grep na62_) -name $(basename $fname) | grep $fname) if [ "$locfile" ]; then echo Using local input file $locfile INPUTFILE=$locfile fi fi $HOMEDIR/bin-cc7/Penta -i $INPUTFILE -o $(basename $INPUTFILE) -n 500 >& $(basename $INPUTFILE .root).log gzip $(basename $INPUTFILE .root).log cp -p $(basename $INPUTFILE) $(basename $INPUTFILE .root).log.gz $HOMEDIR/ exit 0