--- /dev/null
+
+if test -z "$1"; then
+ echo "usage: ./check_tot.sh filename"
+ exit
+fi
+
+NN=5000
+echo 'analysing first'
+echo ${NN}
+echo 'events...'
+
+# this is the famous Carsten programming style...
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2000 | grep 'sing:0' | grep -v 'tot' | wc -l > check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2000 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2001 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2001 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2002 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2002 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2003 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2003 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2004 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2004 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2005 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2005 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2006 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2006 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2007 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2007 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2008 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2008 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2009 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2009 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200e | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200e | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200f | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x200f | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2014 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2014 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2015 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2015 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2016 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2016 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2017 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2017 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2018 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2018 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2019 | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x2019 | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201a | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201a | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201b | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201b | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201c | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201c | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201d | grep 'sing:0' | grep -v 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+hldprint <<EOF $1 -raw -num $NN -onlytdc 0x201d | grep 'sing:0' | grep 'tot' | wc -l >> check_tot.dat
+
+EOF
+
+
+
+./check_tot
+