mana-core-athenarootcomps / test / run_test_athena_ntuple_dumper.sh

The default branch has multiple heads

#!/bin/sh

function run_test() {
    echo "::: running athenarootcomps-r/w basic test..."
    IIMAX=5
    if [[ "$CMTCONFIG" == *-dbg* ]]; then
        IIMAX=1
        echo "::: setting IIMAX=1 (debug mode is slower)"
    else
        IIMAX=5
        echo "::: setting IIMAX=5 (opt mode is faster)"
    fi

    /bin/rm -rf arc-ntuple-dumper-tests
    mkdir arc-ntuple-dumper-tests
    pushd arc-ntuple-dumper-tests

    echo "::: retrieve reference ascii file..."
    reffile=ref.d3pd.ascii
    chkfile=d3pd.ascii
    /bin/rm -f $reffile > /dev/null
    /bin/rm -f $chkfile > /dev/null
    refdir=root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/
    xrdcp $refdir/$reffile $reffile || return 1

    echo ""
    echo "::::::::::::::::::::::::::::::::::::::::::::::"
    echo "::: run athena-ntuple-dumper... (w/ multiple output-streams)"
    time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
    /bin/rm -rf d3pd.rw.timing.log >& /dev/null
    ($time_cmd athena.py -c'USEVARHANDLE=1; DOWRITE=2' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.000.0.log.txt) || return 1
    grep "user" d3pd.rw.timing.log
    echo "::: comparing ascii dumps..."
    /bin/rm -f d3pd.ascii.diff
    diff -urN $reffile $chkfile >& d3pd.ascii.diff
    sc=$?
    echo "::: comparing ascii dumps...[$sc]"
    if [ $sc -ne 0 ]; then
	    return $sc
    fi
    echo "::: comparing output n-tuples..."
    acmd.py diff-root d3pd.root d3pd_2.root -t egamma 2> /dev/null
    sc=$?
    echo "::: comparing output n-tuples...[$sc]"
    if [ $sc -ne 0 ]; then
	    return $sc
    fi

    echo ""
    echo "::::::::::::::::::::::::::::::::::::::::::::::"
    echo "::: run athena-ntuple-dumper... (w/ varhandles, w/o output)"
    time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
    /bin/rm -rf d3pd.rw.timing.log >& /dev/null
    for ii in `seq $IIMAX`; do
        echo " - iter $ii/$IIMAX..."
        ($time_cmd athena.py -c'USEVARHANDLE=1; DOWRITE=0' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.001.$ii.log.txt) || return 1
    done
    grep "user" d3pd.rw.timing.log
    echo "::: comparing ascii dumps..."
    /bin/rm -f d3pd.ascii.diff
    diff -urN $reffile $chkfile >& d3pd.ascii.diff
    sc=$?
    echo "::: comparing ascii dumps...[$sc]"

    if [ $sc -ne 0 ]; then
	    return $sc
    fi

    echo ""
    echo "::::::::::::::::::::::::::::::::::::::::::::::"
    echo "::: run athena-ntuple-dumper... (w/ varhandles)"
    time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
    /bin/rm -rf d3pd.rw.timing.log >& /dev/null
    for ii in `seq $IIMAX`; do
        echo " - iter $ii/$IIMAX..."
        ($time_cmd athena.py -c'USEVARHANDLE=1' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.002.$ii.log.txt) || return 1
    done
    grep "user" d3pd.rw.timing.log
    echo "::: comparing ascii dumps..."
    /bin/rm -f d3pd.ascii.diff
    diff -urN $reffile $chkfile >& d3pd.ascii.diff
    sc=$?
    echo "::: comparing ascii dumps...[$sc]"

    if [ $sc -ne 0 ]; then
	    return $sc
    fi


    echo ""
    echo "::::::::::::::::::::::::::::::::::::::::::::::"
    echo "::: run athena-ntuple-dumper... (w/o varhandles)"
    time_cmd="/usr/bin/time -a -o d3pd.rw.timing.log"
    /bin/rm -rf d3pd.rw.timing.log >& /dev/null
    for ii in `seq $IIMAX`; do
        echo " - iter $ii/$IIMAX..."
        ($time_cmd athena.py -c'USEVARHANDLE=0' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.003.$ii.log.txt) || return 1
    done
    grep "user" d3pd.rw.timing.log
    echo "::: comparing ascii dumps..."
    /bin/rm -f d3pd.ascii.diff
    diff -urN $reffile $chkfile >& d3pd.ascii.diff
    sc=$?
    echo "::: comparing ascii dumps...[$sc]"

    if [ $sc -ne 0 ]; then
	return $sc
    fi

    echo ""
    echo "::::::::::::::::::::::::::::::::::::::::::::::"
    echo "::: reading back n-tuple file..."
    /bin/mv d3pd.root rb.d3pd.root || return 1
    /bin/rm -f $chkfile > /dev/null
    time_cmd="/usr/bin/time -a -o d3pd.rb.timing.log"
    /bin/rm -rf d3pd.rb.timing.log >& /dev/null
    for ii in `seq $IIMAX`; do
        echo " - iter $ii/$IIMAX..."
        ($time_cmd athena.py -c'FNAMES=["rb.d3pd.root"]' -lERROR AthenaRootComps/test_athena_ntuple_dumper.py >& d3pd.004.$ii.log.txt) || return 1
    done
    grep "user" d3pd.rb.timing.log
    echo "::: comparing ascii dumps..."
    /bin/rm -f rb.d3pd.ascii.diff
    diff -urN $reffile $chkfile >& rb.d3pd.ascii.diff
    sc=$?
    echo "::: comparing ascii dumps...[$sc]"

    return $sc
}

run_test
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.