diff --git a/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt b/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt index 3e38730e28972c477a78cc8ee56e249201a059f6..e88b1718ce055b4e40edcd7d14a435bf01558996 100644 --- a/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt +++ b/Database/AthenaRoot/AthenaRootComps/CMakeLists.txt @@ -47,3 +47,49 @@ atlas_install_joboptions( share/tests/*.py ) atlas_install_scripts( test/*.sh test/ref.* ) +atlas_add_test( test_athena_ntuple_dumper_multiple + SCRIPT test/test_athena_ntuple_dumper_multiple.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + + +atlas_add_test( test_athena_ntuple_dumper_varhandles_nooutput + SCRIPT test/test_athena_ntuple_dumper_varhandles_nooutput.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + +atlas_add_test( test_athena_ntuple_dumper_varhandles + SCRIPT test/test_athena_ntuple_dumper_varhandles.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + +atlas_add_test( test_athena_ntuple_dumper_novarhandles + SCRIPT test/test_athena_ntuple_dumper_novarhandles.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 600 ) + +atlas_add_test( test_athena_variable_shape1 + SCRIPT test/test_athena_variable_shape1.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + +atlas_add_test( test_athena_variable_shape2 + SCRIPT test/test_athena_variable_shape2.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + +atlas_add_test( test_athena_variable_shape3 + SCRIPT test/test_athena_variable_shape3.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/test/test_athena_variable_shape_merged.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/test_athena_variable_shape_merged_script.sh + @ONLY ) +atlas_add_test( test_athena_variable_shape_merged + SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/test_athena_variable_shape_merged_script.sh + EXTRA_PATTERNS ".*" + PROPERTIES TIMEOUT 300 ) +set_tests_properties( AthenaRootComps_test_athena_variable_shape_merged_ctest + PROPERTIES DEPENDS + "AthenaRootComps_test_athena_variable_shape1_ctest;AthenaRootComps_test_athena_variable_shape2_ctest;AthenaRootComps_test_athena_variable_shape3_ctest" ) diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_multiple.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_multiple.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_novarhandles.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_novarhandles.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles_nooutput.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_ntuple_dumper_varhandles_nooutput.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape1.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape1.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape2.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape2.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape3.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape3.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape_merged.ref b/Database/AthenaRoot/AthenaRootComps/share/test_athena_variable_shape_merged.ref new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py index 86de9bc8371e1649459e1aabb239e17b2c7c8c2e..985b2ae667e91aa9ef5b52c336880c4394eaa541 100644 --- a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py +++ b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_ntuple_dumper.py @@ -1,8 +1,10 @@ from glob import glob if 1: + testdir = os.environ.get ('ATLAS_REFERENCE_DATA', + 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd') _cbntfiles = [ - 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.0.root', - 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.1.root', + testdir + '/ntuple.0.root', + testdir + '/ntuple.1.root', ] ## _cbntfiles = [ ## '/tmp/binet/data/ntuple.0.root', diff --git a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py index a9d6a3254c89228071fb6fbdbd5cf4a83db8d2b0..5db07f5520947fb55dcaa109671ea0d20a3d46a5 100644 --- a/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py +++ b/Database/AthenaRoot/AthenaRootComps/share/tests/test_athena_variable_shape_ntuple.py @@ -1,8 +1,10 @@ from glob import glob if 1: + testdir = os.environ.get ('ATLAS_REFERENCE_DATA', + 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd') _cbntfiles = [ - 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.0.root', - 'root://eosatlas//eos/atlas/user/b/binet/utests/utests/filter-d3pd/ntuple.1.root', + testdir + '/ntuple.0.root', + testdir + '/ntuple.1.root', ] # _cbntfiles = [ # '/tmp/binet/data/ntuple.0.root', diff --git a/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml b/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml index 856349523c6ede430cd476c0f429c55ad7101f4a..a2aa4019fce5c7636f5a9754d5f674a281d4d2ee 100644 --- a/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml +++ b/Database/AthenaRoot/AthenaRootComps/test/AthenaRootComps.xml @@ -1,27 +1,5 @@ <?xml version="1.0"?> <atn> - <TEST name="arc_rw" type="script" suite="athenarootcomps"> - <package_atn>Control/AthenaRootComps</package_atn> - <options_atn>run_test_athena_ntuple_dumper.sh</options_atn> - <timelimit>30</timelimit> - <author> Sebastien Binet </author> - <mailto> binet@cern.ch </mailto> - <expectations> - <returnValue>0</returnValue> - </expectations> - </TEST> - - <TEST name="arc_variable_shape" type="script" suite="athenarootcomps"> - <package_atn>Control/AthenaRootComps</package_atn> - <options_atn>run_test_athena_variable_shape_ntuple.sh</options_atn> - <timelimit>30</timelimit> - <author> Sebastien Binet </author> - <mailto> binet@cern.ch </mailto> - <expectations> - <returnValue>0</returnValue> - </expectations> - </TEST> - <TEST name="arc_filters" type="makecheck" suite="AthenaRootComps"> <timelimit>20</timelimit> <author>Jack Cranshaw</author> diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh new file mode 100755 index 0000000000000000000000000000000000000000..ffda90b66f81a7ad510d35b8ccb589f9501a10cc --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_multiple.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e + +testname=test_athena_ntuple_dumper_multiple +rm -rf $testname +mkdir $testname +cd $testname + +ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00 +refbase=ref.d3pd.ascii +chkfile=d3pd.ascii + +reffile=$refbase +get_files -data -symlink $reffile > /dev/null +if [ ! -r $reffile ]; then + # Look for the file in DATAPATH. + # We have to look for the directory, not the file itself, + # since get_files is hardcoded not to look more than two + # levels down. + get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null + reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase + if [ ! -r $reffile ]; then + testdata=$ATLAS_REFERENCE_DATA + if [ "$testdata" = "" ]; then + testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles + fi + reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase + fi +fi + +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) || exit 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 + exit $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 + exit $sc +fi diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh new file mode 100755 index 0000000000000000000000000000000000000000..46353583161732466981442a4466096cd74c8783 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_novarhandles.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +set -e + +testname=test_athena_ntuple_dumper_novarhandles +rm -rf $testname +mkdir $testname +cd $testname + +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 + + +ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00 +refbase=ref.d3pd.ascii +chkfile=d3pd.ascii + +reffile=$refbase +get_files -data -symlink $reffile > /dev/null +if [ ! -r $reffile ]; then + # Look for the file in DATAPATH. + # We have to look for the directory, not the file itself, + # since get_files is hardcoded not to look more than two + # levels down. + get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null + reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase + if [ ! -r $reffile ]; then + testdata=$ATLAS_REFERENCE_DATA + if [ "$testdata" = "" ]; then + testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles + fi + reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase + fi +fi + +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) || exit 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 + exit $sc +fi + + +echo "" +echo "::::::::::::::::::::::::::::::::::::::::::::::" +echo "::: reading back n-tuple file..." +/bin/mv d3pd.root rb.d3pd.root || exit 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) || exit 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]" + +exit $sc diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh new file mode 100755 index 0000000000000000000000000000000000000000..183a9bc753c238f0d6b127515b7044a8b2abae96 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -e + +testname=test_athena_ntuple_dumper_varhandles +rm -rf $testname +mkdir $testname +cd $testname + +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 + + +ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00 +refbase=ref.d3pd.ascii +chkfile=d3pd.ascii + +reffile=$refbase +get_files -data -symlink $reffile > /dev/null +if [ ! -r $reffile ]; then + # Look for the file in DATAPATH. + # We have to look for the directory, not the file itself, + # since get_files is hardcoded not to look more than two + # levels down. + get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null + reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase + if [ ! -r $reffile ]; then + testdata=$ATLAS_REFERENCE_DATA + if [ "$testdata" = "" ]; then + testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles + fi + reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase + fi +fi + +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) || exit 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 + exit $sc +fi diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh new file mode 100755 index 0000000000000000000000000000000000000000..c50fc764ddb2eba6f85066e540497214c53fddf2 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_ntuple_dumper_varhandles_nooutput.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -e + +testname=test_athena_ntuple_dumper_varhandles_nooutput +rm -rf $testname +mkdir $testname +cd $testname + +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 + + +ATLAS_REFERENCE_TAG=AthenaRootComps/AthenaRootCompsReference-01-00-00 +refbase=ref.d3pd.ascii +chkfile=d3pd.ascii + +reffile=$refbase +get_files -data -symlink $reffile > /dev/null +if [ ! -r $reffile ]; then + # Look for the file in DATAPATH. + # We have to look for the directory, not the file itself, + # since get_files is hardcoded not to look more than two + # levels down. + get_files -data -symlink $ATLAS_REFERENCE_TAG > /dev/null + reffile=`basename $ATLAS_REFERENCE_TAG`/$refbase + if [ ! -r $reffile ]; then + testdata=$ATLAS_REFERENCE_DATA + if [ "$testdata" = "" ]; then + testdata=/afs/cern.ch/atlas/maxidisk/d33/referencefiles + fi + reffile=$testdata/$ATLAS_REFERENCE_TAG/$refbase + fi +fi + +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) || exit 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 + exit $sc +fi diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh new file mode 100755 index 0000000000000000000000000000000000000000..a2edc53325d72ad323fd08f468a882c88a0cba5c --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape1.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +testname=test_athena_variable_shape/shape1 +rm -rf $testname +mkdir -p $testname +cd $testname + +echo "::: generate f1.root..." +athena.py \ + -c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n","el_eta"]' \ + AthenaRootComps/test_athena_variable_shape_ntuple.py \ + >| log.001.txt 2>| log.001.stderr.txt \ + || exit 1 +/bin/mv d3pd.root f1.root || exit 1 +/bin/mv data.var.txt data.1.txt || exit 1 +(acmd.py dump-root f1.root 2> f1.stderr.ascii) \ + | grep "^egamma" \ + | egrep "RunNumber|EventNumber|el_n" \ + | tee f1.ascii \ + || return 1 +cat f1.ascii| cut -d. -f3 >| f1.ascii.todiff || exit 1 + +exit 0 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh new file mode 100755 index 0000000000000000000000000000000000000000..b7692ee7a985a0cd1bbe5d1fe592731bf2c8fa7e --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape2.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +testname=test_athena_variable_shape/shape2 +rm -rf $testname +mkdir -p $testname +cd $testname + +echo "::: generate f2.root..." +athena.py \ + -c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_phi"]; OUTBRANCHES=["el_n","el_phi"]' \ + AthenaRootComps/test_athena_variable_shape_ntuple.py \ + >| log.002.txt 2>| log.002.stderr.txt \ + || exit 1 +/bin/mv d3pd.root f2.root || exit 1 +/bin/mv data.var.txt data.2.txt || exit 1 +(acmd.py dump-root f2.root 2> f2.stderr.txt) \ + | grep "^egamma" \ + | egrep "RunNumber|EventNumber|el_n" \ + | tee f2.ascii \ + || exit 1 +cat f2.ascii| cut -d. -f3 >| f2.ascii.todiff || exit 1 + +exit 0 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh new file mode 100755 index 0000000000000000000000000000000000000000..e426844d86d935d716d61ecbfb9a0badd6eaee6b --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape3.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +testname=test_athena_variable_shape/shape3 +rm -rf $testname +mkdir -p $testname +cd $testname + +echo "::: generate f3.root..." +athena.py \ + -c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n","el_eta"]' \ + AthenaRootComps/test_athena_variable_shape_ntuple.py \ + >| log.003.txt 2>| log.003.stderr.txt \ + || exit 1 +/bin/mv d3pd.root f3.root || exit 1 +/bin/mv data.var.txt data.3.txt || exit 1 +(acmd.py dump-root f3.root 2> f3.stderr.txt) \ + | grep "^egamma" \ + | egrep "RunNumber|EventNumber|el_n" \ + | tee f3.ascii \ + || exit 1 +cat f3.ascii| cut -d. -f3 >| f3.ascii.todiff || exit 1 + +exit 0 diff --git a/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in new file mode 100755 index 0000000000000000000000000000000000000000..8d8aca285cc87fee77b1f38ef25d06ffecb1d982 --- /dev/null +++ b/Database/AthenaRoot/AthenaRootComps/test/test_athena_variable_shape_merged.sh.in @@ -0,0 +1,41 @@ +#!/bin/bash + +set -e + +testname=test_athena_variable_shape +mkdir -p $testname +cd $testname +rm -f *.txt *.xml + +cp @CMAKE_CURRENT_SOURCE_DIR@/test/ref.data.merged.ascii . + +echo "::: generate merged.root..." +athena.py \ + -c 'EVTMAX=30; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta","el_phi"]; OUTBRANCHES=["el_n",]; FNAMES=["shape1/f1.root","shape2/f2.root","shape3/f3.root"]' \ + AthenaRootComps/test_athena_variable_shape_ntuple.py \ + >| log.004.txt 2>| log.004.stderr.txt \ + || exit 1 +/bin/mv d3pd.root f4.root || exit 1 +/bin/mv data.var.txt data.4.txt || exit 1 +(acmd.py dump-root f4.root 2> f4.stderr.txt) \ + | grep "^egamma" \ + | egrep "RunNumber|EventNumber|el_n" \ + | tee f4.ascii \ + || exit 1 +cat f4.ascii| cut -d. -f3 >| f4.ascii.todiff || exit 1 + +echo "::: compare py-alg outputs..." +cat shape[123]/data.*.txt > data.merged.txt || exit 1 +diff -urN data.merged.txt data.4.txt || exit 1 +echo "::: compare py-alg outputs... [ok]" + +echo "::: compare py-alg output to reference..." +diff -urN data.merged.txt ref.data.merged.ascii || exit 1 +echo "::: compare py-alg output to reference... [ok]" + +echo "::: compare dump-root outputs..." +cat shape[123]/f*.ascii.todiff > merged.ascii.todiff || exit 1 +diff -urN merged.ascii.todiff f4.ascii.todiff || exit 1 +echo "::: compare dump-root outputs... [ok]" + +exit 0