Source

mana-core-athenarootcomps / test / run_test_athena_variable_shape_ntuple.sh

Full commit
#!/bin/sh

function check_disappearing_branches()
{
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 \
    || return 1
/bin/cp d3pd.root f1.root || return 1
acmd.py dump-root f1.root | grep "^egamma" | egrep "RunNumber|EventNumber|el_n" | tee f1.ascii || return 1
cat f1.ascii| cut -d. -f3 >| f1.ascii.todiff || return 1

echo "::: generate f2.root..."
athena.py \
    -c 'EVTMAX=10; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n"]' \
    AthenaRootComps/test_athena_variable_shape_ntuple.py \
    >| log.002.txt \
    || return 1
/bin/cp d3pd.root f2.root || return 1
acmd.py dump-root f2.root | grep "^egamma" | egrep "RunNumber|EventNumber|el_n" | tee f2.ascii || return 1
cat f2.ascii| cut -d. -f3 >| f2.ascii.todiff || return 1

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 \
    || return 1
/bin/cp d3pd.root f3.root || return 1
acmd.py dump-root f3.root | grep "^egamma" | egrep "RunNumber|EventNumber|el_n" | tee f3.ascii || return 1
cat f3.ascii| cut -d. -f3 >| f3.ascii.todiff || return 1

echo "::: generate merged.root..."
athena.py \
    -c 'EVTMAX=30; BRANCHES=["RunNumber", "EventNumber", "el_n", "el_eta"]; OUTBRANCHES=["el_n",]; FNAMES=["f1.root","f2.root","f3.root"]' \
    AthenaRootComps/test_athena_variable_shape_ntuple.py \
    >| log.004.txt \
    || return 1
/bin/cp d3pd.root f4.root || return 1
acmd.py dump-root f4.root | grep "^egamma" | egrep "RunNumber|EventNumber|el_n" | tee f4.ascii || return 1
cat f4.ascii| cut -d. -f3 >| f4.ascii.todiff || return 1

echo "::: compare dump-root outputs..."
cat f[123].ascii.todiff > merged.ascii.todiff || return 1
diff -urN merged.ascii.todiff f4.ascii.todiff || return 1
echo "::: compare dump-root outputs... [ok]"

# echo "::: compare logfiles..."
# cat log.00[123].txt | grep "py_alg" >| log.merged.txt.todiff || return 1
# grep "py_alg" log.004.txt >| log.004.txt.todiff || return 1
# diff -urN log.merged.txt.todiff log.004.txt.todiff || return 1
# echo "::: compare logfiles... [ok]"

return 0
}

check_disappearing_branches