#!/bin/bash # It is easier to run this script than it is to call loon on # the command line because this protects you from having to type # parentheses and quotation marks, both of which are also used by bash # Prints a usage statement if you run create_simple_ntuple.sh -h # or make a mistake usage() { cat << thisisamarkertotellmewhentostop -o [output man file] -i [input sntp file or sntp file list file] -c [force recompilation] thisisamarkertotellmewhentostop } # default value for how to run loon: compile, but only if not # compiled already, and optimize how=+O # Unix magic to parse the commandline options set -- `getopt -u -n $0 -o ho:i:c -- "$@"` if [ $? != 0 ] ; then echo "Invalid Options: $*" usage exit 1 fi # Unix magic to parse the commandline options while true; do case "$1" in -h) usage; exit 0;; -o) outfile=$2; shift 2;; -i) infile="$2"; shift 2;; -c) how=++O; shift;; --) shift; break;; *) echo "Bad argument $1"; usage; exit 1;; esac done if ! [ $outfile ]; then echo You need to give me an output file name with -o exit 1 fi if ! [ $infile ]; then echo You need to give me an input file name with -i exit 1 fi # Check if minossoft is set up already. If not, set it up. if ! [ $SRT_PUBLIC_CONTEXT ]; then source /local/minos/minossoft/setup/setup_minossoft_umn.sh R2.0.3 fi loon -b -q compileandrun_create_simple_ntuple.C'("'$outfile'" ,"'$infile'", "'$how'")'